Removed Completely Lost repeated quest timer.
This commit is contained in:
		| @@ -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)); | ||||
| 			startQuestTimer("SAY_TIMER2", 2000, npc, null); | ||||
| 			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 --> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment