Updated Letter Collector event.
Thanks to Index.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user