From 326a3e6d32dcc432959367aef8c6bce81accf83a Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 16 Oct 2019 18:53:43 +0000 Subject: [PATCH] Addition of Rudolph's Blessing event. Contributed by Edoo. --- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- .../events/RudolphsBlessing/13285-01.htm | 8 + .../events/RudolphsBlessing/13285-02.htm | 6 + .../events/RudolphsBlessing/13285-03.htm | 5 + .../events/RudolphsBlessing/13285-04.htm | 4 + .../events/RudolphsBlessing/13285-05.htm | 3 + .../events/RudolphsBlessing/13285-06.htm | 4 + .../scripts/events/RudolphsBlessing/13285.htm | 11 ++ .../RudolphsBlessing/RudolphsBlessing.java | 164 ++++++++++++++++++ .../events/RudolphsBlessing/config.xml | 47 +++++ .../game/data/stats/skills/23200-23299.xml | 15 +- 80 files changed, 2128 insertions(+), 8 deletions(-) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/config.xml create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285.htm create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/config.xml diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/23200-23299.xml index 0fbca5c346..091efe0046 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/23200-23299.xml @@ -3318,7 +3318,6 @@ -5 -1 0 - 0 3 1200 true @@ -3329,6 +3328,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/23200-23299.xml index d12df7246a..7df65c2b1e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/23200-23299.xml index d12df7246a..7df65c2b1e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/23200-23299.xml index 9aee724164..4fe3d8a525 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/23200-23299.xml index 84cff33df4..ab0ee35990 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/23200-23299.xml index 9fde9454b2..5d9af5a139 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..a65bd050ed --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/23200-23299.xml index c69d838c23..58705dc72a 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm new file mode 100644 index 0000000000..d60ca98767 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-01.htm @@ -0,0 +1,8 @@ +Santa Claus:
+Hahaha... Good!
+Rudolph likes to eat "Fresh Herbs" If you feed it this herb continuously, it will grow into a strong Rudolph. You can find the herbs while hunting without much difficulty.
+When Rudolph's energy runs low, it will go into your pack, find the herb, and eat it. Remember that he'll want to eat about every 10 minutes.
+Also, every time Rudolph eats the herb, it will cast a beneficial spell on you to show you its thanks.
+Finally, you have to donate 2019 adena to receive a weak Rudolph. How should I say this... Think of it as your annual donation to help the less fortunate.
+ + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm new file mode 100644 index 0000000000..e8c42208ba --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-02.htm @@ -0,0 +1,6 @@ +Santa Claus:
+Yes. The role of Santa has meaning for people who are full of love.
+But if you find any "Ice Candy Pieces" while out hunting, please bring them to me. I had a hole in my bag of presents, and several "Ice Candy" gift boxes fell out.
+I'm counting on you.
+If you give me 50 pieces of the Ice Candy Pieces, I'll give you a fitting Christmas present. + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm new file mode 100644 index 0000000000..8e749165b6 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-03.htm @@ -0,0 +1,5 @@ +Santa Claus:
+Hmm... There aren't enough Ice Candy Pieces.
+Ice Candy Pieces come in 50 piece units.
+ + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm new file mode 100644 index 0000000000..3a1bfd1959 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-04.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Please take good care of him.
+I'll look forward to him growing up into a strong Rudolph by the time Christmas ends. + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm new file mode 100644 index 0000000000..c136168b6e --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-05.htm @@ -0,0 +1,3 @@ +Santa Claus:
+You've already received a Rudolph Agathion. + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm new file mode 100644 index 0000000000..ce2ed6871f --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285-06.htm @@ -0,0 +1,4 @@ +Santa Claus:
+Oh no, not enough adena.
+If you donate "2019 adena" to help the less fortunate, I'll give you Rudolph Agathion that you can raise. + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285.htm b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285.htm new file mode 100644 index 0000000000..dbb96da530 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/13285.htm @@ -0,0 +1,11 @@ +Santa Claus:
+Have you heard about the Santa privilege?
+Apprentice Santas spend a lot of time taking care of weak Rudolphs.
+Raising a healthy Rudolph is very important to us.
+But during the Christmas season, we don't have a lot of time to spend taking care of the Rudolphs.
+This year, one apprentice Santa came up with a good idea. We would give people the gift of taking care of a weak Rudolph. It's a great idea, don't you think? We thought it would also give people the gift of joy in doing something good.
+Well? Are you interested in this Santa present?
+
+
+ + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java new file mode 100644 index 0000000000..71ace46687 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/RudolphsBlessing.java @@ -0,0 +1,164 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package events.RudolphsBlessing; + +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion; +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author IvanTotov, Edoo + */ +public class RudolphsBlessing extends LongTimeEvent +{ + private static final int SANTA_CLAUS = 13285; + + private static final int AGATHION_SEAL_BRACELET_RUDOLPH = 21709; + private static final int AGATHION_SEAL_BRACELET_RUDOLPH_NPC = 1598; + private static final int ICE_CANDY_PIECE = 21915; + private static final int SANTA_CLAUS_TREASURE_BOX = 21873; + + private static final int RUDOLPH_PRICE = 2019; // Calendar.getInstance().get(Calendar.YEAR) can be used but need to replace htmls. + + private static final SkillHolder RUDOLPH_TRYUCK = new SkillHolder(23181, 1); + private static final ItemHolder ITEM_REQUIREMENT = new ItemHolder(21872, 2); + + public RudolphsBlessing() + { + addStartNpc(SANTA_CLAUS); + addFirstTalkId(SANTA_CLAUS); + addTalkId(SANTA_CLAUS); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this)); + Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this)); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + if (event.equals("rudolph_eat")) + { + if ((player != null) && player.isOnline()) + { + if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount())) + { + SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill()); + Skill RudolphsBlessing = SkillData.getInstance().getSkill(23297, 1); + RudolphsBlessing.applyEffects(player, player); + } + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + } + if (player == null) + { + return null; + } + + String htmltext = event; + switch (event) + { + case "rudolph": + { + if (hasQuestItems(player, AGATHION_SEAL_BRACELET_RUDOLPH)) + { + htmltext = "13285-05.htm"; + } + else if (player.getAdena() < RUDOLPH_PRICE) + { + htmltext = "13285-06.htm"; + } + else + { + takeItems(player, Inventory.ADENA_ID, RUDOLPH_PRICE); + giveItems(player, AGATHION_SEAL_BRACELET_RUDOLPH, 1); + htmltext = "13285-04.htm"; + } + break; + } + case "event_info": + { + htmltext = "13285-02.htm"; + break; + } + case "reward": + { + if (getQuestItemsCount(player, ICE_CANDY_PIECE) >= 50) + { + takeItems(player, ICE_CANDY_PIECE, 50); + giveItems(player, SANTA_CLAUS_TREASURE_BOX, 1); + } + else + { + htmltext = "13285-03.htm"; + } + break; + } + } + return htmltext; + } + + private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player); + } + + private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) + { + if (event.getAgathionId() != AGATHION_SEAL_BRACELET_RUDOLPH_NPC) + { + return; + } + final PlayerInstance player = event.getPlayer(); + if (player == null) + { + return; + } + + cancelQuestTimer("rudolph_eat", null, player); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "13285.htm"; + } + + public static void main(String[] args) + { + new RudolphsBlessing(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/config.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/config.xml new file mode 100644 index 0000000000..b0d6fa4267 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/RudolphsBlessing/config.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/23200-23299.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/23200-23299.xml index 886e947770..4205728853 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/23200-23299.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/23200-23299.xml @@ -3623,7 +3623,6 @@ -5 -1 0 - 0 3 1200 true @@ -3634,6 +3633,20 @@ 2 SELF SINGLE + + + 10 + DIFF + + + 10 + PER + + + 10 + PER + +