Merged with released L2J-Unity files.
This commit is contained in:
5
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-00.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-00.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Where did my Ricky run off to?<br>
|
||||
You don't think he disappeared like Karla's Lufie, do you?<br>
|
||||
(Only Ertheia between Lv. 11 and Lv. 20 may perform this quest).
|
||||
</body></html>
|
@@ -1,6 +1,6 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Did you happen to see a small fox playing in this area?<br>
|
||||
Cough, my dear Ricky hasn't gotten a lot of attention from me lately due to my cold, cough...<br>
|
||||
My Ricky may be small, but he eats a lot. And when he looks at me with those big eyes...cough!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-02.htm">"Take it easy, there."</Button>
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Did you happen to see a small fox playing in this area?<br>
|
||||
Cough, my dear Ricky hasn't gotten a lot of attention from me lately due to my cold, cough...<br>
|
||||
My Ricky may be small, but he eats a lot. And when he looks at me with those big eyes...cough!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-02.htm">"Take it easy, there."</button>
|
||||
</body></html>
|
@@ -1,7 +1,7 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Ricky's favorite thing to do was chase Kiku around. I'd scold him, saying that's dangerous, but I would always catch him chasing Kiku anyway.<br>
|
||||
Cough... This cold just isn't going away. Oh, my, where's my brain? I haven's show him to you yet.<br>
|
||||
Would you like to meet Ricky?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-03.html">"A furry fox! Yes!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-05.html">"I'm not big on animals."</Button>
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Ricky's favorite thing to do was chase Kiku around. I'd scold him, saying that's dangerous, but I would always catch him chasing Kiku anyway.<br>
|
||||
Cough...This cold just isn't going away. Oh, my, where's my brain? I haven't shown him to you yet.<br>
|
||||
Would you like to meet Ricky?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-03.htm">"A furry fox! Yes!"</button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-05.html">"I'm not big on animals."</button>
|
||||
</body></html>
|
@@ -1,6 +1,6 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Oh no! Where did Ricky run off to now?<br>
|
||||
It's dangerous over on that side! The Kikus and Growlers might hurt him. Please go find him. I can't leave my post.<br>
|
||||
Cough... You'll find him in one of the <font color="LEVEL">3 Kiku's Caves</font> up there. Once you find him, you have <font color="LEVEL">2 minutes</font> to bring him back to me. Ricky might get restless and run away again.<br>
|
||||
Do be careful. The Kiku might attack you for rummaging around its cave.<br>
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Oh no! Where did Ricky run off to now?<br>
|
||||
It's dangerous over on that side! The Kikus and Growlers might hurt him. Please go find him. I can't leave my post.<br>
|
||||
Cough...You'll find him in one of the <font color="LEVEL">3 Kiku's Caves</font> up there. Once you find him, you have <font color="LEVEL">2 minutes</font> to bring him back to me. Ricky might get restless and run away again.<br>
|
||||
Do be careful. The Kiku might attack you for rummaging around its cave.
|
||||
</body></html>
|
@@ -1,5 +1,5 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Ricky!<br>
|
||||
Where do you think you are going again, you little...cough, cough!<br>
|
||||
I think Ricky needs, cough, some obedience traning.
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Ricky!<br>
|
||||
Where do you think you're going again, you little...cough, cough!<br>
|
||||
I think Ricky needs, cough, some obedience training.
|
||||
</body></html>
|
@@ -1,3 +1,3 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
You're unbelievable! Cough...
|
||||
<html><body>Forest Pastrol Leira:<br>
|
||||
You're unbelievable! Cough...
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-06.html
vendored
Normal file
3
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-06.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
Cough, cough...You'll find Ricky in one of the <font color="LEVEL">3 Kiku's Caves</font> up there. Once you find him, you have <font color="LEVEL">2 minutes</font> to bring him back to me. Ricky might get restless and run away again.
|
||||
</body></html>
|
@@ -1,4 +1,4 @@
|
||||
<html><body>Kiku's Cave:<br>
|
||||
This cave looks small. Is Ricky inside?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33995-03.html">Only one way to find out.</button>
|
||||
<html><body>Kiku's Cave:<br>
|
||||
This cave looks small. Is Ricky inside?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend spawn_ricky">"Only one way to find out."</button>
|
||||
</body></html>
|
@@ -1,4 +1,4 @@
|
||||
<html><body>Kiku's Cave:<br>
|
||||
No Ricky, but plenty of Kikus.<br>
|
||||
Try another <font color="LEVEL">Kiku's Cave</font>.
|
||||
<html><body>Kiku's Cave:<br>
|
||||
No Ricky, but plenty of Kikus.<br>
|
||||
Try another <font color="LEVEL">Kiku's Cave</font>.
|
||||
</body></html>
|
@@ -1,3 +1,3 @@
|
||||
<html><body>Kiku's Cave:<br>
|
||||
Excellent, you found him!<br>
|
||||
<html><body>Kiku's Cave:<br>
|
||||
Take Ricky to <font color="LEVEL">Forest Patrol Leira</font>.
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995.html
vendored
Normal file
4
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Kiku's Cave:<br>
|
||||
It's a small cave of Kikus.<br>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</button>
|
||||
</body></html>
|
@@ -1,238 +1,231 @@
|
||||
/*
|
||||
* 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 quests.Q10742_AFurryFriend;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.Race;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
|
||||
/**
|
||||
* @author Sdw, Mobius
|
||||
*/
|
||||
public class Q10742_AFurryFriend extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int LEIRA = 33952;
|
||||
private static final int KIKU_S_CAVE = 33995;
|
||||
private static final int RICKY = 19552;
|
||||
private static final int KIKU = 23453;
|
||||
// Misc
|
||||
private static final int MIN_LEVEL = 11;
|
||||
private static final int MAX_LEVEL = 20;
|
||||
// Location
|
||||
private static final Location RICKY_SPAWN = new Location(-78138, 237328, -3548);
|
||||
// Waypoints
|
||||
private static Location[] WAYPOINTS =
|
||||
{
|
||||
new Location(-78152, 237352, -3569),
|
||||
new Location(-79176, 236792, -3440),
|
||||
new Location(-80072, 237064, -3311),
|
||||
new Location(-80440, 237320, -3313)
|
||||
};
|
||||
|
||||
public Q10742_AFurryFriend()
|
||||
{
|
||||
super(10742, Q10742_AFurryFriend.class.getSimpleName(), "A Furry Friend");
|
||||
addStartNpc(LEIRA);
|
||||
addTalkId(LEIRA, KIKU_S_CAVE);
|
||||
addFirstTalkId(KIKU_S_CAVE);
|
||||
addMoveFinishedId(RICKY);
|
||||
addCondRace(Race.ERTHEIA, "no_quest.html");
|
||||
addCondLevel(MIN_LEVEL, MAX_LEVEL, "no_quest.html");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, false);
|
||||
if (qs == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "33952-02.htm":
|
||||
case "33952-05.html":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "33952-03.html":
|
||||
{
|
||||
qs.startQuest();
|
||||
final L2Npc ricky = addSpawn(RICKY, RICKY_SPAWN);
|
||||
ricky.setIsRunning(true);
|
||||
ricky.setSummoner(player);
|
||||
startQuestTimer("start_move_ricky", 1000, ricky, player);
|
||||
showOnScreenMsg(player, NpcStringId.FOLLOW_RICKY, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "start_move_ricky":
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, WAYPOINTS[0]);
|
||||
npc.setScriptValue(0);
|
||||
break;
|
||||
}
|
||||
case "check_ricky_distance":
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
startQuestTimer("unspawn_ricky", 2000, npc, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Follow was breaking sometimes, making sure it doesn't happen.
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
|
||||
if ((L2Npc) npc.getKnownList().getKnownCharactersInRadius(300).stream().filter(n -> (n.getId() == LEIRA)).findFirst().orElse(null) != null)
|
||||
{
|
||||
qs.setCond(2, true);
|
||||
showOnScreenMsg(player, NpcStringId.RICKY_HAS_FOUND_LEIRA, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
player.sendPacket(new ExSendUIEvent(player, false, false, 0, 0, NpcStringId.REMAINING_TIME));
|
||||
startQuestTimer("unspawn_ricky", 2000, npc, player);
|
||||
cancelQuestTimer("check_ricky_distance", npc, player);
|
||||
cancelQuestTimer("unspawn_ricky_failed", npc, player);
|
||||
break;
|
||||
}
|
||||
|
||||
final double distanceToRicky = player.calculateDistance(npc, false, true);
|
||||
if ((distanceToRicky > 200) && (distanceToRicky < 500))
|
||||
{
|
||||
showOnScreenMsg(player, NpcStringId.YOU_ARE_FAR_FROM_RICKY, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
}
|
||||
else if (distanceToRicky > 500)
|
||||
{
|
||||
startQuestTimer("unspawn_ricky_failed", 120000, npc, player);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "unspawn_ricky":
|
||||
{
|
||||
npc.deleteMe();
|
||||
break;
|
||||
}
|
||||
case "unspawn_ricky_failed":
|
||||
{
|
||||
showOnScreenMsg(player, NpcStringId.BRING_BACK_RICKY, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
npc.deleteMe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, true);
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
|
||||
if (qs.isCompleted())
|
||||
{
|
||||
return getAlreadyCompletedMsg(player);
|
||||
}
|
||||
|
||||
if (npc.getId() == LEIRA)
|
||||
{
|
||||
if (qs.isCreated())
|
||||
{
|
||||
htmltext = "33952-01.htm";
|
||||
}
|
||||
else if (qs.isCond(2))
|
||||
{
|
||||
cancelQuestTimer("start_move_ricky", npc, player);
|
||||
cancelQuestTimer("check_ricky_distance", npc, player);
|
||||
cancelQuestTimer("unspawn_ricky_failed", npc, player);
|
||||
giveAdena(player, 2500, true);
|
||||
addExpAndSp(player, 52516, 5);
|
||||
qs.exitQuest(false, true);
|
||||
htmltext = "33952-04.html";
|
||||
}
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, true);
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
|
||||
if (qs.isStarted())
|
||||
{
|
||||
if (getRandomBoolean())
|
||||
{
|
||||
addAttackDesire(addSpawn(KIKU, player.getLocation(), true, 120000), player);
|
||||
showOnScreenMsg(player, NpcStringId.RICKY_IS_NOT_HERE_NTRY_SEARCHING_ANOTHER_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
htmltext = "33995-02.html";
|
||||
}
|
||||
else if (!player.getKnownList().getKnownCharactersInRadius(500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player)))
|
||||
{
|
||||
showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 4500);
|
||||
final L2Npc ricky = addSpawn(RICKY, player.getLocation());
|
||||
ricky.setSummoner(player);
|
||||
ricky.setTitle(player.getAppearance().getVisibleName());
|
||||
ricky.setIsRunning(true);
|
||||
ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
ricky.setScriptValue(4);
|
||||
startQuestTimer("check_ricky_distance", 1000, ricky, player, true);
|
||||
startQuestTimer("unspawn_ricky_failed", 120000, ricky, player);
|
||||
player.sendPacket(new ExSendUIEvent(player, false, false, 0, 120, NpcStringId.REMAINING_TIME));
|
||||
htmltext = "33995-03.html";
|
||||
}
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoveFinished(L2Npc npc)
|
||||
{
|
||||
final int currentWaypoint = npc.getScriptValue();
|
||||
|
||||
switch (currentWaypoint)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, WAYPOINTS[currentWaypoint + 1]);
|
||||
npc.setScriptValue(currentWaypoint + 1);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
showOnScreenMsg(npc.getSummoner().getActingPlayer(), NpcStringId.RICKY_IS_ENTERING_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
npc.deleteMe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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 quests.Q10742_AFurryFriend;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.Race;
|
||||
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import com.l2jmobius.gameserver.model.quest.State;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
|
||||
/**
|
||||
* A Furry Friend (10742)
|
||||
* @author Sdw
|
||||
*/
|
||||
public final class Q10742_AFurryFriend extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int LEIRA = 33952;
|
||||
private static final int RICKY = 19552;
|
||||
private static final int KIKU_S_CAVE = 33995;
|
||||
// Monster
|
||||
private static final int KIKU = 23453;
|
||||
// Location
|
||||
private static final Location RICKY_SPAWN = new Location(-78119, 237377, -3536);
|
||||
// Misc
|
||||
private static final int MIN_LEVEL = 11;
|
||||
private static final int MAX_LEVEL = 20;
|
||||
|
||||
public Q10742_AFurryFriend()
|
||||
{
|
||||
super(10742);
|
||||
addStartNpc(LEIRA);
|
||||
addTalkId(LEIRA, KIKU_S_CAVE);
|
||||
addFirstTalkId(KIKU_S_CAVE);
|
||||
addRouteFinishedId(RICKY);
|
||||
|
||||
addCondRace(Race.ERTHEIA, "");
|
||||
addCondLevel(MIN_LEVEL, MAX_LEVEL, "33952-00.htm");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, false);
|
||||
if (qs == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "33952-02.htm":
|
||||
case "33952-05.html":
|
||||
htmltext = event;
|
||||
break;
|
||||
case "33952-03.htm":
|
||||
{
|
||||
qs.startQuest();
|
||||
qs.set("cave", getRandom(3));
|
||||
showOnScreenMsg(player, NpcStringId.FOLLOW_RICKY, ExShowScreenMessage.TOP_CENTER, 10000);
|
||||
addSpawn(RICKY, RICKY_SPAWN, false, 180000);
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "spawn_ricky":
|
||||
{
|
||||
if (qs.isStarted() && qs.isCond(1))
|
||||
{
|
||||
final int caveId = npc.getParameters().getInt("caveId");
|
||||
if (qs.getInt("cave") != caveId) // Wrong cave
|
||||
{
|
||||
addAttackPlayerDesire(addSpawn(KIKU, player.getLocation(), true, 120000), player);
|
||||
showOnScreenMsg(player, NpcStringId.RICKY_IS_NOT_HERE_NTRY_SEARCHING_ANOTHER_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 8000);
|
||||
htmltext = "33995-02.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if player has Ricky spawned
|
||||
if (!L2World.getInstance().getVisibleObjects(player, L2Npc.class, 500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player)))
|
||||
{
|
||||
showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000);
|
||||
player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME));
|
||||
|
||||
// Spawn Ricky
|
||||
final L2Npc ricky = addSpawn(RICKY, player, true, 120000);
|
||||
ricky.setSummoner(player);
|
||||
ricky.setTitle(player.getAppearance().getVisibleName());
|
||||
ricky.setIsRunning(true);
|
||||
ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player);
|
||||
}
|
||||
else // Already have Ricky
|
||||
{
|
||||
htmltext = "33995-03.html";
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CHECK_RICKY_DISTANCE":
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
startQuestTimer("DESPAWN_RICKY", 2000, npc, null);
|
||||
}
|
||||
else if ((npc != null) && !npc.isDecayed())
|
||||
{
|
||||
// Follow was breaking sometimes, making sure it doesn't happen.
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
|
||||
// Check Ricky position
|
||||
final double distanceToRicky = player.calculateDistance(npc, false, false);
|
||||
if (distanceToRicky > 350)
|
||||
{
|
||||
showOnScreenMsg(player, NpcStringId.YOU_ARE_FAR_FROM_RICKY, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
if (distanceToRicky > 650)
|
||||
{
|
||||
player.sendPacket(new ExSendUIEvent(player, false, false, 0, 0, NpcStringId.REMAINING_TIME));
|
||||
startQuestTimer("DESPAWN_RICKY", 1000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("CHECK_RICKY_DISTANCE", 2500, npc, player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2Npc leira = L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 125).stream().filter(n -> (n.getId() == LEIRA)).findAny().orElse(null);
|
||||
if (leira != null)
|
||||
{
|
||||
qs.setCond(2, true);
|
||||
player.sendPacket(new ExSendUIEvent(player, false, false, 0, 0, NpcStringId.REMAINING_TIME));
|
||||
showOnScreenMsg(player, NpcStringId.RICKY_HAS_FOUND_LEIRA, ExShowScreenMessage.MIDDLE_CENTER, 10000);
|
||||
startQuestTimer("DESPAWN_RICKY", 1000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("CHECK_RICKY_DISTANCE", 2500, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "DESPAWN_RICKY":
|
||||
{
|
||||
if ((npc != null) && !npc.isDecayed())
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player, boolean isSimulated)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, true);
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
|
||||
if (npc.getId() == LEIRA)
|
||||
{
|
||||
switch (qs.getState())
|
||||
{
|
||||
case State.CREATED:
|
||||
htmltext = "33952-01.htm";
|
||||
break;
|
||||
case State.STARTED:
|
||||
{
|
||||
if (qs.isCond(1))
|
||||
{
|
||||
htmltext = "33952-06.html";
|
||||
}
|
||||
else if (qs.isCond(2))
|
||||
{
|
||||
if (!isSimulated)
|
||||
{
|
||||
giveAdena(player, 2500, true);
|
||||
addExpAndSp(player, 52516, 5);
|
||||
qs.exitQuest(false, true);
|
||||
}
|
||||
htmltext = "33952-04.html";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case State.COMPLETED:
|
||||
htmltext = getAlreadyCompletedMsg(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, false);
|
||||
return ((qs != null) && qs.isCond(1)) ? "33995-01.html" : "33995.html";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRouteFinished(L2Npc npc)
|
||||
{
|
||||
WalkingManager.getInstance().cancelMoving(npc);
|
||||
npc.deleteMe();
|
||||
}
|
||||
}
|
||||
|
@@ -1 +0,0 @@
|
||||
<html><body>You either don't meet this NPC's minimum quest requirements, or your level is too low to start this quest.</body></html>
|
Reference in New Issue
Block a user