This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<html><body>Alegria:<br>
Oh really?!<br>
Well, I'm already taken. But I'm flattered that you would think so highly of me.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Alegria:<br>
Oh, no! You don't have the hat with you.<br>
You should've checked to see if the Explorer Hat (event) was in your inventory! Can't exchange if you don't have it!
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Alegria:<br>
Once you exchange your Explorer Hat, you will not be able to receive it again. Are you ok with that?<br>
Your Birthday Hat is so pretty, which is why I'm worried that this might be a mistake on your part.<br>
<a action="bypass -h Quest CharacterBirthday change">"My mind's made"</a><br>
<a action="bypass -h npc_%objectId%_Chat 0">"Hmm. Maybe you're right." (Back)</a>
</body></html>

View File

@@ -0,0 +1,131 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package events.CharacterBirthday;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
import com.l2jserver.gameserver.util.Util;
/**
* Character Birthday event AI.<br>
* Updated to H5 by Nyaran.
* @author Gnacik
*/
public final class CharacterBirthday extends Quest
{
private static final int ALEGRIA = 32600;
private static int SPAWNS = 0;
private final static int[] GK =
{
30006,
30059,
30080,
30134,
30146,
30177,
30233,
30256,
30320,
30540,
30576,
30836,
30848,
30878,
30899,
31275,
31320,
31964,
32163
};
private CharacterBirthday()
{
super(-1, CharacterBirthday.class.getSimpleName(), "events");
addStartNpc(ALEGRIA);
addStartNpc(GK);
addTalkId(ALEGRIA);
addTalkId(GK);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
QuestState st = getQuestState(player, false);
if (event.equalsIgnoreCase("despawn_npc"))
{
npc.doDie(player);
SPAWNS--;
htmltext = null;
}
else if (event.equalsIgnoreCase("change"))
{
// Change Hat
if (st.hasQuestItems(10250))
{
st.takeItems(10250, 1); // Adventurer Hat (Event)
st.giveItems(21594, 1); // Birthday Hat
htmltext = null; // FIXME: Probably has html
// Despawn npc
npc.doDie(player);
SPAWNS--;
}
else
{
htmltext = "32600-nohat.htm";
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
if (SPAWNS >= 3)
{
return "busy.htm";
}
QuestState st = getQuestState(player, true);
if (!Util.checkIfInRange(10, npc, player, true))
{
L2Npc spawned = st.addSpawn(32600, player.getX() + 10, player.getY() + 10, player.getZ() + 10, 0, false, 0, true);
st.setState(State.STARTED);
st.startQuestTimer("despawn_npc", 180000, spawned);
SPAWNS++;
}
else
{
return "tooclose.htm";
}
return null;
}
public static void main(String[] args)
{
new CharacterBirthday();
}
}

View File

@@ -0,0 +1,3 @@
<html><body>
Alegria is very busy now. Try again later.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Gatekeeper:<br>
Alegria, the Creation Day Helper, cannot be summoned as you are too close.<br1>
Please move back a little bit and try again.
</body></html>