Improvements for Talking Island aggro soldier AIs.
This commit is contained in:
@@ -40,9 +40,9 @@ public final class TrainningSoldier extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead())
|
if ((npc != null))
|
||||||
{
|
{
|
||||||
if (!npc.isInCombat())
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,9 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead() && !npc.isInCombat())
|
if ((npc != null))
|
||||||
|
{
|
||||||
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
||||||
if (!nearbyMonsters.isEmpty())
|
if (!nearbyMonsters.isEmpty())
|
||||||
@@ -57,7 +59,8 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 10000, npc, null);
|
}
|
||||||
|
startQuestTimer("GUARD_AGGRO", 10000, npc, null);
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
}
|
}
|
||||||
@@ -66,7 +69,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
npc.setIsInvul(true);
|
npc.setIsInvul(true);
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 5000, npc, null);
|
startQuestTimer("GUARD_AGGRO", 5000, npc, null);
|
||||||
return super.onSpawn(npc);
|
return super.onSpawn(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,9 +40,9 @@ public final class TrainningSoldier extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead())
|
if ((npc != null))
|
||||||
{
|
{
|
||||||
if (!npc.isInCombat())
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,9 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead() && !npc.isInCombat())
|
if ((npc != null))
|
||||||
|
{
|
||||||
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
||||||
if (!nearbyMonsters.isEmpty())
|
if (!nearbyMonsters.isEmpty())
|
||||||
@@ -57,7 +59,8 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 10000, npc, null);
|
}
|
||||||
|
startQuestTimer("GUARD_AGGRO", 10000, npc, null);
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
}
|
}
|
||||||
@@ -66,7 +69,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
npc.setIsInvul(true);
|
npc.setIsInvul(true);
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 5000, npc, null);
|
startQuestTimer("GUARD_AGGRO", 5000, npc, null);
|
||||||
return super.onSpawn(npc);
|
return super.onSpawn(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,9 +40,9 @@ public final class TrainningSoldier extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead())
|
if ((npc != null))
|
||||||
{
|
{
|
||||||
if (!npc.isInCombat())
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,9 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead() && !npc.isInCombat())
|
if ((npc != null))
|
||||||
|
{
|
||||||
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
||||||
if (!nearbyMonsters.isEmpty())
|
if (!nearbyMonsters.isEmpty())
|
||||||
@@ -57,7 +59,8 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 10000, npc, null);
|
}
|
||||||
|
startQuestTimer("GUARD_AGGRO", 10000, npc, null);
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
}
|
}
|
||||||
@@ -66,7 +69,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
npc.setIsInvul(true);
|
npc.setIsInvul(true);
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 5000, npc, null);
|
startQuestTimer("GUARD_AGGRO", 5000, npc, null);
|
||||||
return super.onSpawn(npc);
|
return super.onSpawn(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,9 +40,9 @@ public final class TrainningSoldier extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead())
|
if ((npc != null))
|
||||||
{
|
{
|
||||||
if (!npc.isInCombat())
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
for (L2Npc nearby : L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 150))
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,9 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if ((npc != null) && !npc.isDead() && !npc.isInCombat())
|
if ((npc != null))
|
||||||
|
{
|
||||||
|
if (!npc.isInCombat() && !npc.isDead())
|
||||||
{
|
{
|
||||||
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
final List<L2MonsterInstance> nearbyMonsters = L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class, 1000);
|
||||||
if (!nearbyMonsters.isEmpty())
|
if (!nearbyMonsters.isEmpty())
|
||||||
@@ -57,7 +59,8 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 10000, npc, null);
|
}
|
||||||
|
startQuestTimer("GUARD_AGGRO", 10000, npc, null);
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
}
|
}
|
||||||
@@ -66,7 +69,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
npc.setIsInvul(true);
|
npc.setIsInvul(true);
|
||||||
startQuestTimer("GUARD_AGGRO" + npc.getObjectId(), 5000, npc, null);
|
startQuestTimer("GUARD_AGGRO", 5000, npc, null);
|
||||||
return super.onSpawn(npc);
|
return super.onSpawn(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user