Advertisement
randy336

[Trinity] Duel Reset Script

Oct 20th, 2012
2,818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. /*
  2. <--------------------------------------------------------------------------->
  3.  - Developer(s): Made by ?? Edited by - Ghostcrawler336
  4.  - Complete: 100%
  5.  - ScriptName: 'Duel Reset'
  6.  - Comment: Untested.
  7.  - Updated - 8/7/2013 or 7/8/2013
  8. <--------------------------------------------------------------------------->
  9. */
  10. #include "ScriptPCH.h"
  11.  
  12. class Duel_Reset : public PlayerScript
  13. {
  14.     public:
  15.         Duel_Reset() : PlayerScript("Duel_Reset"){}
  16.  
  17.         void OnDuelEnd(Player* pWinner, Player* pLoser, DuelCompleteType /*type*/)
  18.         {
  19.             pWinner->RemoveAllSpellCooldown();
  20.             pLoser->RemoveAllSpellCooldown();
  21.             pWinner->SetHealth(pWinner->GetMaxHealth());
  22.             if ( pWinner->getPowerType() == POWER_MANA )
  23.                 pWinner->SetPower(POWER_MANA, pWinner->GetMaxPower(POWER_MANA));
  24.             pLoser->SetHealth(pLoser->GetMaxHealth());
  25.             if ( pLoser->getPowerType() == POWER_MANA )
  26.                 pLoser->SetPower(POWER_MANA,  pLoser->GetMaxPower(POWER_MANA));
  27.         }
  28. };
  29.  
  30. void AddSC_Duel_Reset()
  31. {
  32.     new Duel_Reset();
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement