Dropped OnNpcCreatureSee in favor of OnCreatureSee event.
This commit is contained in:
		| @@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.NpcSay; | ||||
|  | ||||
| @@ -36,7 +37,7 @@ public class MercenaryCaptain extends AbstractNpcAI | ||||
| 	 | ||||
| 	private MercenaryCaptain() | ||||
| 	{ | ||||
| 		addSeeCreatureId(MERCENARY_CAPTAIN); | ||||
| 		setCreatureSeeId(this::onCreatureSee, MERCENARY_CAPTAIN); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -49,14 +50,14 @@ public class MercenaryCaptain extends AbstractNpcAI | ||||
| 		return super.onAdvEvent(event, npc, player); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.NpcSay; | ||||
|  | ||||
| @@ -36,7 +37,7 @@ public class Namo extends AbstractNpcAI | ||||
| 	 | ||||
| 	private Namo() | ||||
| 	{ | ||||
| 		addSeeCreatureId(NAMO); | ||||
| 		setCreatureSeeId(this::onCreatureSee, NAMO); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -49,14 +50,14 @@ public class Namo extends AbstractNpcAI | ||||
| 		return super.onAdvEvent(event, npc, player); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.NpcSay; | ||||
|  | ||||
| @@ -36,7 +37,7 @@ public class Rakun extends AbstractNpcAI | ||||
| 	 | ||||
| 	private Rakun() | ||||
| 	{ | ||||
| 		addSeeCreatureId(RAKUN); | ||||
| 		setCreatureSeeId(this::onCreatureSee, RAKUN); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -49,14 +50,14 @@ public class Rakun extends AbstractNpcAI | ||||
| 		return super.onAdvEvent(event, npc, player); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -21,6 +21,7 @@ import org.l2jmobius.gameserver.model.Location; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
|  | ||||
| import ai.AbstractNpcAI; | ||||
| @@ -79,7 +80,7 @@ public class Rooney extends AbstractNpcAI | ||||
| 	 | ||||
| 	private Rooney() | ||||
| 	{ | ||||
| 		addSeeCreatureId(ROONEY); | ||||
| 		setCreatureSeeId(this::onCreatureSee, ROONEY); | ||||
| 		addSpawn(ROONEY, getRandomEntry(LOCATIONS), false, 0); | ||||
| 	} | ||||
| 	 | ||||
| @@ -124,16 +125,19 @@ public class Rooney extends AbstractNpcAI | ||||
| 		return null; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		if (creature.isPlayer() && npc.isScriptValue(0)) | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELCOME); | ||||
| 			startQuestTimer("teleport", 60000, npc, null); | ||||
| 			npc.setScriptValue(1); | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			if (npc.isScriptValue(0)) | ||||
| 			{ | ||||
| 				npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELCOME); | ||||
| 				startQuestTimer("teleport", 60000, npc, null); | ||||
| 				npc.setScriptValue(1); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -21,6 +21,7 @@ import org.l2jmobius.gameserver.model.World; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
|  | ||||
| import ai.AbstractNpcAI; | ||||
| @@ -44,7 +45,7 @@ public class GardenWatchman extends AbstractNpcAI | ||||
| 	public GardenWatchman() | ||||
| 	{ | ||||
| 		addSpawnId(GARDEN_WATCHMAN); | ||||
| 		addSeeCreatureId(GENESIS_TRAP_1, GENESIS_TRAP_2); | ||||
| 		setCreatureSeeId(this::onCreatureSee, GENESIS_TRAP_1, GENESIS_TRAP_2); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -89,14 +90,14 @@ public class GardenWatchman extends AbstractNpcAI | ||||
| 		return super.onSpawn(npc); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			startQuestTimer("DEBUFF", 3000, npc, null, true); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -24,6 +24,7 @@ import org.l2jmobius.gameserver.model.World; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; | ||||
|  | ||||
| @@ -56,7 +57,7 @@ public class EntrancePortalToCrystalCaverns extends AbstractNpcAI | ||||
| 		addTalkId(CAVERNS_ENTRACE); | ||||
| 		addFirstTalkId(CAVERNS_ENTRACE); | ||||
| 		addSpawnId(CAVERNS_ENTRACE); | ||||
| 		addSeeCreatureId(CAVERNS_ENTRACE); | ||||
| 		setCreatureSeeId(this::onCreatureSee, CAVERNS_ENTRACE); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -116,16 +117,15 @@ public class EntrancePortalToCrystalCaverns extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			creature.getActingPlayer().sendPacket(new OnEventTrigger(PRISON_ENTRACE_TRIGGER_1, true)); | ||||
| 			creature.getActingPlayer().sendPacket(new OnEventTrigger(PRISON_ENTRACE_TRIGGER_2, true)); | ||||
| 			updateTriggersForPlayer(creature.getActingPlayer(), getCurrentInstanceTemplateId()); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public void updateTriggersForPlayer(PlayerInstance player, int currentTemplateId) | ||||
|   | ||||
| @@ -21,6 +21,7 @@ import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.NpcSay; | ||||
|  | ||||
| @@ -43,8 +44,8 @@ public class AltarOfSacrifice extends AbstractNpcAI | ||||
| 	 | ||||
| 	private AltarOfSacrifice() | ||||
| 	{ | ||||
| 		addSeeCreatureId(JENNAS_GUARD); | ||||
| 		addSpawnId(IMMERIAL, JENNAS_GUARD, GIGGLE); | ||||
| 		setCreatureSeeId(this::onCreatureSee, JENNAS_GUARD); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -71,15 +72,15 @@ public class AltarOfSacrifice extends AbstractNpcAI | ||||
| 		return super.onAdvEvent(event, npc, player); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if ((creature != null) && creature.isPlayer() && _jenas_guard.isScriptValue(0)) | ||||
| 		{ | ||||
| 			startQuestTimer("msg_text", 3000, npc, null); | ||||
| 			_jenas_guard.setScriptValue(1); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.model.events.annotations.Id; | ||||
| import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; | ||||
| import org.l2jmobius.gameserver.model.events.annotations.RegisterType; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
|  | ||||
| import ai.AbstractNpcAI; | ||||
| @@ -77,9 +78,9 @@ public class Wastelands extends AbstractNpcAI | ||||
| 	 | ||||
| 	private Wastelands() | ||||
| 	{ | ||||
| 		addSpawnId(COMMANDER, GUARD, DECO_GUARD, REGENERATED_KANILOV, REGENERATED_POSLOF, SAKUM); | ||||
| 		addSeeCreatureId(JOEL, SCHUAZEN, COMMANDO, COMMANDO_CAPTAIN); | ||||
| 		addKillId(REGENERATED_POSLOF, SAKUM); | ||||
| 		addSpawnId(COMMANDER, GUARD, DECO_GUARD, REGENERATED_KANILOV, REGENERATED_POSLOF, SAKUM); | ||||
| 		setCreatureSeeId(this::onCreatureSee, JOEL, SCHUAZEN, COMMANDO, COMMANDO_CAPTAIN); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -187,14 +188,14 @@ public class Wastelands extends AbstractNpcAI | ||||
| 		return super.onAdvEvent(event, npc, player); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer() && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)) | ||||
| 		{ | ||||
| 			startQuestTimer("START_ATTACK", 250, npc, null); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -34,6 +34,7 @@ import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.Playable; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.GrandBossInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.skills.Skill; | ||||
| import org.l2jmobius.gameserver.model.skills.SkillCaster; | ||||
| @@ -108,8 +109,8 @@ public class Baium extends AbstractNpcAI | ||||
| 		addStartNpc(DIMENSION_VORTEX_1, TELE_CUBE, BAIUM_STONE); | ||||
| 		addAttackId(BAIUM, ARCHANGEL); | ||||
| 		addKillId(BAIUM); | ||||
| 		addSeeCreatureId(BAIUM); | ||||
| 		addSpellFinishedId(BAIUM); | ||||
| 		setCreatureSeeId(this::onCreatureSee, BAIUM); | ||||
| 		 | ||||
| 		final StatSet info = GrandBossManager.getInstance().getStatSet(BAIUM); | ||||
| 		 | ||||
| @@ -553,12 +554,14 @@ public class Baium extends AbstractNpcAI | ||||
| 		return super.onKill(npc, killer, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		 | ||||
| 		if (!zone.isInsideZone(creature) || (creature.isNpc() && (creature.getId() == BAIUM_STONE))) | ||||
| 		{ | ||||
| 			return super.onSeeCreature(npc, creature, isSummon); | ||||
| 			return; | ||||
| 		} | ||||
| 		 | ||||
| 		if (creature.isPlayer() && !creature.isDead() && (_standbyPlayer == null)) | ||||
| @@ -590,7 +593,6 @@ public class Baium extends AbstractNpcAI | ||||
| 			refreshAiParams(creature, npc, 10000, 1000); | ||||
| 		} | ||||
| 		manageSkills(npc); | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import org.l2jmobius.gameserver.model.actor.Attackable; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| @@ -59,9 +60,9 @@ public class IceQueensCastle extends AbstractInstance | ||||
| 		super(TEMPLATE_ID); | ||||
| 		addStartNpc(JINIA); | ||||
| 		addTalkId(JINIA); | ||||
| 		addSeeCreatureId(BATTALION_LEADER, LEGIONNAIRE, MERCENARY_ARCHER); | ||||
| 		addSpawnId(FREYA); | ||||
| 		addSpellFinishedId(FREYA); | ||||
| 		setCreatureSeeId(this::onCreatureSee, BATTALION_LEADER, LEGIONNAIRE, MERCENARY_ARCHER); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -139,9 +140,10 @@ public class IceQueensCastle extends AbstractInstance | ||||
| 		return super.onSpawn(npc); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer() && npc.isScriptValue(0)) | ||||
| 		{ | ||||
| 			npc.setScriptValue(1); | ||||
| @@ -157,7 +159,6 @@ public class IceQueensCastle extends AbstractInstance | ||||
| 			}); | ||||
| 			startQuestTimer("ATTACK_KNIGHT", 5000, npc, null); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.model.events.annotations.Id; | ||||
| import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; | ||||
| import org.l2jmobius.gameserver.model.events.annotations.RegisterType; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDamageReceived; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.skills.Skill; | ||||
| import org.l2jmobius.gameserver.model.zone.ZoneType; | ||||
| @@ -205,9 +206,9 @@ public class Lindvior extends AbstractNpcAI | ||||
| 		addExitZoneId(ZONE_ID); | ||||
| 		addKillId(LINDVIOR_GROUND, LINDVIOR_FLY, LINDVIOR_RAID, NPC_GENERATOR); | ||||
| 		addSkillSeeId(NPC_GENERATOR); | ||||
| 		addSpawnId(NPC_ATTACKER_GENERATORS, NPC_ATTACKER_GENERATORS_1, LYN_DRACO_ATTACKER_GENERATORS, GENERATOR_GUARD, NPC_GENERATOR); | ||||
| 		addFirstTalkId(NPC_GENERATOR); | ||||
| 		addSeeCreatureId(INVISIBLE); | ||||
| 		addSpawnId(NPC_ATTACKER_GENERATORS, NPC_ATTACKER_GENERATORS_1, LYN_DRACO_ATTACKER_GENERATORS, GENERATOR_GUARD, NPC_GENERATOR); | ||||
| 		setCreatureSeeId(this::onCreatureSee, INVISIBLE); | ||||
| 		_zoneLair = ZoneManager.getInstance().getZoneById(ZONE_ID, NoSummonFriendZone.class); | ||||
| 		// Unlock | ||||
| 		final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID); | ||||
| @@ -508,18 +509,17 @@ public class Lindvior extends AbstractNpcAI | ||||
| 		return super.onSpawn(npc); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature player, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		setLindviorSpawnTask(); | ||||
| 		npc.getSpawn().stopRespawn(); | ||||
| 		npc.deleteMe(); | ||||
| 		return super.onSeeCreature(npc, player, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	private void nextStage(int _taskId) | ||||
| 	private void nextStage(int taskId) | ||||
| 	{ | ||||
| 		switch (_taskId) | ||||
| 		switch (taskId) | ||||
| 		{ | ||||
| 			case 1: // Spawn Generators | ||||
| 			{ | ||||
|   | ||||
| @@ -22,9 +22,9 @@ import org.l2jmobius.gameserver.ai.CtrlIntention; | ||||
| import org.l2jmobius.gameserver.geoengine.GeoEngine; | ||||
| import org.l2jmobius.gameserver.model.Location; | ||||
| import org.l2jmobius.gameserver.model.World; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation; | ||||
|  | ||||
| @@ -43,8 +43,8 @@ public class Vortex extends AbstractNpcAI | ||||
| 	public Vortex() | ||||
| 	{ | ||||
| 		super(); | ||||
| 		addSeeCreatureId(SMALL_VORTEX, BIG_VORTEX); | ||||
| 		addSpawnId(SMALL_VORTEX, BIG_VORTEX); | ||||
| 		setCreatureSeeId(this::onCreatureSee, SMALL_VORTEX, BIG_VORTEX); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -112,9 +112,9 @@ public class Vortex extends AbstractNpcAI | ||||
| 		return super.onAdvEvent(event, npc, player); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		switch (npc.getId()) | ||||
| 		{ | ||||
| 			case SMALL_VORTEX: | ||||
| @@ -128,7 +128,6 @@ public class Vortex extends AbstractNpcAI | ||||
| 				break; | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -37,6 +37,7 @@ import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.DoorInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestTimer; | ||||
| import org.l2jmobius.gameserver.model.skills.Skill; | ||||
| import org.l2jmobius.gameserver.model.skills.SkillCaster; | ||||
| @@ -134,9 +135,9 @@ public class Ramona extends AbstractNpcAI | ||||
| 	{ | ||||
| 		addStartNpc(MP_CONTROL); | ||||
| 		addKillId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3); | ||||
| 		addSeeCreatureId(MP_CONTROL); | ||||
| 		addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3); | ||||
| 		addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3); | ||||
| 		setCreatureSeeId(this::onCreatureSee, MP_CONTROL); | ||||
| 		 | ||||
| 		final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis(); | ||||
| 		if (temp > 0) | ||||
| @@ -550,15 +551,16 @@ public class Ramona extends AbstractNpcAI | ||||
| 		return super.onKill(npc, killer, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		npc.setInvul(true); | ||||
| 		 | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			startQuestTimer("SPAWN_MS", 10000, npc, null, true); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -37,6 +37,7 @@ import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.Playable; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.skills.BuffInfo; | ||||
| import org.l2jmobius.gameserver.model.zone.ZoneType; | ||||
| @@ -317,6 +318,7 @@ public class Trasken extends AbstractNpcAI | ||||
| 		addExitZoneId(ZONE_ID); | ||||
| 		addEnterZoneId(ZONE_ID_HEART); | ||||
| 		addExitZoneId(ZONE_ID_HEART); | ||||
| 		setCreatureSeeId(this::onCreatureSee, LAVRA_1, LAVRA_2, LAVRA_3, TRADJAN, TIE, BIG_TIE); | ||||
| 		init(); | ||||
| 		if (DoorData.getInstance().getDoor(DOOR) != null) | ||||
| 		{ | ||||
| @@ -537,19 +539,21 @@ public class Trasken extends AbstractNpcAI | ||||
| 		return super.onSpawn(npc); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		if (npc.isDead() || (creature == null)) | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		if (npc.isDead()) | ||||
| 		{ | ||||
| 			return null; | ||||
| 			return; | ||||
| 		} | ||||
| 		 | ||||
| 		if ((npc.getId() == LAVRA_1) || (npc.getId() == LAVRA_2) || (npc.getId() == LAVRA_3) || (npc.getId() == TRADJAN)) | ||||
| 		{ | ||||
| 			addAttackPlayerDesire(npc, getRandomEntry(_zoneLair.getPlayersInside())); | ||||
| 		} | ||||
| 		else if ((npc.getId() == TIE) || (npc.getId() == BIG_TIE)) | ||||
| 		{ | ||||
| 			final Creature creature = event.getSeen(); | ||||
| 			if (getRandom(100) < 60) | ||||
| 			{ | ||||
| 				npc.setTarget(creature); | ||||
| @@ -563,7 +567,6 @@ public class Trasken extends AbstractNpcAI | ||||
| 				addAttackPlayerDesire(npc, (Playable) creature); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.MerchantInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.clan.ClanPrivilege; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.residences.ClanHall; | ||||
| import org.l2jmobius.gameserver.model.residences.ResidenceFunction; | ||||
| @@ -101,7 +102,7 @@ public class ClanHallManager extends AbstractNpcAI | ||||
| 		addStartNpc(CLANHALL_MANAGERS); | ||||
| 		addTalkId(CLANHALL_MANAGERS); | ||||
| 		addFirstTalkId(CLANHALL_MANAGERS); | ||||
| 		addSeeCreatureId(CLANHALL_MANAGERS); | ||||
| 		setCreatureSeeId(this::onCreatureSee, CLANHALL_MANAGERS); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -483,18 +484,18 @@ public class ClanHallManager extends AbstractNpcAI | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			final ClanHall clanHall = npc.getClanHall(); | ||||
| 			if (clanHall != null) | ||||
| 			{ | ||||
| 				creature.getActingPlayer().sendPacket(new AgitDecoInfo(clanHall)); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	private void updateVisualEffects(ClanHall clanHall, Npc npc) | ||||
|   | ||||
| @@ -20,6 +20,7 @@ import org.l2jmobius.gameserver.model.actor.Attackable; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
|  | ||||
| import ai.AbstractNpcAI; | ||||
|  | ||||
| @@ -34,17 +35,17 @@ public class Gordon extends AbstractNpcAI | ||||
| 	private Gordon() | ||||
| 	{ | ||||
| 		addSpawnId(GORDON); | ||||
| 		addSeeCreatureId(GORDON); | ||||
| 		setCreatureSeeId(this::onCreatureSee, GORDON); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer() && ((PlayerInstance) creature).isCursedWeaponEquipped()) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			addAttackPlayerDesire(npc, (PlayerInstance) creature); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
| @@ -66,8 +67,7 @@ public class ChamberOfProphecies extends AbstractInstance | ||||
| 		addStartNpc(KAIN_VAN_HALTER); | ||||
| 		addFirstTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD); | ||||
| 		addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD); | ||||
| 		addSeeCreatureId(FERIN); | ||||
| 		addSeeCreatureId(VAN_HALTER); | ||||
| 		setCreatureSeeId(this::onCreatureSee, FERIN, VAN_HALTER); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -501,12 +501,13 @@ public class ChamberOfProphecies extends AbstractInstance | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Npc npc = (Npc) event.getSeer(); | ||||
| 		final Instance world = npc.getInstanceWorld(); | ||||
| 		if (world != null) | ||||
| 		{ | ||||
| 			final Creature creature = event.getSeen(); | ||||
| 			switch (npc.getId()) | ||||
| 			{ | ||||
| 				case FERIN: | ||||
| @@ -527,7 +528,6 @@ public class ChamberOfProphecies extends AbstractInstance | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| @@ -89,10 +90,10 @@ public class KartiaHelperAdolph extends AbstractNpcAI | ||||
| 	 | ||||
| 	private KartiaHelperAdolph() | ||||
| 	{ | ||||
| 		addSpellFinishedId(KARTIA_ADOLPH); | ||||
| 		setCreatureKillId(this::onCreatureKill, KARTIA_ADOLPH); | ||||
| 		setCreatureAttackedId(this::onCreatureAttacked, KARTIA_ADOLPH); | ||||
| 		addSpellFinishedId(KARTIA_ADOLPH); | ||||
| 		addSeeCreatureId(KARTIA_ADOLPH); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KARTIA_ADOLPH); | ||||
| 		setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); | ||||
| 	} | ||||
| 	 | ||||
| @@ -287,14 +288,14 @@ public class KartiaHelperAdolph extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public static void main(String[] args) | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| @@ -87,7 +88,7 @@ public class KartiaHelperBarton extends AbstractNpcAI | ||||
| 	{ | ||||
| 		setCreatureKillId(this::onCreatureKill, KARTIA_BARTON); | ||||
| 		setCreatureAttackedId(this::onCreatureAttacked, KARTIA_BARTON); | ||||
| 		addSeeCreatureId(KARTIA_BARTON); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KARTIA_BARTON); | ||||
| 		setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); | ||||
| 	} | ||||
| 	 | ||||
| @@ -148,18 +149,17 @@ public class KartiaHelperBarton extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 			((Npc) event.getSeer()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 		} | ||||
| 		else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId())) | ||||
| 		{ | ||||
| 			npc.getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 			((Npc) event.getSeer()).getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public void useRandomSkill(Npc npc) | ||||
|   | ||||
| @@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| @@ -110,7 +111,7 @@ public class KartiaHelperElise extends AbstractNpcAI | ||||
| 	private KartiaHelperElise() | ||||
| 	{ | ||||
| 		setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); | ||||
| 		addSeeCreatureId(KARTIA_ELISE); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KARTIA_ELISE); | ||||
| 		setCreatureKillId(this::onCreatureKill, KARTIA_ELISE); | ||||
| 	} | ||||
| 	 | ||||
| @@ -242,11 +243,12 @@ public class KartiaHelperElise extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer() || (creature instanceof FriendlyNpcInstance)) | ||||
| 		{ | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			final StatSet npcVars = npc.getVariables(); | ||||
| 			if (creature.isPlayer()) | ||||
| 			{ | ||||
| @@ -269,7 +271,6 @@ public class KartiaHelperElise extends AbstractNpcAI | ||||
| 				npcVars.set("HAYUK_OBJECT", creature); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public void onCreatureKill(OnCreatureDeath event) | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
|  | ||||
| @@ -82,7 +83,7 @@ public class KartiaHelperEliyah extends AbstractNpcAI | ||||
| 	{ | ||||
| 		setCreatureKillId(this::onCreatureKill, KARTIA_ELIYAH); | ||||
| 		setCreatureAttackedId(this::onCreatureAttacked, KARTIA_ELIYAH); | ||||
| 		addSeeCreatureId(KARTIA_ELIYAH); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KARTIA_ELIYAH); | ||||
| 		setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); | ||||
| 	} | ||||
| 	 | ||||
| @@ -136,18 +137,17 @@ public class KartiaHelperEliyah extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 			((Npc) event.getSeer()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 		} | ||||
| 		else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId())) | ||||
| 		{ | ||||
| 			npc.getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 			((Npc) event.getSeer()).getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public void onCreatureAttacked(OnCreatureAttacked event) | ||||
|   | ||||
| @@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| @@ -91,7 +92,7 @@ public class KartiaHelperGuardian extends AbstractNpcAI | ||||
| 	{ | ||||
| 		setCreatureKillId(this::onCreatureKill, KARTIA_GUARDIANS); | ||||
| 		setCreatureAttackedId(this::onCreatureAttacked, KARTIA_GUARDIANS); | ||||
| 		addSeeCreatureId(KARTIA_GUARDIANS); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KARTIA_GUARDIANS); | ||||
| 		setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); | ||||
| 	} | ||||
| 	 | ||||
| @@ -154,22 +155,21 @@ public class KartiaHelperGuardian extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 			((Npc) event.getSeer()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 		} | ||||
| 		else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId())) | ||||
| 		{ | ||||
| 			npc.getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 			((Npc) event.getSeer()).getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 		} | ||||
| 		else if (CommonUtil.contains(KARTIA_ELIYAH, creature.getId())) | ||||
| 		{ | ||||
| 			npc.getVariables().set("ELIYAH_OBJECT", creature); | ||||
| 			((Npc) event.getSeer()).getVariables().set("ELIYAH_OBJECT", creature); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public void useRandomSkill(Npc npc) | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| @@ -88,7 +89,7 @@ public class KartiaHelperHayuk extends AbstractNpcAI | ||||
| 	{ | ||||
| 		setCreatureKillId(this::onCreatureKill, KARTIA_HAYUK); | ||||
| 		setCreatureAttackedId(this::onCreatureAttacked, KARTIA_HAYUK); | ||||
| 		addSeeCreatureId(KARTIA_HAYUK); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KARTIA_HAYUK); | ||||
| 		setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); | ||||
| 	} | ||||
| 	 | ||||
| @@ -149,18 +150,17 @@ public class KartiaHelperHayuk extends AbstractNpcAI | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 			((Npc) event.getSeer()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); | ||||
| 		} | ||||
| 		else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId())) | ||||
| 		{ | ||||
| 			npc.getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 			((Npc) event.getSeer()).getVariables().set("ADOLPH_OBJECT", creature); | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	public void useRandomSkill(Npc npc) | ||||
|   | ||||
| @@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.model.actor.Attackable; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.SkillHolder; | ||||
| import org.l2jmobius.gameserver.model.instancezone.Instance; | ||||
| import org.l2jmobius.gameserver.network.SystemMessageId; | ||||
| @@ -85,11 +86,11 @@ public class NornilsGarden extends AbstractInstance | ||||
| 		addTalkId(BOZ_CORE); | ||||
| 		addFirstTalkId(BOZ_CORE); | ||||
| 		addAttackId(SPICULA_ZERO); | ||||
| 		addSpawnId(ATTACABLE_MONSTERS); | ||||
| 		addKillId(ATTACABLE_MONSTERS); | ||||
| 		addKillId(SPICULA_ZERO); | ||||
| 		addKillId(BOZ_STAGE1, BOZ_STAGE2, BOZ_STAGE3, BOZ_STAGE4); | ||||
| 		addSeeCreatureId(BOZ_STAGE1); | ||||
| 		addSpawnId(ATTACABLE_MONSTERS); | ||||
| 		setCreatureSeeId(this::onCreatureSee, BOZ_STAGE1); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -282,16 +283,19 @@ public class NornilsGarden extends AbstractInstance | ||||
| 		return "33781.html"; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		if ((npc.getId() == BOZ_STAGE1) && creature.isPlayable() && npc.isScriptValue(0)) | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayable()) | ||||
| 		{ | ||||
| 			startQuestTimer("stage1", 3000, npc, null); | ||||
| 			npc.setTargetable(false); | ||||
| 			npc.setScriptValue(1); | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			if (npc.isScriptValue(0)) | ||||
| 			{ | ||||
| 				startQuestTimer("stage1", 3000, npc, null); | ||||
| 				npc.setTargetable(false); | ||||
| 				npc.setScriptValue(1); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.model.events.annotations.Id; | ||||
| import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; | ||||
| import org.l2jmobius.gameserver.model.events.annotations.RegisterType; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.events.returns.TerminateReturn; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| @@ -58,7 +59,7 @@ public class Q00454_CompletelyLost extends Quest | ||||
| 		addStartNpc(INJURED_SOLDIER); | ||||
| 		addTalkId(INJURED_SOLDIER, ERMIAN); | ||||
| 		addMoveFinishedId(INJURED_SOLDIER); | ||||
| 		addSeeCreatureId(INJURED_SOLDIER); | ||||
| 		setCreatureSeeId(this::onCreatureSee, INJURED_SOLDIER); | ||||
| 		addEventReceivedId(INJURED_SOLDIER); | ||||
| 	} | ||||
| 	 | ||||
| @@ -397,14 +398,17 @@ public class Q00454_CompletelyLost extends Quest | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		if (creature.isPlayer() && npc.isScriptValue(0)) | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			addAttackPlayerDesire(npc, creature.getActingPlayer(), 10); | ||||
| 			final Npc npc = (Npc) event.getSeer(); | ||||
| 			if (npc.isScriptValue(0)) | ||||
| 			{ | ||||
| 				addAttackPlayerDesire(npc, creature.getActingPlayer(), 10); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -24,9 +24,9 @@ import org.l2jmobius.gameserver.enums.Movie; | ||||
| import org.l2jmobius.gameserver.enums.QuestSound; | ||||
| import org.l2jmobius.gameserver.enums.QuestType; | ||||
| import org.l2jmobius.gameserver.model.Party; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| @@ -60,8 +60,8 @@ public class Q00833_DevilsTreasureTauti extends Quest | ||||
| 		addStartNpc(DETON); | ||||
| 		addTalkId(SETTLEN); | ||||
| 		addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); | ||||
| 		addSeeCreatureId(DETON); | ||||
| 		registerQuestItems(FLAME_FLOWER); | ||||
| 		setCreatureSeeId(this::onCreatureSee, DETON); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -115,10 +115,9 @@ public class Q00833_DevilsTreasureTauti extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final PlayerInstance player = creature.getActingPlayer(); | ||||
| 		final PlayerInstance player = event.getSeen().getActingPlayer(); | ||||
| 		if (player != null) | ||||
| 		{ | ||||
| 			final QuestState qs = getQuestState(player, true); | ||||
| @@ -128,7 +127,6 @@ public class Q00833_DevilsTreasureTauti extends Quest | ||||
| 				qs.startQuest(); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -19,9 +19,9 @@ package quests.Q00835_PitiableMelisa; | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.gameserver.enums.Movie; | ||||
| import org.l2jmobius.gameserver.enums.QuestType; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| import org.l2jmobius.gameserver.model.quest.State; | ||||
| @@ -55,9 +55,9 @@ public class Q00835_PitiableMelisa extends Quest | ||||
| 		super(835); | ||||
| 		addStartNpc(KANNA); | ||||
| 		addTalkId(SETTLEN); | ||||
| 		addSeeCreatureId(KANNA); | ||||
| 		addKillId(MONSTERS); | ||||
| 		registerQuestItems(ICE_CRYSTAL_SHARD); | ||||
| 		setCreatureSeeId(this::onCreatureSee, KANNA); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -119,10 +119,9 @@ public class Q00835_PitiableMelisa extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final PlayerInstance player = creature.getActingPlayer(); | ||||
| 		final PlayerInstance player = event.getSeen().getActingPlayer(); | ||||
| 		if (player != null) | ||||
| 		{ | ||||
| 			final QuestState qs = getQuestState(player, true); | ||||
| @@ -132,7 +131,6 @@ public class Q00835_PitiableMelisa extends Quest | ||||
| 				qs.startQuest(); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -76,7 +76,7 @@ public class Q10537_KamaelDisarray extends Quest | ||||
| 		addKillId(LESSER_GIANT_SOLDIER); | ||||
| 		addSkillSeeId(ESSENCE_LASSER_GIANTS, ROOT_LASSER_GIANTS); | ||||
| 		registerQuestItems(MINIONS_REPOT); | ||||
| 		addSeeCreatureId(RETBACH, STHOR, VETLE); | ||||
| 		// setCreatureSeeId(this::onCreatureSee, RETBACH, STHOR, VETLE); | ||||
| 		addFactionLevel(Faction.GIANT_TRACKERS, 2, "34237-00.htm"); | ||||
| 		addCondMinLevel(MIN_LEVEL, "34237-00.htm"); | ||||
| 	} | ||||
| @@ -258,9 +258,10 @@ public class Q10537_KamaelDisarray extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	// @Override | ||||
| 	// public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	// public void onCreatureSee(OnCreatureSee event) | ||||
| 	// { | ||||
| 	// final Npc npc = (Npc) event.getSeer(); | ||||
| 	// final Creature creature = event.getSeen(); | ||||
| 	// switch (npc.getId()) | ||||
| 	// { | ||||
| 	// case STHOR: | ||||
| @@ -288,8 +289,8 @@ public class Q10537_KamaelDisarray extends Quest | ||||
| 	// break; | ||||
| 	// } | ||||
| 	// } | ||||
| 	// return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	// } | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) | ||||
| 	{ | ||||
|   | ||||
| @@ -19,6 +19,7 @@ package quests.Q10829_InSearchOfTheCause; | ||||
| import org.l2jmobius.gameserver.model.actor.Creature; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; | ||||
| import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| import org.l2jmobius.gameserver.model.quest.State; | ||||
| @@ -44,7 +45,7 @@ public class Q10829_InSearchOfTheCause extends Quest | ||||
| 		super(10829); | ||||
| 		addStartNpc(SERESIN); | ||||
| 		addTalkId(SERESIN, BELAS, FERIN, CYPHONIA); | ||||
| 		addSeeCreatureId(BELAS); | ||||
| 		setCreatureSeeId(this::onCreatureSee, BELAS); | ||||
| 		addCondMinLevel(MIN_LEVEL, "30657-00.htm"); | ||||
| 	} | ||||
| 	 | ||||
| @@ -167,9 +168,9 @@ public class Q10829_InSearchOfTheCause extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) | ||||
| 	public void onCreatureSee(OnCreatureSee event) | ||||
| 	{ | ||||
| 		final Creature creature = event.getSeen(); | ||||
| 		if (creature.isPlayer()) | ||||
| 		{ | ||||
| 			final QuestState qs = getQuestState((PlayerInstance) creature, true); | ||||
| @@ -178,6 +179,5 @@ public class Q10829_InSearchOfTheCause extends Quest | ||||
| 				qs.setCond(2, true); | ||||
| 			} | ||||
| 		} | ||||
| 		return super.onSeeCreature(npc, creature, isSummon); | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment