Core/Entities:
- Rename creature_linked_respawn to linked_respawn - Update functionality: add field ´linkType´. ** 0 = creature respawn dependant on creature (default) ** 1 = creature respawn dependant on gameobject ** 2 = gameobject respawn dependant on gameobject ** 3 = gameobject respawn dependant on creature --HG-- branch : trunk
This commit is contained in:
@@ -323,8 +323,21 @@ void GameObject::Update(uint32 diff)
|
||||
{
|
||||
if (m_respawnTime > 0) // timer on
|
||||
{
|
||||
if (m_respawnTime <= time(NULL)) // timer expired
|
||||
time_t now = time(NULL);
|
||||
if (m_respawnTime <= now) // timer expired
|
||||
{
|
||||
time_t linkedRespawntime = sObjectMgr->GetLinkedRespawnTime(GetGUID(), GetMap()->GetInstanceId());
|
||||
if (linkedRespawntime) // Can't respawn, the master is dead
|
||||
{
|
||||
uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(GetGUID());
|
||||
if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day)
|
||||
SetRespawnTime(DAY);
|
||||
else
|
||||
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5,MINUTE); // else copy time from master and add a little
|
||||
SaveRespawnTime(); // also save to DB immediately
|
||||
return;
|
||||
}
|
||||
|
||||
m_respawnTime = 0;
|
||||
m_SkillupList.clear();
|
||||
m_usetimes = 0;
|
||||
|
||||
Reference in New Issue
Block a user