azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.62k stars 2.64k forks source link

Feature: Add onBeforePlayerResurrect call in the ResurrectPlayer method #17388

Open netweaver opened 1 year ago

netweaver commented 1 year ago

Describe your feature request or suggestion in detail

In Player:: ResurrectPlayer, there is currently a method call of sScriptMgr ->OnPlayerResurrect (this, restore_percent, applySickness), but this method is called after the resurrection takes effect, and has no ability to interfere with whether the player role can be resurrected. I think it is necessary to add an onBeforePlayerResurrect method before processing the resurrection logic, and decide whether to execute resurrection according to the method return value, This can easily implement features such as hard core mode

Describe a possible solution to your feature or suggestion in detail

No response

Additional context

No response

netweaver commented 1 year ago

also eluna can add a hook such as PLAYER_EVENT_BEFORE_RESURRECT

netweaver commented 1 year ago

it's done in my repo, should i create a PR?