Trinitycore: Core: Unable to respawn via script or gm command

Created on 9 Apr 2020  路  15Comments  路  Source: TrinityCore/TrinityCore

Description: If you try to respawn a spawn via a script or a gm command it will not work at some point

  1. .go c 11876
  2. .die .resp until the npc will no longer respawn

.list respawn:
Listing Creature respawns for Durotar (zone 14)
SpawnID | Entry | GridXY| Zone | Respawn time (Full)
11876 | 3100 | [33,23] | Durotar (14) | overdue

Branch(es): 3.3.5

TC rev. hash/commit: rev. 64246306678c

Branch-3.3.5a Comp-Core Sub-Spawns

Most helpful comment

Tested locally with .increase, it seems to work, I will deploy it on my server tomorrow and give an update.

All 15 comments

Confirmed, just noticed this the other night. Sometimes they want to respawn, other times the creatures stay dead

I can .respawn c 11876 for like forever (>40 successful tries) but i cant .respawn a pooled creature once.

No it happen to any creature starting from the second respawn

So, here is what is happening. In the new (new for me) spawn system, respawns are stored in two places, the list of spawns and the list of respawn times. When you respawn something manually (via script or command), the respawn time is updated on the list of spawns, but the list of respawn times remains the same. Therefore, your respawn will only be triggered once everything else before it in the spawn times list is respawned.

I have tried the following to update the respawn times list, it seems to be working but not being familiar with the new system, I am unsure it is fully accurate.
https://gist.github.com/joshwhedon/b3ba8a5b055dc70e8e5a28da35ebc18b

I find some scripts that have this problem like:
https://classic.wowhead.com/npc=15264 in the entrance of ahn'quiraj temple, when you kill someone of 4 first sentinel and wipe, should respawn all sentinel, currently doesn't respawn:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp#L224-L225

Same with sartharion encounter, when you start the fight in hardmode (with 3 drakes alive), when you kill any of 3 drakes during the boss fight and wipe, drakes doesn't respawn:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp#L220-L240

a some other scripts happen the same
I try with @joshwhedon fix (https://github.com/TrinityCore/TrinityCore/issues/24421#issuecomment-612724989) and seems works fine

@joshwhedon do you have more feedback or some suggestion about this?

@jackpoz can be valid?

Feedback wise I have been using it for about a week, did not observe any crash related to it, and nobody has complained of scripts not working related to it either.

Thx, do you have time to do a PR with this fix?

@joshwhedon could you please investigate if https://www.boost.org/doc/libs/1_72_0/doc/html/boost/heap/fibonacci_heap.html provides a way to achieve the same without calling erase() + push() ?
Maybe void update(handle_type handle) ?
Or even void increase(handle_type handle) as we kind of know it's going to be on top of the queue.

I can have a look tomorrow @jackpoz but I honestly have no idea how the fibonacci heap works. I'll try something out and see if it works.

So, here is what is happening. In the new (new for me) spawn system, respawns are stored in two places, the list of spawns and the list of respawn times. When you respawn something manually (via script or command), the respawn time is updated on the list of spawns, but the list of respawn times remains the same. Therefore, your respawn will only be triggered once everything else before it in the spawn times list is respawned.

I have tried the following to update the respawn times list, it seems to be working but not being familiar with the new system, I am unsure it is fully accurate.
https://gist.github.com/joshwhedon/b3ba8a5b055dc70e8e5a28da35ebc18b

Hi, for me,with your fix, when I use respawn command, npcs appears duplicated, one death and one alive, and in some bosses (like Lord Marrowgar) it doesn't do anything.

Thank you

@srg84 it's the correct behavior, a boss cannot be respawn, and corpses are no longer linked to the respawn

@joshwhedon just use increase(handle_type handle) since we know the priority is going to increase anyway.

Something like this

_respawnTimes.increase(info->handle);

please check if it triggers any crash too 馃槃 Could you then open a PR with it ?

Tested locally with .increase, it seems to work, I will deploy it on my server tomorrow and give an update.

Ok been a week, no crash (at least not due to that :D ). So I think the change is safe. If nobody else pushes any change, I'll try to find some time to make a PR this week. If someone has time to do it instead feel free.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

funjoker picture funjoker  路  3Comments

Lopfest picture Lopfest  路  3Comments

Teppic1 picture Teppic1  路  3Comments

Blasphemous picture Blasphemous  路  3Comments

Rushor picture Rushor  路  3Comments