mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 06:00:10 -04:00
Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object - Toggleable spawn groups (with C++/SAI/command options to use them) - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone. - Backward compatibility mode (set via group and for summons) to support creatures/gos that currently don't work well with this (this should be removed once the exceptions are fixed) Fixes and closes #2858 Tags #8661 as fixable. Fixes and closes #13787 Fixes #15222.
This commit is contained in:
@@ -1911,10 +1911,22 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
// First handle any creatures that still have a corpse around
|
||||
Trinity::RespawnDo u_do;
|
||||
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(player, u_do);
|
||||
Cell::VisitGridObjects(player, worker, player->GetGridActivationRange());
|
||||
|
||||
// Now handle any that had despawned, but had respawn time logged.
|
||||
RespawnVector data;
|
||||
player->GetMap()->GetRespawnInfo(data, SPAWN_TYPEMASK_ALL, 0);
|
||||
if (!data.empty())
|
||||
{
|
||||
uint32 const gridId = Trinity::ComputeGridCoord(player->GetPositionX(), player->GetPositionY()).GetId();
|
||||
for (RespawnInfo* info : data)
|
||||
if (info->gridId == gridId)
|
||||
player->GetMap()->RemoveRespawnTime(info, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user