Advertisement
MrKirill1232

Untitled

Oct 31st, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.55 KB | None | 0 0
  1. Index: dist/game/data/scripts/ai/others/EinhasadStore/34487.html
  2. IDEA additional info:
  3. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  4. <+>UTF-8
  5. ===================================================================
  6. diff --git a/dist/game/data/scripts/ai/others/EinhasadStore/34487.html b/dist/game/data/scripts/ai/others/EinhasadStore/34487.html
  7. new file mode 100644
  8. --- /dev/null
  9. +++ b/dist/game/data/scripts/ai/others/EinhasadStore/34487.html
  10. @@ -0,0 +1,49 @@
  11. +<html><title>Game Assistant</title><body>
  12. +<table border=0 cellpadding=0 cellspacing=0 width=306 height=493 background="L2UI_CT1.GroupBox.GroupBox_DF">
  13. + <tr>
  14. + <td valign="center" align="center">
  15. + <table border=0 cellpadding=0 cellspacing=0>
  16. + <tr><td height="15"></td></tr>
  17. + <tr><td width=306 height=260 background="L2UI_EPIC.HtmlWnd.HtmlWnd_Einhasad_IMG"></td></tr>
  18. + <tr><td height="0"></td></tr>
  19. + </table>
  20. + <table border=0 cellpadding=0 cellspacing=0 width="306">
  21. + <tr><td height="0"></td></tr>
  22. + <tr><td align="center" height="18"><font color="af9878">May the Power of Light guide your way!</font></td></tr>
  23. + <tr><td height="15"></td></tr>
  24. + </table>
  25. + <table border=0 cellpadding=0 cellspacing=0 width="295" height="128" background="L2UI_CT1.GroupBox.GroupBox_DF">
  26. + <tr><td height="15"></td></tr>
  27. + <tr><td align="center">
  28. + <button action="bypass Quest EinhasadStore Chat_Jewell_Stones" value="Jewels" width="271" height="25" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  29. + </tr>
  30. + <tr><td height="10"></td></tr>
  31. + <tr><td align="center">
  32. + <button action="bypass Quest EinhasadStore Chat_Accessories" value="Accessories / Agathions / Artifacts" width="271" height="25" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  33. + </tr>
  34. + <tr><td height="10"></td></tr>
  35. + <tr><td align="center">
  36. + <button action="bypass Quest EinhasadStore Chat_Scrolls" value="Enchant Scrolls / Item Enhancement" width="271" height="25" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  37. + </tr>
  38. + <tr><td height="10"></td></tr>
  39. + <tr><td height="10"></td></tr>
  40. + <tr><td align="center">
  41. + <button action="bypass Quest EinhasadStore Chat_Enhancement" value="Item Augmentation / Skill Enchantment" width="271" height="25" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  42. + </tr>
  43. + <tr><td height="10"></td></tr>
  44. + <tr><td height="10"></td></tr>
  45. + <tr><td align="center">
  46. + <button action="bypass Quest EinhasadStore Chat_Others" value="Time Stones / Supplies / Misc" width="271" height="25" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  47. + </tr>
  48. + <tr><td height="10"></td></tr>
  49. + <tr><td height="10"></td></tr>
  50. + <tr><td align="center">
  51. + <button action="bypass Quest EinhasadStore Chat_Cloak" value="Cloaks of Ancient Kingdoms" width="271" height="25" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  52. + </tr>
  53. + <tr><td height="10"></td></tr>
  54. + </table>
  55. + </td>
  56. + </tr>
  57. +</table>
  58. +</body></html>
  59. +
  60. Index: dist/game/data/scripts/ai/others/EinhasadStore/EinhasadStore.java
  61. IDEA additional info:
  62. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  63. <+>UTF-8
  64. ===================================================================
  65. diff --git a/dist/game/data/scripts/ai/others/EinhasadStore/EinhasadStore.java b/dist/game/data/scripts/ai/others/EinhasadStore/EinhasadStore.java
  66. new file mode 100644
  67. --- /dev/null
  68. +++ b/dist/game/data/scripts/ai/others/EinhasadStore/EinhasadStore.java
  69. @@ -0,0 +1,124 @@
  70. +/*
  71. + * This file is part of the L2J Mobius project.
  72. + *
  73. + * This program is free software: you can redistribute it and/or modify
  74. + * it under the terms of the GNU General Public License as published by
  75. + * the Free Software Foundation, either version 3 of the License, or
  76. + * (at your option) any later version.
  77. + *
  78. + * This program is distributed in the hope that it will be useful,
  79. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  80. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  81. + * General Public License for more details.
  82. + *
  83. + * You should have received a copy of the GNU General Public License
  84. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  85. + */
  86. +package ai.others.EinhasadStore;
  87. +
  88. +import ai.AbstractNpcAI;
  89. +import org.l2jmobius.gameserver.cache.HtmCache;
  90. +import org.l2jmobius.gameserver.data.xml.MultisellData;
  91. +import org.l2jmobius.gameserver.model.actor.Npc;
  92. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  93. +import org.l2jmobius.gameserver.model.events.EventType;
  94. +import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
  95. +import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
  96. +import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
  97. +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBypass;
  98. +import org.l2jmobius.gameserver.network.serverpackets.ExPremiumManagerShowHtml;
  99. +
  100. +/**
  101. + */
  102. +public class EinhasadStore extends AbstractNpcAI
  103. +{
  104. + // NPC
  105. + private static final int MERCHANT = 34487;
  106. + // Items
  107. + // Multisells
  108. + private static final int JEWELS_STONE = 34487001;
  109. + private static final int ACCESSORIES = 34487002;
  110. + private static final int SCROLLS = 34487003;
  111. + private static final int ENHANCEMENT = 34487004;
  112. + private static final int OTHER = 34487005;
  113. + private static final int CLOAK = 34487006;
  114. + // Others
  115. + private static final String COMMAND_BYPASS = "Quest EinhasadStore ";
  116. +
  117. + private EinhasadStore()
  118. + {
  119. + addStartNpc(MERCHANT);
  120. + addFirstTalkId(MERCHANT);
  121. + addTalkId(MERCHANT);
  122. + }
  123. +
  124. + @Override
  125. + public String onAdvEvent(String event, Npc npc, PlayerInstance player)
  126. + {
  127. + final String htmltext = null;
  128. + switch (event)
  129. + {
  130. +
  131. + case "back":
  132. + {
  133. + player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/others/EinhasadStore/34487.html")));
  134. + break;
  135. + }
  136. + // Bypass
  137. + case "Chat_Jewell_Stones":
  138. + {
  139. + MultisellData.getInstance().separateAndSend(JEWELS_STONE, player, null, false);
  140. + break;
  141. + }
  142. + case "Chat_Accessories":
  143. + {
  144. + MultisellData.getInstance().separateAndSend(ACCESSORIES, player, null, false);
  145. + break;
  146. + }
  147. + case "Chat_Scrolls":
  148. + {
  149. + MultisellData.getInstance().separateAndSend(SCROLLS, player, null, false);
  150. + break;
  151. + }
  152. + case "Chat_Enhancement":
  153. + {
  154. + MultisellData.getInstance().separateAndSend(ENHANCEMENT, player, null, false);
  155. + break;
  156. + }
  157. + case "Chat_Others":
  158. + {
  159. + MultisellData.getInstance().separateAndSend(OTHER, player, null, false);
  160. + break;
  161. + }
  162. + case "Chat_Cloak":
  163. + {
  164. + MultisellData.getInstance().separateAndSend(CLOAK, player, null, false);
  165. + break;
  166. + }
  167. + }
  168. + return htmltext;
  169. + }
  170. +
  171. + @Override
  172. + public String onFirstTalk(Npc npc, PlayerInstance player)
  173. + {
  174. + player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/others/EinhasadStore/34487.html")));
  175. + return null;
  176. + }
  177. +
  178. + @RegisterEvent(EventType.ON_PLAYER_BYPASS)
  179. + @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
  180. + public void OnPlayerBypass(OnPlayerBypass event)
  181. + {
  182. + final PlayerInstance player = event.getPlayer();
  183. + if (event.getCommand().startsWith(COMMAND_BYPASS))
  184. + {
  185. + notifyEvent(event.getCommand().replace(COMMAND_BYPASS, ""), null, player);
  186. + }
  187. + }
  188. +
  189. + public static void main(String[] args)
  190. + {
  191. + new EinhasadStore();
  192. + }
  193. +}
  194. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement