The Hunt for Santa Begins!
This commit is contained in:
18
trunk/dist/game/data/scripts/events/HuntForSanta/34008-1.htm
vendored
Normal file
18
trunk/dist/game/data/scripts/events/HuntForSanta/34008-1.htm
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<html><body>Noelle:<br>
|
||||
I said Noelle won't make you labor for free. My fairies are extremly powerful!<br>
|
||||
<font color="LEVEL">Stocking Fairy's Blessing</font><br1>
|
||||
STR +3, INT +3, Speed +7<br>
|
||||
<font color="LEVEL">Tree Fairy's Blessing</font><br1>
|
||||
STR +3, MEN +3, +30 P. Critical Rate, +30 M. Critical Rate<br>
|
||||
<font color="LEVEL">Snowman Fairy's Blessing</font><br1>
|
||||
STR +3, WIT +3, Max HP/MP +2013<br>
|
||||
What do you think? Aren't my fairies amazing? Which one will you take with you?<br><br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HuntForSanta receiveBuffStocking">"I'll take the Stocking Fairy's Blessing."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HuntForSanta receiveBuffTree">"I'll take the Tree Fairy's Blessing."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HuntForSanta receiveBuffSnowman">"I'll take the Snowman Fairy's Blessing."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HuntForSanta receiveBuffAll">"I like all three of them."</Button><br1>
|
||||
Requirements: Must be a party leader of a party with 3 races or more, or a party of 7.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HuntForSanta changeBuff">"I want to take a different Fairy's Blessing."</Button><br1>
|
||||
(Note: All of your Blessed Buffs will be deleted.)<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/events/HuntForSanta/34008-2.htm
vendored
Normal file
4
trunk/dist/game/data/scripts/events/HuntForSanta/34008-2.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Noelle:<br>
|
||||
The spirits will find Santa in 2 hours. Find Santa bring back Santa's Marks to me and I'll give you a small gift.<br>
|
||||
(You can receive your reward after 2 hours. You cannot receive your reward if you die or you don't have space in your inventory.)
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/events/HuntForSanta/34008-3.htm
vendored
Normal file
4
trunk/dist/game/data/scripts/events/HuntForSanta/34008-3.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Noelle:<br>
|
||||
Look. If you want to take all three spirits, you need 3 or more races, or 7 members in your party and have the party leader come talk to me.<br>
|
||||
Or. If you want to take a different one, click on the button that says <font color="LEVEL">I want a different Fairy's Blessing</font>.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/events/HuntForSanta/34008-4.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/events/HuntForSanta/34008-4.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Noelle:<br>
|
||||
You need 3 or more races, or 7 members in your party and have the party leader come talk to me.
|
||||
</body></html>
|
8
trunk/dist/game/data/scripts/events/HuntForSanta/34008.htm
vendored
Normal file
8
trunk/dist/game/data/scripts/events/HuntForSanta/34008.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Noelle:<br>
|
||||
Hey, You! Have you seen an old fatso wearing a red hat turned inside out with a white beard that billows about like a cloud?<br>
|
||||
He left in the middle of our busiest season! How dare he leave all this work behind and run away like that? It's completely unacceptable!<br>
|
||||
Look here, noble warrior, I mean warrior, sir, er... ma'am, er...? Look here! You seem to have a lot of time, so how about a little help? Don't worry. I can pay!<br>
|
||||
My cute Stocking Fairy, Tree Fairy, and Snowman Fairy are experts at finding the old man. Just bring one of them around, and it will be a cinch!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HuntForSanta 34008-1.htm">"I'll take..."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Multisell 3400801">"I have a Santa's Mark."</Button>
|
||||
</body></html>
|
155
trunk/dist/game/data/scripts/events/HuntForSanta/HuntForSanta.java
vendored
Normal file
155
trunk/dist/game/data/scripts/events/HuntForSanta/HuntForSanta.java
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J DataPack
|
||||
*
|
||||
* This file is part of L2J DataPack.
|
||||
*
|
||||
* L2J DataPack 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.
|
||||
*
|
||||
* L2J DataPack 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.HuntForSanta;
|
||||
|
||||
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.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* The Hunt for Santa Begins!<br>
|
||||
* Info - http://www.lineage2.com/en/news/events/hunt-for-santa.php
|
||||
* @author Mobius
|
||||
*/
|
||||
public final class HuntForSanta extends LongTimeEvent
|
||||
{
|
||||
// NPC
|
||||
private static final int NOELLE = 34008;
|
||||
// Skills
|
||||
private static final SkillHolder BUFF_STOCKING = new SkillHolder(16419, 1);
|
||||
private static final SkillHolder BUFF_TREE = new SkillHolder(16420, 1);
|
||||
private static final SkillHolder BUFF_SNOWMAN = new SkillHolder(16421, 1);
|
||||
|
||||
private HuntForSanta()
|
||||
{
|
||||
super(HuntForSanta.class.getSimpleName(), "events");
|
||||
addStartNpc(NOELLE);
|
||||
addFirstTalkId(NOELLE);
|
||||
addTalkId(NOELLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "34008.htm":
|
||||
case "34008-1.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "receiveBuffStocking":
|
||||
{
|
||||
htmltext = applyBuff(npc, player, BUFF_STOCKING.getSkill());
|
||||
break;
|
||||
}
|
||||
case "receiveBuffTree":
|
||||
{
|
||||
htmltext = applyBuff(npc, player, BUFF_TREE.getSkill());
|
||||
break;
|
||||
}
|
||||
case "receiveBuffSnowman":
|
||||
{
|
||||
htmltext = applyBuff(npc, player, BUFF_SNOWMAN.getSkill());
|
||||
break;
|
||||
}
|
||||
case "receiveBuffAll":
|
||||
{
|
||||
htmltext = applyAllBuffs(npc, player);
|
||||
break;
|
||||
}
|
||||
case "changeBuff":
|
||||
{
|
||||
removeBuffs(player);
|
||||
htmltext = "34008-1.htm";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return "34008.htm";
|
||||
}
|
||||
|
||||
private String applyBuff(L2Npc npc, L2PcInstance player, Skill skill)
|
||||
{
|
||||
removeBuffs(player);
|
||||
npc.broadcastPacket(new MagicSkillUse(npc, player, skill.getId(), 1, 0, 0));
|
||||
skill.applyEffects(npc, player);
|
||||
return "34008-2.htm";
|
||||
}
|
||||
|
||||
private String applyAllBuffs(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((player.getParty() != null) && (player.getParty().getLeader() == player) && ((player.getParty().getMemberCount() > 6) || (player.getParty().getRaceCount() > 2)))
|
||||
{
|
||||
for (L2PcInstance member : player.getParty().getMembers())
|
||||
{
|
||||
if (Util.calculateDistance(npc, member, false, false) < 500)
|
||||
{
|
||||
removeBuffs(member);
|
||||
npc.broadcastPacket(new MagicSkillUse(npc, member, BUFF_STOCKING.getSkillId(), 1, 0, 0));
|
||||
BUFF_STOCKING.getSkill().applyEffects(npc, member);
|
||||
BUFF_TREE.getSkill().applyEffects(npc, member);
|
||||
BUFF_SNOWMAN.getSkill().applyEffects(npc, member);
|
||||
}
|
||||
}
|
||||
return "34008-2.htm";
|
||||
}
|
||||
else if (player.getParty() == null)
|
||||
{
|
||||
return "34008-3.htm";
|
||||
}
|
||||
return "34008-4.htm";
|
||||
}
|
||||
|
||||
private void removeBuffs(L2PcInstance player)
|
||||
{
|
||||
final BuffInfo buffStocking = player.getEffectList().getBuffInfoBySkillId(BUFF_STOCKING.getSkillId());
|
||||
final BuffInfo buffTree = player.getEffectList().getBuffInfoBySkillId(BUFF_TREE.getSkillId());
|
||||
final BuffInfo buffSnowman = player.getEffectList().getBuffInfoBySkillId(BUFF_SNOWMAN.getSkillId());
|
||||
if (buffStocking != null)
|
||||
{
|
||||
player.getEffectList().remove(true, buffStocking);
|
||||
}
|
||||
if (buffTree != null)
|
||||
{
|
||||
player.getEffectList().remove(true, buffTree);
|
||||
}
|
||||
if (buffSnowman != null)
|
||||
{
|
||||
player.getEffectList().remove(true, buffSnowman);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new HuntForSanta();
|
||||
}
|
||||
}
|
37
trunk/dist/game/data/scripts/events/HuntForSanta/config.xml
vendored
Normal file
37
trunk/dist/game/data/scripts/events/HuntForSanta/config.xml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<event name="Hunt for Santa" active="01 12 1015-07 01 2016" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<spawnlist>
|
||||
<!-- Noelle -->
|
||||
<add npc="34008" x="-78920" y="248056" z="-3296" heading="0" /> <!-- Faeron -->
|
||||
<add npc="34008" x="-115016" y="256248" z="-1520" heading="0" /> <!-- Talking Island -->
|
||||
<add npc="34008" x="208328" y="87656" z="-1024" heading="24575" /> <!-- Arcan -->
|
||||
<add npc="34008" x="80968" y="148168" z="-3472" heading="0" /> <!-- Giran -->
|
||||
<add npc="34008" x="146840" y="26904" z="-2208" heading="11547" /> <!-- Aden -->
|
||||
<add npc="34008" x="147464" y="-56984" z="-2784" heading="11547" /> <!-- Goddard -->
|
||||
<add npc="34008" x="44584" y="-48216" z="-792" heading="27931" /> <!-- Rune -->
|
||||
<add npc="34008" x="82696" y="53944" z="-1488" heading="40959" /> <!-- Oren -->
|
||||
<add npc="34008" x="87592" y="-141720" z="-1344" heading="44315" /> <!-- Schuttgart -->
|
||||
<add npc="34008" x="112072" y="219960" z="-3664" heading="24575" /> <!-- Heine -->
|
||||
<add npc="34008" x="16552" y="142948" z="-2720" heading="24575" /> <!-- Dion -->
|
||||
<add npc="34008" x="-14088" y="122680" z="-3120" heading="32767" /> <!-- Gludio -->
|
||||
<add npc="34008" x="-80536" y="149960" z="-3040" heading="29412" /> <!-- Gludin -->
|
||||
<!-- Tree -->
|
||||
<add npc="34009" x="-79016" y="247912" z="-3296" heading="0" /> <!-- Faeron -->
|
||||
<add npc="34009" x="-115176" y="256280" z="-1520" heading="0" /> <!-- Talking Island -->
|
||||
<add npc="34009" x="208376" y="87480" z="-1024" heading="0" /> <!-- Arcan -->
|
||||
<add npc="34009" x="80840" y="148296" z="-3472" heading="0" /> <!-- Giran -->
|
||||
<add npc="34009" x="146968" y="26728" z="-2208" heading="0" /> <!-- Aden -->
|
||||
<add npc="34009" x="147432" y="-57176" z="-2784" heading="0" /> <!-- Goddard -->
|
||||
<add npc="34009" x="44808" y="-48168" z="-800" heading="0" /> <!-- Rune -->
|
||||
<add npc="34009" x="82856" y="54088" z="-1488" heading="0" /> <!-- Oren -->
|
||||
<add npc="34009" x="87608" y="-141512" z="-1344" heading="0" /> <!-- Schuttgart -->
|
||||
<add npc="34009" x="112200" y="219832" z="-3664" heading="0" /> <!-- Heine -->
|
||||
<add npc="34009" x="16632" y="142824" z="-2704" heading="0" /> <!-- Dion -->
|
||||
<add npc="34009" x="-13944" y="122680" z="-3120" heading="0" /> <!-- Gludio -->
|
||||
<add npc="34009" x="-80392" y="149896" z="-3040" heading="0" /> <!-- Gludin -->
|
||||
</spawnlist>
|
||||
<messages>
|
||||
<add type="onEnd" text="Hunt for Santa: Event end!" />
|
||||
<add type="onEnter" text="Hunt for Santa: Event ongoing!" />
|
||||
</messages>
|
||||
</event>
|
Reference in New Issue
Block a user