Guest User

PvP skills reward (L2)

a guest
May 21st, 2012
1,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. Index: config/custom.properties
  2. ===================================================================
  3. --- config/custom.properties (revision 2)
  4. +++ config/custom.properties (working copy)
  5. @@ -81,4 +81,9 @@
  6. QuizEventTime = 10,20
  7. # Quiz event questions.
  8. # Must be set like: question,answer,rewardid,rewardcount;question,answer,rewardid,rewardcount;
  9. -QuizEventQuestions = Who created this event?,Anarchy,3470,5;What is the name of this server?,L2Server,57,100000000;
  10. \ No newline at end of file
  11. +QuizEventQuestions = Who created this event?,Anarchy,3470,5;What is the name of this server?,L2Server,57,100000000;
  12. +
  13. +# Custom pvp skills.
  14. +AllowPvpSkills = False
  15. +# Custom pvp skills list. (like: pvpsneeded,skillid;pvpsneeded,skillid;
  16. +PvpSkillsList = 100,3100;
  17. \ No newline at end of file
  18. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  19. ===================================================================
  20. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 6)
  21. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
  22. @@ -4851,6 +4851,18 @@
  23. // Add karma to attacker and increase its PK counter
  24. setPvpKills(getPvpKills() + 1);
  25.  
  26. + if (Config.ALLOW_PVP_SKILLS)
  27. + {
  28. + for (int i : Config.PVP_SKILLS_LIST.keySet())
  29. + {
  30. + if (getPvpKills() == i)
  31. + {
  32. + addSkill(SkillTable.getInstance().getInfo(Config.PVP_SKILLS_LIST.get(i), SkillTable.getInstance().getMaxLevel(Config.PVP_SKILLS_LIST.get(i))), true);
  33. + break;
  34. + }
  35. + }
  36. + }
  37. +
  38. // Increase the attacker's killing points by one.
  39. setKillingPoints(getKillingPoints() + 1);
  40.  
  41. Index: java/net/sf/l2j/Config.java
  42. ===================================================================
  43. --- java/net/sf/l2j/Config.java (revision 2)
  44. +++ java/net/sf/l2j/Config.java (working copy)
  45. @@ -745,7 +745,9 @@
  46. public static int[] QUIZ_EVENT_TIME = new int[2];
  47. public static Map<Map<String, String>, Map<Integer, Integer>> QUIZ_EVENT_QUESTIONS = new FastMap<Map<String, String>, Map<Integer, Integer>>();
  48. public static Map<String, String> QUIZ_EVENT_QUESTIONS_KEYSET = new FastMap<String, String>(); // Hidden variable.
  49. -
  50. + public static boolean ALLOW_PVP_SKILLS;
  51. + public static Map<Integer, Integer> PVP_SKILLS_LIST = new FastMap<Integer, Integer>();
  52. +
  53. /**
  54. * This class initializes all global variables for configuration.<br>
  55. * If key doesn't appear in properties file, a default value is setting on by this class.
  56. @@ -1550,6 +1552,14 @@
  57. QUIZ_EVENT_QUESTIONS.put(string_map, int_map);
  58. QUIZ_EVENT_QUESTIONS_KEYSET.put(quiz_event_questions_splitted_2[0], quiz_event_questions_splitted_2[1]);
  59. }
  60. + ALLOW_PVP_SKILLS = Boolean.parseBoolean(elcardia.getProperty("AllowPvpSkills", "false"));
  61. + String PVP_SKILLS_LIST_VALUE = elcardia.getProperty("PvpSkillsList", "100,3100;");
  62. + String[] pvp_skills_list_splitted_1 = PVP_SKILLS_LIST_VALUE.split(";");
  63. + for (String i : pvp_skills_list_splitted_1)
  64. + {
  65. + String[] pvp_skills_list_splitted_2 = i.split(",");
  66. + PVP_SKILLS_LIST.put(Integer.parseInt(pvp_skills_list_splitted_2[0]), Integer.parseInt(pvp_skills_list_splitted_2[1]));
  67. + }
  68. }
  69. catch (Exception e)
  70. {
Advertisement
Add Comment
Please, Sign In to add comment