Addition of L2 Day event.

This commit is contained in:
MobiusDevelopment 2022-01-28 22:40:04 +00:00
parent 610d8c6aa1
commit 58e0a2cd65
10 changed files with 573 additions and 0 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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<Integer, Integer> 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();
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<event name="L2 Day" active="23 03 2006-28 03 2016" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
<droplist>
<add item="3875" min="1" max="1" chance="1%" /> <!-- A -->
<add item="3876" min="1" max="1" chance="1%" /> <!-- C -->
<add item="3877" min="1" max="1" chance="1%" /> <!-- E -->
<add item="3878" min="1" max="1" chance="1%" /> <!-- F -->
<add item="3879" min="1" max="1" chance="1%" /> <!-- G -->
<add item="3880" min="1" max="1" chance="1%" /> <!-- H -->
<add item="3881" min="1" max="1" chance="1%" /> <!-- I -->
<add item="3882" min="1" max="1" chance="1%" /> <!-- L -->
<add item="3883" min="1" max="1" chance="1%" /> <!-- N -->
<add item="3884" min="1" max="1" chance="1%" /> <!-- O -->
<add item="3885" min="1" max="1" chance="1%" /> <!-- R -->
<add item="3886" min="1" max="1" chance="1%" /> <!-- S -->
<add item="3887" min="1" max="1" chance="1%" /> <!-- T -->
<add item="3888" min="1" max="1" chance="1%" /> <!-- II -->
</droplist>
<spawnlist>
<add npc="31854" x="-84042" y="243191" z="-3735" heading="9707" />
<add npc="31855" x="45510" y="48364" z="-3065" heading="49859" />
<add npc="31856" x="11861" y="16173" z="-4568" heading="18289" />
<add npc="31857" x="115639" y="-178066" z="-921" heading="27485" />
<add npc="31858" x="-44810" y="-113388" z="-192" heading="15527" />
</spawnlist>
<messages>
<add type="onEnd" text="L2 Day: Event end!" />
<add type="onEnter" text="L2 Day Event: Collect letters from monsters. Create the words NCSOFT, CHRONICLE and LINEAGE II. Turn these letters to the Event Manager in the villages and win great prizes!" />
</messages>
</event>

View File

@ -0,0 +1,9 @@
<html><body>Event Manager:<br>
Welcome!<br>
We are in the midst of the <font color="LEVEL">L2 Day Event</font>!<br>
How may I help you??<br>
<a action="bypass -h Quest L2Day manager-2.htm">Ask about the event.</a><br>
<a action="bypass -h Quest L2Day collect_l2">I've collected LINEAGEII!</a><br>
<a action="bypass -h Quest L2Day collect_nc">I've collected NCSOFT!</a><br>
<a action="bypass -h Quest L2Day collect_ch">I've collected CHRONICLE!</a>
</body></html>

View File

@ -0,0 +1,39 @@
<html><body>Event Manager:<br>
<font color="LEVEL">Event Participation Method:</font><br>
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!<br>
There are a total of 14 letters and numbers:<br1>
<font color="LEVEL">A</font>, <font color="LEVEL">C</font>, <font color="LEVEL">E</font>, <font color="LEVEL">F</font>, <font color="LEVEL">G</font>, <font color="LEVEL">H</font>, <font color="LEVEL">I</font>, <font color="LEVEL">L</font>, <font color="LEVEL">N</font>, <font color="LEVEL">O</font>, <font color="LEVEL">R</font>, <font color="LEVEL">S</font>, <font color="LEVEL">T</font> and <font color="LEVEL">II</font>.<br>
These letters and numbers can be combined to make the words <font color="LEVEL">LINEAGEII</font>, <font color="LEVEL">NCSOFT</font> and <font color="LEVEL">CHRONICLE</font>. The prizes are different for each combination. Different prizes may be awarded even for the same combinations.<br>
<font color="LEVEL">Event Prize Information:</font><br>
If you collect <font color="LEVEL">LINEAGEII</font>, you can receive one of the following prizes:<br1>
- 1 Ring of Queen Ant<br1>
- 1 Top-Grade Life Stone: level 76<br1>
- 2 High-Grade Life Stones: level 76<br1>
- 2 Blessed Scrolls of Resurrection<br1>
- 2 Blessed Scrolls of Escape<br1>
- 1 Rabbit Ears<br1>
- 1 Little Angel Wings<br1>
- 1 Fairy Antennae<br1>
- 2 Village Scrolls of Escape<br1>
If you collect <font color="LEVEL">NCSOFT</font>, you can receive one of the following prizes:<br1>
- 1 Earring of Orfen<br1>
- 1 High-Grade Life Stone: level 76<br1>
- 2 Mid-Grade Life Stones: level 76<br1>
- 1 Blessed Scroll of Resurrection<br1>
- 1 Blessed Scroll of Escape<br1>
- 1 Little Angel Wings<br1>
- 1 Fairy Antennae<br1>
- 1 Feathered Hat<br1>
- 1 Village Scroll of Escape<br1>
If you collect <font color="LEVEL">CHRONICLE</font>, you can receive one of the following prizes:<br1>
- 1 Ring of Core<br1>
- 1 High-Grade Life Stone: level 76<br1>
- 1 Mid-Grade Life Stone: level 76<br1>
- 1 Blessed Scroll of Resurrection<br1>
- 1 Blessed Scroll of Escape<br1>
- 1 Fairy Antennae<br1>
- 1 Feathered Hat<br1>
- 1 Artisan's Goggles<br1>
- 1 Village Scroll of Escape<br1>
<a action="bypass -h Quest L2Day manager-1.htm">Back</a>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Event Manager:<br>
Oh no!<br>
You don't have enough letters to make a word.<br>
Collect more letters and come back.<br>
<a action="bypass -h Quest L2Day manager-1.htm">Back</a>
</body></html>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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<Integer, Integer> 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();
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<event name="L2 Day" active="23 03 2006-28 03 2016" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
<droplist>
<add item="3875" min="1" max="1" chance="1%" /> <!-- A -->
<add item="3876" min="1" max="1" chance="1%" /> <!-- C -->
<add item="3877" min="1" max="1" chance="1%" /> <!-- E -->
<add item="3878" min="1" max="1" chance="1%" /> <!-- F -->
<add item="3879" min="1" max="1" chance="1%" /> <!-- G -->
<add item="3880" min="1" max="1" chance="1%" /> <!-- H -->
<add item="3881" min="1" max="1" chance="1%" /> <!-- I -->
<add item="3882" min="1" max="1" chance="1%" /> <!-- L -->
<add item="3883" min="1" max="1" chance="1%" /> <!-- N -->
<add item="3884" min="1" max="1" chance="1%" /> <!-- O -->
<add item="3885" min="1" max="1" chance="1%" /> <!-- R -->
<add item="3886" min="1" max="1" chance="1%" /> <!-- S -->
<add item="3887" min="1" max="1" chance="1%" /> <!-- T -->
<add item="3888" min="1" max="1" chance="1%" /> <!-- II -->
</droplist>
<spawnlist>
<add npc="31854" x="-84042" y="243191" z="-3735" heading="9707" />
<add npc="31855" x="45510" y="48364" z="-3065" heading="49859" />
<add npc="31856" x="11861" y="16173" z="-4568" heading="18289" />
<add npc="31857" x="115639" y="-178066" z="-921" heading="27485" />
<add npc="31858" x="-44810" y="-113388" z="-192" heading="15527" />
</spawnlist>
<messages>
<add type="onEnd" text="L2 Day: Event end!" />
<add type="onEnter" text="L2 Day Event: Collect letters from monsters. Create the words NCSOFT, CHRONICLE and LINEAGE II. Turn these letters to the Event Manager in the villages and win great prizes!" />
</messages>
</event>

