Advertisement
Axelut

Fix Special Buff List

May 10th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/java/L2JDev/World/gameserver/Community_L2JDev/Buffer/SpecialBBSManager.java b/java/L2JDev/World/gameserver/Community_L2JDev/Buffer/SpecialBBSManager.java
  2. new file mode 100644
  3. index 0000000..bedd6cd
  4. --- /dev/null
  5. +++ b/java/L2JDev/World/gameserver/Community_L2JDev/Buffer/SpecialBBSManager.java
  6. @@ -0,0 +1,135 @@
  7. +package L2JDev.World.gameserver.Community_L2JDev.Buffer;
  8. +
  9. +import java.util.StringTokenizer;
  10. +
  11. +import L2JDev.World.Config;
  12. +import L2JDev.World.gameserver.communitybbs.manager.BaseBBSManager;
  13. +import L2JDev.World.gameserver.data.SkillTable;
  14. +import L2JDev.World.gameserver.data.cache.HtmCache;
  15. +import L2JDev.World.gameserver.data.xml.ItemData;
  16. +import L2JDev.World.gameserver.enums.ZoneId;
  17. +import L2JDev.World.gameserver.model.actor.Player;
  18. +import L2JDev.World.gameserver.model.entity.TeamVsTeam.TvTEvent;
  19. +import L2JDev.World.gameserver.model.item.instance.ItemInstance;
  20. +import L2JDev.World.gameserver.model.olympiad.OlympiadManager;
  21. +import L2JDev.World.gameserver.network.SystemMessageId;
  22. +import L2JDev.World.gameserver.network.serverpackets.MagicSkillUse;
  23. +import L2JDev.World.gameserver.network.serverpackets.SystemMessage;
  24. +import L2JDev.World.gameserver.skills.L2Skill;
  25. +
  26. +/**
  27. + * @author Juvenil Walker
  28. + *
  29. + */
  30. +public class SpecialBBSManager extends BaseBBSManager
  31. +{
  32. +   @Override
  33. +   public void parseCmd(String command, Player activeChar)
  34. +   {
  35. +       if (command.startsWith("_bbsexe"))
  36. +       {
  37. +
  38. +           String val2 = command.substring(8);
  39. +           StringTokenizer st2 = new StringTokenizer(val2, " ");
  40. +          
  41. +           String a2 = st2.nextToken();
  42. +           int id2 = Integer.parseInt(a2);
  43. +           String b2 = st2.nextToken();
  44. +           int lvl2 = Integer.parseInt(b2);
  45. +           String valor = st2.nextToken();
  46. +           int Prince = Integer.parseInt(valor);
  47. +           String itemname = ItemData.getInstance().getTemplate(Config.BUFF_CONST_ITEM).getName();
  48. +           if (!checkAllowed(activeChar))
  49. +               return;
  50. +
  51. +           ItemInstance itemInstance = activeChar.getInventory().getItemByItemId(Config.BUFF_CONST_ITEM);
  52. +           if (itemInstance == null || !itemInstance.isStackable() && activeChar.getInventory().getItemCount(Config.BUFF_CONST_ITEM, -1) < (Prince))
  53. +           {
  54. +               activeChar.sendMessage("you not enough item " + itemname);
  55. +               return;
  56. +           }
  57. +           else if (itemInstance.isStackable())
  58. +           {
  59. +               if (!activeChar.destroyItemByItemId("Adena", Config.BUFF_CONST_ITEM, Prince, activeChar.getTarget(), true))
  60. +               {
  61. +                   activeChar.sendMessage("you not enough item " + itemname);
  62. +                   return;
  63. +               }
  64. +           }
  65. +           L2Skill skill2 = SkillTable.getInstance().getInfo(id2, lvl2);
  66. +           if (skill2 != null)
  67. +           {
  68. +               skill2.getEffects(activeChar, activeChar);
  69. +               MagicSkillUse mgc = new MagicSkillUse(activeChar, activeChar, id2, lvl2, 1150, 0);
  70. +               activeChar.sendPacket(mgc);
  71. +               activeChar.broadcastPacket(mgc);
  72. +               activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(id2, lvl2));
  73. +           }
  74. +          
  75. +           String filename = "data/html/CommunityBoard/top/extra.htm";
  76. +           String content = HtmCache.getInstance().getHtm(filename, activeChar);
  77. +           content.replace("%ServerName%", Config.ServerName);
  78. +           separateAndSend(content, activeChar);
  79. +          
  80. +       }
  81. +   }
  82. +   public boolean checkAllowed(Player activeChar)
  83. +   {
  84. +       final Player player = activeChar.getActingPlayer();
  85. +       int charId = player.getObjectId();
  86. +       String msg = null;
  87. +       if (activeChar.isSitting())
  88. +           msg = "You can't use Community Buffer when you sit!";
  89. +       else if (activeChar.isDead())
  90. +           msg = "You can't use Community Buffer when you dead!";
  91. +       else if (activeChar.isInCombat())
  92. +           msg = "You can't use Community Buffer when you in combat!";
  93. +       else if(player.isInOlympiadMode() || player.isInsideZone(ZoneId.PVP) || OlympiadManager.getInstance().isRegistered(activeChar) || OlympiadManager.getInstance().isRegisteredInComp(activeChar))
  94. +           msg = "You can't use Community Buffer when you on event!";
  95. +       else if(player.isInJail() || player.isInsideZone(ZoneId.JAIL))
  96. +           msg = "You can't use Community Buffer when you on Jail";
  97. +       else if(player.getPvpFlag() > 1 || player.isInsideZone(ZoneId.CHAOTIC))
  98. +           msg = "You can't use Community Buffer when you on Chaotic";
  99. +       else if(player.getPvpFlag() > 0 || player.isInsideZone(ZoneId.CHAOTIC))
  100. +           msg = "You can't use Community Buffer when you on Chaotic";
  101. +       else if(player.isInsideZone(ZoneId.CHAOTIC))
  102. +           msg = "You can't use Community Buffer when you on Chaotic";
  103. +       else if(player.isCursedWeaponEquipped())
  104. +           msg = "You can't use Community Buffer when you have Cursed Weapon!";
  105. +       else if(player.isInsideZone(ZoneId.BOSS))
  106. +           msg = "You can't use Community Buffer when you on Boss Zone!";
  107. +       else if(player.isInArenaEvent() || player.isInsideZone(ZoneId.ARENA_EVENT))
  108. +           msg = "You can't use Community Buffer when you on Tour!";
  109. +       if (TvTEvent.isPlayerParticipant(charId))
  110. +           msg = "You can't use Community Buffer while participating on Event TvT!.";
  111. +       if (msg != null)
  112. +       {
  113. +           activeChar.sendMessage(msg);
  114. +           String path = "data/html/CommunityBoard/top/";
  115. +           String filepath = "";
  116. +           String content = "";
  117. +          
  118. +           filepath = path + "extra.htm";
  119. +           content = HtmCache.getInstance().getHtm(filepath, player);
  120. +           separateAndSend(content, player);
  121. +           // ===========================================================================
  122. +           if (content != null)
  123. +           {  
  124. +               content = content.replace("%ServerName%", String.valueOf(Config.ServerName));
  125. +               content = content.replace("%name%", String.valueOf(player.getName()));
  126. +               BaseBBSManager.separateAndSend(content, player);
  127. +           }
  128. +       }
  129. +       return msg == null;
  130. +   }
  131. +  
  132. +   public static SpecialBBSManager getInstance()
  133. +   {
  134. +       return SingletonHolder.INSTANCE;
  135. +   }
  136. +  
  137. +   private static class SingletonHolder
  138. +   {
  139. +       protected static final SpecialBBSManager INSTANCE = new SpecialBBSManager();
  140. +   }
  141. +}
  142. \ No newline at end of file
  143. diff --git a/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java b/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java
  144. index ae50aef..5582834 100644
  145. --- a/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java
  146. +++ b/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java
  147. @@ -1,278 +1,278 @@
  148. +       else if (command.startsWith("_bbsexe"))
  149. +           SpecialBBSManager.getInstance().parseCmd(command, player);
  150.  
  151. }
  152. \ No newline at end of file
  153.  
  154. diff --git a/java/L2JDev/World/gameserver/data/html/CommunityBoard/top/extra.HTML
  155. b/java/L2JDev/World/gameserver/data/html/CommunityBoard/top/extra.HTML
  156. index ae50aef..5582834 100644
  157. +<html>
  158. +<body>
  159. +<center>
  160. +   <br>
  161. +   <table cellspacing="0" cellpadding="1" border="0" width="610">
  162. +       <tr>
  163. +           <td width=1 align=center></td>
  164. +           <td width=1 align=center></td>
  165. +           <td width=1 align=center><button value="Home" action="bypass _bbshome" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  166. +           <td width=1 align=center><button value="Shop" action="bypass _bbspag;shop.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  167. +           <td width=1 align=center><button value="Buffer" action="bypass _bbspag;buffer.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  168. +           <td width=1 align=center><button value="Teleport" action="bypass _bbspag;teleport.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  169. +           <td width=1 align=center><button value="Character" action="bypass _bbsMenu" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  170. +           <td width=1 align=center><button value="Skins" action="bypass _bbsSkinHtml" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  171. +           <td width=1 align=center><button value="Boss" action="bypass _bbsranking;boss" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  172. +           <td width=1 align=center><button value="Donate" action="bypass _bbsEnchantIndex" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  173. +       </tr>
  174. +   </table>
  175. +   <br><br>
  176. +   <font color="58CC00">L2JDev</font> - Community Special's
  177. +       <br>
  178. +       <img src="Icons.breaker" width=260 height=16>
  179. +       <br>
  180. +   <table>
  181. +       <tr>
  182. +           <td><button value="Cancel" action="bypass _bbscancelbuff" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  183. +           <td><button value="Heal" action="bypass _bbsheal" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  184. +       </tr>
  185. +   </table>
  186. +   <br><br>
  187. +   <table cellspacing="0" cellpadding="1" border="0" width="610">
  188. +       <tr>
  189. +           <td><img src=icon.skill1164 width=32 height=23 align=left></td>
  190. +           <td><button value="Rheumatism" action="bypass _bbsexe 4551 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  191. +           <td><img src=icon.skill1164 width=32 height=23 align=left></td>
  192. +           <td><button value="Cholera" action="bypass _bbsexe 4552 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  193. +           <td><img src=icon.skill1164 width=32 height=23 align=left></td>
  194. +           <td><button value="Flu" action="bypass _bbsexe 4553 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  195. +           <td><img src=icon.skill1164 width=32 height=23 align=left></td>
  196. +           <td><button value="Malaria" action="bypass _bbsexe 4554 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  197. +           <td></td>
  198. +           <td></td>
  199. +       </tr>
  200. +       <tr>
  201. +           <td><img src=icon.skill0341 width=32 height=23 align=left></td>
  202. +           <td><button value="T. of Life" action="bypass _bbsexe 341 1 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  203. +           <td><img src=icon.skill1410 width=32 height=23 align=left></td>
  204. +           <td><button value="Salvation" action="bypass _bbsexe 1410 1 10" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  205. +           <td><img src=icon.skill1374 width=32 height=23 align=left></td>
  206. +           <td><button value="H. Valor" action="bypass _bbsexe 1374 1 10" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  207. +           <td><img src=icon.skill0396 width=32 height=23 align=left></td>
  208. +           <td><button value="H. Berserker" action="bypass _bbsexe 396 1 10" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  209. +           <td></td>
  210. +           <td></td>
  211. +       </tr>
  212. +    </table>
  213. +    <br>
  214. +    <br>
  215. +    <br>
  216. +       <img src="Icons.breaker" width=260 height=16>
  217. +   <br>
  218. +   <table>
  219. +       <tr>
  220. +           <td><button value="Buff" action="bypass _bbspag;buffer.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  221. +           <td><button value="Song" action="bypass _bbspag;songs.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  222. +           <td><button value="Dance" action="bypass _bbspag;dance.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  223. +           <td><button value="Extra" action="bypass _bbspag;extra.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalOn"></td>
  224. +           <td><button value="VIP" action="bypass _bbspag;VipBuffer.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
  225. +       </tr>
  226. +   </table>
  227. +</center>
  228. +</body>
  229. +</html>
  230.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement