Sync with L2JServer Jan 24th 2015.
This commit is contained in:
6
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-01.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-01.htm
vendored
Normal file
@@ -0,0 +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>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-02.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-02.htm
vendored
Normal file
@@ -0,0 +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.htm">"A furry fox! Yes!"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10742_AFurryFriend 33952-05.htm">"I'm not big on animals."</Button>
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-03.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-03.htm
vendored
Normal file
@@ -0,0 +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>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-04.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-04.htm
vendored
Normal file
@@ -0,0 +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.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-05.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33952-05.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Forest Patrol Leira:<br>
|
||||
You're unbelievable! Cough...
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995-01.htm
vendored
Normal file
4
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995-01.htm
vendored
Normal file
@@ -0,0 +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.htm">Only one way to find out.</button>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995-02.htm
vendored
Normal file
4
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995-02.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Kiku's Cave:<br>
|
||||
No Ricky, but plenty of Kikus.<br>
|
||||
Try another <font color="LEVEL">Kiku's Cave</font>.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995-03.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/33995-03.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Kiku's Cave:<br>
|
||||
Excellent, you found him!<br>
|
||||
</body></html>
|
245
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
vendored
Normal file
245
trunk/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J DataPack
|
||||
*
|
||||
* This file is part of L2J DataPack.
|
||||
*
|
||||
* L2J DataPack is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J DataPack is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package quests.Q10742_AFurryFriend;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
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.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExSendUIEvent;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class Q10742_AFurryFriend extends Quest
|
||||
{
|
||||
// NPC's
|
||||
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
|
||||
protected 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);
|
||||
addMoveFinishedId(RICKY);
|
||||
addCondRace(Race.ERTHEIA, "fixme.html");
|
||||
addCondLevel(MIN_LEVEL, MAX_LEVEL, "fixme.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.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "33952-03.htm":
|
||||
{
|
||||
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 "33995-03.htm":
|
||||
{
|
||||
if (qs.isStarted())
|
||||
{
|
||||
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);
|
||||
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));
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2Npc leira = (L2Npc) npc.getKnownList().getKnownCharactersInRadius(100).stream().filter(n -> (n.getId() == LEIRA)).findFirst().orElse(null);
|
||||
if (leira != 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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())
|
||||
{
|
||||
htmltext = getAlreadyCompletedMsg(player);
|
||||
}
|
||||
|
||||
switch (npc.getId())
|
||||
{
|
||||
case LEIRA:
|
||||
{
|
||||
if (qs.isCreated())
|
||||
{
|
||||
htmltext = "33952-01.htm";
|
||||
}
|
||||
else if (qs.isCond(2))
|
||||
{
|
||||
giveAdena(player, 2500, true);
|
||||
addExpAndSp(player, 52516, 5);
|
||||
qs.exitQuest(false, true);
|
||||
htmltext = "33952-04.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case KIKU_S_CAVE:
|
||||
{
|
||||
if (qs.isStarted())
|
||||
{
|
||||
if (getRandomBoolean())
|
||||
{
|
||||
htmltext = "33995-01.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
addAttackPlayerDesire(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.htm";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user