Guest User

Combo System by Crystalia

a guest
Aug 8th, 2012
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.92 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GS
  3. Index: config/functions/l2jfrozen.properties
  4. ===================================================================
  5. --- config/functions/l2jfrozen.properties   (revision 948)
  6. +++ config/functions/l2jfrozen.properties   (working copy)
  7. @@ -280,4 +280,22 @@
  8.  ProtectorSkillLevel = 13
  9.  ProtectorSkillTime = 600
  10.  # Npc Protector Message
  11. -ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  12. \ No newline at end of file
  13. +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  14. +
  15. +# -----------------------------------------
  16. +# Combo System - by Crystalia
  17. +# -----------------------------------------
  18. +# True = Enable, False = Disable
  19. +AllowCombo = False
  20. +# ID of your skill.
  21. +ComboSkillId = 7029
  22. +# Level of your skill.
  23. +Combo1Level = 1
  24. +Combo2Level = 2
  25. +Combo3Level = 4
  26. +Combo4Level = 5
  27. +# Amount of kills for combo.
  28. +Combo1Kills = 5
  29. +Combo2Kills = 10
  30. +Combo3Kills = 15
  31. +Combo4Kills = 25
  32. \ No newline at end of file
  33.  
  34. ### Eclipse Workspace Patch 1.0
  35. #P L2jFrozen_GS
  36. Index: head-src/com/l2jfrozen/Config.java
  37. ===================================================================
  38. --- head-src/com/l2jfrozen/Config.java  (revision 948)
  39. +++ head-src/com/l2jfrozen/Config.java  (working copy)
  40. @@ -2378,6 +2378,17 @@
  41.     public static String FARM2_CUSTOM_MESSAGE;
  42.     public static String PVP1_CUSTOM_MESSAGE;
  43.     public static String PVP2_CUSTOM_MESSAGE;
  44. +  
  45. +   public static boolean ALLOW_COMBO;
  46. +   public static int COMBO_SKILL_ID;
  47. +   public static int COMBO1_LEVEL;
  48. +   public static int COMBO2_LEVEL;
  49. +   public static int COMBO3_LEVEL;
  50. +   public static int COMBO4_LEVEL;
  51. +   public static int COMBO1_KILLS;
  52. +   public static int COMBO2_KILLS;
  53. +   public static int COMBO3_KILLS;
  54. +   public static int COMBO4_KILLS;
  55.  
  56.     //============================================================
  57.     public static void loadL2JFrozenConfig()
  58. @@ -2497,6 +2508,17 @@
  59.             FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
  60.             PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
  61.             PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
  62. +          
  63. +           ALLOW_COMBO = Boolean.parseBoolean(L2JFrozenSettings.getProperty("AllowCombo" , "False"));
  64. +           COMBO_SKILL_ID = Integer.parseInt(L2JFrozenSettings.getProperty("ComboSkillId","7029"));
  65. +           COMBO1_LEVEL = Integer.parseInt(L2JFrozenSettings.getProperty("Combo1Level" , "1"));
  66. +           COMBO2_LEVEL = Integer.parseInt(L2JFrozenSettings.getProperty("Combo2Level" , "1"));
  67. +           COMBO3_LEVEL = Integer.parseInt(L2JFrozenSettings.getProperty("Combo3Level" , "1"));
  68. +           COMBO4_LEVEL = Integer.parseInt(L2JFrozenSettings.getProperty("Combo4Level" , "1"));
  69. +           COMBO1_KILLS = Integer.parseInt(L2JFrozenSettings.getProperty("Combo1Kills" , "5"));
  70. +           COMBO2_KILLS = Integer.parseInt(L2JFrozenSettings.getProperty("Combo2Kills" , "10"));
  71. +           COMBO3_KILLS = Integer.parseInt(L2JFrozenSettings.getProperty("Combo3Kills" , "15"));
  72. +           COMBO4_KILLS = Integer.parseInt(L2JFrozenSettings.getProperty("Combo4Kills" , "25"));
  73.         }
  74.         catch(Exception e)
  75.         {
  76.        
  77. ### Eclipse Workspace Patch 1.0
  78. #P L2jFrozen_GS
  79. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  80. ===================================================================
  81. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (revision 948)
  82. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  83. @@ -861,6 +861,8 @@
  84.     public boolean _inEventCTF = false,
  85.     _haveFlagCTF = false;
  86.    
  87. +   private int combo = 0;
  88. +  
  89.     /** The _pos checker ctf. */
  90.     public Future<?> _posCheckerCTF = null;
  91.  
  92. @@ -1470,6 +1472,8 @@
  93.     /** Quake System. */
  94.     private int quakeSystem = 0;
  95.    
  96. +  
  97. +  
  98.     /** The _is locked. */
  99.     private boolean _isLocked = false;
  100.    
  101. @@ -7524,6 +7528,8 @@
  102.         stopRentPet();
  103.         stopWaterTask();
  104.         quakeSystem = 0;
  105. +       comboDie(killer);
  106. +       removeSkill(Config.COMBO_SKILL_ID);
  107.          
  108.         //leave war legend aura if enabled
  109.         heroConsecutiveKillCount=0;
  110. @@ -7990,6 +7996,9 @@
  111.        
  112.         // Add karma to attacker and increase its PK counter
  113.         setPvpKills(getPvpKills() + 1);
  114. +      
  115. +       if(Config.ALLOW_COMBO)
  116. +       checkCombo();
  117.  
  118.          // Increase the kill count for a special hero aura
  119.          heroConsecutiveKillCount++;
  120. @@ -8028,6 +8037,56 @@
  121.         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  122.         sendPacket(new UserInfo(this));
  123.     }
  124. +          
  125. +   private void checkCombo()
  126. +   {
  127. +   int i = 0;
  128. +   combo++;
  129. +   int combos = 0;
  130. +              
  131. +   if(combo == Config.COMBO1_KILLS)
  132. +   {
  133. +   i = 1;
  134. +   addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO1_LEVEL), false);
  135. +   combos = Config.COMBO1_KILLS;
  136. +   }
  137. +    else if(combo == Config.COMBO2_KILLS)
  138. +   {
  139. +   i = 2;
  140. +   addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO2_LEVEL), false);
  141. +   combos = Config.COMBO2_KILLS;
  142. +   }
  143. +   else if(combo == Config.COMBO3_KILLS)
  144. +   {
  145. +   i = 3;
  146. +   addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO3_LEVEL), false);
  147. +   combos = Config.COMBO3_KILLS;
  148. +   }
  149. +   else if(combo == Config.COMBO4_KILLS)
  150. +   {
  151. +   i = 4;
  152. +   addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO4_LEVEL), false);
  153. +   combos = Config.COMBO4_KILLS;
  154. +   }
  155. +          
  156. +   if(i > 0)
  157. +   {
  158. +   sendMessage("You have been rewarded with a skill.");
  159. +   Announcements.getInstance().announceToAll("Player "+getName() + " is in a Combo Mode with " +combos +" pvp kills in a row!");
  160. +   }
  161. +          
  162. +   i = 0;
  163. +   combos = 0;
  164. +   }
  165. +          
  166. +   private void comboDie(L2Character killer)
  167. +   {
  168. +   if(combo > Config.COMBO1_KILLS)
  169. +   {
  170. +   Announcements.getInstance().announceToAll("Player "+getName() +" has lost his combo of "+combo +" kills by "+killer.getName());
  171. +   }
  172. +   combo = 0;
  173. +   }
  174.  
  175.     /**
  176.      * Quake system.
Advertisement
Add Comment
Please, Sign In to add comment