-
Notifications
You must be signed in to change notification settings - Fork 31
/
Resetduel.cpp
25 lines (22 loc) · 998 Bytes
/
Resetduel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "ScriptPCH.h"
class Reset_OnDuelEnd : public PlayerScript
{
public:
Reset_OnDuelEnd() : PlayerScript("Reset_OnDuelEnd") {}
void OnDuelEnd(Player *winner, Player *looser, DuelCompleteType type)
{
winner->GetSession()->SendNotification("You just defeated %s! in a duel!", looser->GetName());
winner->RemoveArenaSpellCooldowns();
winner->SetHealth(winner->GetMaxHealth());
looser->GetSession()->SendNotification("%s defeated you in a duel!", winner->GetName());
looser->SetHealth(looser->GetMaxHealth());
if (winner->getPowerType() == POWER_MANA)
winner->SetPower(POWER_MANA, winner->GetMaxPower(POWER_MANA));
if (looser->getPowerType() == POWER_MANA)
looser->SetPower(POWER_MANA, looser->GetMaxPower(POWER_MANA));
}
};
void AddSC_Reset()
{
new Reset_OnDuelEnd;
}