Guest User

Clan Manager by Devlin

a guest
Mar 15th, 2014
1,035
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.01 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_datapack
  3. Index: data/html/mods/clanManager.htm
  4. ===================================================================
  5. --- data/html/mods/clanManager.htm  (revision 0)
  6. +++ data/html/mods/clanManager.htm  (working copy)
  7. @@ -0,0 +1,19 @@
  8. +<html><head><title>Clan Manager</title></head><body>
  9. +<center>
  10. +<img src="L2Font-e.replay_logo-e" width=256 height=80>
  11. +<br>
  12. +<img src="l2ui_ch3.herotower_deco" width=256 height=32 align=center>
  13. +<br>
  14. +</center>
  15. +<center>
  16. +<a action="bypass -h npc_%objectId%_clanLevelUp">Increase Clan's Level</a>
  17. +<a action="bypass -h npc_%objectId%_clanReputationPoints">Increase Clan's Points</a>
  18. +<a action="bypass -h npc_%objectId%_clanSkills">Learn All Clan Skills</a>
  19. +<br>
  20. +</center>
  21. +<center>
  22. +<img src="l2ui_ch3.herotower_deco" width=256 height=32 align=center>
  23. +<br>
  24. +<font color="FFAA00">by Devlin</font>
  25. +</center>
  26. +</body></html>
  27. \ No newline at end of file
  28. #P aCis_gameserver
  29. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java
  30. ===================================================================
  31. --- java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java  (revision 0)
  32. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java  (working copy)
  33. @@ -0,0 +1,163 @@
  34. +/*
  35. + * This program is free software: you can redistribute it and/or modify it under
  36. + * the terms of the GNU General Public License as published by the Free Software
  37. + * Foundation, either version 3 of the License, or (at your option) any later
  38. + * version.
  39. + *
  40. + * This program is distributed in the hope that it will be useful, but WITHOUT
  41. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  42. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  43. + * details.
  44. + *
  45. + * You should have received a copy of the GNU General Public License along with
  46. + * this program. If not, see <http://www.gnu.org/licenses/>.
  47. + */
  48. +package net.sf.l2j.gameserver.model.actor.instance;
  49. +
  50. +import net.sf.l2j.gameserver.datatables.SkillTable;
  51. +import net.sf.l2j.gameserver.model.L2Skill;
  52. +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  53. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  54. +import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
  55. +
  56. +/**
  57. + * @author Devlin
  58. + *
  59. + */
  60. +public class L2ClanManagerInstance extends L2NpcInstance
  61. +{
  62. +   public L2ClanManagerInstance(int objectId, L2NpcTemplate template)
  63. +   {
  64. +       super(objectId, template);
  65. +   }
  66. +  
  67. +    @Override
  68. +    public void showChatWindow(L2PcInstance player, int val)
  69. +    {
  70. +        player.sendPacket(ActionFailed.STATIC_PACKET);
  71. +        String filename = "data/html/mods/clanManager.htm";
  72. +        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  73. +        html.setFile(filename);
  74. +        html.replace("%objectId%", String.valueOf(getObjectId()));
  75. +        player.sendPacket(html);
  76. +    }
  77. +  
  78. +   public int itemId = 57;
  79. +   public int itemCountLevelUp = 10000;
  80. +   public int itemCountReputationPoints = 100000;
  81. +   public int itemCountClanSkills = 100000000;
  82. +   public int clanLevel = 1;
  83. +   public int clanReputationScore = 1000;
  84. +  
  85. +   public int[] clanSkills =
  86. +   {
  87. +       370,
  88. +       371,
  89. +       372,
  90. +       373,
  91. +       374,
  92. +       375,
  93. +       376,
  94. +       377,
  95. +       378,
  96. +       379,
  97. +       380,
  98. +       381,
  99. +       382,
  100. +       383,
  101. +       384,
  102. +       385,
  103. +       386,
  104. +       387,
  105. +       388,
  106. +       389,
  107. +       390,
  108. +       391
  109. +   };
  110. +  
  111. +   @Override
  112. +   public void onBypassFeedback(L2PcInstance player, String command)
  113. +   {
  114. +       if (command.equals("clanLevelUp"))
  115. +       {
  116. +           if (player.getClan() != null)
  117. +           {
  118. +               player.sendMessage("You don't have a clan.");
  119. +               return;
  120. +           }
  121. +          
  122. +           if (!player.isClanLeader())
  123. +           {
  124. +               player.sendMessage("You aren't the leader of your clan.");
  125. +               return;
  126. +           }
  127. +          
  128. +           if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountLevelUp)
  129. +           {
  130. +               player.sendMessage("You don't have enough items.");
  131. +               return;
  132. +           }
  133. +          
  134. +           player.getClan().changeLevel(player.getClan().getLevel() + clanLevel);
  135. +           player.getClan().broadcastClanStatus();
  136. +           player.getInventory().destroyItemByItemId("Init.", itemId, itemCountLevelUp, player, player);
  137. +           player.sendMessage("Your clan's level has been changed to "+player.getClan().getLevel());
  138. +       }
  139. +      
  140. +       else if (command.equals("clanReputationPoints"))
  141. +       {
  142. +           if (player.getClan() != null)
  143. +           {
  144. +               player.sendMessage("You don't have a clan.");
  145. +               return;
  146. +           }
  147. +          
  148. +           if (!player.isClanLeader())
  149. +           {
  150. +               player.sendMessage("You aren't the leader of your clan.");
  151. +               return;
  152. +           }
  153. +          
  154. +           if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountReputationPoints)
  155. +           {
  156. +               player.sendMessage("You don't have enough items.");
  157. +               return;
  158. +           }
  159. +          
  160. +           player.getClan().addReputationScore(clanReputationScore);
  161. +           player.getClan().broadcastClanStatus();
  162. +           player.getInventory().destroyItemByItemId("Init.", itemId, itemCountReputationPoints, player, player);
  163. +           player.sendMessage("Your clan's reputation score has been changed to "+player.getClan().getReputationScore());
  164. +       }
  165. +      
  166. +       else if (command.equals("clanSkills"))
  167. +       {
  168. +           if (player.getClan() != null)
  169. +           {
  170. +               player.sendMessage("You don't have a clan.");
  171. +               return;
  172. +           }
  173. +          
  174. +           if (!player.isClanLeader())
  175. +           {
  176. +               player.sendMessage("You aren't the leader of your clan.");
  177. +               return;
  178. +           }
  179. +          
  180. +           if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountClanSkills)
  181. +           {
  182. +               player.sendMessage("You don't have enough items.");
  183. +               return;
  184. +           }
  185. +          
  186. +           for (int s : clanSkills)
  187. +           {
  188. +               L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
  189. +               player.getClan().addNewSkill(clanSkill);
  190. +               player.getClan().broadcastClanStatus();
  191. +               player.getInventory().destroyItemByItemId("Init.", itemId, itemCountClanSkills, player, player);
  192. +               player.sendMessage("Your clan has learned all clan skills.");
  193. +           }
  194. +       }
  195. +   }
  196. +}
  197. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment