Option to force delete spawned minions upon master death.
This commit is contained in:
@ -644,6 +644,7 @@ public final class Config
|
||||
public static float RAID_MIN_RESPAWN_MULTIPLIER;
|
||||
public static float RAID_MAX_RESPAWN_MULTIPLIER;
|
||||
public static boolean RAID_DISABLE_CURSE;
|
||||
public static boolean FORCE_DELETE_MINIONS;
|
||||
public static int RAID_CHAOS_TIME;
|
||||
public static int GRAND_CHAOS_TIME;
|
||||
public static int MINION_CHAOS_TIME;
|
||||
@ -2039,6 +2040,7 @@ public final class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
FORCE_DELETE_MINIONS = NPC.getBoolean("ForceDeleteMinions", false);
|
||||
|
||||
RAID_DISABLE_CURSE = NPC.getBoolean("DisableRaidCurse", false);
|
||||
RAID_CHAOS_TIME = NPC.getInt("RaidChaosTime", 10);
|
||||
|
@ -88,25 +88,6 @@ public class MinionList
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all spawned minions and try to reuse them.
|
||||
*/
|
||||
public void deleteSpawnedMinions()
|
||||
{
|
||||
if (!_spawnedMinions.isEmpty())
|
||||
{
|
||||
for (L2MonsterInstance minion : _spawnedMinions)
|
||||
{
|
||||
if (minion != null)
|
||||
{
|
||||
minion.setLeader(null);
|
||||
minion.deleteMe();
|
||||
}
|
||||
}
|
||||
_spawnedMinions.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on the minion spawn and added them in the list of the spawned minions.
|
||||
* @param minion
|
||||
@ -118,13 +99,24 @@ public class MinionList
|
||||
|
||||
/**
|
||||
* Called on the master death/delete.
|
||||
* @param force if true - force delete of the spawned minions By default minions deleted only for raidbosses
|
||||
* @param force - When true, force delete of the spawned minions. By default minions are deleted only for raidbosses.
|
||||
*/
|
||||
public void onMasterDie(boolean force)
|
||||
{
|
||||
if (_master.isRaid() || force)
|
||||
if (_master.isRaid() || force || Config.FORCE_DELETE_MINIONS)
|
||||
{
|
||||
deleteSpawnedMinions();
|
||||
if (!_spawnedMinions.isEmpty())
|
||||
{
|
||||
for (L2MonsterInstance minion : _spawnedMinions)
|
||||
{
|
||||
if (minion != null)
|
||||
{
|
||||
minion.setLeader(null);
|
||||
minion.deleteMe();
|
||||
}
|
||||
}
|
||||
_spawnedMinions.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user