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.skills.Skill;
|
||||
@@ -57,9 +58,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
|
||||
@@ -131,9 +132,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);
|
||||
@@ -149,7 +151,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;
|
||||
@@ -99,7 +100,7 @@ public class ClanHallManager extends AbstractNpcAI
|
||||
addStartNpc(CLANHALL_MANAGERS);
|
||||
addTalkId(CLANHALL_MANAGERS);
|
||||
addFirstTalkId(CLANHALL_MANAGERS);
|
||||
addSeeCreatureId(CLANHALL_MANAGERS);
|
||||
setCreatureSeeId(this::onCreatureSee, CLANHALL_MANAGERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -481,18 +482,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)
|
||||
|
@@ -30,6 +30,7 @@ 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;
|
||||
@@ -90,9 +91,9 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
|
||||
private EtinaHelperAliber()
|
||||
{
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_ALIBER);
|
||||
addSpellFinishedId(ETINA_HELPER_ALIBER);
|
||||
addSeeCreatureId(ETINA_HELPER_ALIBER);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_ALIBER);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_ALIBER);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -266,14 +267,14 @@ public class EtinaHelperAliber 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)
|
||||
|
@@ -29,6 +29,7 @@ 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;
|
||||
@@ -71,9 +72,9 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
|
||||
private EtinaHelperDevianne()
|
||||
{
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_DEVIANNE);
|
||||
addSpellFinishedId(ETINA_HELPER_DEVIANNE);
|
||||
addSeeCreatureId(ETINA_HELPER_DEVIANNE);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_DEVIANNE);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_DEVIANNE);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -154,14 +155,14 @@ public class EtinaHelperDevianne 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)
|
||||
|
@@ -29,6 +29,7 @@ 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;
|
||||
@@ -71,9 +72,9 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
|
||||
private EtinaHelperElikia()
|
||||
{
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_ELIKIA);
|
||||
addSpellFinishedId(ETINA_HELPER_ELIKIA);
|
||||
addSeeCreatureId(ETINA_HELPER_ELIKIA);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_ELIKIA);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_ELIKIA);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -153,14 +154,14 @@ public class EtinaHelperElikia 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)
|
||||
|
@@ -29,6 +29,7 @@ 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;
|
||||
@@ -76,9 +77,9 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
|
||||
private EtinaHelperLeona()
|
||||
{
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_LEONA);
|
||||
addSpellFinishedId(ETINA_HELPER_LEONA);
|
||||
addSeeCreatureId(ETINA_HELPER_LEONA);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_LEONA);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_LEONA);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -186,14 +187,14 @@ public class EtinaHelperLeona 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)
|
||||
|
@@ -29,6 +29,7 @@ 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;
|
||||
@@ -71,9 +72,9 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
|
||||
private EtinaHelperSporcha()
|
||||
{
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_SPORCHA);
|
||||
addSpellFinishedId(ETINA_HELPER_SPORCHA);
|
||||
addSeeCreatureId(ETINA_HELPER_SPORCHA);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, ETINA_HELPER_SPORCHA);
|
||||
setCreatureSeeId(this::onCreatureSee, ETINA_HELPER_SPORCHA);
|
||||
setInstanceStatusChangeId(this::onInstanceStatusChange, ETINA_SOLO_INSTANCES);
|
||||
}
|
||||
|
||||
@@ -153,14 +154,14 @@ public class EtinaHelperSporcha 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)
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -39,8 +39,6 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcCreatureSee;
|
||||
import org.l2jmobius.gameserver.network.Disconnection;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.DeleteObject;
|
||||
|
||||
@@ -362,16 +360,6 @@ public class World
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wo.isNpc() && object.isCreature())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcCreatureSee((Npc) wo, (Creature) object, object.isSummon()), (Npc) wo);
|
||||
}
|
||||
|
||||
if (object.isNpc() && wo.isCreature())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcCreatureSee((Npc) object, (Creature) wo, wo.isSummon()), (Npc) object);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -585,16 +573,6 @@ public class World
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wo.isNpc() && object.isCreature())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcCreatureSee((Npc) wo, (Creature) object, object.isSummon()), (Npc) wo);
|
||||
}
|
||||
|
||||
if (object.isNpc() && wo.isCreature())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcCreatureSee((Npc) object, (Creature) wo, wo.isSummon()), (Npc) object);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -86,7 +86,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnAttackableFacti
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnAttackableHate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnAttackableKill;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcCanBeSeen;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcDespawn;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcEventReceived;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcFirstTalk;
|
||||
@@ -952,28 +951,6 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Provides instant callback operation when {@link Npc} sees another creature.
|
||||
* @param callback
|
||||
* @param npcIds
|
||||
* @return
|
||||
*/
|
||||
protected final List<AbstractEventListener> setNpcCreatureSeeId(Consumer<OnNpcCreatureSee> callback, int... npcIds)
|
||||
{
|
||||
return registerConsumer(callback, EventType.ON_NPC_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides instant callback operation when {@link Npc} sees another creature.
|
||||
* @param callback
|
||||
* @param npcIds
|
||||
* @return
|
||||
*/
|
||||
protected final List<AbstractEventListener> setNpcCreatureSeeId(Consumer<OnNpcCreatureSee> callback, Collection<Integer> npcIds)
|
||||
{
|
||||
return registerConsumer(callback, EventType.ON_NPC_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides instant callback operation when {@link Creature} sees another creature.
|
||||
* @param callback
|
||||
|
@@ -43,7 +43,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnAttackableFacti
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnAttackableHate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnAttackableKill;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcCanBeSeen;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcCreatureSee;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcDespawn;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcEventReceived;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcFirstTalk;
|
||||
@@ -192,7 +191,6 @@ public enum EventType
|
||||
|
||||
// NPC events
|
||||
ON_NPC_CAN_BE_SEEN(OnNpcCanBeSeen.class, void.class, TerminateReturn.class),
|
||||
ON_NPC_CREATURE_SEE(OnNpcCreatureSee.class, void.class),
|
||||
ON_NPC_EVENT_RECEIVED(OnNpcEventReceived.class, void.class),
|
||||
ON_NPC_FIRST_TALK(OnNpcFirstTalk.class, void.class),
|
||||
ON_NPC_HATE(OnAttackableHate.class, void.class, TerminateReturn.class),
|
||||
|
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.events.impl.creature.npc;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
|
||||
/**
|
||||
* An instantly executed event when Creature is killed by Creature.
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnNpcCreatureSee implements IBaseEvent
|
||||
{
|
||||
private final Npc _npc;
|
||||
private final Creature _creature;
|
||||
private final boolean _isSummon;
|
||||
|
||||
public OnNpcCreatureSee(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
_npc = npc;
|
||||
_creature = creature;
|
||||
_isSummon = isSummon;
|
||||
}
|
||||
|
||||
public Npc getNpc()
|
||||
{
|
||||
return _npc;
|
||||
}
|
||||
|
||||
public Creature getCreature()
|
||||
{
|
||||
return _creature;
|
||||
}
|
||||
|
||||
public boolean isSummon()
|
||||
{
|
||||
return _isSummon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_NPC_CREATURE_SEE;
|
||||
}
|
||||
}
|
@@ -828,37 +828,6 @@ 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
|
||||
* @param isSummon
|
||||
*/
|
||||
public void notifySeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
PlayerInstance player = null;
|
||||
if (isSummon || creature.isPlayer())
|
||||
{
|
||||
player = creature.getActingPlayer();
|
||||
}
|
||||
String res = null;
|
||||
try
|
||||
{
|
||||
res = onSeeCreature(npc, creature, isSummon);
|
||||
}
|
||||
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
|
||||
@@ -1323,18 +1292,6 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called whenever a NPC "sees" a creature.
|
||||
* @param npc the NPC who sees the creature
|
||||
* @param creature the creature seen by the NPC
|
||||
* @param isSummon this parameter if it's {@code false} it denotes that the character seen by the NPC was indeed the player, else it specifies that the character was the player's summon
|
||||
* @return
|
||||
*/
|
||||
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
|
||||
{
|
||||
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.
|
||||
@@ -2112,22 +2069,6 @@ 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 addSeeCreatureId(int... npcIds)
|
||||
{
|
||||
setNpcCreatureSeeId(event -> notifySeeCreature(event.getNpc(), event.getCreature(), event.isSummon()), npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param npcIds the IDs of the NPCs to register
|
||||
*/
|
||||
public void addSeeCreatureId(Collection<Integer> npcIds)
|
||||
{
|
||||
setNpcCreatureSeeId(event -> notifySeeCreature(event.getNpc(), event.getCreature(), event.isSummon()), npcIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register onEnterZone trigger for zone
|
||||
* @param zoneId the ID of the zone to register
|
||||
|
Reference in New Issue
Block a user