Dropped OnNpcCreatureSee in favor of OnCreatureSee event.
This commit is contained in:
@@ -29,6 +29,7 @@ import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
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.items.instance.ItemInstance;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
@@ -115,8 +116,8 @@ public class PrimevalIsle extends AbstractNpcAI
|
||||
addAttackId(TREX);
|
||||
addAttackId(MONSTERS);
|
||||
addKillId(EGG, SAILREN, DEINO, ORNIT);
|
||||
addSeeCreatureId(TREX);
|
||||
addSeeCreatureId(MONSTERS);
|
||||
setCreatureSeeId(this::onCreatureSee, TREX);
|
||||
setCreatureSeeId(this::onCreatureSee, MONSTERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,9 +243,10 @@ public class PrimevalIsle 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 (CommonUtil.contains(MONSTERS, npc.getId()))
|
||||
{
|
||||
if (creature.isPlayer())
|
||||
@@ -301,7 +303,6 @@ public class PrimevalIsle extends AbstractNpcAI
|
||||
npc.setRunning();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
|
||||
}
|
||||
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;
|
||||
@@ -110,8 +111,8 @@ public class Baium extends AbstractNpcAI
|
||||
addStartNpc(ANG_VORTEX, TELE_CUBE, BAIUM_STONE);
|
||||
addAttackId(BAIUM, ARCHANGEL);
|
||||
addKillId(BAIUM);
|
||||
addSeeCreatureId(BAIUM);
|
||||
addSpellFinishedId(BAIUM);
|
||||
setCreatureSeeId(this::onCreatureSee, BAIUM);
|
||||
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(BAIUM);
|
||||
|
||||
@@ -560,12 +561,12 @@ 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 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))
|
||||
@@ -573,6 +574,7 @@ public class Baium extends AbstractNpcAI
|
||||
_standbyPlayer = (PlayerInstance) creature;
|
||||
}
|
||||
|
||||
final Npc npc = (Npc) event.getSeer();
|
||||
if (creature.isInCategory(CategoryType.CLERIC_GROUP))
|
||||
{
|
||||
if (npc.getCurrentHp() < (npc.getMaxHp() * 0.25))
|
||||
@@ -597,7 +599,6 @@ public class Baium extends AbstractNpcAI
|
||||
refreshAiParams(creature, npc, 10000, 1000);
|
||||
}
|
||||
manageSkills(npc);
|
||||
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;
|
||||
@@ -93,7 +94,7 @@ public class ClanHallManager extends AbstractNpcAI
|
||||
addStartNpc(CLANHALL_MANAGERS);
|
||||
addTalkId(CLANHALL_MANAGERS);
|
||||
addFirstTalkId(CLANHALL_MANAGERS);
|
||||
addSeeCreatureId(CLANHALL_MANAGERS);
|
||||
setCreatureSeeId(this::onCreatureSee, CLANHALL_MANAGERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -443,18 +444,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)
|
||||
|
@@ -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.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import org.l2jmobius.gameserver.model.quest.State;
|
||||
@@ -53,7 +54,7 @@ public class Q00275_DarkWingedSpies extends Quest
|
||||
addStartNpc(NERUGA_CHIEF_TANTUS);
|
||||
addTalkId(NERUGA_CHIEF_TANTUS);
|
||||
addKillId(DARKWING_BAT, VARANGKAS_TRACKER);
|
||||
addSeeCreatureId(VARANGKAS_TRACKER);
|
||||
setCreatureSeeId(this::onCreatureSee, VARANGKAS_TRACKER);
|
||||
registerQuestItems(DARKWING_BAT_FANG, VARANGKAS_PARASITE);
|
||||
}
|
||||
|
||||
@@ -109,16 +110,16 @@ public class Q00275_DarkWingedSpies extends Quest
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
@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.setRunning();
|
||||
((Attackable) npc).addDamageHate(creature, 0, 1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
|
||||
}
|
||||
return super.onSeeCreature(npc, creature, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user