Gladicek

Love Your Gatekeeper 1.5

Feb 8th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.76 KB | None | 0 0
  1. Index: dist/game/data/scripts.cfg
  2. ===================================================================
  3. --- dist/game/data/scripts.cfg (revision 9413)
  4. +++ dist/game/data/scripts.cfg (working copy)
  5. @@ -785,3 +785,4 @@
  6. #events/TheValentineEvent/TheValentineEvent.java
  7. #events/FreyaCelebration/FreyaCelebration.java
  8. #events/MasterOfEnchanting/MasterOfEnchanting.java
  9. +#events/LoveYourGatekeeper/LoveYourGatekeeper.java
  10. Index: dist/game/data/scripts/events/LoveYourGatekeeper/32477-1.htm
  11. ===================================================================
  12. --- dist/game/data/scripts/events/LoveYourGatekeeper/32477-1.htm (revision 0)
  13. +++ dist/game/data/scripts/events/LoveYourGatekeeper/32477-1.htm (working copy)
  14. @@ -0,0 +1,13 @@
  15. +<html><head><body>Volunteer:<br>
  16. +We gatekeepers are under constant criticism and attack, always dealing with complaints that our teleportation services are too slow or too limited. We don't retaliate, but not because we can't, mind you.
  17. +I'm sure you can see some of our strength in the way we endure the attacks upon us.<br>
  18. +But this is only a glimpse of our true power. We have decided to use our power for the greater good.<br>
  19. +Just 10,000 Adena, my friend! For a donation of 10,000 Adena, you too can purchase a genuine <font color="LEVEL">Gatekeeper Transformation Stick</font>.
  20. +You can make a donation once a day to earn this Shadow Item which gives you the ability to transform into a gatekeeper and experience our great powers.
  21. +You can only use the gatekeeper powers when you have this stick equipped.
  22. +Once you remove it, you will revert to your original form.<br>
  23. +The money that you donate will benefit our Gatekeeper Welfare Foundation, so please participate!<br>
  24. +<a action="bypass -h Quest LoveYourGatekeeper 32477.htm">Back</a>
  25. +</body></html>
  26. +
  27. +
  28. Index: dist/game/data/scripts/events/LoveYourGatekeeper/32477-2.htm
  29. ===================================================================
  30. --- dist/game/data/scripts/events/LoveYourGatekeeper/32477-2.htm (revision 0)
  31. +++ dist/game/data/scripts/events/LoveYourGatekeeper/32477-2.htm (working copy)
  32. @@ -0,0 +1,9 @@
  33. +<html><head><body>Volunteer:<br>
  34. +You can use the Gatekeeper Transformation Stick to transform yourself to look like us for an entire hour!<br>
  35. +When you use the Gatekeeper Transformation Stick to look like us, you will possess our great powers and you will gain vitality while hunting. It's fantastic!<br>
  36. +You can obtain a Gatekeeper Transformation Stick once a day per account for a donation of just 10,000 Adena.
  37. +All proceeds go to the Gatekeeper Welfare Foundation, so please participate early and often!<br>
  38. +Please know that during the transformation, your physical form and your attributes will change.<br>
  39. +<a action="bypass -h Quest LoveYourGatekeeper transform_stick">Donate 10,000 Adena.</a><br>
  40. +<a action="bypass -h Quest LoveYourGatekeeper 32477-4.htm">"I won't give up my precious Adena!"</a>
  41. +</body></html>
  42. Index: dist/game/data/scripts/events/LoveYourGatekeeper/32477-3.htm
  43. ===================================================================
  44. --- dist/game/data/scripts/events/LoveYourGatekeeper/32477-3.htm (revision 0)
  45. +++ dist/game/data/scripts/events/LoveYourGatekeeper/32477-3.htm (working copy)
  46. @@ -0,0 +1,5 @@
  47. +<html><head><body>Volunteer:<br>
  48. +You don't have enough Adena. A Gatekeeper Transformation Stick costs 10,000 Adena!<br>
  49. +Don't worry about the expense -- it's worth it.<br>
  50. +<a action="bypass -h Quest LoveYourGatekeeper 32477.htm">Back</a>
  51. +</body></html>
  52. Index: dist/game/data/scripts/events/LoveYourGatekeeper/32477-4.htm
  53. ===================================================================
  54. --- dist/game/data/scripts/events/LoveYourGatekeeper/32477-4.htm (revision 0)
  55. +++ dist/game/data/scripts/events/LoveYourGatekeeper/32477-4.htm (working copy)
  56. @@ -0,0 +1,6 @@
  57. +<html><head><body>Volunteer:<br>
  58. +Oh...you've gone too far!<br>
  59. + Is 10,000 Adena really such an exorbitant sum? <br>
  60. + <a action="bypass -h Quest LoveYourGatekeeper 32477.htm">Go back.</a>
  61. + </body></html>
  62. +
  63. Index: dist/game/data/scripts/events/LoveYourGatekeeper/32477-5.htm
  64. ===================================================================
  65. --- dist/game/data/scripts/events/LoveYourGatekeeper/32477-5.htm (revision 0)
  66. +++ dist/game/data/scripts/events/LoveYourGatekeeper/32477-5.htm (working copy)
  67. @@ -0,0 +1,9 @@
  68. +<html><head><body>Volunteer: <br>
  69. +Well, aren't you kind...<br>
  70. +Your encouragement and support gives us even more strength. <br>
  71. +As a token of our gratitude, we will allow you to change your appearance to look like us.
  72. +I should warn you though: unlike using a Gatekeeper Transformation Stick, you won't be able to display any real power with this regular appearance change.<br>
  73. +<a action="bypass -h Quest LoveYourGatekeeper transform">"Yes, please!"</a><br>
  74. +<a action="bypass -h Quest LoveYourGatekeeper 32477.htm">"I don't know. It sounds scary."</a>
  75. +</body></html>
  76. +
  77. Index: dist/game/data/scripts/events/LoveYourGatekeeper/32477.htm
  78. ===================================================================
  79. --- dist/game/data/scripts/events/LoveYourGatekeeper/32477.htm (revision 0)
  80. +++ dist/game/data/scripts/events/LoveYourGatekeeper/32477.htm (working copy)
  81. @@ -0,0 +1,9 @@
  82. +<html><head><body>Volunteer:<br>
  83. +Goodness! Don't hit me!<br>
  84. +I am from the Gatekeeper Welfare Foundation. We are currently sponsoring a <font color="LEVEL">"Love Your Gatekeeper" campaign</font>.
  85. +Please take part and show your support for our brave gatekeepers. <br>
  86. +<a action="bypass -h Quest LoveYourGatekeeper 32477-1.htm">Learn about the campaign.</a><br>
  87. +<a action="bypass -h Quest LoveYourGatekeeper 32477-2.htm">Purchase a Transformation Stick.</a><br>
  88. +<a action="bypass -h Quest LoveYourGatekeeper 32477-5.htm">Encourage the gatekeeper.</a>
  89. +</body></html>
  90. +
  91. Index: dist/game/data/scripts/events/LoveYourGatekeeper/config.xml
  92. ===================================================================
  93. --- dist/game/data/scripts/events/LoveYourGatekeeper/config.xml (revision 0)
  94. +++ dist/game/data/scripts/events/LoveYourGatekeeper/config.xml (working copy)
  95. @@ -0,0 +1,40 @@
  96. +<?xml version="1.0" encoding="UTF-8"?>
  97. +<event name="Love Your Gatekeeper" active="27 02 2008-28 02 2008" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
  98. + <spawnlist>
  99. + <add npc="32477" x="-80762" y="151118" z="-3043" heading="28672" />
  100. + <add npc="32477" x="-84046" y="150193" z="-3129" heading="4096" />
  101. + <add npc="32477" x="-82675" y="151652" z="-3129" heading="46943" />
  102. + <add npc="32477" x="-12992" y="122818" z="-3117" heading="0" />
  103. + <add npc="32477" x="-13964" y="121947" z="-2988" heading="32768" />
  104. + <add npc="32477" x="-14823" y="123752" z="-3117" heading="8192" />
  105. + <add npc="32477" x="18178" y="145149" z="-3054" heading="7400" />
  106. + <add npc="32477" x="19185" y="144377" z="-3097" heading="32768" />
  107. + <add npc="32477" x="19508" y="145753" z="-3086" heading="47999" />
  108. + <add npc="32477" x="17396" y="170259" z="-3507" heading="30000" />
  109. + <add npc="32477" x="44150" y="-48708" z="-800" heading="32999" />
  110. + <add npc="32477" x="44280" y="-47664" z="-792" heading="49167" />
  111. + <add npc="32477" x="79806" y="55570" z="-1560" heading="0" />
  112. + <add npc="32477" x="83328" y="55824" z="-1525" heading="32768" />
  113. + <add npc="32477" x="80986" y="54504" z="-1525" heading="32768" />
  114. + <add npc="32477" x="83358" y="149223" z="-3400" heading="32768" />
  115. + <add npc="32477" x="82277" y="148598" z="-3467" heading="0" />
  116. + <add npc="32477" x="81621" y="148725" z="-3467" heading="32768" />
  117. + <add npc="32477" x="81680" y="145656" z="-3533" heading="32768" />
  118. + <add npc="32477" x="117498" y="76630" z="-2695" heading="38000" />
  119. + <add npc="32477" x="119536" y="76988" z="-2275" heading="40960" />
  120. + <add npc="32477" x="111585" y="221011" z="-3544" heading="16384" />
  121. + <add npc="32477" x="107922" y="218094" z="-3675" heading="0" />
  122. + <add npc="32477" x="114920" y="220020" z="-3632" heading="32768" />
  123. + <add npc="32477" x="147888" y="-58048" z="-2979" heading="49000" />
  124. + <add npc="32477" x="147285" y="-56461" z="-2776" heading="11500" />
  125. + <add npc="32477" x="147120" y="27312" z="-2192" heading="40960" />
  126. + <add npc="32477" x="147959" y="25695" z="-2000" heading="16384" />
  127. + <add npc="32477" x="87792" y="-142240" z="-1343" heading="44000" />
  128. + <add npc="32477" x="87557" y="-140657" z="-1542" heading="20476" />
  129. + <add npc="32477" x="115933" y="76482" z="-2711" heading="58999" />
  130. + </spawnlist>
  131. + <messages>
  132. + <add type="onEnd" text="Love Your Gatekeeper: Event end!" />
  133. + <add type="onEnter" text="Love Your Gatekeeper: Event ongoing!" />
  134. + </messages>
  135. +</event>
  136. \ No newline at end of file
  137. Index: dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
  138. ===================================================================
  139. --- dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java (revision 0)
  140. +++ dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java (working copy)
  141. @@ -0,0 +1,129 @@
  142. +/*
  143. + * This program is free software: you can redistribute it and/or modify it under
  144. + * the terms of the GNU General Public License as published by the Free Software
  145. + * Foundation, either version 3 of the License, or (at your option) any later
  146. + * version.
  147. + *
  148. + * This program is distributed in the hope that it will be useful, but WITHOUT
  149. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  150. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  151. + * details.
  152. + *
  153. + * You should have received a copy of the GNU General Public License along with
  154. + * this program. If not, see <http://www.gnu.org/licenses/>.
  155. + */
  156. +package events.LoveYourGatekeeper;
  157. +
  158. +import com.l2jserver.gameserver.model.actor.L2Npc;
  159. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  160. +import com.l2jserver.gameserver.model.event.LongTimeEvent;
  161. +import com.l2jserver.gameserver.model.holders.SkillHolder;
  162. +import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
  163. +import com.l2jserver.gameserver.model.quest.QuestState;
  164. +import com.l2jserver.gameserver.model.quest.State;
  165. +import com.l2jserver.gameserver.network.SystemMessageId;
  166. +import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  167. +
  168. +/**
  169. + * Retail Event 'Love Your Gatekeeper'
  170. + * @author Gladicek
  171. + * Based on Freya AI
  172. + */
  173. +
  174. +public class LoveYourGatekeeper extends LongTimeEvent
  175. +{
  176. + // Volunteer
  177. + private static final int NpcId = 32477;
  178. + // Items
  179. + private static final int ItemId = 12814; // Shadow Item - Gatekeeper Transformation Stick
  180. + // Time
  181. + private static final int HOURS = 24;
  182. + // Setting
  183. + private static final int PRICE = 10000;
  184. + // Skills
  185. + private static SkillHolder TELEPORTER_TRANSFORM = new SkillHolder(5655, 1);
  186. +
  187. + public LoveYourGatekeeper(String name, String descr)
  188. + {
  189. + super(name, descr);
  190. + addStartNpc(NpcId);
  191. + addFirstTalkId(NpcId);
  192. + addTalkId(NpcId);
  193. + }
  194. +
  195. + @Override
  196. + public String onFirstTalk(L2Npc npc, L2PcInstance player)
  197. + {
  198. + if (player.getQuestState(getName()) == null)
  199. + {
  200. + newQuestState(player);
  201. + }
  202. + return "32477.htm";
  203. + }
  204. +
  205. + @Override
  206. + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  207. + {
  208. + String htmltext = event;
  209. + final QuestState st = player.getQuestState(getName());
  210. + if (st == null)
  211. + {
  212. + return getNoQuestMsg(player);
  213. + }
  214. +
  215. + switch (event)
  216. + {
  217. + case "transform_stick":
  218. + {
  219. + if (player.getAdena() >= PRICE)
  220. + {
  221. + long _reuse = 0;
  222. + String _streuse = st.get("reuse");
  223. + if (_streuse != null)
  224. + {
  225. + _reuse = Long.parseLong(_streuse);
  226. + }
  227. + if (_reuse > System.currentTimeMillis())
  228. + {
  229. + long remainingTime = (_reuse - System.currentTimeMillis()) / 1000;
  230. + int hours = (int) (remainingTime / 3600);
  231. + int minutes = (int) ((remainingTime % 3600) / 60);
  232. + SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES);
  233. + sm.addItemName(ItemId);
  234. + sm.addNumber(hours);
  235. + sm.addNumber(minutes);
  236. + player.sendPacket(sm);
  237. + }
  238. + else
  239. + {
  240. + st.takeItems(PcInventory.ADENA_ID, PRICE);
  241. + st.giveItems(ItemId, 1);
  242. + st.setState(State.STARTED);
  243. + st.set("reuse", String.valueOf(System.currentTimeMillis() + (HOURS * 3600000)));
  244. + }
  245. +
  246. + }
  247. + else
  248. + {
  249. + return "32477-3.htm";
  250. + }
  251. + return null;
  252. + }
  253. + case "transform":
  254. + {
  255. + if (player.isTransformed())
  256. + {
  257. + return null;
  258. + }
  259. + player.doCast(TELEPORTER_TRANSFORM.getSkill());
  260. + return null;
  261. + }
  262. + }
  263. + return htmltext;
  264. + }
  265. +
  266. + public static void main(String[] args)
  267. + {
  268. + new LoveYourGatekeeper(LoveYourGatekeeper.class.getSimpleName(), "events");
  269. + }
  270. +}
Advertisement
Add Comment
Please, Sign In to add comment