Addition of simplified quest onCreatureSee NPC id registration and method override.
This commit is contained in:
@@ -29,7 +29,6 @@ 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;
|
||||
@@ -116,8 +115,8 @@ public class PrimevalIsle extends AbstractNpcAI
|
||||
addAttackId(TREX);
|
||||
addAttackId(MONSTERS);
|
||||
addKillId(EGG, SAILREN, DEINO, ORNIT);
|
||||
setCreatureSeeId(this::onCreatureSee, TREX);
|
||||
setCreatureSeeId(this::onCreatureSee, MONSTERS);
|
||||
addCreatureSeeId(TREX);
|
||||
addCreatureSeeId(MONSTERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,10 +242,9 @@ public class PrimevalIsle 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 (CommonUtil.contains(MONSTERS, npc.getId()))
|
||||
{
|
||||
if (creature.isPlayer())
|
||||
@@ -303,6 +301,7 @@ public class PrimevalIsle extends AbstractNpcAI
|
||||
npc.setRunning();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
|
||||
}
|
||||
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;
|
||||
@@ -112,7 +111,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);
|
||||
|
||||
@@ -561,12 +560,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 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))
|
||||
@@ -574,7 +573,6 @@ public class Baium extends AbstractNpcAI
|
||||
_standbyPlayer = (PlayerInstance) creature;
|
||||
}
|
||||
|
||||
final Npc npc = (Npc) event.getCreature();
|
||||
if (creature.isInCategory(CategoryType.CLERIC_GROUP))
|
||||
{
|
||||
if (npc.getCurrentHp() < (npc.getMaxHp() * 0.25))
|
||||
@@ -599,6 +597,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.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;
|
||||
@@ -94,7 +93,7 @@ public class ClanHallManager extends AbstractNpcAI
|
||||
addStartNpc(CLANHALL_MANAGERS);
|
||||
addTalkId(CLANHALL_MANAGERS);
|
||||
addFirstTalkId(CLANHALL_MANAGERS);
|
||||
setCreatureSeeId(this::onCreatureSee, CLANHALL_MANAGERS);
|
||||
addCreatureSeeId(CLANHALL_MANAGERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -444,18 +443,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)
|
||||
|
@@ -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.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import org.l2jmobius.gameserver.model.quest.State;
|
||||
@@ -54,7 +53,7 @@ public class Q00275_DarkWingedSpies extends Quest
|
||||
addStartNpc(NERUGA_CHIEF_TANTUS);
|
||||
addTalkId(NERUGA_CHIEF_TANTUS);
|
||||
addKillId(DARKWING_BAT, VARANGKAS_TRACKER);
|
||||
setCreatureSeeId(this::onCreatureSee, VARANGKAS_TRACKER);
|
||||
addCreatureSeeId(VARANGKAS_TRACKER);
|
||||
registerQuestItems(DARKWING_BAT_FANG, VARANGKAS_PARASITE);
|
||||
}
|
||||
|
||||
@@ -110,16 +109,16 @@ public class Q00275_DarkWingedSpies extends Quest
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
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.setRunning();
|
||||
((Attackable) npc).addDamageHate(creature, 0, 1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
|
||||
}
|
||||
return super.onCreatureSee(npc, creature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user