Removed Completely Lost repeated quest timer.
This commit is contained in:
parent
4758ed4e2b
commit
d7ee7eb33f
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -40,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -56,7 +57,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -67,15 +67,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, INJURED_SOLDIER, NpcStringId.GASP));
|
||||
break;
|
||||
}
|
||||
@ -289,18 +282,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
@ -312,7 +293,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -398,18 +379,28 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackPlayerDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
@ -757,21 +748,13 @@ public class Q00454_CompletelyLost extends Quest
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a whisper to the given player.
|
||||
* @param npc the NPC
|
||||
|
@ -187,7 +187,6 @@
|
||||
<npc id="32771" x="-181532" y="180012" z="-10464" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32771" x="-174778" y="179102" z="-15768" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-183067" y="183297" z="-10560" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184867" y="186582" z="-15816" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-176143" y="183062" z="-10496" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184988" y="176880" z="-15328" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
<npc id="32772" x="-184003" y="176960" z="-10232" respawnTime="1800sec" /> <!-- Gracian Soldier's Corpse -->
|
||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@ -41,7 +42,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Completely Lost (454)
|
||||
* @author Zoey76
|
||||
* @author Zoey76, Mobius
|
||||
*/
|
||||
public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
@ -57,7 +58,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
super(454);
|
||||
addStartNpc(INJURED_SOLDIER);
|
||||
addTalkId(INJURED_SOLDIER, ERMIAN);
|
||||
addSpawnId(ERMIAN);
|
||||
addMoveFinishedId(INJURED_SOLDIER);
|
||||
addSeeCreatureId(INJURED_SOLDIER);
|
||||
addEventReceivedId(INJURED_SOLDIER);
|
||||
@ -68,15 +68,8 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "QUEST_TIMER":
|
||||
{
|
||||
npc.broadcastEvent("SCE_IM_ERMIAN", 300, null);
|
||||
startQuestTimer("QUEST_TIMER", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SAY_TIMER1":
|
||||
{
|
||||
// TODO: npc.changeStatus(3);
|
||||
broadcastNpcSay(npc, NpcStringId.GASP);
|
||||
break;
|
||||
}
|
||||
@ -193,7 +186,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
{
|
||||
case "32738-04.htm":
|
||||
{
|
||||
if (qs.isCreated() && qs.isNowAvailable() && (player.getLevel() >= MIN_LEVEL))
|
||||
if (player.getLevel() >= MIN_LEVEL)
|
||||
{
|
||||
if (npc.getVariables().getInt("quest_escort", 0) == 0)
|
||||
{
|
||||
@ -255,9 +248,7 @@ public class Q00454_CompletelyLost extends Quest
|
||||
htmltext = "32738-06.html";
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_START", npc, null);
|
||||
final PlayerInstance leader = npc.getVariables().getObject("leader", PlayerInstance.class);
|
||||
if (leader != null)
|
||||
{
|
||||
if (leader.isInParty())
|
||||
if ((leader != null) && leader.isInParty())
|
||||
{
|
||||
for (PlayerInstance member : leader.getParty().getMembers())
|
||||
{
|
||||
@ -273,7 +264,6 @@ public class Q00454_CompletelyLost extends Quest
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "32738-07.html":
|
||||
@ -288,48 +278,23 @@ public class Q00454_CompletelyLost extends Quest
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_CREATURE_ATTACKED)
|
||||
@RegisterType(ListenerRegisterType.NPC)
|
||||
@Id(INJURED_SOLDIER)
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
// TODO: npc.changeStatus(2);
|
||||
npc.getVariables().set("state", 1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onEventReceived(String eventName, Npc sender, Npc receiver, WorldObject reference)
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
case "SCE_IM_ERMIAN":
|
||||
{
|
||||
if (receiver.getVariables().getInt("state", 0) == 2)
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.getVariables().set("ermian", sender);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(receiver, MOVE_TO, 10000000);
|
||||
receiver.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", receiver, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SCE_A_SEED_ESCORT_QUEST_START":
|
||||
{
|
||||
final PlayerInstance leader = receiver.getVariables().getObject("leader", PlayerInstance.class);
|
||||
if (leader != null)
|
||||
{
|
||||
receiver.setTarget(leader);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, leader);
|
||||
}
|
||||
|
||||
startQuestTimer("CHECK_TIMER", 1000, receiver, null);
|
||||
startQuestTimer("TIME_LIMIT1", 60000, receiver, null);
|
||||
receiver.getVariables().set("state", 2);
|
||||
receiver.setScriptValue(2);
|
||||
receiver.getVariables().set("quest_escort", 99);
|
||||
break;
|
||||
}
|
||||
@ -415,31 +380,34 @@ public class Q00454_CompletelyLost extends Quest
|
||||
@Override
|
||||
public void onMoveFinished(Npc npc)
|
||||
{
|
||||
final Npc ermian = npc.getVariables().getObject("ermian", Npc.class);
|
||||
if (ermian != null)
|
||||
if (npc.isScriptValue(2))
|
||||
{
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, ermian));
|
||||
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 300))
|
||||
{
|
||||
if (nearby.getId() == ERMIAN)
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
addMoveToDesire(npc, MOVE_TO, 10000000);
|
||||
npc.sendScriptEvent("SCE_A_SEED_ESCORT_QUEST_SUCCESS", npc, null);
|
||||
npc.setHeading(Util.calculateHeadingFrom(npc, nearby));
|
||||
startQuestTimer("SAY_TIMER2", 2000, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
if (creature.isPlayer() && (npc.getVariables().getInt("state", 0) == 0))
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
addAttackDesire(npc, creature.getActingPlayer(), 10);
|
||||
}
|
||||
return super.onSeeCreature(npc, creature, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("QUEST_TIMER", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
@ -775,6 +743,19 @@ public class Q00454_CompletelyLost extends Quest
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_CREATURE_ATTACKED)
|
||||
@RegisterType(ListenerRegisterType.NPC)
|
||||
@Id(INJURED_SOLDIER)
|
||||
public TerminateReturn onAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
npc.setScriptValue(1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
startQuestTimer("SAY_TIMER1", 2000, npc, null);
|
||||
return new TerminateReturn(true, false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcast NPC string to all known players.
|
||||
* @param npc the NPC
|
||||
|
10
L2J_Mobius_CT_2.6_HighFive/dist/game/data/spawns/injured_soldiers.xml
vendored
Normal file
10
L2J_Mobius_CT_2.6_HighFive/dist/game/data/spawns/injured_soldiers.xml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/spawns.xsd">
|
||||
<spawn name="InjuredSoldiers">
|
||||
<npc id="32738" x="-184867" y="186582" z="-15816" heading="12564" respawnDelay="60" /> <!-- Injured Soldier -->
|
||||
<npc id="32738" x="-184822" y="179810" z="-15424" heading="39565" respawnDelay="60" /> <!-- Injured Soldier -->
|
||||
<npc id="32738" x="-184735" y="179369" z="-10424" heading="50804" respawnDelay="60" /> <!-- Injured Soldier -->
|
||||
<npc id="32738" x="-175193" y="179068" z="-10304" heading="27153" respawnDelay="60" /> <!-- Injured Soldier -->
|
||||
<npc id="32738" x="-175144" y="178477" z="-15800" heading="52696" respawnDelay="60" /> <!-- Injured Soldier -->
|
||||
</spawn>
|
||||
</list>
|
Loading…
Reference in New Issue
Block a user