From 58e0a2cd6556ccc8d6fb3bfaaa804600d468de07 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 28 Jan 2022 22:40:04 +0000 Subject: [PATCH] Addition of L2 Day event. --- .../game/data/scripts/events/L2Day/L2Day.java | 195 ++++++++++++++++ .../game/data/scripts/events/L2Day/config.xml | 30 +++ .../data/scripts/events/L2Day/manager-1.htm | 9 + .../data/scripts/events/L2Day/manager-2.htm | 39 ++++ .../data/scripts/events/L2Day/manager-no.htm | 6 + .../game/data/scripts/events/L2Day/L2Day.java | 210 ++++++++++++++++++ .../game/data/scripts/events/L2Day/config.xml | 30 +++ .../data/scripts/events/L2Day/manager-1.htm | 9 + .../data/scripts/events/L2Day/manager-2.htm | 39 ++++ .../data/scripts/events/L2Day/manager-no.htm | 6 + 10 files changed, 573 insertions(+) create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/L2Day.java create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/config.xml create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-1.htm create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-2.htm create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-no.htm create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/L2Day.java create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/config.xml create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-1.htm create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-2.htm create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-no.htm diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/L2Day.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/L2Day.java new file mode 100644 index 0000000000..1c69a61f36 --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/L2Day.java @@ -0,0 +1,195 @@ +/* + * 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.L2Day; + +import java.util.HashMap; +import java.util.Map; + +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.ItemChanceHolder; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; + +/** + * L2 Day event AI. + * @author Pandragon + */ +public class L2Day extends LongTimeEvent +{ + // NPCs + private static final Map MANAGERS = new HashMap<>(); + static + { + MANAGERS.put(31854, 7117); // Talking Island Village + MANAGERS.put(31855, 7118); // Elven Village + MANAGERS.put(31856, 7119); // Dark Elven Village + MANAGERS.put(31857, 7121); // Dwarven Village + MANAGERS.put(31858, 7120); // Orc Village + } + // Items + private static final int A = 3875; + private static final int C = 3876; + private static final int E = 3877; + private static final int F = 3878; + private static final int G = 3879; + private static final int H = 3880; + private static final int I = 3881; + private static final int L = 3882; + private static final int N = 3883; + private static final int O = 3884; + private static final int R = 3885; + private static final int S = 3886; + private static final int T = 3887; + private static final int II = 3888; + // Rewards + private static final ItemChanceHolder[] L2_REWARDS = + { + new ItemChanceHolder(3959, 10, 2), // Blessed Scroll of Resurrection (Event) + new ItemChanceHolder(3958, 7, 2), // Blessed Scroll of Escape (Event) + new ItemChanceHolder(6660, 0, 1), // Ring of Queen Ant + }; + private static final ItemChanceHolder[] NC_REWARDS = + { + new ItemChanceHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event) + new ItemChanceHolder(3958, 7, 1), // Blessed Scroll of Escape (Event) + new ItemChanceHolder(6661, 0, 1), // Earring of Orfen + }; + private static final ItemChanceHolder[] CH_REWARDS = + { + new ItemChanceHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event) + new ItemChanceHolder(3958, 7, 1), // Blessed Scroll of Escape (Event) + new ItemChanceHolder(6662, 0, 1), // Ring of Core + }; + + private L2Day() + { + for (int id : MANAGERS.keySet()) + { + addStartNpc(id); + addFirstTalkId(id); + addTalkId(id); + } + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + String htmltext = event; + switch (event) + { + case "collect_l2": + { + if (hasQuestItems(player, L, I, N, E, A, G, II) && (getQuestItemsCount(player, E) > 1)) + { + takeItems(player, 1, L, I, N, E, A, G, E, II); + final int random = getRandom(100); + if (random >= 95) + { + rewardItems(player, MANAGERS.get(npc.getNpcId()), 2); + } + else + { + for (ItemChanceHolder holder : L2_REWARDS) + { + if (random >= holder.getChance()) + { + rewardItems(player, holder); + break; + } + } + } + htmltext = "manager-1.htm"; + } + else + { + htmltext = "manager-no.htm"; + } + break; + } + case "collect_nc": + { + if (hasQuestItems(player, N, C, S, O, F, T)) + { + takeItems(player, 1, N, C, S, O, F, T); + final int random = getRandom(100); + if (random >= 95) + { + rewardItems(player, MANAGERS.get(npc.getNpcId()), 1); + } + else + { + for (ItemChanceHolder holder : NC_REWARDS) + { + if (random >= holder.getChance()) + { + rewardItems(player, holder); + break; + } + } + } + htmltext = "manager-1.htm"; + } + else + { + htmltext = "manager-no.htm"; + } + break; + } + case "collect_ch": + { + if (hasQuestItems(player, C, H, R, O, N, I, L, E) && (getQuestItemsCount(player, C) > 1)) + { + takeItems(player, 1, C, H, R, O, N, I, C, L, E); + final int random = getRandom(100); + if (random >= 95) + { + rewardItems(player, MANAGERS.get(npc.getNpcId()), 1); + } + else + { + for (ItemChanceHolder holder : CH_REWARDS) + { + if (random >= holder.getChance()) + { + rewardItems(player, holder); + break; + } + } + } + htmltext = "manager-1.htm"; + } + else + { + htmltext = "manager-no.htm"; + } + break; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(Npc npc, Player player) + { + return "manager-1.htm"; + } + + public static void main(String[] args) + { + new L2Day(); + } +} diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/config.xml b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/config.xml new file mode 100644 index 0000000000..f21065b1f4 --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/config.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-1.htm b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-1.htm new file mode 100644 index 0000000000..da2ae56ae5 --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-1.htm @@ -0,0 +1,9 @@ +Event Manager:
+Welcome!
+We are in the midst of the L2 Day Event!
+How may I help you??
+Ask about the event.
+I've collected LINEAGEII!
+I've collected NCSOFT!
+I've collected CHRONICLE! + \ No newline at end of file diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-2.htm b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-2.htm new file mode 100644 index 0000000000..66cf3caa8c --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-2.htm @@ -0,0 +1,39 @@ +Event Manager:
+Event Participation Method:
+While hunting monsters in Lineage 2, you have a chance of obtaining items marked with letters or numbers. Collect a certain combination of them and bring them to me, and I will exchange them for prizes!
+There are a total of 14 letters and numbers: +A, C, E, F, G, H, I, L, N, O, R, S, T and II.
+These letters and numbers can be combined to make the words LINEAGEII, NCSOFT and CHRONICLE. The prizes are different for each combination. Different prizes may be awarded even for the same combinations.
+Event Prize Information:
+If you collect LINEAGEII, you can receive one of the following prizes: +- 1 Ring of Queen Ant +- 1 Top-Grade Life Stone: level 76 +- 2 High-Grade Life Stones: level 76 +- 2 Blessed Scrolls of Resurrection +- 2 Blessed Scrolls of Escape +- 1 Rabbit Ears +- 1 Little Angel Wings +- 1 Fairy Antennae +- 2 Village Scrolls of Escape +If you collect NCSOFT, you can receive one of the following prizes: +- 1 Earring of Orfen +- 1 High-Grade Life Stone: level 76 +- 2 Mid-Grade Life Stones: level 76 +- 1 Blessed Scroll of Resurrection +- 1 Blessed Scroll of Escape +- 1 Little Angel Wings +- 1 Fairy Antennae +- 1 Feathered Hat +- 1 Village Scroll of Escape +If you collect CHRONICLE, you can receive one of the following prizes: +- 1 Ring of Core +- 1 High-Grade Life Stone: level 76 +- 1 Mid-Grade Life Stone: level 76 +- 1 Blessed Scroll of Resurrection +- 1 Blessed Scroll of Escape +- 1 Fairy Antennae +- 1 Feathered Hat +- 1 Artisan's Goggles +- 1 Village Scroll of Escape +Back + \ No newline at end of file diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-no.htm b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-no.htm new file mode 100644 index 0000000000..071008b40e --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/events/L2Day/manager-no.htm @@ -0,0 +1,6 @@ +Event Manager:
+Oh no!
+You don't have enough letters to make a word.
+Collect more letters and come back.
+Back + \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/L2Day.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/L2Day.java new file mode 100644 index 0000000000..cf4048b9df --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/L2Day.java @@ -0,0 +1,210 @@ +/* + * 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.L2Day; + +import java.util.HashMap; +import java.util.Map; + +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.ItemChanceHolder; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; + +/** + * L2 Day event AI. + * @author Pandragon + */ +public class L2Day extends LongTimeEvent +{ + // NPCs + private static final Map MANAGERS = new HashMap<>(); + static + { + MANAGERS.put(31854, 7117); // Talking Island Village + MANAGERS.put(31855, 7118); // Elven Village + MANAGERS.put(31856, 7119); // Dark Elven Village + MANAGERS.put(31857, 7121); // Dwarven Village + MANAGERS.put(31858, 7120); // Orc Village + } + // Items + private static final int A = 3875; + private static final int C = 3876; + private static final int E = 3877; + private static final int F = 3878; + private static final int G = 3879; + private static final int H = 3880; + private static final int I = 3881; + private static final int L = 3882; + private static final int N = 3883; + private static final int O = 3884; + private static final int R = 3885; + private static final int S = 3886; + private static final int T = 3887; + private static final int II = 3888; + // Rewards + private static final ItemChanceHolder[] L2_REWARDS = + { + new ItemChanceHolder(8947, 19, 1), // L2day - Rabbit Ears + new ItemChanceHolder(8948, 16, 1), // L2day - Little Angel Wings + new ItemChanceHolder(8949, 13, 1), // L2day - Fairy Antennae + new ItemChanceHolder(3959, 10, 2), // Blessed Scroll of Resurrection (Event) + new ItemChanceHolder(3958, 7, 2), // Blessed Scroll of Escape (Event) + new ItemChanceHolder(8752, 4, 2), // High-Grade Life Stone - Level 76 + new ItemChanceHolder(8762, 1, 1), // Top-Grade Life Stone - Level 76 + new ItemChanceHolder(6660, 0, 1), // Ring of Queen Ant + }; + private static final ItemChanceHolder[] NC_REWARDS = + { + new ItemChanceHolder(8948, 19, 1), // L2day - Little Angel Wings + new ItemChanceHolder(8949, 16, 1), // L2day - Fairy Antennae + new ItemChanceHolder(8950, 13, 1), // L2day - Feathered Hat + new ItemChanceHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event) + new ItemChanceHolder(3958, 7, 1), // Blessed Scroll of Escape (Event) + new ItemChanceHolder(8742, 4, 2), // Mid-Grade Life Stone - Level 76 + new ItemChanceHolder(8752, 1, 1), // High-Grade Life Stone - Level 76 + new ItemChanceHolder(6661, 0, 1), // Earring of Orfen + }; + private static final ItemChanceHolder[] CH_REWARDS = + { + new ItemChanceHolder(8949, 19, 1), // L2day - Fairy Antennae + new ItemChanceHolder(8950, 16, 1), // L2day - Feathered Hat + new ItemChanceHolder(8951, 13, 1), // L2day - Artisan's Goggles + new ItemChanceHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event) + new ItemChanceHolder(3958, 7, 1), // Blessed Scroll of Escape (Event) + new ItemChanceHolder(8742, 4, 1), // Mid-Grade Life Stone - Level 76 + new ItemChanceHolder(8752, 1, 1), // High-Grade Life Stone - Level 76 + new ItemChanceHolder(6662, 0, 1), // Ring of Core + }; + + private L2Day() + { + for (int id : MANAGERS.keySet()) + { + addStartNpc(id); + addFirstTalkId(id); + addTalkId(id); + } + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + String htmltext = event; + switch (event) + { + case "collect_l2": + { + if (hasQuestItems(player, L, I, N, E, A, G, II) && (getQuestItemsCount(player, E) > 1)) + { + takeItems(player, 1, L, I, N, E, A, G, E, II); + final int random = getRandom(100); + if (random >= 95) + { + rewardItems(player, MANAGERS.get(npc.getNpcId()), 2); + } + else + { + for (ItemChanceHolder holder : L2_REWARDS) + { + if (random >= holder.getChance()) + { + rewardItems(player, holder); + break; + } + } + } + htmltext = "manager-1.htm"; + } + else + { + htmltext = "manager-no.htm"; + } + break; + } + case "collect_nc": + { + if (hasQuestItems(player, N, C, S, O, F, T)) + { + takeItems(player, 1, N, C, S, O, F, T); + final int random = getRandom(100); + if (random >= 95) + { + rewardItems(player, MANAGERS.get(npc.getNpcId()), 1); + } + else + { + for (ItemChanceHolder holder : NC_REWARDS) + { + if (random >= holder.getChance()) + { + rewardItems(player, holder); + break; + } + } + } + htmltext = "manager-1.htm"; + } + else + { + htmltext = "manager-no.htm"; + } + break; + } + case "collect_ch": + { + if (hasQuestItems(player, C, H, R, O, N, I, L, E) && (getQuestItemsCount(player, C) > 1)) + { + takeItems(player, 1, C, H, R, O, N, I, C, L, E); + final int random = getRandom(100); + if (random >= 95) + { + rewardItems(player, MANAGERS.get(npc.getNpcId()), 1); + } + else + { + for (ItemChanceHolder holder : CH_REWARDS) + { + if (random >= holder.getChance()) + { + rewardItems(player, holder); + break; + } + } + } + htmltext = "manager-1.htm"; + } + else + { + htmltext = "manager-no.htm"; + } + break; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(Npc npc, Player player) + { + return "manager-1.htm"; + } + + public static void main(String[] args) + { + new L2Day(); + } +} diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/config.xml b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/config.xml new file mode 100644 index 0000000000..f21065b1f4 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/config.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-1.htm b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-1.htm new file mode 100644 index 0000000000..da2ae56ae5 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-1.htm @@ -0,0 +1,9 @@ +Event Manager:
+Welcome!
+We are in the midst of the L2 Day Event!
+How may I help you??
+Ask about the event.
+I've collected LINEAGEII!
+I've collected NCSOFT!
+I've collected CHRONICLE! + \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-2.htm b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-2.htm new file mode 100644 index 0000000000..66cf3caa8c --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-2.htm @@ -0,0 +1,39 @@ +Event Manager:
+Event Participation Method:
+While hunting monsters in Lineage 2, you have a chance of obtaining items marked with letters or numbers. Collect a certain combination of them and bring them to me, and I will exchange them for prizes!
+There are a total of 14 letters and numbers: +A, C, E, F, G, H, I, L, N, O, R, S, T and II.
+These letters and numbers can be combined to make the words LINEAGEII, NCSOFT and CHRONICLE. The prizes are different for each combination. Different prizes may be awarded even for the same combinations.
+Event Prize Information:
+If you collect LINEAGEII, you can receive one of the following prizes: +- 1 Ring of Queen Ant +- 1 Top-Grade Life Stone: level 76 +- 2 High-Grade Life Stones: level 76 +- 2 Blessed Scrolls of Resurrection +- 2 Blessed Scrolls of Escape +- 1 Rabbit Ears +- 1 Little Angel Wings +- 1 Fairy Antennae +- 2 Village Scrolls of Escape +If you collect NCSOFT, you can receive one of the following prizes: +- 1 Earring of Orfen +- 1 High-Grade Life Stone: level 76 +- 2 Mid-Grade Life Stones: level 76 +- 1 Blessed Scroll of Resurrection +- 1 Blessed Scroll of Escape +- 1 Little Angel Wings +- 1 Fairy Antennae +- 1 Feathered Hat +- 1 Village Scroll of Escape +If you collect CHRONICLE, you can receive one of the following prizes: +- 1 Ring of Core +- 1 High-Grade Life Stone: level 76 +- 1 Mid-Grade Life Stone: level 76 +- 1 Blessed Scroll of Resurrection +- 1 Blessed Scroll of Escape +- 1 Fairy Antennae +- 1 Feathered Hat +- 1 Artisan's Goggles +- 1 Village Scroll of Escape +Back + \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-no.htm b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-no.htm new file mode 100644 index 0000000000..071008b40e --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/events/L2Day/manager-no.htm @@ -0,0 +1,6 @@ +Event Manager:
+Oh no!
+You don't have enough letters to make a word.
+Collect more letters and come back.
+Back + \ No newline at end of file