Fixed respawn issue with TimakOrcTroopLeader minion spawns.

This commit is contained in:
MobiusDevelopment
2020-10-15 15:17:32 +00:00
parent 46172a2184
commit b2ee30a67e
17 changed files with 272 additions and 51 deletions

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);

View File

@@ -51,13 +51,26 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
if (npc.isMonster())
{
final MonsterInstance monster = (MonsterInstance) npc;
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
if (!monster.isTeleporting() && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)) && (monster.getMinionList().countSpawnedMinions() < 3))
{
for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
{
addMinion((MonsterInstance) npc, is.getId());
boolean found = false;
for (MonsterInstance minion : monster.getMinionList().getSpawnedMinions())
{
if (minion.getId() == is.getId())
{
found = true;
break;
}
}
if (!found)
{
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
addMinion(monster, is.getId());
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
return super.onAttack(npc, attacker, damage, isSummon);