Skip to content
Snippets Groups Projects
Commit 0dd04215 authored by Adry85's avatar Adry85 Committed by Zoey76
Browse files

Fixed Timak Orc Troop Leader npc minions spawn.

Reported by: ShinichiYao
parent 8317a177
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,6 @@ package ai.group_template;
import java.util.HashSet;
import java.util.Set;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
......@@ -30,6 +28,8 @@ import com.l2jserver.gameserver.model.holders.MinionHolder;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import ai.npc.AbstractNpcAI;
/**
* Minion Spawn Manager.
* @author Zealar
......@@ -424,6 +424,11 @@ public final class MinionSpawnManager extends AbstractNpcAI
if (npc.getTemplate().getParameters().getSet().get("SummonPrivateRate") == null)
{
((L2MonsterInstance) npc).getMinionList().spawnMinions(npc.getTemplate().getParameters().getMinionList("Privates"));
npc.setScriptValue(1);
}
else
{
npc.setScriptValue(0);
}
return super.onSpawn(npc);
}
......@@ -436,13 +441,14 @@ public final class MinionSpawnManager extends AbstractNpcAI
final L2MonsterInstance monster = (L2MonsterInstance) npc;
if (!monster.isTeleporting())
{
if (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0))
if ((getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0)) && npc.isScriptValue(0))
{
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList("Privates"))
{
addMinion((L2MonsterInstance) npc, is.getId());
}
broadcastNpcSay(npc, Say2.NPC_ALL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
npc.setScriptValue(1);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment