actual freya branch
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<html><body>Alegria:<br>
|
||||
Oh! I don't know. What now? I'm a bit out of my depth here.<br>
|
||||
If you like me, let's get to know each other. Who knows, maybe we'll be able to spend more time together someday. Infortunately, I've got to run now. See you soon!
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>
|
||||
Hold on there, buddy. You can't receive a gift unless today's date is your actual birthday.<br>
|
||||
If you're not sure what day your birthday falls on, try using the <font color="LEVEL">/mybirthday</font> command.<br>
|
||||
Come back and see me on the yearly anniversary of your creation day, and we will celebrate like there's no tomorrow!
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Alegria:<br>
|
||||
I hope these gifts will make this birthday one you'll never forget!<br>
|
||||
<font color="LEVEL">Good bye! See you next year...</font>
|
||||
</body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>Alegria:<br>
|
||||
Howdy-hi, adventurer!!<br>
|
||||
The word around town is that you're celebrating your birthday today. Hooray!<br>
|
||||
As a reward for all the time you've spent in this fair land, I'm here to present you with your official birthday gift. For every year of loyalty and dedication you have shown, I will reward you with <font color="LEVEL">one birthday celebration item and a 12-hour vitality replenishing buff</font>. However, you'll want to remember that if you are killed during the next 12 hours, your birthday buff will be gone for good. Or at least until next year.<br>
|
||||
In addition, <font color="LEVEL">if you switch to a subclass while the buff is still active</font>, you will also lose the buff. So make sure you are on your preferred class before you receive the buff.<br>
|
||||
I don't mean to be rude, but I've got other people to see, so I can't stay and chat all day. To receive your gifts, please click on the link below.<br><br><br>
|
||||
<a action="bypass -h Quest CharacterBirthday receive_reward">Receive your birthday gifts.</a><br>
|
||||
<a action="bypass -h Quest CharacterBirthday 32600-1.htm">Wait! I want to talk to you some more</a>
|
||||
</body></html>
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package events.CharacterBirthday;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
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.network.serverpackets.MagicSkillUse;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
|
||||
/**
|
||||
* @author Gnacik
|
||||
*
|
||||
*/
|
||||
|
||||
public class CharacterBirthday extends Quest
|
||||
{
|
||||
private static final int _npc = 32600;
|
||||
private static boolean is_spawned = false;
|
||||
|
||||
private final static int[] _gk =
|
||||
{
|
||||
30006,30059,30080,30134,30146,30177,30233,30256,30320,30540,
|
||||
30576,30836,30848,30878,30899,31275,31320,31964,32163
|
||||
};
|
||||
|
||||
public CharacterBirthday(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addStartNpc(_npc);
|
||||
addFirstTalkId(_npc);
|
||||
addTalkId(_npc);
|
||||
for (int id : _gk)
|
||||
{
|
||||
addStartNpc(id);
|
||||
addTalkId(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
htmltext = event;
|
||||
|
||||
if (event.equalsIgnoreCase("despawn_npc"))
|
||||
{
|
||||
npc.doDie(player);
|
||||
is_spawned = false;
|
||||
|
||||
htmltext = null;
|
||||
}
|
||||
if (event.equalsIgnoreCase("receive_reward"))
|
||||
{
|
||||
// Give Adventurer Hat (Event)
|
||||
st.giveItems(10250, 1);
|
||||
|
||||
// Give Buff
|
||||
L2Skill skill;
|
||||
skill = SkillTable.getInstance().getInfo(5950, 1);
|
||||
if (skill != null)
|
||||
skill.getEffects(npc, player);
|
||||
npc.setTarget(player);
|
||||
npc.broadcastPacket(new MagicSkillUse(player, 5950, 1, 1000, 0));
|
||||
|
||||
// Despawn npc
|
||||
npc.doDie(player);
|
||||
is_spawned = false;
|
||||
|
||||
// Update for next year
|
||||
Calendar now = Calendar.getInstance();
|
||||
now.setTimeInMillis(System.currentTimeMillis());
|
||||
st.set("Birthday", String.valueOf(now.get(Calendar.YEAR)+1));
|
||||
|
||||
htmltext = "32600-ok.htm";
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if(is_spawned)
|
||||
return null;
|
||||
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
if (st != null && player.checkBirthDay() == 0)
|
||||
{
|
||||
player.sendPacket(new PlaySound(1, "HB01", 0, 0, 0, 0, 0));
|
||||
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", 60000, spawned);
|
||||
is_spawned = true;
|
||||
}
|
||||
else
|
||||
return "32600-no.htm";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
if (player.checkBirthDay() == 0)
|
||||
htmltext = "32600.htm";
|
||||
else
|
||||
htmltext = "32600-no.htm";
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new CharacterBirthday(-1, "CharacterBirthday", "events");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>
|
||||
These warm spring sunrays feel strange to me undoubtedly because I'm used to the frozen eternal winter of the Ice Palace. I fear they may be causing some equally strange thoughts, as I'm feeling rather generous right now.<br>
|
||||
Give me one Adena and I shall bestow a gift upon you for visiting me.<br>
|
||||
However, if you don't intend to bother me, leave me alone a while, say... 20 hours, so that I might enjoy this change of weather.<br>
|
||||
Oh and also, should you find any heart-warming items during your adventures, bring them back to me and I might feel even more generous...<br><br>
|
||||
<a action="bypass -h Quest FreyaCelebration give_potion">Give one Adena to Freya.</a><br>
|
||||
</body>
|
||||
</html>
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package events.FreyaCelebration;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
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.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
** @author Gnacik
|
||||
**
|
||||
** Retail Event : 'Freya Celebration'
|
||||
*/
|
||||
public class FreyaCelebration extends Quest
|
||||
{
|
||||
private static final int _freya = 13296;
|
||||
private static final int _freya_potion = 15440;
|
||||
private static final int _freya_gift = 17138;
|
||||
private static final int _hours = 20;
|
||||
|
||||
private static final int[] _skills = { 9150, 9151, 9152, 9153, 9154, 9155, 9156 };
|
||||
|
||||
private static final String[] _freya_texts =
|
||||
{
|
||||
"It has been so long since I have felt this... I almost miss it.",
|
||||
"I have no idea what I'm feeling right now. Are all human emotions like this?",
|
||||
"You humans bring me such nonsense... a gift. I have no need of such things.",
|
||||
"I would 'appreciate' this, however it has been far too long since I have felt appreciation for anything.",
|
||||
" I am Freya the Ice Queen! Feelings and emotions of Felicia are nothing but memories to me."
|
||||
};
|
||||
|
||||
private static final int[][] _spawns = {
|
||||
{ -119494, 44882, 360, 24576 },
|
||||
{ -117239, 46842, 360, 49151 },
|
||||
{ -84023, 243051, -3728, 4096 },
|
||||
{ -84411, 244813, -3728, 57343 },
|
||||
{ 46908, 50856, -2992, 8192 },
|
||||
{ 45538, 48357, -3056, 18000 },
|
||||
{ -45372, -114104, -240, 16384 },
|
||||
{ -45278, -112766, -240, 0 },
|
||||
{ 9929, 16324, -4568, 62999 },
|
||||
{ 11546, 17599, -4584, 46900 },
|
||||
{ 115096, -178370, -880, 0 },
|
||||
{ -13727, 122117, -2984, 16384 },
|
||||
{ -14129, 123869, -3112, 40959 },
|
||||
{ -83156, 150994, -3120, 0 },
|
||||
{ -81031, 150038, -3040, 0 },
|
||||
{ 16111, 142850, -2696, 16000 },
|
||||
{ 17275, 145000, -3032, 25000 },
|
||||
{ 111004, 218928, -3536, 16384 },
|
||||
{ 81755, 146487, -3528, 32768 },
|
||||
{ 82145, 148609, -3464, 0 },
|
||||
{ 83037, 149324, -3464, 44000 },
|
||||
{ 81987, 53723, -1488, 0 },
|
||||
{ 147200, 25614, -2008, 16384 },
|
||||
{ 148557, 26806, -2200, 32768 },
|
||||
{ 147421, -55435, -2728, 49151 },
|
||||
{ 148206, -55786, -2776, 61439 },
|
||||
{ 85584, -142490, -1336, 0 },
|
||||
{ 86865, -142915, -1336, 26000 },
|
||||
{ 43966, -47709, -792, 49999 },
|
||||
{ 43165, -48461, -792, 17000 }
|
||||
};
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
if (st == null || q == null)
|
||||
return null;
|
||||
|
||||
if (event.equalsIgnoreCase("give_potion"))
|
||||
{
|
||||
if (st.getQuestItemsCount(57) > 1)
|
||||
{
|
||||
long _curr_time = System.currentTimeMillis();
|
||||
String value = q.loadGlobalQuestVar(player.getAccountName());
|
||||
long _reuse_time = value == "" ? 0 : Long.parseLong(value);
|
||||
|
||||
if (_curr_time > _reuse_time)
|
||||
{
|
||||
st.setState(State.STARTED);
|
||||
st.takeItems(57, 1);
|
||||
st.giveItems(_freya_potion, 1);
|
||||
q.saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (_hours * 3600000)));
|
||||
}
|
||||
else
|
||||
{
|
||||
long remainingTime = (_reuse_time - System.currentTimeMillis()) / 1000;
|
||||
int hours = (int) (remainingTime / 3600);
|
||||
int minutes = (int) ((remainingTime % 3600) / 60);
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES);
|
||||
sm.addItemName(_freya_potion);
|
||||
sm.addNumber(hours);
|
||||
sm.addNumber(minutes);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_UNIT_OF_THE_ITEM_S1_REQUIRED);
|
||||
sm.addItemName(57);
|
||||
sm.addNumber(1);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if ((caster == null) || (npc == null))
|
||||
return null;
|
||||
|
||||
if ((npc.getNpcId() == _freya) && Util.contains(targets, npc) && Util.contains(_skills, skill.getId()))
|
||||
{
|
||||
if (Rnd.get(100) < 5)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), "Dear " + caster.getName() + "... I want to express my appreciation for the gift. Take this with you. Why are you shocked? I'm a very generous person."));
|
||||
caster.addItem("FreyaCelebration", _freya_gift, 1, npc, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Rnd.get(10) < 2)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), _freya_texts[Rnd.get(_freya_texts.length - 1)]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
return "13296.htm";
|
||||
}
|
||||
|
||||
public FreyaCelebration(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
addStartNpc(_freya);
|
||||
addFirstTalkId(_freya);
|
||||
addTalkId(_freya);
|
||||
addSkillSeeId(_freya);
|
||||
for (int[] _spawn : _spawns)
|
||||
{
|
||||
addSpawn(_freya, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FreyaCelebration(-1, "FreyaCelebration", "events");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
The Memories of a Newbie provides the "Newbie Support buffs", which can be received up to level 75, to veteran adventurers of level 76 or more.<br>
|
||||
This is an additional gift given by the Temple, so that all of you can focus on training. This is a small reward to all the great adventurers who fought on the front lines when our world was in danger. Please note that it will only be available <font color="LEVEL">during the time I'm dispatched</font>.<br><br>
|
||||
You will receive the following buffs:<br><br>
|
||||
Warrior: Wind Walk, Shield, Magic Barrier, Bless the Body, Vampiric Rage, Regeneration, Haste.<br>
|
||||
Mage: Wind Walk, Shield, Magic Barrier, Bless the Soul, Acumen, Concentration, Empower.<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality memories_player">Receive the Memories of a Newbie.</a><br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
The Memories of a Newbie for summons provides the "Newbie Support buffs", which can be received up to level 75, to the veteran adventurers' summons of level 76 or more.<br>
|
||||
This is an additional gift given by the Temple, so that all of you can focus on training. This is a small reward to all the great adventurers who fought on the front lines when our world was in danger. Please note that it will only be available <font color="LEVEL">during the time I'm dispatched</font>.<br><br>
|
||||
Your summon will receive the following buffs (these buffs do not apply to pets):<br><br>
|
||||
Wind Walk, Shield, Magic Barrier, Bless the Body, Bless the Soul, Vampiric Rage, Acumen, Regeneration, Concentration, Haste, and Empower.<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality memories_summon">Receive the Memories of a Newbie for summons.</a><br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
The Oracle said that the great danger coming from the Frozen Labyrinth in the Schuttgart territory will affect the whole world. Since the Archbishop has received this revelation from Eva, his nights have been sleepless. He finally went to the Magic Research Institute and came to an important decision: the Gift of Vitality must be unleashed. This shall help Aden's adventurers to reveal their maximum potential.<br>
|
||||
The Gift was sealed centuries ago and a huge amount of money and effort from the highest ranked wizards was required for this decision to become real. The Magic Research Institute made it happen.<br>
|
||||
Now everyone must work together to face the approaching evil.<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306-05.htm">What should I do?</a><br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
All you need to do is work harder on the things that you have done up to now. <font color="LEVEL">Train more, become stronger</font>, and stretch your limits! Soon a great danger will threaten the world. We are in dire need of talented adventurers who are prepared to fight! I recommend you take the Gift of Vitality and go hunting!<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
You are not qualified to receive the Memories of a Newbie. Can you see a newbie guide or adventurer guide next to me? Please receive the Newbie Support buffs from them. The Memories of a Newbie has the same effect as the Newbie Support buffs which you're receiving.<br>
|
||||
(Only characters level 76 or more can receive the Memories of a Newbie.)<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
Hum. You don't have any summon, do you? Why do you covet a gift that is not intended for you? You can receive the Memories of a Newbie for summons only if you bring a summon.<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
Look me straight in the eyes and answer me. Haven't you already received the Gift of Vitality? If you lie, I will break your neck.<br>
|
||||
(The Gift of Vitality buff will disappear when switching sub-classes.)<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
May Eva's blessing accompany you on your journey.<br>
|
||||
Good luck!<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
Your Vitality has been replenished to level 4 and will be maintained in that state for 2 hours! Go outside, defeat monsters, and return as an adventurer capable of protecting the world!<br>
|
||||
(The Gift of Vitality buff will disappear when switching sub-classes.)<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306.htm">Back</a><br><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>Jack Sage:<br><br>
|
||||
Greetings, brave adventurer of Aden!<br>
|
||||
My name is Jack Sage from Eva's Temple. According to Eva's Oracle, <font color="LEVEL">the world is now facing a great danger</font>. So great, in fact, that in our current state we cannot cope with it. As a consequence, Eva's Temple and the Magic Research Institute have decided to provide an ancient magic, which had been sealed long ago, to every adventurer who wishes to improve their abilities. It is called the <font color="LEVEL">Gift of Vitality</font>. The Gift of Vitality <font color="LEVEL">fills the vitality up to level 4 and maintains that state for 2 hours!</font> We shall do our best to overcome the imminent danger.<br>
|
||||
May Eva's blessing accompany you on your journey.<br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality vitality">Receive the Gift of Vitality.</a><br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306-02.htm">Ask about the Memories of a Newbie.</a><br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306-03.htm">Ask about the Memories of a Newbie for summons.</a><br><br>
|
||||
<a action="bypass -h Quest GiftOfVitality 4306-04.htm">What is the great danger you're talking about?</a><br><br>
|
||||
</body></html>
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package events.GiftOfVitality;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2SummonInstance;
|
||||
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.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
** @author Gnacik
|
||||
**
|
||||
** Retail Event : 'Gift of Vitality'
|
||||
*/
|
||||
public class GiftOfVitality extends Quest
|
||||
{
|
||||
// Reuse between buffs
|
||||
private static final int _hours = 5;
|
||||
|
||||
private static final int _jack = 4306;
|
||||
|
||||
private static final int[][] _spawns =
|
||||
{
|
||||
{ 82766, 149438, -3464, 33865 },
|
||||
{ 82286, 53291, -1488, 15250 },
|
||||
{ 147060, 25943, -2008, 18774 },
|
||||
{ 148096, -55466, -2728, 40541 },
|
||||
{ 87116, -141332, -1336, 52193 },
|
||||
{ 43521, -47542, -792, 31655 },
|
||||
{ 17203, 144949, -3024, 18166 },
|
||||
{ 111164, 221062, -3544, 2714 },
|
||||
{ -13869, 122063, -2984, 18270 },
|
||||
{ -83161, 150915, -3120, 17311 },
|
||||
{ 45402, 48355, -3056, 49153 },
|
||||
{ 115616, -177941, -896, 30708 },
|
||||
{ -44928, -113608, -192, 30212 },
|
||||
{ -84037, 243194, -3728, 8992 },
|
||||
{-119690, 44583, 360, 29289 },
|
||||
{ 12084, 16576, -4584, 57345 }
|
||||
};
|
||||
|
||||
public GiftOfVitality(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addStartNpc(_jack);
|
||||
addFirstTalkId(_jack);
|
||||
addTalkId(_jack);
|
||||
for(int[] _spawn : _spawns)
|
||||
addSpawn(_jack, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
htmltext = event;
|
||||
|
||||
if (event.equalsIgnoreCase("vitality"))
|
||||
{
|
||||
long _reuse = 0;
|
||||
String _streuse = st.get("reuse");
|
||||
if(_streuse != null)
|
||||
_reuse = Long.parseLong(_streuse);
|
||||
if(_reuse > System.currentTimeMillis())
|
||||
{
|
||||
long remainingTime = (_reuse - System.currentTimeMillis()) / 1000;
|
||||
int hours = (int) (remainingTime / 3600);
|
||||
int minutes = (int) ((remainingTime%3600) / 60);
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES);
|
||||
sm.addSkillName(23179);
|
||||
sm.addNumber(hours);
|
||||
sm.addNumber(minutes);
|
||||
player.sendPacket(sm);
|
||||
htmltext = "4306-notime.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(23179,1)); // Gift of Vitality
|
||||
st.setState(State.STARTED);
|
||||
st.set("reuse", String.valueOf(System.currentTimeMillis() + _hours*60*60*1000));
|
||||
htmltext = "4306-okvitality.htm";
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("memories_player"))
|
||||
{
|
||||
if (player.getLevel() < 76)
|
||||
{
|
||||
htmltext = "4306-nolevel.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player.isMageClass())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5627,1)); // Wind Walk
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5628,1)); // Shield
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5637,1)); // Magic Barrier
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5633,1)); // Bless the Soul
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5634,1)); // Acumen
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5635,1)); // Concentration
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5636,1)); // Empower
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5627,1)); // Wind Walk
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5628,1)); // Shield
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5637,1)); // Magic Barrier
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5629,1)); // Bless the Body
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5630,1)); // Vampiric Rage
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5631,1)); // Regeneration
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5632,1)); // Haste
|
||||
}
|
||||
htmltext = "4306-okbuff.htm";
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("memories_summon"))
|
||||
{
|
||||
if (player.getLevel() < 76)
|
||||
{
|
||||
htmltext = "4306-nolevel.htm";
|
||||
}
|
||||
else if (player.getPet() == null || !(player.getPet() instanceof L2SummonInstance))
|
||||
{
|
||||
htmltext = "4306-nosummon.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setTarget(player.getPet());
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5627,1)); // Wind Walk
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5628,1)); // Shield
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5637,1)); // Magic Barrier
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5629,1)); // Bless the Body
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5633,1)); // Bless the Soul
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5630,1)); // Vampiric Rage
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5634,1)); // Acumen
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5631,1)); // Regeneration
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5635,1)); // Concentration
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5632,1)); // Haste
|
||||
npc.doCast(SkillTable.getInstance().getInfo(5636,1)); // Empower
|
||||
htmltext = "4306-okbuff.htm";
|
||||
}
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
return "4306.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new GiftOfVitality(-1, "GiftOfVitality", "events");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
<font color="LEVEL">1 - Medals and Prizes</font><br>
|
||||
Hunting the monsters that dwell outside the village will yield medals. Bring them to me and I'll reward you with a fabulous prize, personally selected for you by Collector Bashtal! You'll find two types of medals: Regular medals and glittering medals. Glittering medals are quite rare, and therefore most valuable, especially for your future.<br><br>
|
||||
<font color="LEVEL">2 - Advancing Levels</font><br>
|
||||
A collector's level reflects that player's contribution to the medal collection and collecting skill. Meow! Higher levels are eligible for a greater selection of prizes. Winnie over there can tell you more about raising your level.<br>
|
||||
<a action="bypass -h Quest HeavyMedal 31228.htm">Back</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
These are the <font color="LEVEL">prizes</font> that were selected by my Lord Bashtal: <font color="LEVEL">Greater Haste Potion, Greater Swift Attack Potion, Greater Magic Haste Potion, Quick Healing Potion, Blessed Scroll of Escape, Blessed Scroll of Resurrection, Scroll: Enchant Armor (All Grades), Scroll: Enchant Weapon (All Grades), Red Party Mask, Soul Crystal (All Colors) - Stage 11, Soul Crystal (All Colors) - Stage 12, Sealed Majestic Necklace, Sealed Majestic Earring, and Sealed Majestic Ring</font>.<br>
|
||||
You'll need to raise your collector level to be eligible for some of these items. If you wish to raise your level, go see Winnie the Cat!<br>
|
||||
<a action="bypass -h Quest HeavyMedal 31228.htm">Back</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager:<br>
|
||||
Raise your level as a collector, newbie! You can exchange medals for more valuable prizes! Meeow!<br>
|
||||
Here are the prizes you can choose from!<br>
|
||||
<a action="bypass -h npc_%objectId%_multisell 3122800">"I want to trade a medal for a prize."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
A rabbit, eh? You still have a long way to go! Don't get discouraged, just raise your level!<br>
|
||||
Here are the prizes you can choose from! Meow!<br>
|
||||
<a action="bypass -h npc_%objectId%_multisell 3122801">"I want to trade a medal for a prize."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
Ah, a hyena! Meow! Very impressive! Thanks for all the medals! Meow!<br>
|
||||
<a action="bypass -h npc_%objectId%_multisell 3122802">"I want to trade a medal for a prize."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
Ah, a fox, eh? Meow! Thanks for all the medals! Thank you!<br>
|
||||
Here are the prizes you can choose from! Meow!<br>
|
||||
<a action="bypass -h npc_%objectId%_multisell 3122803">"I want to trade a medal for a prize."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
Ah, a wolf, eh? It's been too long since I've had the pleasure of meeting a collector of your character!<br>
|
||||
Here are the prizes you can choose from!<br>
|
||||
<a action="bypass -h npc_%objectId%_multisell 3122804">"I want to trade a medal for a prize."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Roy the Cat:<br>
|
||||
Meow! Greetings! I'm Roy the Cat!<br>
|
||||
My master, the great collector Bashtal from the Bronze Key guild, has asked me and my friends to collect medals that were scattered throughout the world. The search has brought me to this village!<br>
|
||||
I'm organizing an event I'm calling the<font color="LEVEL"> Medal Collecting Event</font>! Anyone who brings medals will receive fabulous prizes! Meow!<br>
|
||||
<a action="bypass -h Quest HeavyMedal talk">"I want to trade medals for prizes."</a><br>
|
||||
<a action="bypass -h Quest HeavyMedal 31228-1.htm">"Tell me more about the event."</a><br>
|
||||
<a action="bypass -h Quest HeavyMedal 31228-2.htm">"What are the prizes?"</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
<font color="LEVEL">1 - Medals and Prizes</font><br>
|
||||
Hunting the monsters that dwell outside the village will yield medals. Bring them to me and I'll reward you with a fabulous prize, personally selected for you by Collector Bashtal!<br><br>
|
||||
<font color="LEVEL">2 - Advancing Levels</font><br>
|
||||
A collector's level reflects that player's contribution to the medal collection and collecting skill. You should raise your level as high as you can! Meow!! To raise your level, just bring me glittering medals and pass a simple test. Meow~!<br>
|
||||
<a action="bypass -h Quest HeavyMedal 31229.htm">Back</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Here are the <font color="LEVEL">event prizes</font> that have been prepared by my Lord Bashtal: <font color="LEVEL">Greater Haste Potion, Greater Swift Attack Potion, Greater Magic Haste Potion, Quick Healing Potion, Blessed Scroll of Escape, Blessed Scroll of Resurrection, Scroll: Enchant Armor (All Grades), Scroll: Enchant Weapon (All Grades), Red Party Mask, Soul Crystal (All Colors) - Stage 11, Soul Crystal (All Colors) - Stage 12, Sealed Majestic Necklace, Sealed Majestic Earring, and Sealed Majestic Ring</font>. Whew! An impressive list, eh? Meow!<br>
|
||||
I don't think I missed anything. Roy the Cat over there will trade medals for prizes. Meow~!<br>
|
||||
<a action="bypass -h Quest HeavyMedal 31229.htm">Back</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
I'll toss a coin, and you call either heads or tails. Meow! <font color="LEVEL">When you guess correctly, I'll raise your level!!</font><br>
|
||||
Now! Then... Fling! Whirl... whirl... whirl... slap!<br>
|
||||
Meow~ What's it gonna be? Heads or tails?<br>
|
||||
<a action="bypass -h Quest HeavyMedal heads">"Heads!"</a><br>
|
||||
<a action="bypass -h Quest HeavyMedal tails">"Tails!"</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Heads, eh? Let's see...<br>
|
||||
Sorry, you lose! It's tails! Bring more glittering medals and I'll play the game with you again!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Heads? Let's see...<br>
|
||||
Heads it is!!! Congratulations!<br>
|
||||
<font color="LEVEL">Here is the token for rabbit!</font> Carry this mark with you to prove that you belong to the rabbit level. If you lose it, you won't be able to prove your level. Be careful with it!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
You don't have enough glittering medals. Hmm, I thought you had enough... I suppose I was mistaken. Collect more glittering medals and bring them to me! Meow!!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Heads? Let's see...<br>
|
||||
Heads it is!!! Congratulations!<br>
|
||||
<font color="LEVEL">Here is the token for hyena!</font> Carry this mark with you to prove that you belong to the hyena level. If you lose it, you won't be able to prove your level. Be careful with it!<br>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Heads? Let's see...<br>
|
||||
Heads it is!!! Congratulations!<br>
|
||||
<font color="LEVEL">Here is the token for fox!</font> Carry this mark with you to prove that you belong to the fox level. If you lose it, you won't be able to prove your level. Be careful with it!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Heads? Let's see...<br>
|
||||
Heads it is!!! Congratulations!<br><font color="LEVEL">Here is the token for wolf!</font> Carry this mark with you to prove that you belong to the wolf level. If you lose it, you won't be able to prove your level. Be careful with it!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>Event Manager Winnie the Cat:<br>
|
||||
A <font color="LEVEL">no level collector</font>, eh?<br>
|
||||
<font color="LEVEL">If you'd like to try to raise your level, give me 5 glittering medals and I'll play a game with you! Meow!</font> If you lose, you can always try again!<br>
|
||||
The game will help you develop the qualities you'll need as a collector. Meow! Your abilities are evaluated by the number of glittering medals you collect and your luck is tested by the number of times you win the game.<br>
|
||||
You can play as long as you have glittering medals! Meow!! Would you like to give it a try?<br>
|
||||
<a action="bypass -h Quest HeavyMedal game">"I want to play the coin-toss game."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Ah, a <font color="LEVEL">rabbit</font>, eh?<br>
|
||||
<font color="LEVEL">To raise your level to hyena, pay me 10 glittering medals and I'll play a game with you! </font>Meow!<br>
|
||||
The game is a test of both your luck and skill, the two essential qualities of a collector. Meow! Your abilities are evaluated by the number of glittering medals you collect, and your luck is tested by how often you win the game.<br>
|
||||
If you lose, pay 10 more glittering medals and try again! You'll eventually win. Meow!! Would you like to give it a try?<br>
|
||||
<a action="bypass -h Quest HeavyMedal game">"I want to play the coin-toss game."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Ah, a <font color="LEVEL">hyena</font>, eh? I know you've been working hard, so I'll keep the explanation brief.<br>
|
||||
<font color="LEVEL">If you wish to become a fox level collector, pay me 20 glittering medals and I'll play a game with you! Meow!</font> You can play as many times as you want, as long as you have enough glittering medals!
|
||||
<br>
|
||||
This game tests your ablities as well as your luck. Meow! Your abilities are evaluated by the number of glittering medals you collect and your luck is tested by the number of times you win the game!<br>
|
||||
<a action="bypass -h Quest HeavyMedal game">"I want to play the coin-toss game."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Wow! <font color="LEVEL">Are you really a fox level collector?</font> Meow! I wouldn't have known at first glance, but now that I get a closer look at you, I can see it in your eyes! I'm sure your'e already familiar with the game, so I'll keep the explanation brief...<br>
|
||||
<font color="LEVEL">If you wish to become a wolf level collector, pay me 40 glittering medals and I'll play a game with you! Meow!</font> You can play as many times as you want, as long as you have enough glittering medals.<br>
|
||||
The game tests both your abilities and your luck, the two essential qualities of a collector! Meow!<br>
|
||||
<a action="bypass -h Quest HeavyMedal game">"I want to play the coin-toss game."</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
<font color="LEVEL">Wow, a wolf?!</font> I can't remember the last time I met a wolf level collector! You've reached the highest level possible! Great job! Meow!!!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
You don't have enough glittering medals to play the coin-toss game. Collect some more medals and come back. Meow!!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Tails? Let's see...<br>
|
||||
Sorry, you lose! Go collect more glittering medals and try again. Meow!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Tails? Let's see...<br>
|
||||
Tails it is! Congratulations, you've reached <font color="LEVEL">rabbit level</font>! Keep this mark with you to prove it.<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
You don't have enough glittering medals. Hmm, I thought you had enough... I suppose I was mistaken. Collect more glittering medals and bring them to me! Meow!!<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Tails? Let me see...<br>
|
||||
Tails it is! Congratulations, you've reached <font color="LEVEL">hyena level</font>! Keep this mark with you to prove it.<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Tails? Let's see...<br>
|
||||
Tails it is! Congratulations, you've reached <font color="LEVEL">fox level</font>! Keep this mark with you to prove it.<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Tails? Let's see...<br>
|
||||
Tails it is! Congratulations, you've reached <font color="LEVEL">wolf level</font>! Keep this mark with you to prove it.<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<body>
|
||||
Event Manager Winnie the Cat:<br>
|
||||
Meow! Greetings! I'm Winnie the Cat!<br>
|
||||
Our master, Collector Bashtal, formerly of the Bronze Key guild, has asked us to collect medals that were scattered throughout the world. We've come to this village as his personal emmissaries!<br>
|
||||
We're organizing a<font color="LEVEL"> Medal Collecting Event</font>! Would you like to participate? Collect medals and take them to Roy the Cat over there!<br>
|
||||
There's so much to do, but I need a nap!! Meow!!<br>
|
||||
<a action="bypass -h Quest HeavyMedal talk">"I want to raise my level."</a><br>
|
||||
<a action="bypass -h Quest HeavyMedal 31229-1.htm">"Tell me more about the event."</a><br>
|
||||
<a action="bypass -h Quest HeavyMedal 31229-2.htm">"What are the prizes?"</a><br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
package events.HeavyMedal;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
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.util.Rnd;
|
||||
|
||||
/**
|
||||
** @author Gnacik
|
||||
**
|
||||
** Retail Event : 'Heavy Medals'
|
||||
*/
|
||||
public class HeavyMedal extends Quest
|
||||
{
|
||||
private final static int CAT_ROY = 31228;
|
||||
private final static int CAT_WINNIE = 31229;
|
||||
private final static int GLITTERING_MEDAL = 6393;
|
||||
|
||||
private final static int WIN_CHANCE = 50;
|
||||
|
||||
private final static int[] MEDALS = { 5,10,20,40 };
|
||||
private final static int[] BADGES = { 6399,6400,6401,6402 };
|
||||
|
||||
private static final int[][] _spawns_winnie =
|
||||
{
|
||||
{-44342,-113726,-240,0},
|
||||
{-44671,-115437,-240,22500},
|
||||
{-13073,122841,-3117,0},
|
||||
{-13972,121893,-2988,32768},
|
||||
{-14843,123710,-3117,8192},
|
||||
{11327,15682,-4584,25000},
|
||||
{11243,17712,-4574,57344},
|
||||
{18154,145192,-3054,7400},
|
||||
{19214,144327,-3097,32768},
|
||||
{19459,145775,-3086,48000},
|
||||
{17418,170217,-3507,36000},
|
||||
{47146,49382,-3059,32000},
|
||||
{44157,50827,-3059,57344},
|
||||
{79798,55629,-1560,0},
|
||||
{83328,55769,-1525,32768},
|
||||
{80986,54452,-1525,32768},
|
||||
{83329,149095,-3405,49152},
|
||||
{82277,148564,-3467,0},
|
||||
{81620,148689,-3464,32768},
|
||||
{81691,145610,-3467,32768},
|
||||
{114719,-178742,-821,0},
|
||||
{115708,-182422,-1449,0},
|
||||
{-80731,151152,-3043,28672},
|
||||
{-84097,150171,-3129,4096},
|
||||
{-82678,151666,-3129,49152},
|
||||
{117459,76664,-2695,38000},
|
||||
{115936,76488,-2711,59000},
|
||||
{119576,76940,-2275,40960},
|
||||
{-84516,243015,-3730,34000},
|
||||
{-86031,243153,-3730,60000},
|
||||
{147124,27401,-2192,40960},
|
||||
{147985,25664,-2000,16384},
|
||||
{111724,221111,-3543,16384},
|
||||
{107899,218149,-3675,0},
|
||||
{114920,220080,-3632,32768},
|
||||
{147924,-58052,-2979,49000},
|
||||
{147285,-56461,-2776,33000},
|
||||
{44176,-48688,-800,33000},
|
||||
{44294,-47642,-792,50000}
|
||||
};
|
||||
|
||||
private static final int[][] _spawns_roy =
|
||||
{
|
||||
{-44337,-113669,-224,0},
|
||||
{-44628,-115409,-240,22500},
|
||||
{-13073,122801,-3117,0},
|
||||
{-13949,121934,-2988,32768},
|
||||
{-14786,123686,-3117,8192},
|
||||
{11281,15652,-4584,25000},
|
||||
{11303,17732,-4574,57344},
|
||||
{18178,145149,-3054,7400},
|
||||
{19208,144380,-3097,32768},
|
||||
{19508,145775,-3086,48000},
|
||||
{17396,170259,-3507,36000},
|
||||
{47151,49436,-3059,32000},
|
||||
{44122,50784,-3059,57344},
|
||||
{79806,55570,-1560,0},
|
||||
{83328,55824,-1525,32768},
|
||||
{80986,54504,-1525,32768},
|
||||
{83332,149160,-3405,49152},
|
||||
{82277,148598,-3467,0},
|
||||
{81621,148725,-3467,32768},
|
||||
{81680,145656,-3467,32768},
|
||||
{114733,-178691,-821,0},
|
||||
{115708,-182362,-1449,0},
|
||||
{-80789,151073,-3043,28672},
|
||||
{-84049,150176,-3129,4096},
|
||||
{-82623,151666,-3129,49152},
|
||||
{117498,76630,-2695,38000},
|
||||
{115914,76449,-2711,59000},
|
||||
{119536,76988,-2275,40960},
|
||||
{-84516,242971,-3730,34000},
|
||||
{-86003,243205,-3730,60000},
|
||||
{147184,27405,-2192,17000},
|
||||
{147920,25664,-2000,16384},
|
||||
{111776,221104,-3543,16384},
|
||||
{107904,218096,-3675,0},
|
||||
{114920,220020,-3632,32768},
|
||||
{147888,-58048,-2979,49000},
|
||||
{147262,-56450,-2776,33000},
|
||||
{44176,-48732,-800,33000},
|
||||
{44319,-47640,-792,50000}
|
||||
};
|
||||
|
||||
public HeavyMedal(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addStartNpc(CAT_ROY);
|
||||
addStartNpc(CAT_WINNIE);
|
||||
addTalkId(CAT_ROY);
|
||||
addTalkId(CAT_WINNIE);
|
||||
addFirstTalkId(CAT_ROY);
|
||||
addFirstTalkId(CAT_WINNIE);
|
||||
for(int[] _spawn : _spawns_roy)
|
||||
addSpawn(CAT_ROY, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
for(int[] _spawn : _spawns_winnie)
|
||||
addSpawn(CAT_WINNIE, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
htmltext = event;
|
||||
|
||||
int level = checkLevel(st);
|
||||
|
||||
if (event.equalsIgnoreCase("game"))
|
||||
{
|
||||
if (st.getQuestItemsCount(GLITTERING_MEDAL) < MEDALS[level])
|
||||
return "31229-no.htm";
|
||||
else
|
||||
return "31229-game.htm";
|
||||
}
|
||||
else if (event.equalsIgnoreCase("heads") || event.equalsIgnoreCase("tails"))
|
||||
{
|
||||
if (st.getQuestItemsCount(GLITTERING_MEDAL) < MEDALS[level])
|
||||
return "31229-"+event.toLowerCase()+"-10.htm";
|
||||
|
||||
st.takeItems(GLITTERING_MEDAL, MEDALS[level]);
|
||||
|
||||
if(Rnd.get(100) > WIN_CHANCE)
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (level>0)
|
||||
st.takeItems(BADGES[level-1], -1);
|
||||
st.giveItems(BADGES[level], 1);
|
||||
st.playSound("Itemsound.quest_itemget");
|
||||
level++;
|
||||
}
|
||||
return "31229-"+event.toLowerCase()+"-"+String.valueOf(level)+".htm";
|
||||
}
|
||||
else if (event.equalsIgnoreCase("talk"))
|
||||
{
|
||||
return String.valueOf(npc.getNpcId())+ "-lvl-"+String.valueOf(level)+".htm";
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
return npc.getNpcId()+".htm";
|
||||
}
|
||||
|
||||
public int checkLevel(QuestState st)
|
||||
{
|
||||
int _lev = 0;
|
||||
if(st == null)
|
||||
return 0;
|
||||
else if (st.getQuestItemsCount(6402) > 0)
|
||||
_lev = 4;
|
||||
else if (st.getQuestItemsCount(6401) > 0)
|
||||
_lev = 3;
|
||||
else if (st.getQuestItemsCount(6400) > 0)
|
||||
_lev = 2;
|
||||
else if (st.getQuestItemsCount(6399) > 0)
|
||||
_lev = 1;
|
||||
|
||||
return _lev;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new HeavyMedal(-1, "HeavyMedal", "events");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Are you ready to test your luck? <br>
|
||||
If Fortune holds you in her embrace, then you could win a prize beyond your wildest expectations. And just remember, <font color="LEVEL">you can only have one staff at a time</font>.<br>
|
||||
First, you must purchase a <font color="LEVEL">Staff of Master Yogi</font>. This item will cost a partly 1,000,000 adena, and will serve as the item to be enchanted.<br>
|
||||
Second, you must obtain <font color="LEVEL">special enchant scrolls</font>.<br>
|
||||
There are several ways this can be done. Every 6 hours I will sell you a package of 24 scrolls for only 5,000,000 adena. You can also obtain scrolls through normal hunting. Or you can buy additional scrolls from me for a slightly greater cost.<br>
|
||||
Different rewards are given depending on the number of successful enchants applied to the weapon. And just like with normal enchanting, if you fail you will lose the staff. However unlike regular enchanting, enchantment failure will not result in crystals.<br>
|
||||
If you exercise patience and perseverance, then I have no doubt you will be successful!<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-2.htm">Ask about the prizes.</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Participate in the event.</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599.htm">Back</a><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Here is the reward list for the number of successful Enchants. Why not give it try?<br><br>
|
||||
Enchant +1: No reward<br>
|
||||
Enchant +2: No reward<br>
|
||||
Enchant +3: No reward<br>
|
||||
Enchant +4: 1 Small Firecracker<br>
|
||||
Enchant +5: 2 Small Firecrackers, 1 Large Fireworks<br>
|
||||
Enchant +6: 3 Small Firecrackers, 2 Large Fireworks<br>
|
||||
Enchant +7: 1 Shadow-Type Hair Accessory<br>
|
||||
Enchant +8: 1 Scroll: Enchant D-Grade Weapon<br>
|
||||
Enchant +9: 1 Scroll: Enchant D-Grade Weapon, 1 Scroll: Enchant Armor<br>
|
||||
Enchant +10: 1 Scroll: Enchant C-Grade Weapon<br>
|
||||
Enchant +11: 1 Scroll: Enchant C-Grade Weapon, 1 Scroll: Enchant Armor<br>
|
||||
Enchant +12: 1 Scroll: Enchant B-Grade Weapon<br>
|
||||
Enchant +13: 1 Scroll: Enchant A-Grade Weapon<br>
|
||||
Enchant +14: 1 Hair Accessory<br>
|
||||
Enchant +15: 1 S-Grade Accessory<br>
|
||||
Enchant +16: Top-Grade Life Stone<br>
|
||||
Enchant +17: 1 Scroll: Enchant S-Grade Weapon<br>
|
||||
Enchant +18: 1 S-Grade Armor<br>
|
||||
Enchant +19: 1 S-Grade Weapon<br>
|
||||
Enchant +20: 1 Stage 14 Soul Crystal<br>
|
||||
Enchant +21: 1 Top-Grade Life Stone, 1 High-Grade Life Stone, 1 Soul Crystal<br>
|
||||
Enchant +22: 1 S80-Grade Armor<br>
|
||||
Enchant +23: 1 S80-Grade Weapon<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599.htm">Back</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
I'm sorry but you create character after event start...<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599.htm">Back</a>
|
||||
</body></html>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Aha! So you decided to accept the challenge, eh? Outstanding! Select one of the following to get started. And don't forget, you can only have one staff in your inventory at any given time. And the staff must be equipped in order to receive a reward. May the light of guidance fall upon you.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting buy_staff">Purchase Staff of Master Yogi (1,000,000 Adena).</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting buy_scroll_24">Purchase 24 enchant Scrolls (5,000,000 adena).</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting buy_scroll_1">Purchase 1 Enchant Scroll (500,000 Adena).</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting buy_scroll_10">Purchase 10 Enchant Scrolls (5,000,000 Adena)</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-2.htm">View the prize list.</a><br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599.htm">Back</a>
|
||||
</body></html>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
The basic requirements are an <font color="LEVEL">Enchant success rate of at least +4 and an equipped staff.</font>
|
||||
</body></html>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Congratulations on beginning your enchants.<br>
|
||||
It looks like luck is beginning to favor you. Don't be afraid to challenge yourself, my child. Well done!
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Tsk tsk. You don't have the money required to purchase this item.<br><br>
|
||||
That means you must earn some more money or let this chance slip through your fingers. The choice is yours.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Ummm.... you seem a little shy on funds.<br>
|
||||
Unless you have more money, I'm afraid I can't sell you these goods.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Nia Kujarako! You don't have enough Adena.<br>
|
||||
Are you telling me that you don't even have a few thousand Adena? How disappointing.<br>
|
||||
Go hunt and earn some quickly. You may not get another chance like this...<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Ah, excellent, great hero! May the Yogi's sense be with you...<br>
|
||||
I foresee good things in your future. Do not be afraid to aim high!<br>
|
||||
Good luck! I hope to see you again.<br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Ha ha!<br>
|
||||
This package of 24 can only be purchased every 6 hours.<br>
|
||||
If you look in your chat window, you should see a system message that tells you how much time is remaining before you can make this purchase again.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Congratulations on taking the first step! Now all you need are some scrolls, and you'll be on your way.<br>
|
||||
Just remember young one, peace makes plenty.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Either you have insufficient adena or you already possess a Staff of Master Yogi. Remember, <font color="LEVEL">you can only have one!</font><br>
|
||||
Why, you ask?<br>
|
||||
Only the gods know. It is not our place to question their divine providence.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Back</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>Master Yogi:<br>
|
||||
Hello child, and welcome.<br>
|
||||
My name is Master Yogi, and I have come back to the lands of Aden and Elmore in possession of much knowledge and enlightenment.<br>
|
||||
I have long walked the way of the ascetic and have only returned from my sojourn to share my wisdom with you.<br>
|
||||
With me, I bring a new event. And through this event, you too will learn the secrets and mysteries surrounding enchantment.<br><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-1.htm">Ask about the event.</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting 32599-participate.htm">Participate in the event.</a><br>
|
||||
<a action="bypass -h Quest MasterOfEnchanting receive_reward">Receive reward.</a><br>
|
||||
</body></html>
|
||||
+301
@@ -0,0 +1,301 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package events.MasterOfEnchanting;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Event Code for "Master of Enchanting"
|
||||
* http://www.lineage2.com/archive/2009/06/master_of_encha.html
|
||||
* @author Gnacik
|
||||
*/
|
||||
public class MasterOfEnchanting extends Quest
|
||||
{
|
||||
private static final int _master_yogi = 32599;
|
||||
private static final int _master_yogi_staff = 13539;
|
||||
private static final int _master_yogi_scroll = 13540;
|
||||
|
||||
private static final int _adena = 57;
|
||||
private static final int _staff_price = 1000000;
|
||||
private static final int _scroll_24_price = 5000000;
|
||||
private static final int _scroll_24_time = 6;
|
||||
|
||||
private static final int _scroll_1_price = 500000;
|
||||
private static final int _scroll_10_price = 5000000;
|
||||
|
||||
private static final int[] _hat_shadow_reward = { 13074, 13075, 13076 };
|
||||
private static final int[] _hat_event_reward = { 13518, 13519, 13522 };
|
||||
private static final int[] _crystal_reward = { 9570, 9571, 9572 };
|
||||
|
||||
private static final int[][] _spawns =
|
||||
{
|
||||
{16111,142850,-2707,16000},
|
||||
{17275,145000,-3037,25000},
|
||||
{83037,149324,-3470,44000},
|
||||
{82145,148609,-3468,0},
|
||||
{81755,146487,-3534,32768},
|
||||
{-81031,150038,-3045,0},
|
||||
{-83156,150994,-3130,0},
|
||||
{-13727,122117,-2990,16384},
|
||||
{-14129,123869,-3118,40959},
|
||||
{-84411,244813,-3730,57343},
|
||||
{-84023,243051,-3730,4096},
|
||||
{46908,50856,-2997,8192},
|
||||
{45538,48357,-3061,18000},
|
||||
{9929,16324,-4576,62999},
|
||||
{11546,17599,-4586,46900},
|
||||
{81987,53723,-1497,0},
|
||||
{81083,56118,-1562,32768},
|
||||
{147200,25614,-2014,16384},
|
||||
{148557,26806,-2206,32768},
|
||||
{117356,76708,-2695,49151},
|
||||
{115887,76382,-2714,0},
|
||||
{-117239,46842,367,49151},
|
||||
{-119494,44882,367,24576},
|
||||
{111004,218928,-3544,16384},
|
||||
{108426,221876,-3600,49151},
|
||||
{-45278,-112766,-241,0},
|
||||
{-45372,-114104,-241,16384},
|
||||
{115096,-178370,-891,0},
|
||||
{116199,-182694,-1506,0},
|
||||
{86865,-142915,-1341,26000},
|
||||
{85584,-142490,-1343,0},
|
||||
{147421,-55435,-2736,49151},
|
||||
{148206,-55786,-2782,61439},
|
||||
{43165,-48461,-797,17000},
|
||||
{43966,-47709,-798,49999}
|
||||
};
|
||||
|
||||
public MasterOfEnchanting(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addStartNpc(_master_yogi);
|
||||
addFirstTalkId(_master_yogi);
|
||||
addTalkId(_master_yogi);
|
||||
for(int[] _spawn : _spawns)
|
||||
addSpawn(_master_yogi, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
|
||||
htmltext = event;
|
||||
if (event.equalsIgnoreCase("buy_staff"))
|
||||
{
|
||||
if (st.getQuestItemsCount(_master_yogi_staff) == 0 && st.getQuestItemsCount(_adena) > _staff_price)
|
||||
{
|
||||
st.takeItems(_adena, _staff_price);
|
||||
st.giveItems(_master_yogi_staff, 1);
|
||||
htmltext = "32599-staffbuyed.htm";
|
||||
}
|
||||
else
|
||||
htmltext = "32599-staffcant.htm";
|
||||
}
|
||||
else if (event.equalsIgnoreCase("buy_scroll_24"))
|
||||
{
|
||||
long _curr_time = System.currentTimeMillis();
|
||||
String value = q.loadGlobalQuestVar(player.getAccountName());
|
||||
long _reuse_time = value == "" ? 0 : Long.parseLong(value);
|
||||
if( player.getCreateTime() > Long.parseLong("1246913000000"))
|
||||
{
|
||||
return "32599-bidth.htm";
|
||||
}
|
||||
if (_curr_time > _reuse_time)
|
||||
{
|
||||
if (st.getQuestItemsCount(_adena) > _scroll_24_price)
|
||||
{
|
||||
st.takeItems(_adena, _scroll_24_price);
|
||||
st.giveItems(_master_yogi_scroll, 24);
|
||||
q.saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (_scroll_24_time * 3600000)));
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
else
|
||||
htmltext = "32599-s24-no.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
long _remaining_time = (_reuse_time - _curr_time) / 1000;
|
||||
int hours = (int) _remaining_time / 3600;
|
||||
int minutes = ((int) _remaining_time % 3600) / 60;
|
||||
if (hours > 0)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ITEM_PURCHASABLE_IN_S1_HOURS_S2_MINUTES);
|
||||
sm.addNumber(hours);
|
||||
sm.addNumber(minutes);
|
||||
player.sendPacket(sm);
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
else if (minutes > 0)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ITEM_PURCHASABLE_IN_S1_MINUTES);
|
||||
sm.addNumber(minutes);
|
||||
player.sendPacket(sm);
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Little glitch. There is no SystemMessage with seconds only.
|
||||
// If time is less than 1 minute player can buy scrolls
|
||||
if (st.getQuestItemsCount(_adena) > _scroll_24_price)
|
||||
{
|
||||
st.takeItems(_adena, _scroll_24_price);
|
||||
st.giveItems(_master_yogi_scroll, 24);
|
||||
q.saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (_scroll_24_time * 3600000)));
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
else
|
||||
htmltext = "32599-s24-no.htm";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("buy_scroll_1"))
|
||||
{
|
||||
if (st.getQuestItemsCount(_adena) > _scroll_1_price)
|
||||
{
|
||||
st.takeItems(_adena, _scroll_1_price);
|
||||
st.giveItems(_master_yogi_scroll, 1);
|
||||
htmltext = "32599-scroll-ok.htm";
|
||||
}
|
||||
else
|
||||
htmltext = "32599-s1-no.htm";
|
||||
}
|
||||
else if (event.equalsIgnoreCase("buy_scroll_10"))
|
||||
{
|
||||
if (st.getQuestItemsCount(_adena) > _scroll_10_price)
|
||||
{
|
||||
st.takeItems(_adena, _scroll_10_price);
|
||||
st.giveItems(_master_yogi_scroll, 10);
|
||||
htmltext = "32599-scroll-ok.htm";
|
||||
}
|
||||
else
|
||||
htmltext = "32599-s10-no.htm";
|
||||
}
|
||||
else if (event.equalsIgnoreCase("receive_reward"))
|
||||
{
|
||||
if (st.getItemEquipped(Inventory.PAPERDOLL_RHAND) == _master_yogi_staff && st.getEnchantLevel(_master_yogi_staff) > 3)
|
||||
{
|
||||
switch(st.getEnchantLevel(_master_yogi_staff))
|
||||
{
|
||||
case 4:
|
||||
st.giveItems(6406, 1); // Firework
|
||||
break;
|
||||
case 5:
|
||||
st.giveItems(6406, 2); // Firework
|
||||
st.giveItems(6407, 1); // Large Firework
|
||||
break;
|
||||
case 6:
|
||||
st.giveItems(6406, 3); // Firework
|
||||
st.giveItems(6407, 2); // Large Firework
|
||||
break;
|
||||
case 7:
|
||||
st.giveItems(_hat_shadow_reward[Rnd.get(3)], 1);
|
||||
break;
|
||||
case 8:
|
||||
st.giveItems(955, 1); // Scroll: Enchant Weapon (D)
|
||||
break;
|
||||
case 9:
|
||||
st.giveItems(955, 1); // Scroll: Enchant Weapon (D)
|
||||
st.giveItems(956, 1); // Scroll: Enchant Armor (D)
|
||||
break;
|
||||
case 10:
|
||||
st.giveItems(951, 1); // Scroll: Enchant Weapon (C)
|
||||
break;
|
||||
case 11:
|
||||
st.giveItems(951, 1); // Scroll: Enchant Weapon (C)
|
||||
st.giveItems(952, 1); // Scroll: Enchant Armor (C)
|
||||
break;
|
||||
case 12:
|
||||
st.giveItems(948, 1); // Scroll: Enchant Armor (B)
|
||||
break;
|
||||
case 13:
|
||||
st.giveItems(729, 1); // Scroll: Enchant Weapon (A)
|
||||
break;
|
||||
case 14:
|
||||
st.giveItems(_hat_event_reward[Rnd.get(3)], 1);
|
||||
break;
|
||||
case 15:
|
||||
st.giveItems(13992, 1); // Grade S Accessory Chest (Event)
|
||||
break;
|
||||
case 16:
|
||||
st.giveItems(8762, 1); // Top-Grade Life Stone: level 76
|
||||
break;
|
||||
case 17:
|
||||
st.giveItems(959, 1); // Scroll: Enchant Weapon (S)
|
||||
break;
|
||||
case 18:
|
||||
st.giveItems(13991, 1); // Grade S Armor Chest (Event)
|
||||
break;
|
||||
case 19:
|
||||
st.giveItems(13990, 1); // Grade S Weapon Chest (Event)
|
||||
break;
|
||||
case 20:
|
||||
st.giveItems(_crystal_reward[Rnd.get(3)], 1); // Red/Blue/Green Soul Crystal - Stage 14
|
||||
break;
|
||||
case 21:
|
||||
st.giveItems(8762, 1); // Top-Grade Life Stone: level 76
|
||||
st.giveItems(8752, 1); // High-Grade Life Stone: level 76
|
||||
st.giveItems(_crystal_reward[Rnd.get(3)], 1); // Red/Blue/Green Soul Crystal - Stage 14
|
||||
break;
|
||||
case 22:
|
||||
st.giveItems(13989, 1); // S80 Grade Armor Chest (Event)
|
||||
break;
|
||||
case 23:
|
||||
st.giveItems(13988, 1); // S80 Grade Weapon Chest (Event)
|
||||
default:
|
||||
if(st.getEnchantLevel(_master_yogi_staff) > 23)
|
||||
st.giveItems(13988, 1); // S80 Grade Weapon Chest (Event)
|
||||
break;
|
||||
}
|
||||
st.takeItems(_master_yogi_staff, 1);
|
||||
htmltext = "32599-rewardok.htm";
|
||||
}
|
||||
else
|
||||
htmltext = "32599-rewardnostaff.htm";
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
htmltext = npc.getNpcId() + ".htm";
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new MasterOfEnchanting(-1, "MasterOfEnchanting", "events");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html><body>
|
||||
Meow~ You're really a lovable person.<br>
|
||||
I'll definitely help you show your heart to the one who's precious to you.<br>
|
||||
If you use the <font color="LEVEL">Valentine Secret Spell</font> that I gave you, you can find out the <font color="LEVEL">way to make a special Valentine Cake</font> for the person you love~ meow~.<br>
|
||||
If you register the Valentine Secret Spell as a recipe, then collect 10 dark chocolates, 10 white chocolates, and 5 fresh creams, you can make a cake. It can fail sometimes, so pray for success in your heart~ meow~~<br>
|
||||
But, I can't give you the chocolates and fresh cream. Some unknown monsters took them after raiding the warehouse awhile ago.<br>
|
||||
But with the courage that comes from making a gift for someone precious to you, you should be able to retrieve the cake ingredients from the monsters.<br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301-2.htm">I'm curious about the event rewards.</a><br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301.htm">To the beginning</a><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>
|
||||
Meow~ It's a reward for the person receiving the gift.<br>
|
||||
If you take the Valentine Secret Spell and collect chocolates and fresh cream, you can make a special Valentine cake. The first cake that you make will probably look shabby. But with a little effort, you can turn it into a great cake.<br>
|
||||
First, the <font color="LEVEL">Simple Valentine Cake</font> - Transformation Scroll, Healing Potion, Ordinary Valentine Cake<br>
|
||||
Second, the <font color="LEVEL">Velvety Valentine Cake</font> - Armor Enchant Scroll, Blessed Scroll of Return, Blessed Scroll of Resurrection, 3 Day Energy Agathion of Love, Delicious Valentine Cake<br>
|
||||
Third, the <font color="LEVEL">Delectable Valentine Cake</font> - Weapon Enchant Scroll, 7 Day Energy Agathion of Love, Perfect Valentine Cake<br>
|
||||
Fourth, the <font color="LEVEL">Decadent Valentine Cake</font> - Top-grade Armor Enchant Scroll, 15 Day Energy Agathion of Love, 30 Day Energy Agathion of Love<br><br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301.htm">To the beginning</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>
|
||||
Meow~ <br>
|
||||
Please take the <font color="LEVEL">Valentine Secret Spell</font> to help you make a special Valentine cake.<br><br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301.htm">To the beginning</a><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>
|
||||
Meow~ <br>
|
||||
I already gave you Valentine Secret Spell, but you're back for me. How greedy.<br>
|
||||
I can't give it to you~<br><br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301.htm">To the beginning</a><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html><body>
|
||||
Meow~ meow~ <br>
|
||||
I'm <font color="LEVEL">Valentine messenger Queen Yang</font><br>
|
||||
The goddess of love Aphrodite gave me a special mission.<br>
|
||||
She told me to help lovers stay in love forever, to deliver comaraderie to friends who are always by your side, and to give something to those who are precious to you.<br>
|
||||
I want to give all of you a special gift today. Lalala~ Lala~<br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301-1.htm">See detailed event explanation.</a><br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301-2.htm">I'm curious about the event rewards.</a><br>
|
||||
<a action="bypass -h Quest TheValentineEvent 4301-3.htm">Receive Valentine Secret Spell.</a><br>
|
||||
</body></html>
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package events.TheValentineEvent;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* Event Code for "The Valentine Event"
|
||||
* http://www.lineage2.com/archive/2009/01/the_valentine_e.html
|
||||
* @author Gnat
|
||||
*/
|
||||
public class TheValentineEvent extends Quest
|
||||
{
|
||||
private static final int _npc = 4301;
|
||||
private static final int _recipe = 20191;
|
||||
|
||||
private static final int[][] _spawns =
|
||||
{
|
||||
{87792,-142240,-1343,44000},
|
||||
{87616,-140688,-1542,16500},
|
||||
{114733,-178691,-821,0},
|
||||
{115708,-182362,-1449,0},
|
||||
{-44337,-113669,-224,0},
|
||||
{-44628,-115409,-240,22500},
|
||||
{-13073,122801,-3117,0},
|
||||
{-13949,121934,-2988,32768},
|
||||
{-14822,123708,-3117,8192},
|
||||
{-80762,151118,-3043,28672},
|
||||
{-84049,150176,-3129,4096},
|
||||
{-82623,151666,-3129,49152},
|
||||
{-84516,242971,-3730,34000},
|
||||
{-86003,243205,-3730,60000},
|
||||
{11281,15652,-4584,25000},
|
||||
{11303,17732,-4574,57344},
|
||||
{47151,49436,-3059,32000},
|
||||
{79806,55570,-1560,0},
|
||||
{83328,55824,-1525,32768},
|
||||
{80986,54504,-1525,32768},
|
||||
{18178,145149,-3054,7400},
|
||||
{19208,144380,-3097,32768},
|
||||
{19508,145775,-3086,48000},
|
||||
{17396,170259,-3507,30000},
|
||||
{83332,149160,-3405,49152},
|
||||
{82277,148598,-3467,0},
|
||||
{81621,148725,-3467,32768},
|
||||
{81680,145656,-3533,32768},
|
||||
{117498,76630,-2695,38000},
|
||||
{115914,76449,-2711,59000},
|
||||
{119536,76988,-2275,40960},
|
||||
{147120,27312,-2192,40960},
|
||||
{147920,25664,-2000,16384},
|
||||
{111776,221104,-3543,16384},
|
||||
{107904,218096,-3675,0},
|
||||
{114920,220020,-3632,32768},
|
||||
{147888,-58048,-2979,49000},
|
||||
{147285,-56461,-2776,11500},
|
||||
{44176,-48732,-800,33000},
|
||||
{44294,-47642,-792,50000},
|
||||
{-116677,46824,360,34828}
|
||||
};
|
||||
|
||||
public TheValentineEvent(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addStartNpc(_npc);
|
||||
addFirstTalkId(_npc);
|
||||
addTalkId(_npc);
|
||||
for(int[] _spawn : _spawns)
|
||||
addSpawn(_npc, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
|
||||
htmltext = event;
|
||||
if(event.equalsIgnoreCase("4301-3.htm"))
|
||||
{
|
||||
if(st.getState() == State.COMPLETED)
|
||||
{
|
||||
htmltext = "4301-4.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
st.giveItems(_recipe, 1);
|
||||
st.playSound("Itemsound.quest_itemget");
|
||||
st.setState(State.COMPLETED);
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
Quest q = QuestManager.getInstance().getQuest(getName());
|
||||
st = q.newQuestState(player);
|
||||
}
|
||||
htmltext = npc.getNpcId() + ".htm";
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TheValentineEvent(-1, "TheValentineEvent", "events");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user