Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: 32477-1.htm
- ===================================================================
- --- 32477-1.htm (revision 0)
- +++ 32477-1.htm (working copy)
- @@ -0,0 +1,14 @@
- +<html><head><body>Volunteer:<br>
- +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.
- +I'm sure you can see some of our strength in the way we endure the attacks upon us.<br>
- +But this is only a glimpse of our true power. We have decided to use our power for the greater good.<br>
- +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>.
- +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.
- +You can only use the gatekeeper powers when you have this stick equipped.
- +Once you remove it, you will revert to your original form.<br>
- +The money that you donate will benefit our Gatekeeper Welfare Foundation, so please participate! <br>
- +<a action="bypass -h Quest LoveYourGatekeeper 32477.htm">Back</a>
- +</body></html>
- +
- +
- Index: 32477-2.htm
- ===================================================================
- --- 32477-2.htm (revision 0)
- +++ 32477-2.htm (working copy)
- @@ -0,0 +1,5 @@
- +<html><head><body>Volunteer:<br>
- +You don't have enough Adena.
- + A Gatekeeper Transformation Stick costs 10,000 Adena!<br>
- + Don't worry about the expense -- it's worth it.<br>
- + <a action="bypass -h Quest LoveYourGatekeeper 32477.htm">Back</a></body></html>
- Index: 32477-3.htm
- ===================================================================
- --- 32477-3.htm (revision 0)
- +++ 32477-3.htm (working copy)
- @@ -0,0 +1,6 @@
- +<html><head><body>Volunteer:<br>
- +Oh...you've gone too far!<br>
- + Is 10,000 Adena really such an exorbitant sum? <br>
- + <a action="bypass -h Quest LoveYourGatekeeper 32477.htm">Go back.</a>
- + </body></html>
- +
- Index: 32477.htm
- ===================================================================
- --- 32477.htm (revision 0)
- +++ 32477.htm (working copy)
- @@ -0,0 +1,11 @@
- +<html><head><body>
- +Volunteer:<br>
- +Goodness! Don't hit me!<br>
- +I am from the Gatekeeper Welfare Foundation.
- +We are currently sponsoring a <font color="LEVEL">"Love Your Gatekeeper" campaign</font>.
- + Please take part and show your support for our brave gatekeepers. <br>
- + <a action="bypass -h Quest LoveYourGatekeeper 32477-1.htm">Learn about the campaign.</a><br>
- + <a action="bypass -h Quest LoveYourGatekeeper transform_stick">Purchase a Transformation Stick.</a><br>
- + <a action="bypass -h Quest LoveYourGatekeeper transform">Encourage the gatekeeper.</a></body>
- + </html>
- +
- Index: config.xml
- ===================================================================
- --- config.xml (revision 0)
- +++ config.xml (working copy)
- @@ -0,0 +1,25 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<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">
- + <spawnlist>
- + <add npc="32477" x="82766" y="149438" z="-3464" heading="33865" />
- + <add npc="32477" x="82286" y="53291" z="-1488" heading="15250" />
- + <add npc="32477" x="147060" y="25943" z="-2008" heading="18774" />
- + <add npc="32477" x="148096" y="-55466" z="-2728" heading="40541" />
- + <add npc="32477" x="87116" y="-141332" z="-1336" heading="52193" />
- + <add npc="32477" x="43521" y="-47542" z="-792" heading="31655" />
- + <add npc="32477" x="17203" y="144949" z="-3024" heading="18166" />
- + <add npc="32477" x="111164" y="221062" z="-3544" heading="2714" />
- + <add npc="32477" x="-13869" y="122063" z="-2984" heading="18270" />
- + <add npc="32477" x="-83161" y="150915" z="-3120" heading="17311" />
- + <add npc="32477" x="45402" y="48355" z="-3056" heading="49153" />
- + <add npc="32477" x="115616" y="-177941" z="-896" heading="30708" />
- + <add npc="32477" x="-44928" y="-113608" z="-192" heading="30212" />
- + <add npc="32477" x="-84037" y="243194" z="-3728" heading="8992" />
- + <add npc="32477" x="-119690" y="44583" z="360" heading="29289" />
- + <add npc="32477" x="12084" y="16576" z="-4584" heading="57345" />
- + </spawnlist>
- + <messages>
- + <add type="onEnd" text="Love Your Gatekeeper: Event end!" />
- + <add type="onEnter" text="Love Your Gatekeeper: Event ongoing!" />
- + </messages>
- +</event>
- \ No newline at end of file
- Index: LoveYourGatekeeper.java
- ===================================================================
- --- LoveYourGatekeeper.java (revision 0)
- +++ LoveYourGatekeeper.java (working copy)
- @@ -0,0 +1,126 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package events.LoveYourGatekeeper;
- +
- +import com.l2jserver.gameserver.model.actor.L2Npc;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.event.LongTimeEvent;
- +import com.l2jserver.gameserver.model.holders.SkillHolder;
- +import com.l2jserver.gameserver.model.quest.QuestState;
- +import com.l2jserver.gameserver.network.SystemMessageId;
- +import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
- +
- +/**
- + * Retail Event 'Love Your Gatekeeper'
- + * @author Gladicek
- + * TODO: Retail like spawns for Volunteers
- + */
- +
- +public class LoveYourGatekeeper extends LongTimeEvent
- +{
- + // Volunteer
- + private static final int NpcId = 32477;
- + // Items
- + private static final int ItemId = 12814; // Shadow Item - Gatekeeper Transformation Stick
- + private static final int ADENA = 57;
- + // Time
- + private static final int HOURS = 24;
- + // Setting
- + private static final int PRICE1 = 10000;
- + private static final int PRICE2 = 5000;
- + // Skills
- + private static SkillHolder TELEPORTER_TRANSFORM = new SkillHolder(5655, 1);
- +
- + public LoveYourGatekeeper(String name, String descr)
- + {
- + super(name, descr);
- + addStartNpc(NpcId);
- + addFirstTalkId(NpcId);
- + addTalkId(NpcId);
- + }
- +
- + @Override
- + public String onFirstTalk(L2Npc npc, L2PcInstance player)
- + {
- + if (player.getQuestState(getName()) == null)
- + {
- + newQuestState(player);
- + }
- + return "32477.htm";
- + }
- +
- + @Override
- + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- + {
- + String htmltext = event;
- + final QuestState st = player.getQuestState(getName());
- + if (st == null)
- + {
- + return getNoQuestMsg(player);
- + }
- +
- + switch (event)
- + {
- + case "transform_stick":
- + {
- + if (st.getQuestItemsCount(ADENA) >= PRICE1)
- + {
- + long _reuse = 0;
- + String _streuse = st.get("reuse");
- + if (_streuse != null)
- + {
- + _reuse = Long.parseLong(_streuse);
- + }
- + if (_reuse > System.currentTimeMillis())
- + {
- + long remainingTime = (_reuse - System.currentTimeMillis()) / 1000;
- + int hours = (int) (remainingTime / 3600);
- + int minutes = (int) ((remainingTime % 3600) / 60);
- + SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES);
- + sm.addItemName(ItemId);
- + sm.addNumber(hours);
- + sm.addNumber(minutes);
- + player.sendPacket(sm);
- + }
- + st.takeItems(ADENA, PRICE1);
- + st.giveItems(ItemId, 1);
- + st.set("reuse", String.valueOf(System.currentTimeMillis() + (HOURS * 3600000)));
- +
- + }
- + else if (st.getQuestItemsCount(ADENA) < PRICE2)
- + {
- + htmltext = "32477-2.htm";
- + }
- + else
- + htmltext = "32477-3.htm";
- + }
- + case "transform":
- + {
- + if (player.getFirstEffect(107) != null)
- + {
- + return null;
- + }
- + npc.doCast(TELEPORTER_TRANSFORM.getSkill());
- + }
- +
- + }
- + return htmltext;
- + }
- +
- + public static void main(String[] args)
- + {
- + new LoveYourGatekeeper(LoveYourGatekeeper.class.getSimpleName(), "events");
- + }
- +}
Advertisement
Add Comment
Please, Sign In to add comment