Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.19 KB | None | 0 0
  1. +++++++++++++++++++++++++L2JFrozen/config/head/other.properties
  2.  
  3.  
  4. AllowVipMulXpSp = True
  5. VipMulXp = 2
  6. VipMulSp = 2
  7.  
  8. + EnableVipSystem = True
  9. + # List of Vip Skills
  10. + # Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
  11. + VipSkills = 395,1
  12.  
  13. +++++++++++++++++++++++++com/l2jfrozen/Config.java
  14.  
  15.  
  16. public static int VIP_XP;
  17. public static int VIP_SP;
  18. + public static boolean ENABLE_VIP_SYSTEM;
  19. + public static Map VIP_SKILLS;
  20. public static boolean ANNOUNCE_CASTLE_LORDS;
  21.  
  22.  
  23. VIP_XP = Integer.parseInt(otherSettings.getProperty("VipMulXp", "2"));
  24. VIP_SP = Integer.parseInt(otherSettings.getProperty("VipMulSp", "2"));
  25. + ENABLE_VIP_SYSTEM = Boolean.parseBoolean(otherSettings.getProperty("EnableVipSystem", "True"));
  26. ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False"));
  27.  
  28.  
  29.  
  30. System.out.println("[Aio System]: invalid config property in "+OTHER+" -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
  31. }
  32. }
  33. }
  34. }
  35. }
  36. + //if(ENABLE_VIP_SYSTEM) //create map if system is enabled
  37. + {
  38. + String[] VipSkillsSplit = otherSettings.getProperty("VipSkills", "").split(";");
  39. + VIP_SKILLS = new FastMap(VipSkillsSplit.length);
  40. + for (String skill : VipSkillsSplit)
  41. + {
  42. + String[] skillSplit = skill.split(",");
  43. + if (skillSplit.length != 2)
  44. + {
  45. + System.out.println("[Vip System]: invalid config property in other.properties -> VipSkills \"" + skill + "\"");
  46. + }
  47. + else
  48. + {
  49. + try
  50. + {
  51. + VIP_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  52. + }
  53. + catch (NumberFormatException nfe)
  54. + {
  55. + if (!skill.equals(""))
  56. + {
  57. + System.out.println("[Vip System]: invalid config property in other.properties -> VipSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
  58. + }
  59. + }
  60. + }
  61. + }
  62. + }
  63. STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "100"));
  64. STARTING_AA = Integer.parseInt(otherSettings.getProperty("StartingAncientAdena", "0"));
  65.  
  66.  
  67.  
  68.  
  69. +++++++++++++++++++++++++com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminVip.java
  70.  
  71.  
  72.  
  73.  
  74. public void doVip(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time)
  75.  
  76. + _player.rewardVipSkills();
  77. _player.broadcastUserInfo();
  78. _player.sendPacket(new EtcStatusUpdate(_player));
  79. + _player.sendSkillList();
  80.  
  81. public void removeVip(L2PcInstance activeChar, L2PcInstance _player, String _playername)
  82.  
  83. + _player.lostVipSkills();
  84. _player.broadcastUserInfo();
  85. _player.sendPacket(new EtcStatusUpdate(_player));
  86. + _player.sendSkillList();
  87.  
  88.  
  89.  
  90.  
  91. +++++++++++++++++++++++++com/l2jfrozen/gameserver/model/actors/instance/L2PcInstance.java
  92.  
  93.  
  94.  
  95. public void setVip(boolean val)
  96. {
  97. _isVip = val;
  98. -
  99. +
  100. }
  101. -
  102. +
  103. + public void rewardVipSkills()
  104. + {
  105. + L2Skill skill;
  106. + for(Integer skillid : Config.VIP_SKILLS.keySet())
  107. + {
  108. + int skilllvl = Config.VIP_SKILLS.get(skillid);
  109. + skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
  110. + if(skill != null)
  111. + {
  112. + addSkill(skill, true);
  113. + }
  114. + }
  115. + sendMessage("GM give to you Vip's skills");
  116. + }
  117. +
  118. + public void lostVipSkills()
  119. + {
  120. + L2Skill skill;
  121. + for(Integer skillid : Config.VIP_SKILLS.keySet())
  122. + {
  123. + int skilllvl = Config.VIP_SKILLS.get(skillid);
  124. + skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
  125. + removeSkill(skill);
  126. + }
  127. + }
  128. +
  129.  
  130. 0
  131. Back to top
  132. Quote
  133. MultiQuote
  134. Edit
  135. Report
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement