alpha-core icon indicating copy to clipboard operation
alpha-core copied to clipboard

Cannot recover from death on a certain toon

Open X-Genesis-Qhulut opened this issue 3 years ago • 4 comments

Describe the bug

After dying as described here my toon cannot be revived.

After clicking on "Release spirit" the toon teleports to the bind location and immediately dies again, with the "5 minutes until release" dialog box. Any attempts to release spirit just re-starts the 5-minute countdown.

After waiting 5 minutes the dialog box goes away but the toon is still dead.

The client/server messages are as follows, upon clicking on "Release Spirit":

[DEBUG] [12/08/2022 11:06:59] [127.0.0.1] <- Handling CMSG_SET_TARGET
[DEBUG] [12/08/2022 11:06:59] [127.0.0.1] -- Success! CMSG_SET_TARGET
[DEBUG] [12/08/2022 11:06:59] [127.0.0.1] <- Handling CMSG_SET_TARGET
[DEBUG] [12/08/2022 11:06:59] [127.0.0.1] -- Success! CMSG_SET_TARGET
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] <- Handling CMSG_REPOP_REQUEST
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -> Sending SMSG_ATTACKSTOP
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -> Sending SMSG_CAST_RESULT
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -> Sending SMSG_SPELL_GO
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -> Sending SMSG_UPDATE_AURA_DURATION
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -- Success! CMSG_REPOP_REQUEST
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -> Sending MSG_MOVE_TELEPORT_ACK
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] <- Handling MSG_MOVE_TELEPORT_ACK
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -- Success! MSG_MOVE_TELEPORT_ACK
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] <- Handling MSG_MOVE_HEARTBEAT
[DEBUG] [12/08/2022 11:07:00] [127.0.0.1] -- Success! MSG_MOVE_HEARTBEAT

This is a modified server that also shows the SMSG_xxxx messages. The "Handling" message is displayed before the handler is called and the "Success!" message is display after the handler is called. Any SMSG_xxxx messages would be a result of what the handler did.

I made another mage and did the same process (dying in Moonbrook) however this mage recovers when you release spirit. A comparison of the two toons on the "characters" database shows:

           guid | 3         5
        account | 1         1
           name | MyMage    MyOtherMage
           race | 3         7
          class | 8         8
         gender | 1         1
          level | 40        40
             xp | 0         0
          money | 97669     0
           skin | 7         1
           face | 9         3
      hairstyle | 13        2
     haircolour | 8         2
     facialhair | 0         0
      bankslots | 0         0
   talentpoints | 710       710
    skillpoints | 43        43
     position_x | 9941.13   -6234.97
     position_y | 2205.7    331.24
     position_z | 1328.86   382.945
            map | 1         0
    orientation | 0         0.0785398
         online | 0         0
      totaltime | 18318     468
      leveltime | 5705      312
    extra_flags | 16        16
           zone | 187       132
      taxi_path |   
          drunk | 0         0
         health | 0         700
         power1 | 426       1683
         power2 | 0         0
         power3 | 0         0
         power4 | 0         0
         power5 | 0         0

There doesn't seem to be a heap of difference between MyMage and MyOtherMage except for the location and the race.

If I set MyMage health to 10 on the database, and then re-connect it appears fine (I am alive). If I set the health back to zero on the database the problem returns. It cannot be released.

Steps to reproduce

  • Make a female dwarf mage
  • Set its level to 40 (.level 40)
  • Teleport to Darnassus (.tel darnassus)
  • Bind to the binder there
  • Teleport to Moonbrook (.tel moonbrook)
  • Run away from the mobs chasing you
  • Die
  • Log out
  • Log back in
  • Try to release spirit

Expected behavior To be able to release my spirit after dying.

X-Genesis-Qhulut avatar Aug 12 '22 03:08 X-Genesis-Qhulut

Further investigation indicates this is a problem with the Dwarf race. If you change the race on the database from 3 (dwarf) to 7 (gnome) you can release spirit successfully.

What I suspect is happening is that the max_health for the dwarf race is incorrectly calculated, particularly for a level 40. When you connect your max_health is set to zero. Then when you try to release your spirit it sets health = max_health, which causes you to immediately die again after releasing spirit.

I'm not sure of the best fix, but at least when handling CMSG_REPOP_REQUEST there should be a check that health is not being set to zero.

X-Genesis-Qhulut avatar Aug 12 '22 06:08 X-Genesis-Qhulut

Alternative steps to reproduce, instead of travelling to Moonbrook and quite possibly encountering https://github.com/The-Alpha-Project/alpha-core/issues/462, just log out and set the health of the toon to zero on the "characters" table.

X-Genesis-Qhulut avatar Aug 12 '22 06:08 X-Genesis-Qhulut

~~Were you using a Dwarf mage by any chance @X-Genesis-Qhulut?~~ At this moment level stat calculations for that race/class combination only goes up to 25, need to add support up to level 60.

Sorry just read Make a female dwarf mage in the steps, that might be the cause.

GrenderG avatar Aug 12 '22 15:08 GrenderG

Yes, it was a dwarf mage --- the stats for it are in the original post.

X-Genesis-Qhulut avatar Aug 12 '22 20:08 X-Genesis-Qhulut

Fixed in https://github.com/The-Alpha-Project/alpha-core/commit/2a6406af15781753e4a8e70d8184b1b6656b6ebb

GrenderG avatar Aug 20 '22 17:08 GrenderG