eluna-scripts-ornfelt/lua/WowEmulationScriptPack/C++/DuelCD.cpp
2024-09-23 07:59:23 +02:00

24 lines
No EOL
912 B
C++

#include "ScriptPCH.h"
class Duel_Reset : public PlayerScript
{
public:
Duel_Reset() : PlayerScript("Duel_Reset"){}
void OnDuelEnd(Player* pWinner, Player* pLoser, DuelCompleteType /*type*/)
{
pWinner->RemoveAllSpellCooldown();
pLoser->RemoveAllSpellCooldown();
pWinner->SetHealth(pWinner->GetMaxHealth());
if ( pWinner->getPowerType() == POWER_MANA )
pWinner->SetPower(POWER_MANA, pWinner->GetMaxPower(POWER_MANA));
pLoser->SetHealth(pLoser->GetMaxHealth());
if ( pLoser->getPowerType() == POWER_MANA )
pLoser->SetPower(POWER_MANA, pLoser->GetMaxPower(POWER_MANA));
}
};
void AddSC_Duel_Reset()
{
new Duel_Reset();
}