Updated Letter Collector event.
Thanks to Index.
This commit is contained in:
parent
0dc934ff26
commit
e9430b97dd
@ -1,8 +0,0 @@
|
||||
<html><body>Angel Cat:<br>
|
||||
Traveler, are you interested in collecting letters?<br>
|
||||
Collect letters to create <font color="LEVEL">LINEAGE II</font>, <font color="LEVEL">TOGETHER</font>, or <font color="LEVEL">NCSOFT</font>, and bring them to me! I'll give you a gift!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector 33873-2.htm">"Tell me about the Letter Collecter Event."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector lineage">"I've collected 'LINEAGE II.'"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector together">"I've collected 'TOGETHER.'"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector ncsoft">"I've collected 'NCSOFT.'"</Button>
|
||||
</body></html>
|
@ -1,9 +0,0 @@
|
||||
<html><body>Angel Cat:<br>
|
||||
<font color="LEVEL">So, here's the gist:</font><br>
|
||||
If you hunt monsters in the Lineage II world, you have a chance of obtaining letter-engraved items.
|
||||
If you collect those letters and bring them to me, I'll give you a gift depending on the combination.<br>
|
||||
There are a total of 14 letters, and they are:<br>
|
||||
<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">I</font>, <font color="LEVEL">L</font>, <font color="LEVEL">N</font>, <font color="LEVEL">O</font>, <font color="LEVEL">S</font>, <font color="LEVEL">T</font>, <font color="LEVEL">II</font>, <font color="LEVEL">R</font>, and <font color="LEVEL">H</font>.<br><br>
|
||||
<br><br><br>Combine the letters and numbers to create <font color="LEVEL">LINEAGE II</font>, <font color="LEVEL">TOGETHER</font>, or <font color="LEVEL">NCSOFT</font>.<br><br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 33873-1.htm">Back</Button>
|
||||
</body></html>
|
@ -16,230 +16,42 @@
|
||||
*/
|
||||
package events.LetterCollector;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.quest.LongTimeEvent;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExLetterCollectorUI;
|
||||
|
||||
/**
|
||||
* Event: Letter Collector
|
||||
* @URL http://www.lineage2.com/en/news/events/letter-collector-event-05112016.php
|
||||
* @author Mobius, Gigi
|
||||
* @author Mobius
|
||||
*/
|
||||
public class LetterCollector extends LongTimeEvent
|
||||
{
|
||||
// NPC
|
||||
private static final int ANGEL_CAT = 33873;
|
||||
// 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 ItemHolder[] REWARDS_TAUTI =
|
||||
{
|
||||
new ItemHolder(34998, 1), // Tauti's One-handed Axe
|
||||
new ItemHolder(35001, 1), // Tauti's Dual Axe
|
||||
};
|
||||
private static final ItemHolder[] REWARDS_SPECTER =
|
||||
{
|
||||
new ItemHolder(18035, 1), // Blessed Specter Shaper
|
||||
new ItemHolder(18036, 1), // Blessed Specter Cutter
|
||||
new ItemHolder(18037, 1), // Blessed Specter Slasher
|
||||
new ItemHolder(18038, 1), // Blessed Specter Avenger
|
||||
new ItemHolder(18039, 1), // Blessed Specter Fighter
|
||||
new ItemHolder(18040, 1), // Blessed Specter Stormer
|
||||
new ItemHolder(18041, 1), // Blessed Specter Thrower
|
||||
new ItemHolder(18042, 1), // Blessed Specter Shooter
|
||||
new ItemHolder(18043, 1), // Blessed Specter Buster
|
||||
new ItemHolder(18044, 1), // Blessed Specter Caster
|
||||
new ItemHolder(18045, 1), // Blessed Specter Retributer
|
||||
new ItemHolder(18046, 1), // Blessed Specter Dualsword
|
||||
new ItemHolder(18047, 1), // Blessed Specter Dual Dagger
|
||||
new ItemHolder(18048, 1), // Blessed Specter Dual Blunt Weapon
|
||||
};
|
||||
private static final ItemHolder[] REWARDS_SERAPH =
|
||||
{
|
||||
new ItemHolder(18049, 1), // Blessed Seraph Helmet
|
||||
new ItemHolder(18050, 1), // Blessed Seraph Breastplate
|
||||
new ItemHolder(18051, 1), // Blessed Seraph Gaiters
|
||||
new ItemHolder(18052, 1), // Blessed Seraph Gauntlets
|
||||
new ItemHolder(18053, 1), // Blessed Seraph Boots
|
||||
new ItemHolder(18054, 1), // Blessed Seraph Shield
|
||||
new ItemHolder(18055, 1), // Blessed Seraph Leather Helmet
|
||||
new ItemHolder(18056, 1), // Blessed Seraph Leather Armor
|
||||
new ItemHolder(18057, 1), // Blessed Seraph Leather Leggings
|
||||
new ItemHolder(18058, 1), // Blessed Seraph Leather Gloves
|
||||
new ItemHolder(18059, 1), // Blessed Seraph Leather Boots
|
||||
new ItemHolder(18060, 1), // Blessed Seraph Circlet
|
||||
new ItemHolder(18061, 1), // Blessed Seraph Tunic
|
||||
new ItemHolder(18062, 1), // Blessed Seraph Stockings
|
||||
new ItemHolder(18063, 1), // Blessed Seraph Gloves
|
||||
new ItemHolder(18064, 1), // Blessed Seraph Shoes
|
||||
new ItemHolder(18065, 1), // Blessed Seraph Sigil
|
||||
};
|
||||
private static final ItemHolder[] REWARDS_OTHER =
|
||||
{
|
||||
new ItemHolder(17371, 20), // Crystal (R-grade)
|
||||
new ItemHolder(17754, 2000), // Soulshot (R-grade)
|
||||
new ItemHolder(19440, 1), // Gemstone (R-grade)
|
||||
new ItemHolder(19442, 500), // Blessed Spiritshot (R-grade)
|
||||
new ItemHolder(34945, 1), // Lv. 3 Giant Dye Pack
|
||||
new ItemHolder(34946, 1), // Lv. 3 Legendary Dye Pack
|
||||
new ItemHolder(34947, 1), // Lv. 3 Ancient Dye Pack
|
||||
new ItemHolder(34950, 1), // Lv. 4 Giant Dye Pack
|
||||
new ItemHolder(34951, 1), // Lv. 4 Legendary Dye Pack
|
||||
new ItemHolder(34952, 1), // Lv. 4 Ancient Dye Pack
|
||||
new ItemHolder(34953, 1), // Lv. 5 Giant Dye Pack
|
||||
new ItemHolder(34954, 1), // Lv. 5 Legendary Dye Pack
|
||||
new ItemHolder(34955, 1), // Lv. 5 Ancient Dye Pack
|
||||
new ItemHolder(35567, 1), // Dark Eternal Enhancement Stone
|
||||
new ItemHolder(37009, 3), // Blueberry Cake (MP)
|
||||
new ItemHolder(37802, 1), // Dark Eternal Enhancement Stone Fragment
|
||||
new ItemHolder(38101, 1), // Leona's Scroll: 1,000,000 SP
|
||||
new ItemHolder(38102, 1), // Leona's Scroll: 5,000,000 SP
|
||||
new ItemHolder(38103, 1), // Leona's Scroll: 10,000,000 SP
|
||||
new ItemHolder(39560, 1), // Low-grade Wind Dye Pack
|
||||
new ItemHolder(39561, 1), // Mid-grade Wind Dye Pack
|
||||
new ItemHolder(39562, 1), // High-grade Wind Dye Pack
|
||||
new ItemHolder(39633, 1), // Fortune Pocket - Stage 5
|
||||
};
|
||||
|
||||
private LetterCollector()
|
||||
{
|
||||
addStartNpc(ANGEL_CAT);
|
||||
addFirstTalkId(ANGEL_CAT);
|
||||
addTalkId(ANGEL_CAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onPlayerLogin(OnPlayerLogin event)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
if (!isEventPeriod())
|
||||
{
|
||||
case "33873-1.htm":
|
||||
case "33873-2.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "lineage":
|
||||
{
|
||||
if ((getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, A) >= 1) && //
|
||||
(getQuestItemsCount(player, G) >= 1) && //
|
||||
(getQuestItemsCount(player, II) >= 1))
|
||||
{
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, A, 1);
|
||||
takeItems(player, G, 1);
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, getReward());
|
||||
htmltext = "33873-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "together":
|
||||
{
|
||||
if ((getQuestItemsCount(player, T) >= 2) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, G) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, H) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1))
|
||||
{
|
||||
takeItems(player, T, 2);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, G, 1);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, H, 1);
|
||||
takeItems(player, R, 1);
|
||||
giveItems(player, getReward());
|
||||
htmltext = "33873-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "ncsoft":
|
||||
{
|
||||
if ((getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, C) >= 1) && //
|
||||
(getQuestItemsCount(player, S) >= 1) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, F) >= 1) && //
|
||||
(getQuestItemsCount(player, T) >= 1))
|
||||
{
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, C, 1);
|
||||
takeItems(player, S, 1);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, F, 1);
|
||||
takeItems(player, T, 1);
|
||||
giveItems(player, getReward());
|
||||
htmltext = "33873-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private ItemHolder getReward()
|
||||
{
|
||||
if (getRandom(100) < 1)
|
||||
|
||||
final PlayerInstance player = event.getPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
return getRandomEntry(REWARDS_TAUTI);
|
||||
player.sendPacket(ExLetterCollectorUI.STATIC_PACKET);
|
||||
}
|
||||
else if (getRandom(100) < 3)
|
||||
{
|
||||
return getRandomEntry(REWARDS_SPECTER);
|
||||
}
|
||||
else if (getRandom(100) < 3)
|
||||
{
|
||||
return getRandomEntry(REWARDS_SERAPH);
|
||||
}
|
||||
else
|
||||
{
|
||||
return getRandomEntry(REWARDS_OTHER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return npc.getId() + "-1.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new LetterCollector();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<event name="Letter Collector" active="11 05 1016-01 06 2016" enableShrines="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<event name="Letter Collector" active="30 06 2021-29 07 2021" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<!-- Minimum level (95) also set at ExLetterCollectorUI.java -->
|
||||
<!-- Rewards and items set at ExLetterCollectorTakeReward.java -->
|
||||
<droplist>
|
||||
<add item="37004" min="1" max="1" chance="3%" /> <!-- Letter Collector's Pouch: LINEAGE II -->
|
||||
<add item="37003" min="1" max="1" chance="3%" /> <!-- Letter Collector's Pouch: TOGETHER -->
|
||||
<add item="37005" min="1" max="1" chance="3%" /> <!-- Letter Collector's Pouch: NCSOFT -->
|
||||
<add item="37006" min="1" max="1" chance="1%" /> <!-- Letter Collector's Pouch: RIIS -->
|
||||
<add item="3875" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's A -->
|
||||
<add item="3877" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's N -->
|
||||
<add item="3884" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's O -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's T -->
|
||||
<add item="3880" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's II -->
|
||||
<add item="22894" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's W -->
|
||||
<add item="29545" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's D -->
|
||||
<add item="29825" min="1" max="1" chance="1%" minLevel="95" /> <!-- Letter Collector's P -->
|
||||
</droplist>
|
||||
<spawnlist>
|
||||
<add npc="33873" x="-14143" y="123176" z="-3096" heading="30212" /> <!-- Gludio -->
|
||||
<add npc="33873" x="16354" y="142848" z="-2680" heading="14450" /> <!-- Dion -->
|
||||
<add npc="33873" x="80814" y="147987" z="-3448" heading="3355" /> <!-- Giran -->
|
||||
<add npc="33873" x="82008" y="53874" z="-1472" heading="3355" /> <!-- Oren -->
|
||||
<add npc="33873" x="147457" y="27863" z="-2248" heading="17863" /> <!-- Aden -->
|
||||
<add npc="33873" x="112172" y="220447" z="-3648" heading="30708" /> <!-- Heine -->
|
||||
<add npc="33873" x="148195" y="-57368" z="-2752" heading="17863" /> <!-- Goddard -->
|
||||
<add npc="33873" x="44530" y="-48368" z="-776" heading="14450" /> <!-- Rune -->
|
||||
<add npc="33873" x="86897" y="-141346" z="-1320" heading="49153" /> <!-- Shutgard -->
|
||||
<add npc="33873" x="-114822" y="256385" z="-1472" heading="49744" /> <!-- Talking Island -->
|
||||
<add npc="33873" x="-78832" y="249115" z="-3272" heading="56380" /> <!-- Faeron Village -->
|
||||
<add npc="33873" x="-80485" y="149537" z="-3016" heading="16383" /> <!-- Gluddin -->
|
||||
<add npc="33873" x="117380" y="76684" z="-2672" heading="40961" /> <!-- Hunters Village -->
|
||||
<add npc="33873" x="208499" y="87743" z="-1006" heading="11264" /> <!-- Arcan -->
|
||||
</spawnlist>
|
||||
<messages>
|
||||
<add type="onEnd" text="Letter Collector: Event end!" />
|
||||
<add type="onEnter" text="Letter Collector: Event ongoing!" />
|
||||
|
@ -1,4 +0,0 @@
|
||||
<html><body>Angel Cat:<br>
|
||||
I'm sorry, but you'll need more letters to play.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 33873-1.htm">Back</Button>
|
||||
</body></html>
|
@ -552,7 +552,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
||||
EX_PVP_BOOK_LIST(0x18D, ExPvpBookList::new, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_KILLER_LOCATION(0x18E, null, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_TELEPORT_TO_KILLER(0x18F, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, ExLetterCollectorTakeReward::new, ConnectionState.IN_GAME),
|
||||
EX_SET_STATUS_BONUS(0x191, null, ConnectionState.IN_GAME),
|
||||
EX_RESET_STATUS_BONUS(0x192, null, ConnectionState.IN_GAME),
|
||||
EX_OLYMPIAD_MY_RANKING_INFO(0x193, RequestOlympiadMyRankingInfo::new, ConnectionState.IN_GAME),
|
||||
|
@ -0,0 +1,248 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerInventory;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
/**
|
||||
* @author Index, Mobius
|
||||
*/
|
||||
public class ExLetterCollectorTakeReward implements IClientIncomingPacket
|
||||
{
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
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 T = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
private static final int W = 22894;
|
||||
private static final int D = 29545;
|
||||
private static final int P = 29825;
|
||||
|
||||
// Rewards
|
||||
private static final ItemChanceHolder[] LINEAGE_II_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(80333, 5, 1), // Dragon Necklace
|
||||
new ItemChanceHolder(80334, 5, 1), // Dragon Earring
|
||||
new ItemChanceHolder(80335, 5, 1), // Dragon Ring
|
||||
new ItemChanceHolder(48296, 5, 1), // +10 Eternal Light Armor Capsule
|
||||
new ItemChanceHolder(48297, 5, 1), // +10 Eternal Robe Capsule
|
||||
new ItemChanceHolder(48295, 5, 1), // +10 Eternal Heavy Armor Capsule
|
||||
new ItemChanceHolder(39573, 5, 1), // Sealed Talisman - Insanity
|
||||
new ItemChanceHolder(37716, 5, 1), // Seven Signs' Energy
|
||||
new ItemChanceHolder(80416, 5, 1), // Fortune Box of 10 Billion Adena
|
||||
new ItemChanceHolder(36414, 5, 1), // Dragon Claw
|
||||
new ItemChanceHolder(47705, 15, 1), // Blue Cat's Eye Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47627, 15, 1), // Sapphire Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47626, 15, 1), // Ruby Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47703, 15, 1), // Red Cat's Eye Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47629, 15, 1), // Opal Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(28360, 15, 1), // Cat's Eye Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(28362, 15, 1), // Amethyst Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47631, 15, 1), // Diamond Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47634, 15, 1), // Pearl Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47635, 15, 1), // Vital Stone Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47630, 15, 1), // Obsidian Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47633, 15, 1), // Aquamarine Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(80423, 30, 1), // Balance Artifact Box
|
||||
new ItemChanceHolder(80420, 30, 1), // Attack Artifact Box
|
||||
new ItemChanceHolder(80421, 30, 1), // Protection Artifact Box
|
||||
new ItemChanceHolder(80422, 30, 1), // Support Artifact Box
|
||||
new ItemChanceHolder(39374, 30, 1), // Scroll: 5.000.000 SP
|
||||
new ItemChanceHolder(46274, 30, 1), // Wind Vitality Tonic
|
||||
new ItemChanceHolder(35563, 30, 1), // Giant's Energy
|
||||
new ItemChanceHolder(38761, 30, 1), // Energy of Destruction 3-unit Pack
|
||||
new ItemChanceHolder(36513, 30, 1), // Elcyum Powder
|
||||
new ItemChanceHolder(27673, 30, 1), // Freya's Scroll of Storm
|
||||
};
|
||||
private static final ItemChanceHolder[] DEATH_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(47821, 5, 1), // Sayha's Talisman Lv. 10
|
||||
new ItemChanceHolder(47820, 5, 1), // Sayha's Talisman Lv. 9
|
||||
new ItemChanceHolder(37717, 5, 1), // Talisman - Seven Signs
|
||||
new ItemChanceHolder(39572, 5, 1), // Talisman - Insanity
|
||||
new ItemChanceHolder(48032, 5, 1), // Sayha's Talisman Lv. 8
|
||||
new ItemChanceHolder(80416, 5, 1), // Fortune Box of 10 Billion Adena
|
||||
new ItemChanceHolder(28448, 5, 1), // Sayha's Talisman Lv. 7
|
||||
new ItemChanceHolder(37715, 5, 1), // Talisman - Anakim
|
||||
new ItemChanceHolder(35649, 15, 1), // Sealed Talisman - Longing
|
||||
new ItemChanceHolder(29152, 15, 1), // High-grade Zodiac Agathion Pack
|
||||
new ItemChanceHolder(29151, 15, 1), // Mid-grade Zodiac Agathion Pack
|
||||
new ItemChanceHolder(28373, 15, 1), // Tanzenite Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47632, 15, 1), // Emerald Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(47636, 15, 1), // Garnet Lv. 3 Jewelry Box
|
||||
new ItemChanceHolder(80423, 30, 1), // Balance Artifact Box
|
||||
new ItemChanceHolder(80420, 30, 1), // Attack Artifact Box
|
||||
new ItemChanceHolder(80421, 30, 1), // Protection Artifact Box
|
||||
new ItemChanceHolder(80422, 30, 1), // Support Artifact Box
|
||||
new ItemChanceHolder(39374, 30, 1), // Scroll: 5.000.000 SP
|
||||
new ItemChanceHolder(46274, 30, 1), // Wind Vitality Tonic
|
||||
new ItemChanceHolder(35563, 30, 1), // Giant's Energy
|
||||
new ItemChanceHolder(38761, 30, 1), // Energy of Destruction 3-unit Pack
|
||||
new ItemChanceHolder(36513, 30, 1), // Elcyum Powder
|
||||
new ItemChanceHolder(27673, 30, 1), // Freya's Scroll of Storm
|
||||
};
|
||||
private static final ItemChanceHolder[] KNIGHT_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(80416, 5, 1), // Fortune Box of 10 Billion Adena
|
||||
new ItemChanceHolder(28448, 5, 1), // Sayha's Talisman Lv. 7
|
||||
new ItemChanceHolder(26291, 5, 1), // Kaliel's Energy - Longing
|
||||
new ItemChanceHolder(36731, 5, 1), // Life Stone: Giant's Power
|
||||
new ItemChanceHolder(37714, 5, 1), // Talisman - Lilith
|
||||
new ItemChanceHolder(29150, 15, 1), // Low-grade Zodiac Agathion Pack
|
||||
new ItemChanceHolder(80423, 30, 1), // Balance Artifact Box
|
||||
new ItemChanceHolder(80420, 30, 1), // Attack Artifact Box
|
||||
new ItemChanceHolder(80421, 30, 1), // Protection Artifact Box
|
||||
new ItemChanceHolder(80422, 30, 1), // Support Artifact Box
|
||||
new ItemChanceHolder(36515, 15, 1), // Elcyum
|
||||
new ItemChanceHolder(48215, 30, 1), // Circlet Spirit Stone
|
||||
new ItemChanceHolder(28540, 30, 1), // Magnificent Brooch Spirit Stone
|
||||
new ItemChanceHolder(36514, 30, 1), // Elcyum Crystal
|
||||
new ItemChanceHolder(39374, 30, 1), // Scroll: 5.000.000 SP
|
||||
new ItemChanceHolder(46274, 30, 1), // Wind Vitality Tonic
|
||||
new ItemChanceHolder(35563, 30, 1), // Giant's Energy
|
||||
new ItemChanceHolder(38761, 30, 1), // Energy of Destruction 3-unit Pack
|
||||
new ItemChanceHolder(27673, 30, 1), // Freya's Scroll of Storm
|
||||
};
|
||||
|
||||
private int _wordId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_wordId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final PlayerInstance player = client.getPlayer();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInventory inventory = player.getInventory();
|
||||
if (inventory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_wordId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(L, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(II, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", L, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", II, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(LINEAGE_II_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(N, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 3) || //
|
||||
(inventory.getInventoryItemCount(W, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(L, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(D, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", W, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", L, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", D, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(DEATH_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(T, -1) < 3) || //
|
||||
(inventory.getInventoryItemCount(O, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(P, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", O, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", O, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", P, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(KNIGHT_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ItemChanceHolder getRandomReward(ItemChanceHolder[] rewards)
|
||||
{
|
||||
ItemChanceHolder reward = null;
|
||||
while (reward == null)
|
||||
{
|
||||
final ItemChanceHolder random = rewards[Rnd.get(rewards.length)];
|
||||
if ((Rnd.get(100) < random.getChance()) && (ItemTable.getInstance().getTemplate(random.getId()) != null))
|
||||
{
|
||||
reward = random;
|
||||
}
|
||||
}
|
||||
return reward;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class ExLetterCollectorUI implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExLetterCollectorUI STATIC_PACKET = new ExLetterCollectorUI();
|
||||
|
||||
private static final int LETTER_COLLECTOR_MIN_LEVEL = 95;
|
||||
|
||||
private ExLetterCollectorUI()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_LETTER_COLLECTOR_UI_LAUNCHER.writeId(packet);
|
||||
packet.writeC(0x01); // enabled (0x00 - no, 0x01 -yes)
|
||||
packet.writeD(LETTER_COLLECTOR_MIN_LEVEL); // Minimum Level
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm glad to see you, adventurer!<br>
|
||||
Do you want to claim reward for collecting the words <font color="LEVEL">LINEAGE II</font>, <font color="LEVEL">MEMORIES</font>, or <font color="LEVEL">CHRONICLE</font>?<br>
|
||||
You can make these words from the letters you get while hunting the monsters in Lineage II world.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector lineage">"I have all of the letters of LINEAGE II!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector memories">"I have all of the letters of MEMORIES!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector chronicle">"I have all of the letters of CHRONICLE!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector 9000-2.htm">"I'd like to exchange my letters for other ones."</Button>
|
||||
</body></html>
|
@ -1,17 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I can exchange <font color="LEVEL">two of your letters</font> for <font color="LEVEL">one</font> of random letters. In case with the rare S, H and the number II, you'll will need only one item for exchange. Press the button below when're you ready!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeA">"I want to exchange two of my letters A for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeC">"I want to exchange two of my letters C for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeE">"I want to exchange two of my letters E for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeG">"I want to exchange two of my letters G for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeI">"I want to exchange two of my letters I for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeL">"I want to exchange two of my letters L for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeM">"I want to exchange two of my letters M for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeN">"I want to exchange two of my letters N for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeO">"I want to exchange two of my letters O for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeL">"I want to exchange two of my letters R for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeH">"I want to exchange one of my letters H for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeS">"I want to exchange one of my letters S for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeII">"I want to exchange one of my letters II for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -16,346 +16,42 @@
|
||||
*/
|
||||
package events.LetterCollector;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.quest.LongTimeEvent;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExLetterCollectorUI;
|
||||
|
||||
/**
|
||||
* Event: Letter Collector
|
||||
* @URL https://eu.4gameforum.com/threads/648400/
|
||||
* @author Mobius, Gigi, Adapted for Classic by QuangNguyen
|
||||
* @author Mobius
|
||||
*/
|
||||
public class LetterCollector extends LongTimeEvent
|
||||
{
|
||||
// NPC
|
||||
private static final int ROSALIA = 9000;
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int C = 3876;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
private static final int I = 3881;
|
||||
private static final int L = 3882;
|
||||
private static final int N = 3883;
|
||||
private static final int R = 3885;
|
||||
private static final int M = 34956;
|
||||
private static final int O = 3884;
|
||||
private static final int S = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
// Exchange Letters
|
||||
private static final int[] LETTERS =
|
||||
{
|
||||
A,
|
||||
C,
|
||||
E,
|
||||
G,
|
||||
I,
|
||||
L,
|
||||
N,
|
||||
R,
|
||||
M,
|
||||
O,
|
||||
S,
|
||||
H,
|
||||
II
|
||||
};
|
||||
// Reward
|
||||
private static final int LINEAGEII = 29581;
|
||||
private static final int MEMMORIES = 29583;
|
||||
private static final int CHRONICLE = 29582;
|
||||
|
||||
private LetterCollector()
|
||||
{
|
||||
addStartNpc(ROSALIA);
|
||||
addFirstTalkId(ROSALIA);
|
||||
addTalkId(ROSALIA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onPlayerLogin(OnPlayerLogin event)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
if (!isEventPeriod())
|
||||
{
|
||||
case "9000-1.htm":
|
||||
case "9000-2.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "lineage":
|
||||
{
|
||||
if ((getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, A) >= 1) && //
|
||||
(getQuestItemsCount(player, G) >= 1) && //
|
||||
(getQuestItemsCount(player, II) >= 1))
|
||||
{
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, A, 1);
|
||||
takeItems(player, G, 1);
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, LINEAGEII, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "memories":
|
||||
{
|
||||
if ((getQuestItemsCount(player, M) >= 2) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, S) >= 1))
|
||||
{
|
||||
takeItems(player, M, 2);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, R, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, S, 1);
|
||||
giveItems(player, MEMMORIES, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "chronicle":
|
||||
{
|
||||
if ((getQuestItemsCount(player, C) >= 2) && //
|
||||
(getQuestItemsCount(player, H) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 1))
|
||||
{
|
||||
takeItems(player, C, 2);
|
||||
takeItems(player, H, 1);
|
||||
takeItems(player, R, 1);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, E, 1);
|
||||
giveItems(player, CHRONICLE, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeA":
|
||||
{
|
||||
if (getQuestItemsCount(player, A) >= 2)
|
||||
{
|
||||
takeItems(player, A, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeC":
|
||||
{
|
||||
if (getQuestItemsCount(player, C) >= 2)
|
||||
{
|
||||
takeItems(player, C, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeE":
|
||||
{
|
||||
if (getQuestItemsCount(player, E) >= 2)
|
||||
{
|
||||
takeItems(player, E, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeG":
|
||||
{
|
||||
if (getQuestItemsCount(player, G) >= 2)
|
||||
{
|
||||
takeItems(player, G, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeI":
|
||||
{
|
||||
if (getQuestItemsCount(player, I) >= 2)
|
||||
{
|
||||
takeItems(player, I, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeL":
|
||||
{
|
||||
if (getQuestItemsCount(player, L) >= 2)
|
||||
{
|
||||
takeItems(player, L, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeM":
|
||||
{
|
||||
if (getQuestItemsCount(player, M) >= 2)
|
||||
{
|
||||
takeItems(player, M, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeN":
|
||||
{
|
||||
if (getQuestItemsCount(player, N) >= 2)
|
||||
{
|
||||
takeItems(player, N, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeO":
|
||||
{
|
||||
if (getQuestItemsCount(player, O) >= 2)
|
||||
{
|
||||
takeItems(player, O, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeR":
|
||||
{
|
||||
if (getQuestItemsCount(player, R) >= 2)
|
||||
{
|
||||
takeItems(player, R, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeH":
|
||||
{
|
||||
if (getQuestItemsCount(player, H) >= 1)
|
||||
{
|
||||
takeItems(player, H, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeS":
|
||||
{
|
||||
if (getQuestItemsCount(player, S) >= 1)
|
||||
{
|
||||
takeItems(player, S, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeII":
|
||||
{
|
||||
if (getQuestItemsCount(player, II) >= 1)
|
||||
{
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInstance player = event.getPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(ExLetterCollectorUI.STATIC_PACKET);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return npc.getId() + "-1.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new LetterCollector();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,37 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<event name="Looking for right words" active="08 03 2017-09 03 2018" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<event name="Letter Collector" active="30 06 2021-29 07 2021" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<!-- Minimum level (5) also set at ExLetterCollectorUI.java -->
|
||||
<!-- Rewards and items set at ExLetterCollectorTakeReward.java -->
|
||||
<droplist>
|
||||
<add item="3875" min="1" max="1" chance="3%" /> <!-- Letter Collector's A -->
|
||||
<add item="3876" min="1" max="1" chance="3%" /> <!-- Letter Collector's C -->
|
||||
<add item="3877" min="1" max="1" chance="3%" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="3%" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="3%" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="3%" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="3%" /> <!-- Letter Collector's N -->
|
||||
<add item="3885" min="1" max="1" chance="3%" /> <!-- Letter Collector's R -->
|
||||
<add item="34956" min="1" max="1" chance="3%" /> <!-- Letter Collector's M -->
|
||||
<add item="3884" min="1" max="1" chance="3%" /> <!-- Letter Collector's O -->
|
||||
<add item="3886" min="1" max="1" chance="3%" /> <!-- Letter Collector's S -->
|
||||
<add item="3880" min="1" max="1" chance="3%" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="3%" /> <!-- Letter Collector's II -->
|
||||
<add item="3875" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's A -->
|
||||
<add item="3877" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's N -->
|
||||
<add item="3885" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's R -->
|
||||
<add item="34956" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's M -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's S -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's T -->
|
||||
<add item="3880" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's II -->
|
||||
<add item="92021" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's D -->
|
||||
<add item="93412" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's K -->
|
||||
<add item="93413" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's U -->
|
||||
</droplist>
|
||||
<spawnlist>
|
||||
<add npc="9000" x="-84008" y="243032" z="-3728" heading="49744" /> <!-- Talking Island -->
|
||||
<add npc="9000" x="45688" y="49080" z="-3056" heading="49744" /> <!-- Elven Village -->
|
||||
<add npc="9000" x="-44584" y="-113608" z="-192" heading="49744" /> <!-- Orc Village -->
|
||||
<add npc="9000" x="10643" y="17034" z="-4592" heading="49744" /> <!-- Dark Elven Village -->
|
||||
<add npc="9000" x="115656" y="-178056" z="-912" heading="49744" /> <!-- Dwarf Village -->
|
||||
<add npc="9000" x="-80485" y="149537" z="-3016" heading="16383" /> <!-- Gluddin -->
|
||||
<add npc="9000" x="-14143" y="123176" z="-3096" heading="30212" /> <!-- Gludio -->
|
||||
<add npc="9000" x="16354" y="142848" z="-2680" heading="14450" /> <!-- Dion -->
|
||||
<add npc="9000" x="82312" y="148616" z="-3440" heading="3355" /> <!-- Giran -->
|
||||
<add npc="9000" x="82008" y="53874" z="-1472" heading="3355" /> <!-- Oren -->
|
||||
<add npc="9000" x="147064" y="25928" z="-2008" heading="17863" /> <!-- Aden -->
|
||||
<add npc="9000" x="117380" y="76684" z="-2672" heading="40961" /> <!-- Hunters Village -->
|
||||
<add npc="9000" x="147464" y="-56984" z="-2784" heading="11547" /> <!-- Goddard -->
|
||||
</spawnlist>
|
||||
<messages>
|
||||
<add type="onEnd" text="Looking for right words: Event end!" />
|
||||
<add type="onEnter" text="Looking for right words: Event ongoing!" />
|
||||
<add type="onEnd" text="Letter Collector: Event end!" />
|
||||
<add type="onEnter" text="Letter Collector: Event ongoing!" />
|
||||
</messages>
|
||||
</event>
|
@ -1,4 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm sorry, but you'll need more letters to play.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -1,4 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm sorry, but you do not have enough letters to exchange!.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -544,7 +544,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
||||
EX_PVP_BOOK_LIST(0x18D, ExPvpBookList::new, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_KILLER_LOCATION(0x18E, null, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_TELEPORT_TO_KILLER(0x18F, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, ExLetterCollectorTakeReward::new, ConnectionState.IN_GAME),
|
||||
EX_SET_STATUS_BONUS(0x191, ExSetStatusBonus::new, ConnectionState.IN_GAME),
|
||||
EX_RESET_STATUS_BONUS(0x192, ExResetStatusBonus::new, ConnectionState.IN_GAME),
|
||||
EX_OLYMPIAD_MY_RANKING_INFO(0x193, RequestOlympiadMyRankingInfo::new, ConnectionState.IN_GAME),
|
||||
|
@ -0,0 +1,257 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerInventory;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
/**
|
||||
* @author Index, Mobius
|
||||
*/
|
||||
public class ExLetterCollectorTakeReward implements IClientIncomingPacket
|
||||
{
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
private static final int I = 3881;
|
||||
private static final int L = 3882;
|
||||
private static final int N = 3883;
|
||||
private static final int R = 3885;
|
||||
private static final int M = 34956;
|
||||
private static final int S = 3886;
|
||||
private static final int T = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
private static final int D = 92021;
|
||||
private static final int K = 93412;
|
||||
private static final int U = 93413;
|
||||
|
||||
// Rewards
|
||||
private static final ItemChanceHolder[] LINEAGE_II_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(49683, 5, 1), // Talisman of Baium
|
||||
new ItemChanceHolder(91119, 5, 1), // Ignis' Necklace
|
||||
new ItemChanceHolder(91117, 5, 1), // Nebula's Necklace
|
||||
new ItemChanceHolder(91121, 5, 1), // Procella's Necklace
|
||||
new ItemChanceHolder(91123, 5, 1), // Petram's Necklace
|
||||
new ItemChanceHolder(91952, 5, 1), // Ring of Insolance
|
||||
new ItemChanceHolder(91953, 5, 1), // Dragon Valley's Earring
|
||||
new ItemChanceHolder(91035, 15, 1), // Water Spirit Ore
|
||||
new ItemChanceHolder(91036, 15, 1), // Fire Spirit Ore
|
||||
new ItemChanceHolder(91037, 15, 1), // Wind Spirit Ore
|
||||
new ItemChanceHolder(91038, 15, 1), // Earth Spirit Ore
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] DEATH_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(91012, 5, 1), // Top-grade A-grade Weapon Pack
|
||||
new ItemChanceHolder(93459, 5, 1), // A-grade Armor Pack - Majestic Equipment
|
||||
new ItemChanceHolder(93460, 5, 1), // A-grade Armor Pack - Equipment of Nightmare
|
||||
new ItemChanceHolder(93461, 5, 1), // A-grade Armor Pack - Tallum Equipment
|
||||
new ItemChanceHolder(93462, 5, 1), // A-grade Armor Pack - Dark Crystal Equipment
|
||||
new ItemChanceHolder(90015, 15, 1), // Top-grade Life Stone - Weapon
|
||||
new ItemChanceHolder(93100, 15, 1), // Mid-grade Life Stone Shield / Sigil
|
||||
new ItemChanceHolder(91938, 15, 1), // Primeval Isle's Time Stone
|
||||
new ItemChanceHolder(93699, 15, 1), // Charging Stone of Random Crafting - 1 charge
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] KNIGHT_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(93103, 5, 1), // Spellbook: Divine Beam
|
||||
new ItemChanceHolder(92401, 5, 1), // Spellbook: White Guardian
|
||||
new ItemChanceHolder(91945, 5, 1), // Book of Shadows
|
||||
new ItemChanceHolder(91944, 5, 1), // Book of Light
|
||||
new ItemChanceHolder(91943, 15, 1), // Crystal of Shadows
|
||||
new ItemChanceHolder(91942, 15, 1), // Crystal of Light
|
||||
new ItemChanceHolder(8619, 15, 1), // Buff Expansion Book Lv. 2
|
||||
new ItemChanceHolder(8620, 15, 1), // Buff Expansion Book Lv. 3
|
||||
new ItemChanceHolder(90045, 15, 1), // Magical Tablet
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] SUMMER_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(93976, 5, 1), // Blessed Scroll: Enchant A-grade Weapon
|
||||
new ItemChanceHolder(93977, 5, 1), // Blessed Scroll: Enchant A-grade Armor
|
||||
new ItemChanceHolder(729, 5, 1), // Scroll: Enchant A-grade Weapon
|
||||
new ItemChanceHolder(730, 5, 1), // Scroll: Enchant A-grade Armor
|
||||
new ItemChanceHolder(947, 15, 1), // Scroll: Enchant B-grade Weapon
|
||||
new ItemChanceHolder(948, 15, 1), // Scroll: Enchant B-grade Armor
|
||||
new ItemChanceHolder(91967, 15, 1), // Scroll: Enchant Dragon Valley's Earring
|
||||
new ItemChanceHolder(91966, 15, 1), // Scroll: Enchant Ring of Insolance
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(91780, 30, 1), // Battle Scroll
|
||||
new ItemChanceHolder(93486, 30, 1), // Combat Scroll
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(1538, 30, 1), // Improved Scroll of Escape
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
|
||||
private int _wordId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_wordId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final PlayerInstance player = client.getPlayer();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInventory inventory = player.getInventory();
|
||||
if (inventory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_wordId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(L, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(II, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", L, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", II, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(LINEAGE_II_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(D, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(T, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", D, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(DEATH_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(K, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(T, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", K, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(KNIGHT_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(S, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(U, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(M, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(R, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", S, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", U, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", M, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", M, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", R, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(SUMMER_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ItemChanceHolder getRandomReward(ItemChanceHolder[] rewards)
|
||||
{
|
||||
ItemChanceHolder reward = null;
|
||||
while (reward == null)
|
||||
{
|
||||
final ItemChanceHolder random = rewards[Rnd.get(rewards.length)];
|
||||
if ((Rnd.get(100) < random.getChance()) && (ItemTable.getInstance().getTemplate(random.getId()) != null))
|
||||
{
|
||||
reward = random;
|
||||
}
|
||||
}
|
||||
return reward;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class ExLetterCollectorUI implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExLetterCollectorUI STATIC_PACKET = new ExLetterCollectorUI();
|
||||
|
||||
private static final int LETTER_COLLECTOR_MIN_LEVEL = 5;
|
||||
|
||||
private ExLetterCollectorUI()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_LETTER_COLLECTOR_UI_LAUNCHER.writeId(packet);
|
||||
packet.writeC(0x01); // enabled (0x00 - no, 0x01 -yes)
|
||||
packet.writeD(LETTER_COLLECTOR_MIN_LEVEL); // Minimum Level
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm glad to see you, adventurer!<br>
|
||||
Do you want to claim reward for collecting the words <font color="LEVEL">LINEAGE II</font>, <font color="LEVEL">MEMORIES</font>, or <font color="LEVEL">CHRONICLE</font>?<br>
|
||||
You can make these words from the letters you get while hunting the monsters in Lineage II world.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector lineage">"I have all of the letters of LINEAGE II!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector memories">"I have all of the letters of MEMORIES!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector chronicle">"I have all of the letters of CHRONICLE!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector 9000-2.htm">"I'd like to exchange my letters for other ones."</Button>
|
||||
</body></html>
|
@ -1,17 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I can exchange <font color="LEVEL">two of your letters</font> for <font color="LEVEL">one</font> of random letters. In case with the rare S, H and the number II, you'll will need only one item for exchange. Press the button below when're you ready!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeA">"I want to exchange two of my letters A for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeC">"I want to exchange two of my letters C for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeE">"I want to exchange two of my letters E for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeG">"I want to exchange two of my letters G for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeI">"I want to exchange two of my letters I for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeL">"I want to exchange two of my letters L for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeM">"I want to exchange two of my letters M for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeN">"I want to exchange two of my letters N for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeO">"I want to exchange two of my letters O for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeL">"I want to exchange two of my letters R for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeH">"I want to exchange one of my letters H for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeS">"I want to exchange one of my letters S for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeII">"I want to exchange one of my letters II for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -16,346 +16,42 @@
|
||||
*/
|
||||
package events.LetterCollector;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.quest.LongTimeEvent;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExLetterCollectorUI;
|
||||
|
||||
/**
|
||||
* Event: Letter Collector
|
||||
* @URL https://eu.4gameforum.com/threads/648400/
|
||||
* @author Mobius, Gigi, Adapted for Classic by QuangNguyen
|
||||
* @author Mobius
|
||||
*/
|
||||
public class LetterCollector extends LongTimeEvent
|
||||
{
|
||||
// NPC
|
||||
private static final int ROSALIA = 9000;
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int C = 3876;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
private static final int I = 3881;
|
||||
private static final int L = 3882;
|
||||
private static final int N = 3883;
|
||||
private static final int R = 3885;
|
||||
private static final int M = 34956;
|
||||
private static final int O = 3884;
|
||||
private static final int S = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
// Exchange Letters
|
||||
private static final int[] LETTERS =
|
||||
{
|
||||
A,
|
||||
C,
|
||||
E,
|
||||
G,
|
||||
I,
|
||||
L,
|
||||
N,
|
||||
R,
|
||||
M,
|
||||
O,
|
||||
S,
|
||||
H,
|
||||
II
|
||||
};
|
||||
// Reward
|
||||
private static final int LINEAGEII = 29581;
|
||||
private static final int MEMMORIES = 29583;
|
||||
private static final int CHRONICLE = 29582;
|
||||
|
||||
private LetterCollector()
|
||||
{
|
||||
addStartNpc(ROSALIA);
|
||||
addFirstTalkId(ROSALIA);
|
||||
addTalkId(ROSALIA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onPlayerLogin(OnPlayerLogin event)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
if (!isEventPeriod())
|
||||
{
|
||||
case "9000-1.htm":
|
||||
case "9000-2.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "lineage":
|
||||
{
|
||||
if ((getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, A) >= 1) && //
|
||||
(getQuestItemsCount(player, G) >= 1) && //
|
||||
(getQuestItemsCount(player, II) >= 1))
|
||||
{
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, A, 1);
|
||||
takeItems(player, G, 1);
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, LINEAGEII, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "memories":
|
||||
{
|
||||
if ((getQuestItemsCount(player, M) >= 2) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, S) >= 1))
|
||||
{
|
||||
takeItems(player, M, 2);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, R, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, S, 1);
|
||||
giveItems(player, MEMMORIES, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "chronicle":
|
||||
{
|
||||
if ((getQuestItemsCount(player, C) >= 2) && //
|
||||
(getQuestItemsCount(player, H) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 1))
|
||||
{
|
||||
takeItems(player, C, 2);
|
||||
takeItems(player, H, 1);
|
||||
takeItems(player, R, 1);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, E, 1);
|
||||
giveItems(player, CHRONICLE, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeA":
|
||||
{
|
||||
if (getQuestItemsCount(player, A) >= 2)
|
||||
{
|
||||
takeItems(player, A, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeC":
|
||||
{
|
||||
if (getQuestItemsCount(player, C) >= 2)
|
||||
{
|
||||
takeItems(player, C, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeE":
|
||||
{
|
||||
if (getQuestItemsCount(player, E) >= 2)
|
||||
{
|
||||
takeItems(player, E, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeG":
|
||||
{
|
||||
if (getQuestItemsCount(player, G) >= 2)
|
||||
{
|
||||
takeItems(player, G, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeI":
|
||||
{
|
||||
if (getQuestItemsCount(player, I) >= 2)
|
||||
{
|
||||
takeItems(player, I, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeL":
|
||||
{
|
||||
if (getQuestItemsCount(player, L) >= 2)
|
||||
{
|
||||
takeItems(player, L, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeM":
|
||||
{
|
||||
if (getQuestItemsCount(player, M) >= 2)
|
||||
{
|
||||
takeItems(player, M, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeN":
|
||||
{
|
||||
if (getQuestItemsCount(player, N) >= 2)
|
||||
{
|
||||
takeItems(player, N, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeO":
|
||||
{
|
||||
if (getQuestItemsCount(player, O) >= 2)
|
||||
{
|
||||
takeItems(player, O, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeR":
|
||||
{
|
||||
if (getQuestItemsCount(player, R) >= 2)
|
||||
{
|
||||
takeItems(player, R, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeH":
|
||||
{
|
||||
if (getQuestItemsCount(player, H) >= 1)
|
||||
{
|
||||
takeItems(player, H, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeS":
|
||||
{
|
||||
if (getQuestItemsCount(player, S) >= 1)
|
||||
{
|
||||
takeItems(player, S, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeII":
|
||||
{
|
||||
if (getQuestItemsCount(player, II) >= 1)
|
||||
{
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInstance player = event.getPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(ExLetterCollectorUI.STATIC_PACKET);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return npc.getId() + "-1.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new LetterCollector();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,37 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<event name="Looking for right words" active="08 03 2017-09 03 2018" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<event name="Letter Collector" active="30 06 2021-29 07 2021" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<!-- Minimum level (5) also set at ExLetterCollectorUI.java -->
|
||||
<!-- Rewards and items set at ExLetterCollectorTakeReward.java -->
|
||||
<droplist>
|
||||
<add item="3875" min="1" max="1" chance="3%" /> <!-- Letter Collector's A -->
|
||||
<add item="3876" min="1" max="1" chance="3%" /> <!-- Letter Collector's C -->
|
||||
<add item="3877" min="1" max="1" chance="3%" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="3%" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="3%" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="3%" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="3%" /> <!-- Letter Collector's N -->
|
||||
<add item="3885" min="1" max="1" chance="3%" /> <!-- Letter Collector's R -->
|
||||
<add item="34956" min="1" max="1" chance="3%" /> <!-- Letter Collector's M -->
|
||||
<add item="3884" min="1" max="1" chance="3%" /> <!-- Letter Collector's O -->
|
||||
<add item="3886" min="1" max="1" chance="3%" /> <!-- Letter Collector's S -->
|
||||
<add item="3880" min="1" max="1" chance="3%" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="3%" /> <!-- Letter Collector's II -->
|
||||
<add item="3875" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's A -->
|
||||
<add item="3877" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's N -->
|
||||
<add item="3885" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's R -->
|
||||
<add item="34956" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's M -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's S -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's T -->
|
||||
<add item="3880" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's II -->
|
||||
<add item="92021" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's D -->
|
||||
<add item="93412" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's K -->
|
||||
<add item="93413" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's U -->
|
||||
</droplist>
|
||||
<spawnlist>
|
||||
<add npc="9000" x="-84008" y="243032" z="-3728" heading="49744" /> <!-- Talking Island -->
|
||||
<add npc="9000" x="45688" y="49080" z="-3056" heading="49744" /> <!-- Elven Village -->
|
||||
<add npc="9000" x="-44584" y="-113608" z="-192" heading="49744" /> <!-- Orc Village -->
|
||||
<add npc="9000" x="10643" y="17034" z="-4592" heading="49744" /> <!-- Dark Elven Village -->
|
||||
<add npc="9000" x="115656" y="-178056" z="-912" heading="49744" /> <!-- Dwarf Village -->
|
||||
<add npc="9000" x="-80485" y="149537" z="-3016" heading="16383" /> <!-- Gluddin -->
|
||||
<add npc="9000" x="-14143" y="123176" z="-3096" heading="30212" /> <!-- Gludio -->
|
||||
<add npc="9000" x="16354" y="142848" z="-2680" heading="14450" /> <!-- Dion -->
|
||||
<add npc="9000" x="82312" y="148616" z="-3440" heading="3355" /> <!-- Giran -->
|
||||
<add npc="9000" x="82008" y="53874" z="-1472" heading="3355" /> <!-- Oren -->
|
||||
<add npc="9000" x="147064" y="25928" z="-2008" heading="17863" /> <!-- Aden -->
|
||||
<add npc="9000" x="117380" y="76684" z="-2672" heading="40961" /> <!-- Hunters Village -->
|
||||
<add npc="9000" x="147464" y="-56984" z="-2784" heading="11547" /> <!-- Goddard -->
|
||||
</spawnlist>
|
||||
<messages>
|
||||
<add type="onEnd" text="Looking for right words: Event end!" />
|
||||
<add type="onEnter" text="Looking for right words: Event ongoing!" />
|
||||
<add type="onEnd" text="Letter Collector: Event end!" />
|
||||
<add type="onEnter" text="Letter Collector: Event ongoing!" />
|
||||
</messages>
|
||||
</event>
|
@ -1,4 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm sorry, but you'll need more letters to play.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -1,4 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm sorry, but you do not have enough letters to exchange!.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -567,7 +567,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
||||
EX_PVP_BOOK_LIST(0x18D, ExPvpBookList::new, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_KILLER_LOCATION(0x18E, null, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_TELEPORT_TO_KILLER(0x18F, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, ExLetterCollectorTakeReward::new, ConnectionState.IN_GAME),
|
||||
EX_SET_STATUS_BONUS(0x191, ExSetStatusBonus::new, ConnectionState.IN_GAME),
|
||||
EX_RESET_STATUS_BONUS(0x192, ExResetStatusBonus::new, ConnectionState.IN_GAME),
|
||||
EX_OLYMPIAD_MY_RANKING_INFO(0x193, RequestOlympiadMyRankingInfo::new, ConnectionState.IN_GAME),
|
||||
|
@ -0,0 +1,257 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerInventory;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
/**
|
||||
* @author Index, Mobius
|
||||
*/
|
||||
public class ExLetterCollectorTakeReward implements IClientIncomingPacket
|
||||
{
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
private static final int I = 3881;
|
||||
private static final int L = 3882;
|
||||
private static final int N = 3883;
|
||||
private static final int R = 3885;
|
||||
private static final int M = 34956;
|
||||
private static final int S = 3886;
|
||||
private static final int T = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
private static final int D = 92021;
|
||||
private static final int K = 93412;
|
||||
private static final int U = 93413;
|
||||
|
||||
// Rewards
|
||||
private static final ItemChanceHolder[] LINEAGE_II_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(49683, 5, 1), // Talisman of Baium
|
||||
new ItemChanceHolder(91119, 5, 1), // Ignis' Necklace
|
||||
new ItemChanceHolder(91117, 5, 1), // Nebula's Necklace
|
||||
new ItemChanceHolder(91121, 5, 1), // Procella's Necklace
|
||||
new ItemChanceHolder(91123, 5, 1), // Petram's Necklace
|
||||
new ItemChanceHolder(91952, 5, 1), // Ring of Insolance
|
||||
new ItemChanceHolder(91953, 5, 1), // Dragon Valley's Earring
|
||||
new ItemChanceHolder(91035, 15, 1), // Water Spirit Ore
|
||||
new ItemChanceHolder(91036, 15, 1), // Fire Spirit Ore
|
||||
new ItemChanceHolder(91037, 15, 1), // Wind Spirit Ore
|
||||
new ItemChanceHolder(91038, 15, 1), // Earth Spirit Ore
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] DEATH_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(91012, 5, 1), // Top-grade A-grade Weapon Pack
|
||||
new ItemChanceHolder(93459, 5, 1), // A-grade Armor Pack - Majestic Equipment
|
||||
new ItemChanceHolder(93460, 5, 1), // A-grade Armor Pack - Equipment of Nightmare
|
||||
new ItemChanceHolder(93461, 5, 1), // A-grade Armor Pack - Tallum Equipment
|
||||
new ItemChanceHolder(93462, 5, 1), // A-grade Armor Pack - Dark Crystal Equipment
|
||||
new ItemChanceHolder(90015, 15, 1), // Top-grade Life Stone - Weapon
|
||||
new ItemChanceHolder(93100, 15, 1), // Mid-grade Life Stone Shield / Sigil
|
||||
new ItemChanceHolder(91938, 15, 1), // Primeval Isle's Time Stone
|
||||
new ItemChanceHolder(93699, 15, 1), // Charging Stone of Random Crafting - 1 charge
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] KNIGHT_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(93103, 5, 1), // Spellbook: Divine Beam
|
||||
new ItemChanceHolder(92401, 5, 1), // Spellbook: White Guardian
|
||||
new ItemChanceHolder(91945, 5, 1), // Book of Shadows
|
||||
new ItemChanceHolder(91944, 5, 1), // Book of Light
|
||||
new ItemChanceHolder(91943, 15, 1), // Crystal of Shadows
|
||||
new ItemChanceHolder(91942, 15, 1), // Crystal of Light
|
||||
new ItemChanceHolder(8619, 15, 1), // Buff Expansion Book Lv. 2
|
||||
new ItemChanceHolder(8620, 15, 1), // Buff Expansion Book Lv. 3
|
||||
new ItemChanceHolder(90045, 15, 1), // Magical Tablet
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] SUMMER_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(93976, 5, 1), // Blessed Scroll: Enchant A-grade Weapon
|
||||
new ItemChanceHolder(93977, 5, 1), // Blessed Scroll: Enchant A-grade Armor
|
||||
new ItemChanceHolder(729, 5, 1), // Scroll: Enchant A-grade Weapon
|
||||
new ItemChanceHolder(730, 5, 1), // Scroll: Enchant A-grade Armor
|
||||
new ItemChanceHolder(947, 15, 1), // Scroll: Enchant B-grade Weapon
|
||||
new ItemChanceHolder(948, 15, 1), // Scroll: Enchant B-grade Armor
|
||||
new ItemChanceHolder(91967, 15, 1), // Scroll: Enchant Dragon Valley's Earring
|
||||
new ItemChanceHolder(91966, 15, 1), // Scroll: Enchant Ring of Insolance
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(91780, 30, 1), // Battle Scroll
|
||||
new ItemChanceHolder(93486, 30, 1), // Combat Scroll
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(1538, 30, 1), // Improved Scroll of Escape
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
|
||||
private int _wordId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_wordId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final PlayerInstance player = client.getPlayer();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInventory inventory = player.getInventory();
|
||||
if (inventory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_wordId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(L, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(II, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", L, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", II, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(LINEAGE_II_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(D, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(T, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", D, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(DEATH_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(K, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(T, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", K, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(KNIGHT_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(S, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(U, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(M, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(R, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", S, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", U, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", M, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", M, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", R, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(SUMMER_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ItemChanceHolder getRandomReward(ItemChanceHolder[] rewards)
|
||||
{
|
||||
ItemChanceHolder reward = null;
|
||||
while (reward == null)
|
||||
{
|
||||
final ItemChanceHolder random = rewards[Rnd.get(rewards.length)];
|
||||
if ((Rnd.get(100) < random.getChance()) && (ItemTable.getInstance().getTemplate(random.getId()) != null))
|
||||
{
|
||||
reward = random;
|
||||
}
|
||||
}
|
||||
return reward;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class ExLetterCollectorUI implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExLetterCollectorUI STATIC_PACKET = new ExLetterCollectorUI();
|
||||
|
||||
private static final int LETTER_COLLECTOR_MIN_LEVEL = 5;
|
||||
|
||||
private ExLetterCollectorUI()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_LETTER_COLLECTOR_UI_LAUNCHER.writeId(packet);
|
||||
packet.writeC(0x01); // enabled (0x00 - no, 0x01 -yes)
|
||||
packet.writeD(LETTER_COLLECTOR_MIN_LEVEL); // Minimum Level
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm glad to see you, adventurer!<br>
|
||||
Do you want to claim reward for collecting the words <font color="LEVEL">LINEAGE II</font>, <font color="LEVEL">MEMORIES</font>, or <font color="LEVEL">CHRONICLE</font>?<br>
|
||||
You can make these words from the letters you get while hunting the monsters in Lineage II world.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector lineage">"I have all of the letters of LINEAGE II!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector memories">"I have all of the letters of MEMORIES!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector chronicle">"I have all of the letters of CHRONICLE!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector 9000-2.htm">"I'd like to exchange my letters for other ones."</Button>
|
||||
</body></html>
|
@ -1,17 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I can exchange <font color="LEVEL">two of your letters</font> for <font color="LEVEL">one</font> of random letters. In case with the rare S, H and the number II, you'll will need only one item for exchange. Press the button below when're you ready!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeA">"I want to exchange two of my letters A for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeC">"I want to exchange two of my letters C for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeE">"I want to exchange two of my letters E for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeG">"I want to exchange two of my letters G for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeI">"I want to exchange two of my letters I for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeL">"I want to exchange two of my letters L for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeM">"I want to exchange two of my letters M for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeN">"I want to exchange two of my letters N for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeO">"I want to exchange two of my letters O for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeL">"I want to exchange two of my letters R for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeH">"I want to exchange one of my letters H for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeS">"I want to exchange one of my letters S for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LetterCollector exchangeII">"I want to exchange one of my letters II for another random one."</Button>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -16,346 +16,42 @@
|
||||
*/
|
||||
package events.LetterCollector;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.quest.LongTimeEvent;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExLetterCollectorUI;
|
||||
|
||||
/**
|
||||
* Event: Letter Collector
|
||||
* @URL https://eu.4gameforum.com/threads/648400/
|
||||
* @author Mobius, Gigi, Adapted for Classic by QuangNguyen
|
||||
* @author Mobius
|
||||
*/
|
||||
public class LetterCollector extends LongTimeEvent
|
||||
{
|
||||
// NPC
|
||||
private static final int ROSALIA = 9000;
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int C = 3876;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
private static final int I = 3881;
|
||||
private static final int L = 3882;
|
||||
private static final int N = 3883;
|
||||
private static final int R = 3885;
|
||||
private static final int M = 34956;
|
||||
private static final int O = 3884;
|
||||
private static final int S = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
// Exchange Letters
|
||||
private static final int[] LETTERS =
|
||||
{
|
||||
A,
|
||||
C,
|
||||
E,
|
||||
G,
|
||||
I,
|
||||
L,
|
||||
N,
|
||||
R,
|
||||
M,
|
||||
O,
|
||||
S,
|
||||
H,
|
||||
II
|
||||
};
|
||||
// Reward
|
||||
private static final int LINEAGEII = 29581;
|
||||
private static final int MEMMORIES = 29583;
|
||||
private static final int CHRONICLE = 29582;
|
||||
|
||||
private LetterCollector()
|
||||
{
|
||||
addStartNpc(ROSALIA);
|
||||
addFirstTalkId(ROSALIA);
|
||||
addTalkId(ROSALIA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onPlayerLogin(OnPlayerLogin event)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
if (!isEventPeriod())
|
||||
{
|
||||
case "9000-1.htm":
|
||||
case "9000-2.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "lineage":
|
||||
{
|
||||
if ((getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, A) >= 1) && //
|
||||
(getQuestItemsCount(player, G) >= 1) && //
|
||||
(getQuestItemsCount(player, II) >= 1))
|
||||
{
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, A, 1);
|
||||
takeItems(player, G, 1);
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, LINEAGEII, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "memories":
|
||||
{
|
||||
if ((getQuestItemsCount(player, M) >= 2) && //
|
||||
(getQuestItemsCount(player, E) >= 2) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, S) >= 1))
|
||||
{
|
||||
takeItems(player, M, 2);
|
||||
takeItems(player, E, 2);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, R, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, S, 1);
|
||||
giveItems(player, MEMMORIES, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "chronicle":
|
||||
{
|
||||
if ((getQuestItemsCount(player, C) >= 2) && //
|
||||
(getQuestItemsCount(player, H) >= 1) && //
|
||||
(getQuestItemsCount(player, R) >= 1) && //
|
||||
(getQuestItemsCount(player, O) >= 1) && //
|
||||
(getQuestItemsCount(player, N) >= 1) && //
|
||||
(getQuestItemsCount(player, I) >= 1) && //
|
||||
(getQuestItemsCount(player, L) >= 1) && //
|
||||
(getQuestItemsCount(player, E) >= 1))
|
||||
{
|
||||
takeItems(player, C, 2);
|
||||
takeItems(player, H, 1);
|
||||
takeItems(player, R, 1);
|
||||
takeItems(player, O, 1);
|
||||
takeItems(player, N, 1);
|
||||
takeItems(player, I, 1);
|
||||
takeItems(player, L, 1);
|
||||
takeItems(player, E, 1);
|
||||
giveItems(player, CHRONICLE, 1);
|
||||
htmltext = "9000-1.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItem.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeA":
|
||||
{
|
||||
if (getQuestItemsCount(player, A) >= 2)
|
||||
{
|
||||
takeItems(player, A, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeC":
|
||||
{
|
||||
if (getQuestItemsCount(player, C) >= 2)
|
||||
{
|
||||
takeItems(player, C, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeE":
|
||||
{
|
||||
if (getQuestItemsCount(player, E) >= 2)
|
||||
{
|
||||
takeItems(player, E, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeG":
|
||||
{
|
||||
if (getQuestItemsCount(player, G) >= 2)
|
||||
{
|
||||
takeItems(player, G, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeI":
|
||||
{
|
||||
if (getQuestItemsCount(player, I) >= 2)
|
||||
{
|
||||
takeItems(player, I, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeL":
|
||||
{
|
||||
if (getQuestItemsCount(player, L) >= 2)
|
||||
{
|
||||
takeItems(player, L, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeM":
|
||||
{
|
||||
if (getQuestItemsCount(player, M) >= 2)
|
||||
{
|
||||
takeItems(player, M, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeN":
|
||||
{
|
||||
if (getQuestItemsCount(player, N) >= 2)
|
||||
{
|
||||
takeItems(player, N, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeO":
|
||||
{
|
||||
if (getQuestItemsCount(player, O) >= 2)
|
||||
{
|
||||
takeItems(player, O, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeR":
|
||||
{
|
||||
if (getQuestItemsCount(player, R) >= 2)
|
||||
{
|
||||
takeItems(player, R, 2);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeH":
|
||||
{
|
||||
if (getQuestItemsCount(player, H) >= 1)
|
||||
{
|
||||
takeItems(player, H, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeS":
|
||||
{
|
||||
if (getQuestItemsCount(player, S) >= 1)
|
||||
{
|
||||
takeItems(player, S, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "exchangeII":
|
||||
{
|
||||
if (getQuestItemsCount(player, II) >= 1)
|
||||
{
|
||||
takeItems(player, II, 1);
|
||||
giveItems(player, getRandomEntry(LETTERS), 1);
|
||||
htmltext = "9000-2.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "noItemExchange.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInstance player = event.getPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(ExLetterCollectorUI.STATIC_PACKET);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return npc.getId() + "-1.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new LetterCollector();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,37 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<event name="Looking for right words" active="08 03 2017-09 03 2018" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<event name="Letter Collector" active="30 06 2021-29 07 2021" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
|
||||
<!-- Minimum level (5) also set at ExLetterCollectorUI.java -->
|
||||
<!-- Rewards and items set at ExLetterCollectorTakeReward.java -->
|
||||
<droplist>
|
||||
<add item="3875" min="1" max="1" chance="3%" /> <!-- Letter Collector's A -->
|
||||
<add item="3876" min="1" max="1" chance="3%" /> <!-- Letter Collector's C -->
|
||||
<add item="3877" min="1" max="1" chance="3%" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="3%" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="3%" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="3%" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="3%" /> <!-- Letter Collector's N -->
|
||||
<add item="3885" min="1" max="1" chance="3%" /> <!-- Letter Collector's R -->
|
||||
<add item="34956" min="1" max="1" chance="3%" /> <!-- Letter Collector's M -->
|
||||
<add item="3884" min="1" max="1" chance="3%" /> <!-- Letter Collector's O -->
|
||||
<add item="3886" min="1" max="1" chance="3%" /> <!-- Letter Collector's S -->
|
||||
<add item="3880" min="1" max="1" chance="3%" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="3%" /> <!-- Letter Collector's II -->
|
||||
<add item="3875" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's A -->
|
||||
<add item="3877" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's E -->
|
||||
<add item="3879" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's G -->
|
||||
<add item="3881" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's I -->
|
||||
<add item="3882" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's L -->
|
||||
<add item="3883" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's N -->
|
||||
<add item="3885" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's R -->
|
||||
<add item="34956" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's M -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's S -->
|
||||
<add item="3886" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's T -->
|
||||
<add item="3880" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's H -->
|
||||
<add item="3888" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's II -->
|
||||
<add item="92021" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's D -->
|
||||
<add item="93412" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's K -->
|
||||
<add item="93413" min="1" max="1" chance="1%" minLevel="5" /> <!-- Letter Collector's U -->
|
||||
</droplist>
|
||||
<spawnlist>
|
||||
<add npc="9000" x="-84008" y="243032" z="-3728" heading="49744" /> <!-- Talking Island -->
|
||||
<add npc="9000" x="45688" y="49080" z="-3056" heading="49744" /> <!-- Elven Village -->
|
||||
<add npc="9000" x="-44584" y="-113608" z="-192" heading="49744" /> <!-- Orc Village -->
|
||||
<add npc="9000" x="10643" y="17034" z="-4592" heading="49744" /> <!-- Dark Elven Village -->
|
||||
<add npc="9000" x="115656" y="-178056" z="-912" heading="49744" /> <!-- Dwarf Village -->
|
||||
<add npc="9000" x="-80485" y="149537" z="-3016" heading="16383" /> <!-- Gluddin -->
|
||||
<add npc="9000" x="-14143" y="123176" z="-3096" heading="30212" /> <!-- Gludio -->
|
||||
<add npc="9000" x="16354" y="142848" z="-2680" heading="14450" /> <!-- Dion -->
|
||||
<add npc="9000" x="82312" y="148616" z="-3440" heading="3355" /> <!-- Giran -->
|
||||
<add npc="9000" x="82008" y="53874" z="-1472" heading="3355" /> <!-- Oren -->
|
||||
<add npc="9000" x="147064" y="25928" z="-2008" heading="17863" /> <!-- Aden -->
|
||||
<add npc="9000" x="117380" y="76684" z="-2672" heading="40961" /> <!-- Hunters Village -->
|
||||
<add npc="9000" x="147464" y="-56984" z="-2784" heading="11547" /> <!-- Goddard -->
|
||||
</spawnlist>
|
||||
<messages>
|
||||
<add type="onEnd" text="Looking for right words: Event end!" />
|
||||
<add type="onEnter" text="Looking for right words: Event ongoing!" />
|
||||
<add type="onEnd" text="Letter Collector: Event end!" />
|
||||
<add type="onEnter" text="Letter Collector: Event ongoing!" />
|
||||
</messages>
|
||||
</event>
|
@ -1,4 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm sorry, but you'll need more letters to play.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -1,4 +0,0 @@
|
||||
<html><body>Letter Collector Rosalia:<br>
|
||||
I'm sorry, but you do not have enough letters to exchange!.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest LetterCollector 9000-1.htm">Back</Button>
|
||||
</body></html>
|
@ -567,7 +567,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
||||
EX_PVP_BOOK_LIST(0x18D, ExPvpBookList::new, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_KILLER_LOCATION(0x18E, null, ConnectionState.IN_GAME),
|
||||
EX_PVPBOOK_TELEPORT_TO_KILLER(0x18F, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, null, ConnectionState.IN_GAME),
|
||||
EX_LETTER_COLLECTOR_TAKE_REWARD(0x190, ExLetterCollectorTakeReward::new, ConnectionState.IN_GAME),
|
||||
EX_SET_STATUS_BONUS(0x191, ExSetStatusBonus::new, ConnectionState.IN_GAME),
|
||||
EX_RESET_STATUS_BONUS(0x192, ExResetStatusBonus::new, ConnectionState.IN_GAME),
|
||||
EX_OLYMPIAD_MY_RANKING_INFO(0x193, RequestOlympiadMyRankingInfo::new, ConnectionState.IN_GAME),
|
||||
|
@ -0,0 +1,257 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerInventory;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
/**
|
||||
* @author Index, Mobius
|
||||
*/
|
||||
public class ExLetterCollectorTakeReward implements IClientIncomingPacket
|
||||
{
|
||||
// Items
|
||||
private static final int A = 3875;
|
||||
private static final int E = 3877;
|
||||
private static final int G = 3879;
|
||||
private static final int I = 3881;
|
||||
private static final int L = 3882;
|
||||
private static final int N = 3883;
|
||||
private static final int R = 3885;
|
||||
private static final int M = 34956;
|
||||
private static final int S = 3886;
|
||||
private static final int T = 3886;
|
||||
private static final int H = 3880;
|
||||
private static final int II = 3888;
|
||||
private static final int D = 92021;
|
||||
private static final int K = 93412;
|
||||
private static final int U = 93413;
|
||||
|
||||
// Rewards
|
||||
private static final ItemChanceHolder[] LINEAGE_II_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(49683, 5, 1), // Talisman of Baium
|
||||
new ItemChanceHolder(91119, 5, 1), // Ignis' Necklace
|
||||
new ItemChanceHolder(91117, 5, 1), // Nebula's Necklace
|
||||
new ItemChanceHolder(91121, 5, 1), // Procella's Necklace
|
||||
new ItemChanceHolder(91123, 5, 1), // Petram's Necklace
|
||||
new ItemChanceHolder(91952, 5, 1), // Ring of Insolance
|
||||
new ItemChanceHolder(91953, 5, 1), // Dragon Valley's Earring
|
||||
new ItemChanceHolder(91035, 15, 1), // Water Spirit Ore
|
||||
new ItemChanceHolder(91036, 15, 1), // Fire Spirit Ore
|
||||
new ItemChanceHolder(91037, 15, 1), // Wind Spirit Ore
|
||||
new ItemChanceHolder(91038, 15, 1), // Earth Spirit Ore
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] DEATH_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(91012, 5, 1), // Top-grade A-grade Weapon Pack
|
||||
new ItemChanceHolder(93459, 5, 1), // A-grade Armor Pack - Majestic Equipment
|
||||
new ItemChanceHolder(93460, 5, 1), // A-grade Armor Pack - Equipment of Nightmare
|
||||
new ItemChanceHolder(93461, 5, 1), // A-grade Armor Pack - Tallum Equipment
|
||||
new ItemChanceHolder(93462, 5, 1), // A-grade Armor Pack - Dark Crystal Equipment
|
||||
new ItemChanceHolder(90015, 15, 1), // Top-grade Life Stone - Weapon
|
||||
new ItemChanceHolder(93100, 15, 1), // Mid-grade Life Stone Shield / Sigil
|
||||
new ItemChanceHolder(91938, 15, 1), // Primeval Isle's Time Stone
|
||||
new ItemChanceHolder(93699, 15, 1), // Charging Stone of Random Crafting - 1 charge
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] KNIGHT_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(93103, 5, 1), // Spellbook: Divine Beam
|
||||
new ItemChanceHolder(92401, 5, 1), // Spellbook: White Guardian
|
||||
new ItemChanceHolder(91945, 5, 1), // Book of Shadows
|
||||
new ItemChanceHolder(91944, 5, 1), // Book of Light
|
||||
new ItemChanceHolder(91943, 15, 1), // Crystal of Shadows
|
||||
new ItemChanceHolder(91942, 15, 1), // Crystal of Light
|
||||
new ItemChanceHolder(8619, 15, 1), // Buff Expansion Book Lv. 2
|
||||
new ItemChanceHolder(8620, 15, 1), // Buff Expansion Book Lv. 3
|
||||
new ItemChanceHolder(90045, 15, 1), // Magical Tablet
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
private static final ItemChanceHolder[] SUMMER_REWARDS =
|
||||
{
|
||||
new ItemChanceHolder(93976, 5, 1), // Blessed Scroll: Enchant A-grade Weapon
|
||||
new ItemChanceHolder(93977, 5, 1), // Blessed Scroll: Enchant A-grade Armor
|
||||
new ItemChanceHolder(729, 5, 1), // Scroll: Enchant A-grade Weapon
|
||||
new ItemChanceHolder(730, 5, 1), // Scroll: Enchant A-grade Armor
|
||||
new ItemChanceHolder(947, 15, 1), // Scroll: Enchant B-grade Weapon
|
||||
new ItemChanceHolder(948, 15, 1), // Scroll: Enchant B-grade Armor
|
||||
new ItemChanceHolder(91967, 15, 1), // Scroll: Enchant Dragon Valley's Earring
|
||||
new ItemChanceHolder(91966, 15, 1), // Scroll: Enchant Ring of Insolance
|
||||
new ItemChanceHolder(91641, 30, 1), // Sayha's Blessing
|
||||
new ItemChanceHolder(91780, 30, 1), // Battle Scroll
|
||||
new ItemChanceHolder(93486, 30, 1), // Combat Scroll
|
||||
new ItemChanceHolder(49674, 30, 1), // XP Growth Scroll
|
||||
new ItemChanceHolder(90907, 30, 5), // Soulshot Ticket
|
||||
new ItemChanceHolder(1538, 30, 1), // Improved Scroll of Escape
|
||||
new ItemChanceHolder(91757, 30, 1), // Magic Lamp Charging Potion
|
||||
new ItemChanceHolder(91974, 30, 10), // HP Recovery Potion
|
||||
new ItemChanceHolder(3031, 30, 10), // Spirit Ore
|
||||
};
|
||||
|
||||
private int _wordId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_wordId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final PlayerInstance player = client.getPlayer();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final PlayerInventory inventory = player.getInventory();
|
||||
if (inventory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_wordId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(L, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(II, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", L, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", II, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(LINEAGE_II_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(D, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(A, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(T, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", D, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", A, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(DEATH_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(K, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(N, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(I, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(G, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(H, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(T, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", K, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", N, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", I, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", G, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", H, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", T, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(KNIGHT_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if ((inventory.getInventoryItemCount(S, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(U, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(M, -1) < 2) || //
|
||||
(inventory.getInventoryItemCount(E, -1) < 1) || //
|
||||
(inventory.getInventoryItemCount(R, -1) < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroyItemByItemId("LetterCollector", S, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", U, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", M, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", M, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", E, 1, player, true);
|
||||
player.destroyItemByItemId("LetterCollector", R, 1, player, true);
|
||||
|
||||
player.addItem("LetterCollector", getRandomReward(SUMMER_REWARDS), player, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ItemChanceHolder getRandomReward(ItemChanceHolder[] rewards)
|
||||
{
|
||||
ItemChanceHolder reward = null;
|
||||
while (reward == null)
|
||||
{
|
||||
final ItemChanceHolder random = rewards[Rnd.get(rewards.length)];
|
||||
if ((Rnd.get(100) < random.getChance()) && (ItemTable.getInstance().getTemplate(random.getId()) != null))
|
||||
{
|
||||
reward = random;
|
||||
}
|
||||
}
|
||||
return reward;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class ExLetterCollectorUI implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExLetterCollectorUI STATIC_PACKET = new ExLetterCollectorUI();
|
||||
|
||||
private static final int LETTER_COLLECTOR_MIN_LEVEL = 5;
|
||||
|
||||
private ExLetterCollectorUI()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_LETTER_COLLECTOR_UI_LAUNCHER.writeId(packet);
|
||||
packet.writeC(0x01); // enabled (0x00 - no, 0x01 -yes)
|
||||
packet.writeD(LETTER_COLLECTOR_MIN_LEVEL); // Minimum Level
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user