Addition of simplified quest onCreatureSee NPC id registration and method override.
This commit is contained in:
@@ -20,7 +20,6 @@ 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;
|
||||
|
||||
@@ -37,7 +36,7 @@ public class MercenaryCaptain extends AbstractNpcAI
|
||||
|
||||
private MercenaryCaptain()
|
||||
{
|
||||
setCreatureSeeId(this::onCreatureSee, MERCENARY_CAPTAIN);
|
||||
addCreatureSeeId(MERCENARY_CAPTAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,14 +49,14 @@ public class MercenaryCaptain extends AbstractNpcAI
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -20,7 +20,6 @@ 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;
|
||||
|
||||
@@ -37,7 +36,7 @@ public class Namo extends AbstractNpcAI
|
||||
|
||||
private Namo()
|
||||
{
|
||||
setCreatureSeeId(this::onCreatureSee, NAMO);
|
||||
addCreatureSeeId(NAMO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,14 +49,14 @@ public class Namo extends AbstractNpcAI
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -20,7 +20,6 @@ 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;
|
||||
|
||||
@@ -37,7 +36,7 @@ public class Rakun extends AbstractNpcAI
|
||||
|
||||
private Rakun()
|
||||
{
|
||||
setCreatureSeeId(this::onCreatureSee, RAKUN);
|
||||
addCreatureSeeId(RAKUN);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,14 +49,14 @@ public class Rakun extends AbstractNpcAI
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -22,7 +22,6 @@ import org.l2jmobius.gameserver.model.StatSet;
|
||||
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;
|
||||
@@ -46,7 +45,7 @@ public class Wisp extends AbstractNpcAI
|
||||
private Wisp()
|
||||
{
|
||||
addSpawnId(WISP);
|
||||
setCreatureSeeId(this::onCreatureSee, WISP, LARGE_WISP);
|
||||
addCreatureSeeId(WISP, LARGE_WISP);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,26 +69,24 @@ public class Wisp extends AbstractNpcAI
|
||||
{
|
||||
final Spawn spawn = npc.getSpawn();
|
||||
spawn.stopRespawn();
|
||||
|
||||
if ((npc.getId() == WISP) && (getRandom(100) < 10))
|
||||
{
|
||||
addSpawn(LARGE_WISP, npc);
|
||||
npc.deleteMe();
|
||||
}
|
||||
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
if (creature.isPlayer() || creature.isFakePlayer())
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
npc.doCast(npc.getId() == WISP ? WISP_HEAL.getSkill() : LARGE_WISP_HEAL.getSkill());
|
||||
getTimers().addTimer("DELETE_NPC", 5000, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -21,7 +21,6 @@ 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;
|
||||
@@ -80,7 +79,7 @@ public class Rooney extends AbstractNpcAI
|
||||
|
||||
private Rooney()
|
||||
{
|
||||
setCreatureSeeId(this::onCreatureSee, ROONEY);
|
||||
addCreatureSeeId(ROONEY);
|
||||
addSpawn(ROONEY, getRandomEntry(LOCATIONS), false, 0);
|
||||
}
|
||||
|
||||
@@ -125,19 +124,16 @@ public class Rooney extends AbstractNpcAI
|
||||
return null;
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELCOME);
|
||||
startQuestTimer("teleport", 60000, npc, null);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELCOME);
|
||||
startQuestTimer("teleport", 60000, npc, null);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -21,7 +21,6 @@ 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;
|
||||
@@ -45,7 +44,7 @@ public class GardenWatchman extends AbstractNpcAI
|
||||
public GardenWatchman()
|
||||
{
|
||||
addSpawnId(GARDEN_WATCHMAN);
|
||||
setCreatureSeeId(this::onCreatureSee, GENESIS_TRAP_1, GENESIS_TRAP_2);
|
||||
addCreatureSeeId(GENESIS_TRAP_1, GENESIS_TRAP_2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,14 +89,14 @@ public class GardenWatchman extends AbstractNpcAI
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
startQuestTimer("DEBUFF", 3000, npc, null, true);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -24,7 +24,6 @@ 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;
|
||||
|
||||
@@ -57,7 +56,7 @@ public class EntrancePortalToCrystalCaverns extends AbstractNpcAI
|
||||
addTalkId(CAVERNS_ENTRACE);
|
||||
addFirstTalkId(CAVERNS_ENTRACE);
|
||||
addSpawnId(CAVERNS_ENTRACE);
|
||||
setCreatureSeeId(this::onCreatureSee, CAVERNS_ENTRACE);
|
||||
addCreatureSeeId(CAVERNS_ENTRACE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,15 +116,16 @@ public class EntrancePortalToCrystalCaverns extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
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.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public void updateTriggersForPlayer(PlayerInstance player, int currentTemplateId)
|
||||
|
@@ -21,7 +21,6 @@ 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;
|
||||
|
||||
@@ -45,7 +44,7 @@ public class AltarOfSacrifice extends AbstractNpcAI
|
||||
private AltarOfSacrifice()
|
||||
{
|
||||
addSpawnId(IMMERIAL, JENNAS_GUARD, GIGGLE);
|
||||
setCreatureSeeId(this::onCreatureSee, JENNAS_GUARD);
|
||||
addCreatureSeeId(JENNAS_GUARD);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,15 +71,15 @@ public class AltarOfSacrifice extends AbstractNpcAI
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
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.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -32,7 +32,6 @@ 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;
|
||||
@@ -80,7 +79,7 @@ public class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
addKillId(REGENERATED_POSLOF, SAKUM);
|
||||
addSpawnId(COMMANDER, GUARD, DECO_GUARD, REGENERATED_KANILOV, REGENERATED_POSLOF, SAKUM);
|
||||
setCreatureSeeId(this::onCreatureSee, JOEL, SCHUAZEN, COMMANDO, COMMANDO_CAPTAIN);
|
||||
addCreatureSeeId(JOEL, SCHUAZEN, COMMANDO, COMMANDO_CAPTAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,14 +187,14 @@ public class Wastelands extends AbstractNpcAI
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer() && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK))
|
||||
{
|
||||
startQuestTimer("START_ATTACK", 250, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -34,7 +34,6 @@ 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;
|
||||
@@ -110,7 +109,7 @@ public class Baium extends AbstractNpcAI
|
||||
addAttackId(BAIUM, ARCHANGEL);
|
||||
addKillId(BAIUM);
|
||||
addSpellFinishedId(BAIUM);
|
||||
setCreatureSeeId(this::onCreatureSee, BAIUM);
|
||||
addCreatureSeeId(BAIUM);
|
||||
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(BAIUM);
|
||||
|
||||
@@ -554,14 +553,12 @@ public class Baium extends AbstractNpcAI
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Creature creature = event.getSeen();
|
||||
|
||||
if (!zone.isInsideZone(creature) || (creature.isNpc() && (creature.getId() == BAIUM_STONE)))
|
||||
{
|
||||
return;
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
if (creature.isPlayer() && !creature.isDead() && (_standbyPlayer == null))
|
||||
@@ -593,6 +590,8 @@ public class Baium extends AbstractNpcAI
|
||||
refreshAiParams(creature, npc, 10000, 1000);
|
||||
}
|
||||
manageSkills(npc);
|
||||
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -30,7 +30,6 @@ 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.skills.BuffInfo;
|
||||
@@ -103,7 +102,7 @@ public class BalokWarzone extends AbstractInstance
|
||||
addSkillSeeId(BALOK);
|
||||
addKillId(BALOK, MINION);
|
||||
addSpellFinishedId(BALOK);
|
||||
setCreatureSeeId(this::onCreatureSee, INVISIBLE_NPC_1);
|
||||
addCreatureSeeId(INVISIBLE_NPC_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -293,16 +292,16 @@ public class BalokWarzone extends AbstractInstance
|
||||
return super.onKill(npc, player, isPet);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("stage_1_start", 60000, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -25,7 +25,6 @@ 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.OnCreatureDeath;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@@ -64,7 +63,7 @@ public class BaylorWarzone extends AbstractInstance
|
||||
addTalkId(BENUSTA);
|
||||
addInstanceCreatedId(TEMPLATE_ID);
|
||||
addSpellFinishedId(INVISIBLE_NPC_1);
|
||||
setCreatureSeeId(this::onCreatureSee, INVISIBLE_NPC_1);
|
||||
addCreatureSeeId(INVISIBLE_NPC_1);
|
||||
setCreatureKillId(this::onBossKill, BAYLOR);
|
||||
}
|
||||
|
||||
@@ -310,16 +309,16 @@ public class BaylorWarzone extends AbstractInstance
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("START_SCENE_01", 5000, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -25,7 +25,6 @@ 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.skills.Skill;
|
||||
@@ -60,7 +59,7 @@ public class IceQueensCastle extends AbstractInstance
|
||||
addTalkId(JINIA);
|
||||
addSpawnId(FREYA);
|
||||
addSpellFinishedId(FREYA);
|
||||
setCreatureSeeId(this::onCreatureSee, BATTALION_LEADER, LEGIONNAIRE, MERCENARY_ARCHER);
|
||||
addCreatureSeeId(BATTALION_LEADER, LEGIONNAIRE, MERCENARY_ARCHER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,10 +131,9 @@ public class IceQueensCastle extends AbstractInstance
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
@@ -151,6 +149,7 @@ public class IceQueensCastle extends AbstractInstance
|
||||
});
|
||||
startQuestTimer("ATTACK_KNIGHT", 5000, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -25,7 +25,6 @@ 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.OnCreatureDeath;
|
||||
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.NpcStringId;
|
||||
@@ -78,7 +77,7 @@ public class KimerianCommon extends AbstractInstance
|
||||
addSpawnId(FAIRY_REBEL, NEOMI_KASHERON);
|
||||
addAttackId(KIMERIAN);
|
||||
addKillId(KIMERIAN_GHOST, KIMERIAN);
|
||||
setCreatureSeeId(this::onCreatureSee, FAIRY_REBEL, NEOMI_KASHERON, INVISIBLE_NPC, KIMERIAN);
|
||||
addCreatureSeeId(FAIRY_REBEL, NEOMI_KASHERON, INVISIBLE_NPC, KIMERIAN);
|
||||
setCreatureKillId(this::onCreatureKill, FAIRY_REBEL, NEOMI_KASHERON);
|
||||
}
|
||||
|
||||
@@ -334,14 +333,12 @@ public class KimerianCommon extends AbstractInstance
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final StatSet npcParams = npc.getParameters();
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
switch (npc.getId())
|
||||
@@ -412,6 +409,7 @@ public class KimerianCommon extends AbstractInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
private void spawnHollow(Npc npc, PlayerInstance player, boolean isHollow)
|
||||
|
@@ -46,7 +46,6 @@ 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;
|
||||
@@ -208,7 +207,7 @@ public class Lindvior extends AbstractNpcAI
|
||||
addSkillSeeId(NPC_GENERATOR);
|
||||
addFirstTalkId(NPC_GENERATOR);
|
||||
addSpawnId(NPC_ATTACKER_GENERATORS, NPC_ATTACKER_GENERATORS_1, LYN_DRACO_ATTACKER_GENERATORS, GENERATOR_GUARD, NPC_GENERATOR);
|
||||
setCreatureSeeId(this::onCreatureSee, INVISIBLE);
|
||||
addCreatureSeeId(INVISIBLE);
|
||||
_zoneLair = ZoneManager.getInstance().getZoneById(ZONE_ID, NoSummonFriendZone.class);
|
||||
// Unlock
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
|
||||
@@ -509,12 +508,13 @@ public class Lindvior extends AbstractNpcAI
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
setLindviorSpawnTask();
|
||||
npc.getSpawn().stopRespawn();
|
||||
npc.deleteMe();
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
private void nextStage(int taskId)
|
||||
|
@@ -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;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Vortex extends AbstractNpcAI
|
||||
{
|
||||
super();
|
||||
addSpawnId(SMALL_VORTEX, BIG_VORTEX);
|
||||
setCreatureSeeId(this::onCreatureSee, SMALL_VORTEX, BIG_VORTEX);
|
||||
addCreatureSeeId(SMALL_VORTEX, BIG_VORTEX);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,9 +112,9 @@ public class Vortex extends AbstractNpcAI
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
switch (npc.getId())
|
||||
{
|
||||
case SMALL_VORTEX:
|
||||
@@ -128,6 +128,7 @@ public class Vortex extends AbstractNpcAI
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -27,7 +27,6 @@ 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.skills.Skill;
|
||||
@@ -118,7 +117,7 @@ public class OctavisWarzone extends AbstractInstance
|
||||
addMoveFinishedId(GLADIATORS);
|
||||
addSpellFinishedId(OCTAVIS_STAGE_2);
|
||||
addEnterZoneId(TELEPORT_ZONE.getId());
|
||||
setCreatureSeeId(this::onCreatureSee, DOOR_MANAGER);
|
||||
addCreatureSeeId(DOOR_MANAGER);
|
||||
addInstanceCreatedId(TEMPLATE_ID, EXTREME_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
@@ -562,10 +561,9 @@ public class OctavisWarzone extends AbstractInstance
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
private void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
@@ -574,6 +572,7 @@ public class OctavisWarzone extends AbstractInstance
|
||||
getTimers().addTimer("SECOND_DOOR_OPEN", 3000, npc, null);
|
||||
getTimers().addTimer("CLOSE_DOORS", 60000, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -37,7 +37,6 @@ 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;
|
||||
@@ -137,7 +136,7 @@ public class Ramona extends AbstractNpcAI
|
||||
addKillId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
|
||||
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
|
||||
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
|
||||
setCreatureSeeId(this::onCreatureSee, MP_CONTROL);
|
||||
addCreatureSeeId(MP_CONTROL);
|
||||
|
||||
final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
@@ -551,16 +550,15 @@ public class Ramona extends AbstractNpcAI
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.setInvul(true);
|
||||
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
startQuestTimer("SPAWN_MS", 10000, npc, null, true);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -29,7 +29,6 @@ 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.skills.Skill;
|
||||
@@ -101,7 +100,7 @@ public class TeredorWarzone extends AbstractInstance
|
||||
addEventReceivedId(EGG_2);
|
||||
addAttackId(TEREDOR);
|
||||
addKillId(EGG_2, TEREDOR);
|
||||
setCreatureSeeId(this::onCreatureSee, BEETLE, POS_CHECKER, EGG_2, FAKE_TEREDOR);
|
||||
addCreatureSeeId(BEETLE, POS_CHECKER, EGG_2, FAKE_TEREDOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -272,10 +271,9 @@ public class TeredorWarzone extends AbstractInstance
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
@@ -361,6 +359,7 @@ public class TeredorWarzone extends AbstractInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -37,7 +37,6 @@ 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;
|
||||
@@ -318,7 +317,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);
|
||||
addCreatureSeeId(LAVRA_1, LAVRA_2, LAVRA_3, TRADJAN, TIE, BIG_TIE);
|
||||
init();
|
||||
if (DoorData.getInstance().getDoor(DOOR) != null)
|
||||
{
|
||||
@@ -539,12 +538,12 @@ public class Trasken extends AbstractNpcAI
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
if (npc.isDead())
|
||||
{
|
||||
return;
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
if ((npc.getId() == LAVRA_1) || (npc.getId() == LAVRA_2) || (npc.getId() == LAVRA_3) || (npc.getId() == TRADJAN))
|
||||
@@ -553,7 +552,6 @@ public class Trasken extends AbstractNpcAI
|
||||
}
|
||||
else if ((npc.getId() == TIE) || (npc.getId() == BIG_TIE))
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (getRandom(100) < 60)
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
@@ -567,6 +565,8 @@ public class Trasken extends AbstractNpcAI
|
||||
addAttackPlayerDesire(npc, (Playable) creature);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -30,7 +30,6 @@ 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;
|
||||
@@ -100,7 +99,7 @@ public class ClanHallManager extends AbstractNpcAI
|
||||
addStartNpc(CLANHALL_MANAGERS);
|
||||
addTalkId(CLANHALL_MANAGERS);
|
||||
addFirstTalkId(CLANHALL_MANAGERS);
|
||||
setCreatureSeeId(this::onCreatureSee, CLANHALL_MANAGERS);
|
||||
addCreatureSeeId(CLANHALL_MANAGERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -482,18 +481,18 @@ public class ClanHallManager extends AbstractNpcAI
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final ClanHall clanHall = npc.getClanHall();
|
||||
if (clanHall != null)
|
||||
{
|
||||
creature.getActingPlayer().sendPacket(new AgitDecoInfo(clanHall));
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
private void updateVisualEffects(ClanHall clanHall, Npc npc)
|
||||
|
@@ -20,7 +20,6 @@ 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;
|
||||
|
||||
@@ -35,17 +34,17 @@ public class Gordon extends AbstractNpcAI
|
||||
private Gordon()
|
||||
{
|
||||
addSpawnId(GORDON);
|
||||
setCreatureSeeId(this::onCreatureSee, GORDON);
|
||||
addCreatureSeeId(GORDON);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer() && ((PlayerInstance) creature).isCursedWeaponEquipped())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
addAttackPlayerDesire(npc, (PlayerInstance) creature);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -25,7 +25,6 @@ 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;
|
||||
@@ -67,7 +66,7 @@ public class ChamberOfProphecies extends AbstractInstance
|
||||
addStartNpc(KAIN_VAN_HALTER);
|
||||
addFirstTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
|
||||
addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
|
||||
setCreatureSeeId(this::onCreatureSee, FERIN, VAN_HALTER);
|
||||
addCreatureSeeId(FERIN, VAN_HALTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -501,13 +500,12 @@ public class ChamberOfProphecies extends AbstractInstance
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (world != null)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
switch (npc.getId())
|
||||
{
|
||||
case FERIN:
|
||||
@@ -528,6 +526,7 @@ public class ChamberOfProphecies extends AbstractInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -23,7 +23,6 @@ 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.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
@@ -76,7 +75,7 @@ public class CrystalCavernsEmeraldSquare extends AbstractInstance
|
||||
addSpellFinishedId(WATER_CANNON_SKILL);
|
||||
addInstanceEnterId(TEMPLATE_ID);
|
||||
addInstanceLeaveId(TEMPLATE_ID);
|
||||
setCreatureSeeId(this::onCreatureSee, WATER_CANNON);
|
||||
addCreatureSeeId(WATER_CANNON);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -380,10 +379,9 @@ public class CrystalCavernsEmeraldSquare extends AbstractInstance
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if ((world != null) && creature.isPlayer() && npc.isScriptValue(0))
|
||||
{
|
||||
@@ -391,6 +389,7 @@ public class CrystalCavernsEmeraldSquare extends AbstractInstance
|
||||
npc.setDisplayEffect(1);
|
||||
getTimers().addRepeatingTimer("CANNON_LOOP_ATTACK", 1000, npc, null);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -24,7 +24,6 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
||||
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.zone.ZoneType;
|
||||
@@ -79,7 +78,7 @@ public class CrystalCavernsSteamCorridor extends AbstractInstance
|
||||
addInstanceCreatedId(TEMPLATE_ID);
|
||||
addInstanceEnterId(TEMPLATE_ID);
|
||||
addInstanceLeaveId(TEMPLATE_ID);
|
||||
setCreatureSeeId(this::onCreatureSee, PLAYER_DETECTOR);
|
||||
addCreatureSeeId(PLAYER_DETECTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -361,10 +360,9 @@ public class CrystalCavernsSteamCorridor extends AbstractInstance
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
private void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance) && creature.isPlayer())
|
||||
{
|
||||
@@ -381,6 +379,7 @@ public class CrystalCavernsSteamCorridor extends AbstractInstance
|
||||
npc.deleteMe();
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -30,7 +30,6 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
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.OnCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@@ -92,8 +91,8 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
private EtinaHelperAliber()
|
||||
{
|
||||
addSpellFinishedId(ETINA_HELPER_ALIBER);
|
||||
addCreatureSeeId(ETINA_HELPER_ALIBER);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_ALIBER);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_ALIBER);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -267,14 +266,14 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
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.OnCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
@@ -73,8 +72,8 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
private EtinaHelperDevianne()
|
||||
{
|
||||
addSpellFinishedId(ETINA_HELPER_DEVIANNE);
|
||||
addCreatureSeeId(ETINA_HELPER_DEVIANNE);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_DEVIANNE);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_DEVIANNE);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -155,14 +154,14 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
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.OnCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
@@ -73,8 +72,8 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
private EtinaHelperElikia()
|
||||
{
|
||||
addSpellFinishedId(ETINA_HELPER_ELIKIA);
|
||||
addCreatureSeeId(ETINA_HELPER_ELIKIA);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_ELIKIA);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_ELIKIA);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -154,14 +153,14 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
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.OnCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
@@ -78,8 +77,8 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
private EtinaHelperLeona()
|
||||
{
|
||||
addSpellFinishedId(ETINA_HELPER_LEONA);
|
||||
addCreatureSeeId(ETINA_HELPER_LEONA);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_LEONA);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_LEONA);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -187,14 +186,14 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
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.OnCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
@@ -73,8 +72,8 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
private EtinaHelperSporcha()
|
||||
{
|
||||
addSpellFinishedId(ETINA_HELPER_SPORCHA);
|
||||
addCreatureSeeId(ETINA_HELPER_SPORCHA);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_SPORCHA);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_SPORCHA);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -154,14 +153,14 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -31,7 +31,6 @@ 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;
|
||||
@@ -91,9 +90,9 @@ public class KartiaHelperAdolph extends AbstractNpcAI
|
||||
private KartiaHelperAdolph()
|
||||
{
|
||||
addSpellFinishedId(KARTIA_ADOLPH);
|
||||
addCreatureSeeId(KARTIA_ADOLPH);
|
||||
setCreatureKillId(this::onCreatureKill, KARTIA_ADOLPH);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, KARTIA_ADOLPH);
|
||||
setCreatureSeeId(this::onCreatureSee, KARTIA_ADOLPH);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -288,14 +287,14 @@ public class KartiaHelperAdolph extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -27,7 +27,6 @@ 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;
|
||||
@@ -86,9 +85,9 @@ public class KartiaHelperBarton extends AbstractNpcAI
|
||||
|
||||
private KartiaHelperBarton()
|
||||
{
|
||||
addCreatureSeeId(KARTIA_BARTON);
|
||||
setCreatureKillId(this::onCreatureKill, KARTIA_BARTON);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, KARTIA_BARTON);
|
||||
setCreatureSeeId(this::onCreatureSee, KARTIA_BARTON);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -149,17 +148,18 @@ public class KartiaHelperBarton extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId()))
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("ADOLPH_OBJECT", creature);
|
||||
npc.getVariables().set("ADOLPH_OBJECT", creature);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public void useRandomSkill(Npc npc)
|
||||
|
@@ -33,7 +33,6 @@ 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,8 +109,8 @@ public class KartiaHelperElise extends AbstractNpcAI
|
||||
|
||||
private KartiaHelperElise()
|
||||
{
|
||||
addCreatureSeeId(KARTIA_ELISE);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES);
|
||||
setCreatureSeeId(this::onCreatureSee, KARTIA_ELISE);
|
||||
setCreatureKillId(this::onCreatureKill, KARTIA_ELISE);
|
||||
}
|
||||
|
||||
@@ -243,12 +242,11 @@ public class KartiaHelperElise extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer() || (creature instanceof FriendlyNpcInstance))
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
@@ -271,6 +269,7 @@ public class KartiaHelperElise extends AbstractNpcAI
|
||||
npcVars.set("HAYUK_OBJECT", creature);
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public void onCreatureKill(OnCreatureDeath event)
|
||||
|
@@ -25,7 +25,6 @@ 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;
|
||||
|
||||
@@ -81,9 +80,9 @@ public class KartiaHelperEliyah extends AbstractNpcAI
|
||||
|
||||
private KartiaHelperEliyah()
|
||||
{
|
||||
addCreatureSeeId(KARTIA_ELIYAH);
|
||||
setCreatureKillId(this::onCreatureKill, KARTIA_ELIYAH);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, KARTIA_ELIYAH);
|
||||
setCreatureSeeId(this::onCreatureSee, KARTIA_ELIYAH);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -137,17 +136,18 @@ public class KartiaHelperEliyah extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId()))
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("ADOLPH_OBJECT", creature);
|
||||
npc.getVariables().set("ADOLPH_OBJECT", creature);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
|
@@ -26,7 +26,6 @@ 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;
|
||||
@@ -90,9 +89,9 @@ public class KartiaHelperGuardian extends AbstractNpcAI
|
||||
|
||||
private KartiaHelperGuardian()
|
||||
{
|
||||
addCreatureSeeId(KARTIA_GUARDIANS);
|
||||
setCreatureKillId(this::onCreatureKill, KARTIA_GUARDIANS);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, KARTIA_GUARDIANS);
|
||||
setCreatureSeeId(this::onCreatureSee, KARTIA_GUARDIANS);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -155,21 +154,22 @@ public class KartiaHelperGuardian extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId()))
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("ADOLPH_OBJECT", creature);
|
||||
npc.getVariables().set("ADOLPH_OBJECT", creature);
|
||||
}
|
||||
else if (CommonUtil.contains(KARTIA_ELIYAH, creature.getId()))
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("ELIYAH_OBJECT", creature);
|
||||
npc.getVariables().set("ELIYAH_OBJECT", creature);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public void useRandomSkill(Npc npc)
|
||||
|
@@ -27,7 +27,6 @@ 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,9 +86,9 @@ public class KartiaHelperHayuk extends AbstractNpcAI
|
||||
|
||||
private KartiaHelperHayuk()
|
||||
{
|
||||
addCreatureSeeId(KARTIA_HAYUK);
|
||||
setCreatureKillId(this::onCreatureKill, KARTIA_HAYUK);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, KARTIA_HAYUK);
|
||||
setCreatureSeeId(this::onCreatureSee, KARTIA_HAYUK);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -150,17 +149,18 @@ public class KartiaHelperHayuk extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer());
|
||||
}
|
||||
else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId()))
|
||||
{
|
||||
((Npc) event.getCreature()).getVariables().set("ADOLPH_OBJECT", creature);
|
||||
npc.getVariables().set("ADOLPH_OBJECT", creature);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
public void useRandomSkill(Npc npc)
|
||||
|
@@ -31,7 +31,6 @@ 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.OnCreatureDeath;
|
||||
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.zone.ZoneType;
|
||||
@@ -186,13 +185,13 @@ public class KartiasLabyrinth extends AbstractInstance
|
||||
addMoveFinishedId(MINI_BOSSES);
|
||||
addMoveFinishedId(PRISONERS);
|
||||
addRouteFinishedId(MONSTERS);
|
||||
setCreatureKillId(this::onCreatureKill, MONSTERS);
|
||||
setCreatureKillId(this::onBossKill, BOSSES);
|
||||
setCreatureSeeId(this::onCreatureSee, MONSTERS);
|
||||
addCreatureSeeId(MONSTERS);
|
||||
addEnterZoneId(KARTIA_85_DETECT_1, KARTIA_85_DETECT_2);
|
||||
addEnterZoneId(KARTIA_90_DETECT_1, KARTIA_90_DETECT_2);
|
||||
addEnterZoneId(KARTIA_95_DETECT_1, KARTIA_95_DETECT_2);
|
||||
addInstanceCreatedId(TEMPLATE_ID_SOLO_85, TEMPLATE_ID_SOLO_90, TEMPLATE_ID_SOLO_95, TEMPLATE_ID_GROUP_85, TEMPLATE_ID_GROUP_90, TEMPLATE_ID_GROUP_95);
|
||||
setCreatureKillId(this::onCreatureKill, MONSTERS);
|
||||
setCreatureKillId(this::onBossKill, BOSSES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -873,10 +872,9 @@ public class KartiasLabyrinth extends AbstractInstance
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if ((world != null) && (creature.isPlayer() || creature.getInstanceType().isType(InstanceType.FriendlyNpcInstance)) && npc.isScriptValue(1))
|
||||
{
|
||||
@@ -892,6 +890,7 @@ public class KartiasLabyrinth extends AbstractInstance
|
||||
addAttackDesire(npc, creature);
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -23,7 +23,6 @@ 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;
|
||||
@@ -90,7 +89,7 @@ public class NornilsGarden extends AbstractInstance
|
||||
addKillId(ATTACABLE_MONSTERS);
|
||||
addKillId(SPICULA_ZERO);
|
||||
addKillId(BOZ_STAGE1, BOZ_STAGE2, BOZ_STAGE3, BOZ_STAGE4);
|
||||
setCreatureSeeId(this::onCreatureSee, BOZ_STAGE1);
|
||||
addCreatureSeeId(BOZ_STAGE1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -283,12 +282,11 @@ public class NornilsGarden extends AbstractInstance
|
||||
return "33781.html";
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
if (creature.isPlayable())
|
||||
{
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
startQuestTimer("stage1", 3000, npc, null);
|
||||
@@ -296,6 +294,7 @@ public class NornilsGarden extends AbstractInstance
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -24,7 +24,6 @@ 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.skills.Skill;
|
||||
@@ -116,7 +115,7 @@ public class PrisonOfDarkness extends AbstractInstance
|
||||
addTalkId(SPEZION_HEADSTONE, WARP_POINT, TIME_BOMB_1, STARLIGHT_LATTICE, JOSEPHINA);
|
||||
addSpawnId(WARP_POINT, ESCORT_WARRIOR);
|
||||
addSpellFinishedId(MONSTERS);
|
||||
setCreatureSeeId(this::onCreatureSee, EXIT_PORTAL);
|
||||
addCreatureSeeId(EXIT_PORTAL);
|
||||
addKillId(SPEZIONS_PAWN);
|
||||
addFirstTalkId(JOSEPHINA);
|
||||
}
|
||||
@@ -343,10 +342,9 @@ public class PrisonOfDarkness extends AbstractInstance
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final Creature creature = event.getSeen();
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
@@ -373,6 +371,7 @@ public class PrisonOfDarkness extends AbstractInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@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);
|
||||
addCreatureSeeId(DETON);
|
||||
registerQuestItems(FLAME_FLOWER);
|
||||
setCreatureSeeId(this::onCreatureSee, DETON);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,9 +115,10 @@ public class Q00833_DevilsTreasureTauti extends Quest
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final PlayerInstance player = event.getSeen().getActingPlayer();
|
||||
final PlayerInstance player = creature.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, true);
|
||||
@@ -127,6 +128,7 @@ public class Q00833_DevilsTreasureTauti extends Quest
|
||||
qs.startQuest();
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@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;
|
||||
@@ -56,8 +56,8 @@ public class Q00835_PitiableMelisa extends Quest
|
||||
addStartNpc(KANNA);
|
||||
addTalkId(SETTLEN);
|
||||
addKillId(MONSTERS);
|
||||
addCreatureSeeId(KANNA);
|
||||
registerQuestItems(ICE_CRYSTAL_SHARD);
|
||||
setCreatureSeeId(this::onCreatureSee, KANNA);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,9 +119,10 @@ public class Q00835_PitiableMelisa extends Quest
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
@Override
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
final PlayerInstance player = event.getSeen().getActingPlayer();
|
||||
final PlayerInstance player = creature.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final QuestState qs = getQuestState(player, true);
|
||||
@@ -131,6 +132,7 @@ public class Q00835_PitiableMelisa extends Quest
|
||||
qs.startQuest();
|
||||
}
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -828,6 +828,36 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
showResult(player, res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param npc the NPC that sees the creature
|
||||
* @param creature the creature seen by the NPC
|
||||
*/
|
||||
public void notifyCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
PlayerInstance player = null;
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
player = creature.getActingPlayer();
|
||||
}
|
||||
String res = null;
|
||||
try
|
||||
{
|
||||
res = onCreatureSee(npc, creature);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
showError(player, e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (player != null)
|
||||
{
|
||||
showResult(player, res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param eventName - name of event
|
||||
* @param sender - NPC, who sent event
|
||||
@@ -1292,6 +1322,17 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called whenever an NPC "sees" a creature.
|
||||
* @param npc the NPC who sees the creature
|
||||
* @param creature the creature seen by the NPC
|
||||
* @return
|
||||
*/
|
||||
public String onCreatureSee(Npc npc, Creature creature)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called whenever a player enters the game.
|
||||
* @param player this parameter contains a reference to the exact instance of the player who is entering to the world.
|
||||
@@ -2069,6 +2110,22 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
setAttackableAggroRangeEnterId(event -> notifyAggroRangeEnter(event.getNpc(), event.getActiveChar(), event.isSummon()), npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param npcIds the IDs of the NPCs to register
|
||||
*/
|
||||
public void addCreatureSeeId(int... npcIds)
|
||||
{
|
||||
setCreatureSeeId(event -> notifyCreatureSee((Npc) event.getCreature(), event.getSeen()), npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param npcIds the IDs of the NPCs to register
|
||||
*/
|
||||
public void addCreatureSeeId(Collection<Integer> npcIds)
|
||||
{
|
||||
setCreatureSeeId(event -> notifyCreatureSee((Npc) event.getCreature(), event.getSeen()), npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register onEnterZone trigger for zone
|
||||
* @param zoneId the ID of the zone to register
|
||||
|
Reference in New Issue
Block a user