The Hunt for Santa Begins!

This commit is contained in:
MobiusDev 2015-11-30 21:10:36 +00:00
parent 189999f5b0
commit d0550f696c
18 changed files with 408 additions and 13 deletions

View File

@ -444,6 +444,19 @@
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<!-- Santa Suit -->
<appearance_stone id="40330" targetType="ARMOR" type="FIXED" visualId="37534">
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<!-- Santa Hat -->
<appearance_stone id="40310" targetType="ACCESSORY" type="FIXED" visualId="37535">
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!--Samurai Outfit -->
<appearance_stone id="23880" targetType="ARMOR" type="FIXED" visualId="23879">
<bodyPart>chest</bodyPart>

View File

@ -74,4 +74,8 @@
<!-- Dark Assassin Suit -->
<item id="24134" price="0" /> <!-- Dark Assassin Appearance Stone -->
<!-- Santa Suit -->
<item id="40310" price="0" /> <!-- Santa Hat Appearance Stone -->
<item id="40330" price="0" /> <!-- Santa Suit Appearance Stone -->
</list>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<npcs>
<npc>34008</npc> <!-- Noelle -->
</npcs>
<item>
<ingredient id="40313" count="6"/>
<production id="37534" count="1"/>
</item>
<item>
<ingredient id="40313" count="6"/>
<production id="37535" count="1"/>
</item>
<item>
<ingredient id="40313" count="6"/>
<production id="40312" count="1"/>
</item>
<item>
<ingredient id="40313" count="6"/>
<production id="40330" count="1"/>
</item>
<item>
<ingredient id="40313" count="6"/>
<production id="40310" count="1"/>
</item>
<item>
<ingredient id="40313" count="3"/>
<production id="40311" count="1"/>
</item>
</list>

View File

@ -249,6 +249,7 @@ conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
# Events
events/CharacterBirthday/CharacterBirthday.java
events/HuntForSanta/HuntForSanta.java
# Disabled by default events
#events/GiftOfVitality/GiftOfVitality.java

View 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>

View 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>

View 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>

View 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>

View 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>

View 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();
}
}

View 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>

View File

@ -161,6 +161,7 @@ public final class EffectMasterHandler
RestorationRandom.class,
Resurrection.class,
ResurrectionSpecial.class,
RewardItemOnExit.class,
Root.class,
RunAway.class,
ServitorShare.class,

View File

@ -0,0 +1,51 @@
/*
* 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 handlers.effecthandlers;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.skills.BuffInfo;
/**
* Reward Item on Exit effect implementation.
* @author Mobius
*/
public final class RewardItemOnExit extends AbstractEffect
{
private final int _itemId;
private final long _itemCount;
public RewardItemOnExit(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
{
super(attachCond, applyCond, set, params);
_itemId = params.getInt("itemId", 40313); // Default item is Santa's Mark.
_itemCount = params.getLong("itemCount", 1);
}
@Override
public void onExit(BuffInfo info)
{
if (!info.isRemoved() && info.getEffected().isPlayer() && !info.getEffected().getActingPlayer().isDead())
{
info.getEffected().getActingPlayer().addItem("RewardItemOnExitEffect", _itemId, _itemCount, info.getEffected(), true);
}
}
}

View File

@ -125,6 +125,10 @@
<set name="icon" val="BranchSys3.Icon.g_shape_shifting_hair2" />
<set name="commissionItemType" val="OTHER_ITEM" />
<set name="default_action" val="SKILL_REDUCE" />
<set name="handler" val="Appearance" />
<set name="immediate_effect" val="true" />
<set name="is_auctionable" val="false" />
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="material" val="STEEL" />
</item>
@ -141,6 +145,7 @@
<item id="40312" name="Santa's Cloak" type="Armor">
<!-- Light and cozy cloak. -->
<set name="icon" val="BranchSys3.icon.g_christmas_cloak" />
<set name="bodypart" val="back" />
<set name="default_action" val="EQUIP" />
<set name="is_auctionable" val="false" />
<set name="is_depositable" val="false" />
@ -325,6 +330,10 @@
<set name="icon" val="BranchSys3.icon1.g_scrl_change_chest" />
<set name="commissionItemType" val="OTHER_ITEM" />
<set name="default_action" val="SKILL_REDUCE" />
<set name="handler" val="Appearance" />
<set name="immediate_effect" val="true" />
<set name="is_auctionable" val="false" />
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="material" val="STEEL" />
</item>

View File

@ -137,7 +137,6 @@
</collision>
</npc>
<npc id="34008" level="99" type="L2Npc" name="Noelle" title="Event Manager">
<!-- AUTO GENERATED NPC TODO: FIX IT -->
<race>HUMAN</race>
<sex>FEMALE</sex>
<stats str="40" int="21" dex="30" wit="20" con="43" men="20">
@ -154,8 +153,7 @@
</collision>
</npc>
<npc id="34009" level="99" type="L2Npc" name="Holiday Tree" title="Holiday Spirit">
<!-- AUTO GENERATED NPC TODO: FIX IT -->
<race>HUMAN</race>
<race>PLANT</race>
<sex>FEMALE</sex>
<stats str="40" int="21" dex="30" wit="20" con="43" men="20">
<vitals hp="68" hpRegen="7.5" mp="1345.8" mpRegen="2.7" />
@ -164,7 +162,7 @@
<run ground="120" />
</speed>
</stats>
<status attackable="false" />
<status attackable="false" targetable="false" showName="false" />
<collision>
<radius normal="9.5" />
<height normal="22.4" />

View File

@ -181,37 +181,78 @@
<set name="targetType" val="SELF" />
</skill>
<skill id="16419" levels="2" name="Stocking Fairy's Blessing">
<!-- AUTO GENERATED SKILL -->
<!-- For 2 hr., STR + 3, INT + 3, Speed + 7. Can obtain item after 2 hr. Must be alive with space in the inventory to receive item. -->
<table name="#hitTimes"> 1000 0 </table>
<set name="icon" val="BranchSys.icon.br_xmas_present_i00" />
<set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="targetType" val="SELF" />
<set name="abnormalTime" val="30" />
<set name="abnormalVisualEffect" val="XMAS_SOCKS" />
<set name="castRange" val="900" />
<set name="hitTime" val="#hitTimes" />
<set name="isMagic" val="4" />
<set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="stayAfterDeath" val="true" />
<set name="targetType" val="SELF" />
<for>
<effect name="Buff">
<add stat="STR" val="3" />
<add stat="INT" val="3" />
<add stat="runSpd" val="7" />
</effect>
<effect name="RewardItemOnExit">
<param itemId="40313" /> <!-- Santa's Mark -->
<param itemCount="1" />
</effect>
</for>
</skill>
<skill id="16420" levels="2" name="Tree Fairy's Blessing">
<!-- AUTO GENERATED SKILL -->
<!-- For 2 hr., CON + 3, MEN + 3, P. Critical Rate + 30, M. Critical Rate + 30. Can obtain item after 2 hr. Must be alive with space in the inventory to receive item. -->
<table name="#hitTimes"> 1000 0 </table>
<set name="icon" val="BranchSys.icon.br_xmas_miracle_i00" />
<set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="targetType" val="SELF" />
<set name="abnormalTime" val="30" />
<set name="abnormalVisualEffect" val="XMAS_TREE" />
<set name="castRange" val="900" />
<set name="hitTime" val="#hitTimes" />
<set name="isMagic" val="4" />
<set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="stayAfterDeath" val="true" />
<set name="targetType" val="SELF" />
<for>
<effect name="Buff">
<add stat="CON" val="3" />
<add stat="MEN" val="3" />
<add stat="critRate" val="30" />
<add stat="mCritRate" val="30" />
</effect>
<effect name="RewardItemOnExit">
<param itemId="40313" /> <!-- Santa's Mark -->
<param itemCount="1" />
</effect>
</for>
</skill>
<skill id="16421" levels="2" name="Snowman Fairy's Blessing">
<!-- AUTO GENERATED SKILL -->
<!-- For 2 hr., DEX + 3, WIT + 3, Max HP/MP + 2013. Can obtain item after 2 hr. Must be alive with space in the inventory to receive item. -->
<table name="#hitTimes"> 1000 0 </table>
<set name="icon" val="BranchSys.icon.br_xmas_present_luck_i00" />
<set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="targetType" val="SELF" />
<set name="abnormalTime" val="30" />
<set name="abnormalVisualEffect" val="XMAS_SNOWMAN" />
<set name="castRange" val="900" />
<set name="hitTime" val="#hitTimes" />
<set name="isMagic" val="4" />
<set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="stayAfterDeath" val="true" />
<set name="targetType" val="SELF" />
<for>
<effect name="Buff">
<add stat="DEX" val="3" />
<add stat="WIT" val="3" />
<add stat="maxHp" val="2013" />
<add stat="maxMp" val="2013" />
</effect>
<effect name="RewardItemOnExit">
<param itemId="40313" /> <!-- Santa's Mark -->
<param itemCount="1" />
</effect>
</for>
</skill>
<skill id="16422" levels="1" name="Winter Holiday Reward">
<!-- AUTO GENERATED SKILL -->

View File

@ -673,6 +673,7 @@
<xs:enumeration value="RestorationRandom" />
<xs:enumeration value="Resurrection" />
<xs:enumeration value="ResurrectionSpecial" />
<xs:enumeration value="RewardItemOnExit" />
<xs:enumeration value="Root" />
<xs:enumeration value="RunAway" />
<xs:enumeration value="ServitorShare" />

View File

@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import com.l2jserver.gameserver.enums.Race;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
@ -90,6 +91,22 @@ public abstract class AbstractPlayerGroup
return getMembers().size();
}
/**
* @return the count of all player races in this group
*/
public int getRaceCount()
{
List<Race> partyRaces = new ArrayList<>();
for (L2PcInstance member : getMembers())
{
if (!partyRaces.contains(member.getRace()))
{
partyRaces.add(member.getRace());
}
}
return partyRaces.size();
}
/**
* @return the level of this group
*/