Misc fixes

This commit is contained in:
hondacrx
2021-06-23 15:09:41 -04:00
parent 7a8b37421b
commit 44cfe32b50
3 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -552,7 +552,7 @@ namespace Game.Chat
}
}
else
handler.SendSysMessage($" | |-- '{groupData.name}' could've been {(isSpawn ? "allowed to spawn" : "blocked from spawning")} if boss state {bossStateId} matched mask {tuple.Item3}; but it is {(EncounterState)actualState} . {(1 << (int)actualState)}, which does not match.");
handler.SendSysMessage($" | |-- '{groupData.name}' could've been {(isSpawn ? "allowed to spawn" : "blocked from spawning")} if boss state {bossStateId} matched mask 0x{tuple.Item3:X2}; but it is {(EncounterState)actualState} . 0x{(1 << (int)actualState):X2}, which does not match.");
}
if (isBlocked)
handler.SendSysMessage($" | |=> '{groupData.name}' is not active due to a blocking rule being matched");
+2 -4
View File
@@ -58,12 +58,12 @@ namespace Game.Chat
}
Player player = handler.GetSession().GetPlayer();
if (!player.GetMap().SpawnGroupDespawn(groupId, deleteRespawnTimes))
if (!player.GetMap().SpawnGroupDespawn(groupId, deleteRespawnTimes, out int despawnedCount))
{
handler.SendSysMessage(CypherStrings.SpawngroupBadgroup, groupId);
return false;
}
handler.SendSysMessage($"Despawned a total of {despawnedCount} objects.");
return true;
}
@@ -454,8 +454,6 @@ namespace Game.Chat
}
handler.SendSysMessage(CypherStrings.SpawngroupSpawncount, creatureList.Count);
foreach (WorldObject obj in creatureList)
handler.SendSysMessage($"{obj.GetName()} ({obj.GetGUID()})");
return true;
}
+7
View File
@@ -2759,6 +2759,11 @@ namespace Game.Maps
public bool SpawnGroupDespawn(uint groupId, bool deleteRespawnTimes)
{
return SpawnGroupDespawn(groupId, deleteRespawnTimes, out _);
}
public bool SpawnGroupDespawn(uint groupId, bool deleteRespawnTimes, out int count)
{
count = 0;
SpawnGroupTemplateData groupData = GetSpawnGroupData(groupId);
if (groupData == null || groupData.flags.HasAnyFlag(SpawnGroupFlags.System))
{
@@ -2793,6 +2798,8 @@ namespace Game.Maps
}
}
count = toUnload.Count;
// now do the actual despawning
foreach (WorldObject obj in toUnload)
obj.AddObjectToRemoveList();