Guest User

AIO Item

a guest
Jan 8th, 2012
1,624
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 1 0
  1. Index: data/scripts/handlers/itemhandlers/AIOItem.java
  2. ===================================================================
  3. --- data/scripts/handlers/itemhandlers/AIOItem.java (revision 0)
  4. +++ data/scripts/handlers/itemhandlers/AIOItem.java (revision 0)
  5. @@ -0,0 +1,35 @@
  6. +/*
  7. + * This program is free software: you can redistribute it and/or modify it under
  8. + * the terms of the GNU General Public License as published by the Free Software
  9. + * Foundation, either version 3 of the License, or (at your option) any later
  10. + * version.
  11. + *
  12. + * This program is distributed in the hope that it will be useful, but WITHOUT
  13. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  15. + * details.
  16. + *
  17. + * You should have received a copy of the GNU General Public License along with
  18. + * this program. If not, see <http://www.gnu.org/licenses/>.
  19. + */
  20. +package handlers.itemhandlers;
  21. +
  22. +import com.l2jserver.gameserver.handler.IItemHandler;
  23. +import com.l2jserver.gameserver.model.actor.L2Playable;
  24. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  25. +import com.l2jserver.gameserver.model.entity.AIO;
  26. +import com.l2jserver.gameserver.model.item.instance.L2ItemInstance;
  27. +
  28. +public class AIOItem implements IItemHandler
  29. +{
  30. + /**
  31. + *
  32. + * @see com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable, com.l2jserver.gameserver.model.L2ItemInstance, boolean)
  33. + */
  34. + public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
  35. + {
  36. + L2PcInstance activeChar = (L2PcInstance) playable;
  37. + AIO x = new AIO();
  38. + x.showHTML(activeChar);
  39. + }
  40. +}
  41. \ No newline at end of file
  42.  
  43. Index: Index: java/com/l2jserver/gameserver/model/network/clientpackets/RequstBypassToServer.java
  44. ===================================================================
  45. --- Index: java/com/l2jserver/gameserver/model/network/clientpackets/RequstBypassToServer.java (revision 5089)
  46. +++ Index: java/com/l2jserver/gameserver/model/network/clientpackets/RequstBypassToServer.java (working copy)
  47. @@ -33,6 +33,7 @@
  48. import com.l2jserver.gameserver.model.actor.instance.L2MerchantSummonInstance;
  49. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  50. import com.l2jserver.gameserver.model.entity.Hero;
  51. +import com.l2jserver.gameserver.model.entity.AIO;
  52. import com.l2jserver.gameserver.network.SystemMessageId;
  53. import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
  54. import com.l2jserver.gameserver.network.communityserver.writepackets.RequestShowCommunityBoard;
  55. @@ -165,6 +166,12 @@
  56. }
  57. catch (NumberFormatException nfe) {}
  58. }
  59. +
  60. + if (_command.startsWith("aioItem")){
  61. +
  62. + AIO list = new AIO();
  63. + list.convert(activeChar,_command.substring(8));
  64. + }
  65. // Navigate through Manor windows
  66. else if (_command.startsWith("manor_menu_select"))
  67. {
  68.  
  69.  
  70. Index: C:/Users/Marwan/Desktop/Workspace/L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/AIO.java
  71. ===================================================================
  72. --- C:/Users/Marwan/Desktop/Workspace/L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/AIO.java (revision 0)
  73. +++ C:/Users/Marwan/Desktop/Workspace/L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/AIO.java (revision 0)
  74. @@ -0,0 +1,42 @@
  75. +/*
  76. + * This program is free software: you can redistribute it and/or modify it under
  77. + * the terms of the GNU General Public License as published by the Free Software
  78. + * Foundation, either version 3 of the License, or (at your option) any later
  79. + * version.
  80. + *
  81. + * This program is distributed in the hope that it will be useful, but WITHOUT
  82. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  83. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  84. + * details.
  85. + *
  86. + * You should have received a copy of the GNU General Public License along with
  87. + * this program. If not, see <http://www.gnu.org/licenses/>.
  88. + */
  89. +package com.l2jserver.gameserver.model.entity;
  90. +import com.l2jserver.gameserver.cache.HtmCache;
  91. +
  92. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  93. +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
  94. +
  95. +
  96. +/**
  97. + * @author Marwan
  98. + *
  99. + */
  100. +public class AIO
  101. +{
  102. + public void showHTML(L2PcInstance activeChar){
  103. + String htmFile = "data/html/aio.htm";
  104. + String htmContent = HtmCache.getInstance().getHtm(htmFile);
  105. + String html = HtmCache.getInstance().getHtm("en", "data/html/aio.htm");
  106. + if (html == null)
  107. + html = "<html><body><br><br><center><font color=LEVEL>404:</font> File Not Found</center></body></html>";
  108. + activeChar.sendPacket(new NpcHtmlMessage(1, html));
  109. + }
  110. +
  111. + public void convert(L2PcInstance activeChar, String text)
  112. + {
  113. + showHTML(activeChar);
  114. + }
  115. +
  116. + }
Advertisement
Add Comment
Please, Sign In to add comment