Etis Van Etina solo helper cleanup.
This commit is contained in:
parent
d677831160
commit
6730cb9cb2
@ -87,6 +87,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
292, // Fall of Etina (Solo)
|
||||
293, // Fall of Etina (Solo)
|
||||
};
|
||||
//@formatter:on
|
||||
|
||||
private EtinaHelperAliber()
|
||||
{
|
||||
@ -108,7 +109,6 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -132,7 +132,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -149,18 +149,18 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
case "DESTROY_BARRICADES":
|
||||
{
|
||||
final FriendlyNpc _aliber = (FriendlyNpc) instance.getNpc(ETINA_HELPER_ALIBER);
|
||||
boolean BARRICADE_DESTROYED = instance.getParameters().getBoolean("BARRICADE_DESTROYED", false);
|
||||
final FriendlyNpc aliber = (FriendlyNpc) instance.getNpc(ETINA_HELPER_ALIBER);
|
||||
boolean destroyed = instance.getParameters().getBoolean("BARRICADE_DESTROYED", false);
|
||||
if (!instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.setInvul(true);
|
||||
_aliber.setCanReturnToSpawnPoint(false);
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[0]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[0], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.setInvul(true);
|
||||
aliber.setCanReturnToSpawnPoint(false);
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[0]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[0], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_1").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -174,12 +174,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_2").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty() && instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[1], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[1], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_2").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -193,12 +193,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_3").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty() && instance.getNpcsOfGroup("BARRICADES_2").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[2], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[2], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_3").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -212,12 +212,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_4").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty() && instance.getNpcsOfGroup("BARRICADES_3").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[3], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[3], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_4").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -229,8 +229,8 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
instance.despawnGroup("BARRICADES_4");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,28 +238,22 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RAGE_AGAINST_ALL_THAT_STANDS_IN_OUR_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RAGE_AGAINST_ALL_THAT_STANDS_IN_OUR_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperAliber, null));
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("USE_SKILL", 6000, etinaHelperAliber, null));
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("DESTROY_BARRICADES", 5000, etinaHelperAliber, null));
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,29 +126,22 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BEHOLD_THE_POWER_OF_THE_IVORY_TOWER_WIZARDS);
|
||||
}
|
||||
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BEHOLD_THE_POWER_OF_THE_IVORY_TOWER_WIZARDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_DEVIANNE).forEach(etinaHelperDevianne -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperDevianne, null));
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,28 +126,22 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_ELIKIA).forEach(etinaHelperElikia -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperElikia, null));
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,6 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -114,7 +113,7 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -133,42 +132,39 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
final Npc attacker = (Npc) event.getAttacker();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
switch (attacker.getId())
|
||||
{
|
||||
switch (attacker.getId())
|
||||
case CAMILLE:
|
||||
{
|
||||
default:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GISELLE_NO_IS_SHE_CAMILLE_IN_THAT_STATE);
|
||||
break;
|
||||
}
|
||||
case KAIN_VAN_HALTER:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVEN_THE_MIGHTY_ETINA_SEEMS_TO_FEAR_US);
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ETIS_VAN_ETINA_WE_FINALLY_MEET);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CAMILLE:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GISELLE_NO_IS_SHE_CAMILLE_IN_THAT_STATE);
|
||||
break;
|
||||
}
|
||||
case KAIN_VAN_HALTER:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVEN_THE_MIGHTY_ETINA_SEEMS_TO_FEAR_US);
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ETIS_VAN_ETINA_WE_FINALLY_MEET);
|
||||
break;
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,10 +173,10 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_LEONA).forEach(etinaHelperLeona -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperLeona, null));
|
||||
// instance.getAliveNpcs(ETINA_HELPER_LEONA).forEach(etinaHelperLeona -> getTimers().addRepeatingTimer("USE_SKILL", 6000, etinaHelperLeona, null));
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,28 +126,22 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_SPORCHA).forEach(etinaHelperSporcha -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperSporcha, null));
|
||||
}
|
||||
}
|
||||
|
@ -479,20 +479,20 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
final Instance world = attacker.getInstanceWorld();
|
||||
if (isInInstance(world))
|
||||
{
|
||||
final boolean CAMILLE_30 = world.getParameters().getBoolean("CAMILLE_30", false);
|
||||
final boolean CAMILLE_60 = world.getParameters().getBoolean("CAMILLE_60", false);
|
||||
final boolean KAIN_30 = world.getParameters().getBoolean("KAIN_30", false);
|
||||
final boolean KAIN_60 = world.getParameters().getBoolean("KAIN_60", false);
|
||||
final boolean ETINA_80 = world.getParameters().getBoolean("ETINA_80", false);
|
||||
final boolean ETINA_15 = world.getParameters().getBoolean("ETINA_15", false);
|
||||
final boolean camille30 = world.getParameters().getBoolean("CAMILLE_30", false);
|
||||
final boolean camille60 = world.getParameters().getBoolean("CAMILLE_60", false);
|
||||
final boolean kain30 = world.getParameters().getBoolean("KAIN_30", false);
|
||||
final boolean kain60 = world.getParameters().getBoolean("KAIN_60", false);
|
||||
final boolean etina80 = world.getParameters().getBoolean("ETINA_80", false);
|
||||
final boolean etina15 = world.getParameters().getBoolean("ETINA_15", false);
|
||||
if (npc.getId() == CAMILLE)
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !CAMILLE_30)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !camille30)
|
||||
{
|
||||
world.getParameters().set("CAMILLE_30", true);
|
||||
world.spawnGroup("CAMILLE_MINIONS");
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !CAMILLE_60)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !camille60)
|
||||
{
|
||||
world.getParameters().set("CAMILLE_60", true);
|
||||
world.spawnGroup("CAMILLE_MINIONS");
|
||||
@ -500,13 +500,13 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
}
|
||||
else if (npc.getId() == KAIN_VAN_HALTER)
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !KAIN_30)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !kain30)
|
||||
{
|
||||
world.getParameters().set("KAIN_30", true);
|
||||
showOnScreenMsg(world, NpcStringId.ETIS_VAN_ETINA_SUMMONS_HIS_APOSTLES_MINIONS, ExShowScreenMessage.TOP_CENTER, 7000, true);
|
||||
world.spawnGroup("KAIN_MINIONS");
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !KAIN_60)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !kain60)
|
||||
{
|
||||
world.getParameters().set("KAIN_60", true);
|
||||
showOnScreenMsg(world, NpcStringId.ETIS_VAN_ETINA_SUMMONS_HIS_APOSTLES_MINIONS, ExShowScreenMessage.TOP_CENTER, 7000, true);
|
||||
@ -515,7 +515,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
}
|
||||
else if ((npc.getId() == ETIS_VAN_ETINA1))
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.8)) && !ETINA_80)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.8)) && !etina80)
|
||||
{
|
||||
final Npc etina1 = world.getNpc(ETIS_VAN_ETINA1);
|
||||
world.getParameters().set("ETINA_80", true);
|
||||
@ -532,7 +532,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
startQuestTimer("calamityCastTimer", 120000, npc, attacker, true);
|
||||
startQuestTimer("destructionCastTimer", 120000, npc, attacker, true);
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.15)) && !ETINA_15)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.15)) && !etina15)
|
||||
{
|
||||
world.getParameters().set("ETINA_15", true);
|
||||
world.spawnGroup("ETINA_MINIONS");
|
||||
@ -704,6 +704,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
292, // Fall of Etina (Solo)
|
||||
293, // Fall of Etina (Solo)
|
||||
};
|
||||
//@formatter:on
|
||||
|
||||
private EtinaHelperAliber()
|
||||
{
|
||||
@ -108,7 +109,6 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -132,7 +132,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -149,18 +149,18 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
case "DESTROY_BARRICADES":
|
||||
{
|
||||
final FriendlyNpc _aliber = (FriendlyNpc) instance.getNpc(ETINA_HELPER_ALIBER);
|
||||
boolean BARRICADE_DESTROYED = instance.getParameters().getBoolean("BARRICADE_DESTROYED", false);
|
||||
final FriendlyNpc aliber = (FriendlyNpc) instance.getNpc(ETINA_HELPER_ALIBER);
|
||||
boolean destroyed = instance.getParameters().getBoolean("BARRICADE_DESTROYED", false);
|
||||
if (!instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.setInvul(true);
|
||||
_aliber.setCanReturnToSpawnPoint(false);
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[0]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[0], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.setInvul(true);
|
||||
aliber.setCanReturnToSpawnPoint(false);
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[0]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[0], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_1").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -174,12 +174,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_2").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty() && instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[1], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[1], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_2").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -193,12 +193,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_3").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty() && instance.getNpcsOfGroup("BARRICADES_2").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[2], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[2], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_3").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -212,12 +212,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_4").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty() && instance.getNpcsOfGroup("BARRICADES_3").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[3], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[3], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_4").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -229,8 +229,8 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
instance.despawnGroup("BARRICADES_4");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,28 +238,22 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RAGE_AGAINST_ALL_THAT_STANDS_IN_OUR_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RAGE_AGAINST_ALL_THAT_STANDS_IN_OUR_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperAliber, null));
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("USE_SKILL", 6000, etinaHelperAliber, null));
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("DESTROY_BARRICADES", 5000, etinaHelperAliber, null));
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,29 +126,22 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BEHOLD_THE_POWER_OF_THE_IVORY_TOWER_WIZARDS);
|
||||
}
|
||||
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BEHOLD_THE_POWER_OF_THE_IVORY_TOWER_WIZARDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_DEVIANNE).forEach(etinaHelperDevianne -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperDevianne, null));
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,28 +126,22 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_ELIKIA).forEach(etinaHelperElikia -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperElikia, null));
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,6 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -114,7 +113,7 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -133,42 +132,39 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
final Npc attacker = (Npc) event.getAttacker();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
switch (attacker.getId())
|
||||
{
|
||||
switch (attacker.getId())
|
||||
case CAMILLE:
|
||||
{
|
||||
default:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GISELLE_NO_IS_SHE_CAMILLE_IN_THAT_STATE);
|
||||
break;
|
||||
}
|
||||
case KAIN_VAN_HALTER:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVEN_THE_MIGHTY_ETINA_SEEMS_TO_FEAR_US);
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ETIS_VAN_ETINA_WE_FINALLY_MEET);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CAMILLE:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GISELLE_NO_IS_SHE_CAMILLE_IN_THAT_STATE);
|
||||
break;
|
||||
}
|
||||
case KAIN_VAN_HALTER:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVEN_THE_MIGHTY_ETINA_SEEMS_TO_FEAR_US);
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ETIS_VAN_ETINA_WE_FINALLY_MEET);
|
||||
break;
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,10 +173,10 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_LEONA).forEach(etinaHelperLeona -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperLeona, null));
|
||||
// instance.getAliveNpcs(ETINA_HELPER_LEONA).forEach(etinaHelperLeona -> getTimers().addRepeatingTimer("USE_SKILL", 6000, etinaHelperLeona, null));
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,28 +126,22 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_SPORCHA).forEach(etinaHelperSporcha -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperSporcha, null));
|
||||
}
|
||||
}
|
||||
|
@ -479,20 +479,20 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
final Instance world = attacker.getInstanceWorld();
|
||||
if (isInInstance(world))
|
||||
{
|
||||
final boolean CAMILLE_30 = world.getParameters().getBoolean("CAMILLE_30", false);
|
||||
final boolean CAMILLE_60 = world.getParameters().getBoolean("CAMILLE_60", false);
|
||||
final boolean KAIN_30 = world.getParameters().getBoolean("KAIN_30", false);
|
||||
final boolean KAIN_60 = world.getParameters().getBoolean("KAIN_60", false);
|
||||
final boolean ETINA_80 = world.getParameters().getBoolean("ETINA_80", false);
|
||||
final boolean ETINA_15 = world.getParameters().getBoolean("ETINA_15", false);
|
||||
final boolean camille30 = world.getParameters().getBoolean("CAMILLE_30", false);
|
||||
final boolean camille60 = world.getParameters().getBoolean("CAMILLE_60", false);
|
||||
final boolean kain30 = world.getParameters().getBoolean("KAIN_30", false);
|
||||
final boolean kain60 = world.getParameters().getBoolean("KAIN_60", false);
|
||||
final boolean etina80 = world.getParameters().getBoolean("ETINA_80", false);
|
||||
final boolean etina15 = world.getParameters().getBoolean("ETINA_15", false);
|
||||
if (npc.getId() == CAMILLE)
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !CAMILLE_30)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !camille30)
|
||||
{
|
||||
world.getParameters().set("CAMILLE_30", true);
|
||||
world.spawnGroup("CAMILLE_MINIONS");
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !CAMILLE_60)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !camille60)
|
||||
{
|
||||
world.getParameters().set("CAMILLE_60", true);
|
||||
world.spawnGroup("CAMILLE_MINIONS");
|
||||
@ -500,13 +500,13 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
}
|
||||
else if (npc.getId() == KAIN_VAN_HALTER)
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !KAIN_30)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !kain30)
|
||||
{
|
||||
world.getParameters().set("KAIN_30", true);
|
||||
showOnScreenMsg(world, NpcStringId.ETIS_VAN_ETINA_SUMMONS_HIS_APOSTLES_MINIONS, ExShowScreenMessage.TOP_CENTER, 7000, true);
|
||||
world.spawnGroup("KAIN_MINIONS");
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !KAIN_60)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !kain60)
|
||||
{
|
||||
world.getParameters().set("KAIN_60", true);
|
||||
showOnScreenMsg(world, NpcStringId.ETIS_VAN_ETINA_SUMMONS_HIS_APOSTLES_MINIONS, ExShowScreenMessage.TOP_CENTER, 7000, true);
|
||||
@ -515,7 +515,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
}
|
||||
else if ((npc.getId() == ETIS_VAN_ETINA1))
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.8)) && !ETINA_80)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.8)) && !etina80)
|
||||
{
|
||||
final Npc etina1 = world.getNpc(ETIS_VAN_ETINA1);
|
||||
world.getParameters().set("ETINA_80", true);
|
||||
@ -532,7 +532,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
startQuestTimer("calamityCastTimer", 120000, npc, attacker, true);
|
||||
startQuestTimer("destructionCastTimer", 120000, npc, attacker, true);
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.15)) && !ETINA_15)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.15)) && !etina15)
|
||||
{
|
||||
world.getParameters().set("ETINA_15", true);
|
||||
world.spawnGroup("ETINA_MINIONS");
|
||||
@ -704,6 +704,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
292, // Fall of Etina (Solo)
|
||||
293, // Fall of Etina (Solo)
|
||||
};
|
||||
//@formatter:on
|
||||
|
||||
private EtinaHelperAliber()
|
||||
{
|
||||
@ -108,7 +109,6 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -132,7 +132,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -149,18 +149,18 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
case "DESTROY_BARRICADES":
|
||||
{
|
||||
final FriendlyNpc _aliber = (FriendlyNpc) instance.getNpc(ETINA_HELPER_ALIBER);
|
||||
boolean BARRICADE_DESTROYED = instance.getParameters().getBoolean("BARRICADE_DESTROYED", false);
|
||||
final FriendlyNpc aliber = (FriendlyNpc) instance.getNpc(ETINA_HELPER_ALIBER);
|
||||
boolean destroyed = instance.getParameters().getBoolean("BARRICADE_DESTROYED", false);
|
||||
if (!instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.setInvul(true);
|
||||
_aliber.setCanReturnToSpawnPoint(false);
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[0]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[0], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.setInvul(true);
|
||||
aliber.setCanReturnToSpawnPoint(false);
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[0]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[0], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_1").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -174,12 +174,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_2").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty() && instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[1], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[1], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_2").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -193,12 +193,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_3").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty() && instance.getNpcsOfGroup("BARRICADES_2").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[2], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[2], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_3").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -212,12 +212,12 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
}
|
||||
else if (!instance.getNpcsOfGroup("BARRICADES_4").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty() && instance.getNpcsOfGroup("BARRICADES_3").isEmpty())
|
||||
{
|
||||
_aliber.setRunning();
|
||||
_aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);
|
||||
if (_aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[3], 200) && !BARRICADE_DESTROYED)
|
||||
aliber.setRunning();
|
||||
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);
|
||||
if (aliber.getLocation().isIn2DRadius(SKILL_CAST_LOCATIONS[3], 200) && !destroyed)
|
||||
{
|
||||
_aliber.broadcastPacket(new MagicSkillUse(_aliber, _aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
_aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
aliber.broadcastPacket(new MagicSkillUse(aliber, aliber, BARRICADE_DESTRUCTION.getSkillId(), 1, 500, 0));
|
||||
aliber.broadcastPacket(new ExShowScreenMessage(NpcStringId.ALIBER_IS_CASTING_A_SPELL_TO_DESTROY_THE_BARRICADE, ExShowScreenMessage.TOP_CENTER, 7000, true));
|
||||
instance.getNpcsOfGroup("BARRICADES_4").forEach(barricade ->
|
||||
{
|
||||
if (barricade != null)
|
||||
@ -229,8 +229,8 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
instance.despawnGroup("BARRICADES_4");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,28 +238,22 @@ public class EtinaHelperAliber extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RAGE_AGAINST_ALL_THAT_STANDS_IN_OUR_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RAGE_AGAINST_ALL_THAT_STANDS_IN_OUR_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperAliber, null));
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("USE_SKILL", 6000, etinaHelperAliber, null));
|
||||
instance.getAliveNpcs(ETINA_HELPER_ALIBER).forEach(etinaHelperAliber -> getTimers().addRepeatingTimer("DESTROY_BARRICADES", 5000, etinaHelperAliber, null));
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,29 +126,22 @@ public class EtinaHelperDevianne extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BEHOLD_THE_POWER_OF_THE_IVORY_TOWER_WIZARDS);
|
||||
}
|
||||
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BEHOLD_THE_POWER_OF_THE_IVORY_TOWER_WIZARDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_DEVIANNE).forEach(etinaHelperDevianne -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperDevianne, null));
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,28 +126,22 @@ public class EtinaHelperElikia extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_ELIKIA).forEach(etinaHelperElikia -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperElikia, null));
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,6 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -114,7 +113,7 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -133,42 +132,39 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
final Npc attacker = (Npc) event.getAttacker();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
switch (attacker.getId())
|
||||
{
|
||||
switch (attacker.getId())
|
||||
case CAMILLE:
|
||||
{
|
||||
default:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GISELLE_NO_IS_SHE_CAMILLE_IN_THAT_STATE);
|
||||
break;
|
||||
}
|
||||
case KAIN_VAN_HALTER:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVEN_THE_MIGHTY_ETINA_SEEMS_TO_FEAR_US);
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ETIS_VAN_ETINA_WE_FINALLY_MEET);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CAMILLE:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GISELLE_NO_IS_SHE_CAMILLE_IN_THAT_STATE);
|
||||
break;
|
||||
}
|
||||
case KAIN_VAN_HALTER:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVEN_THE_MIGHTY_ETINA_SEEMS_TO_FEAR_US);
|
||||
break;
|
||||
}
|
||||
case ETIS_VAN_ETINA2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ETIS_VAN_ETINA_WE_FINALLY_MEET);
|
||||
break;
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,10 +173,10 @@ public class EtinaHelperLeona extends AbstractNpcAI
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_LEONA).forEach(etinaHelperLeona -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperLeona, null));
|
||||
// instance.getAliveNpcs(ETINA_HELPER_LEONA).forEach(etinaHelperLeona -> getTimers().addRepeatingTimer("USE_SKILL", 6000, etinaHelperLeona, null));
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
{
|
||||
final StatSet npcVars = npc.getVariables();
|
||||
final Player plr = npcVars.getObject("PLAYER_OBJECT", Player.class);
|
||||
final Monster monster = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
|
||||
if (plr != null)
|
||||
{
|
||||
final double distance = npc.calculateDistance2D(plr);
|
||||
@ -109,7 +108,7 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
WorldObject target = npc.getTarget();
|
||||
if (target == null)
|
||||
{
|
||||
npc.setTarget(monster);
|
||||
npc.setTarget(getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500)));
|
||||
}
|
||||
if ((target != null) && !target.isInvul() && target.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, target) && !CommonUtil.contains(NOT_ATK_NPCS, target.getId()) && !CommonUtil.contains(ETINA_HELPERS, target.getId()))
|
||||
{
|
||||
@ -127,28 +126,22 @@ public class EtinaHelperSporcha extends AbstractNpcAI
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final FriendlyNpc npc = (FriendlyNpc) event.getTarget();
|
||||
if (npc != null)
|
||||
if ((npc != null) && !npc.isInCombat())
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
if ((instance != null) && !event.getAttacker().isPlayable() && (getRandom(50) < 5) && !CommonUtil.contains(ETINA_HELPERS, event.getAttacker().getId()))
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
if (getRandom(50) < 5)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_GET_IN_MY_WAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onInstanceStatusChange(OnInstanceStatusChange event)
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
final int status = event.getStatus();
|
||||
if ((status == 1) || (status == 2) || (status == 3))
|
||||
{
|
||||
final Instance instance = event.getWorld();
|
||||
instance.getAliveNpcs(ETINA_HELPER_SPORCHA).forEach(etinaHelperSporcha -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, etinaHelperSporcha, null));
|
||||
}
|
||||
}
|
||||
|
@ -479,20 +479,20 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
final Instance world = attacker.getInstanceWorld();
|
||||
if (isInInstance(world))
|
||||
{
|
||||
final boolean CAMILLE_30 = world.getParameters().getBoolean("CAMILLE_30", false);
|
||||
final boolean CAMILLE_60 = world.getParameters().getBoolean("CAMILLE_60", false);
|
||||
final boolean KAIN_30 = world.getParameters().getBoolean("KAIN_30", false);
|
||||
final boolean KAIN_60 = world.getParameters().getBoolean("KAIN_60", false);
|
||||
final boolean ETINA_80 = world.getParameters().getBoolean("ETINA_80", false);
|
||||
final boolean ETINA_15 = world.getParameters().getBoolean("ETINA_15", false);
|
||||
final boolean camille30 = world.getParameters().getBoolean("CAMILLE_30", false);
|
||||
final boolean camille60 = world.getParameters().getBoolean("CAMILLE_60", false);
|
||||
final boolean kain30 = world.getParameters().getBoolean("KAIN_30", false);
|
||||
final boolean kain60 = world.getParameters().getBoolean("KAIN_60", false);
|
||||
final boolean etina80 = world.getParameters().getBoolean("ETINA_80", false);
|
||||
final boolean etina15 = world.getParameters().getBoolean("ETINA_15", false);
|
||||
if (npc.getId() == CAMILLE)
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !CAMILLE_30)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !camille30)
|
||||
{
|
||||
world.getParameters().set("CAMILLE_30", true);
|
||||
world.spawnGroup("CAMILLE_MINIONS");
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !CAMILLE_60)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !camille60)
|
||||
{
|
||||
world.getParameters().set("CAMILLE_60", true);
|
||||
world.spawnGroup("CAMILLE_MINIONS");
|
||||
@ -500,13 +500,13 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
}
|
||||
else if (npc.getId() == KAIN_VAN_HALTER)
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !KAIN_30)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.3)) && !kain30)
|
||||
{
|
||||
world.getParameters().set("KAIN_30", true);
|
||||
showOnScreenMsg(world, NpcStringId.ETIS_VAN_ETINA_SUMMONS_HIS_APOSTLES_MINIONS, ExShowScreenMessage.TOP_CENTER, 7000, true);
|
||||
world.spawnGroup("KAIN_MINIONS");
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !KAIN_60)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.6)) && !kain60)
|
||||
{
|
||||
world.getParameters().set("KAIN_60", true);
|
||||
showOnScreenMsg(world, NpcStringId.ETIS_VAN_ETINA_SUMMONS_HIS_APOSTLES_MINIONS, ExShowScreenMessage.TOP_CENTER, 7000, true);
|
||||
@ -515,7 +515,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
}
|
||||
else if ((npc.getId() == ETIS_VAN_ETINA1))
|
||||
{
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.8)) && !ETINA_80)
|
||||
if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.8)) && !etina80)
|
||||
{
|
||||
final Npc etina1 = world.getNpc(ETIS_VAN_ETINA1);
|
||||
world.getParameters().set("ETINA_80", true);
|
||||
@ -532,7 +532,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
startQuestTimer("calamityCastTimer", 120000, npc, attacker, true);
|
||||
startQuestTimer("destructionCastTimer", 120000, npc, attacker, true);
|
||||
}
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.15)) && !ETINA_15)
|
||||
else if ((npc.getCurrentHp() <= (npc.getMaxHp() * 0.15)) && !etina15)
|
||||
{
|
||||
world.getParameters().set("ETINA_15", true);
|
||||
world.spawnGroup("ETINA_MINIONS");
|
||||
@ -704,6 +704,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user