View File

@ -0,0 +1,9 @@
<html><body>Event Manager:<br>
Welcome!<br>
We are in the midst of the <font color="LEVEL">L2 Day Event</font>!<br>
How may I help you??<br>
<a action="bypass -h Quest L2Day manager-2.htm">Ask about the event.</a><br>
<a action="bypass -h Quest L2Day collect_l2">I've collected LINEAGEII!</a><br>
<a action="bypass -h Quest L2Day collect_nc">I've collected NCSOFT!</a><br>
<a action="bypass -h Quest L2Day collect_ch">I've collected CHRONICLE!</a>
</body></html>

View File

@ -0,0 +1,39 @@
<html><body>Event Manager:<br>
<font color="LEVEL">Event Participation Method:</font><br>
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!<br>
There are a total of 14 letters and numbers:<br1>
<font color="LEVEL">A</font>, <font color="LEVEL">C</font>, <font color="LEVEL">E</font>, <font color="LEVEL">F</font>, <font color="LEVEL">G</font>, <font color="LEVEL">H</font>, <font color="LEVEL">I</font>, <font color="LEVEL">L</font>, <font color="LEVEL">N</font>, <font color="LEVEL">O</font>, <font color="LEVEL">R</font>, <font color="LEVEL">S</font>, <font color="LEVEL">T</font> and <font color="LEVEL">II</font>.<br>
These letters and numbers can be combined to make the words <font color="LEVEL">LINEAGEII</font>, <font color="LEVEL">NCSOFT</font> and <font color="LEVEL">CHRONICLE</font>. The prizes are different for each combination. Different prizes may be awarded even for the same combinations.<br>
<font color="LEVEL">Event Prize Information:</font><br>
If you collect <font color="LEVEL">LINEAGEII</font>, you can receive one of the following prizes:<br1>
- 1 Ring of Queen Ant<br1>
- 1 Top-Grade Life Stone: level 76<br1>
- 2 High-Grade Life Stones: level 76<br1>
- 2 Blessed Scrolls of Resurrection<br1>
- 2 Blessed Scrolls of Escape<br1>
- 1 Rabbit Ears<br1>
- 1 Little Angel Wings<br1>
- 1 Fairy Antennae<br1>
- 2 Village Scrolls of Escape<br1>
If you collect <font color="LEVEL">NCSOFT</font>, you can receive one of the following prizes:<br1>
- 1 Earring of Orfen<br1>
- 1 High-Grade Life Stone: level 76<br1>
- 2 Mid-Grade Life Stones: level 76<br1>
- 1 Blessed Scroll of Resurrection<br1>
- 1 Blessed Scroll of Escape<br1>
- 1 Little Angel Wings<br1>
- 1 Fairy Antennae<br1>
- 1 Feathered Hat<br1>
- 1 Village Scroll of Escape<br1>
If you collect <font color="LEVEL">CHRONICLE</font>, you can receive one of the following prizes:<br1>
- 1 Ring of Core<br1>
- 1 High-Grade Life Stone: level 76<br1>
- 1 Mid-Grade Life Stone: level 76<br1>
- 1 Blessed Scroll of Resurrection<br1>
- 1 Blessed Scroll of Escape<br1>
- 1 Fairy Antennae<br1>
- 1 Feathered Hat<br1>
- 1 Artisan's Goggles<br1>
- 1 Village Scroll of Escape<br1>
<a action="bypass -h Quest L2Day manager-1.htm">Back</a>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Event Manager:<br>
Oh no!<br>
You don't have enough letters to make a word.<br>
Collect more letters and come back.<br>
<a action="bypass -h Quest L2Day manager-1.htm">Back</a>
</body></html>