Advertisement
Emulation

Untitled

Sep 23rd, 2013
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.95 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. uint32 auras[] = { 48162, 48074, 48170, 43223, 36880, 467, 48469 };
  4.  
  5. class duel_reset : public PlayerScript
  6. {
  7. public:
  8.     duel_reset() : PlayerScript("duel_reset"){ }
  9.    
  10.     void OnDuelEnd(Player* winner, Player* loser, DuelCompleteType type)
  11.     {      
  12.    
  13.             /*--WINNER STUFF BEGIN--*/
  14.             winner->SetHealth(winner->GetMaxHealth());
  15.             winner->RemoveAllArenaSpellCooldowns(); //Resets CDs under 10 minutes; Death-Knights spam Army of the Dead, and crash server.
  16.             if(winner->GetPowerType() == POWER_MANA)
  17.                 winner->SetPower(POWER_MANA, winner->GetMaxPower(POWER_MANA));
  18.             if(winner->GetPowerType() == POWER_RAGE)
  19.                 winner->SetPower(POWER_RAGE, winner->GetMaxPower(POWER_RAGE));
  20.             if(winner->GetPowerType() == POWER_ENERGY)
  21.                 winner->SetPower(POWER_ENERGY, winner->GetMaxPower(POWER_ENERGY));
  22.             for(int i = 0; i < 7; i++)
  23.                     winner->AddAura(auras[i], winner);
  24.                     winner->GetSession()->SendNotification("You have been buffed and earned 1 gold for winning a duel! Keep going champion!");
  25.             winner->SetMoney(winner->GetMoney() + 10000); //1 gold
  26.             winner->AddAura(6119, winner); //Mounts winner on black war bear
  27.            
  28.             /*--LOSER STUFF BEGIN--*/
  29.             loser->SetHealth(loser->GetMaxHealth());
  30.             loser->RemoveAllArenaSpellCooldowns();
  31.             //Gives casters full mana, warriors full rage, and rogues full energy, so they can easily get back into the fights, and dominate.
  32.             if(loser->GetPowerType() == POWER_MANA)
  33.                 loser->SetPower(POWER_MANA, loser->GetMaxPower(POWER_MANA));
  34.             if(loser->GetPowerType() == POWER_RAGE)
  35.                 loser->SetPower(POWER_RAGE, loser->GetMaxPower(POWER_RAGE));
  36.             if(loser->GetPowerType() == POWER_ENERGY)
  37.                 loser->SetPower(POWER_ENERGY, loser->GetMaxPower(POWER_ENERGY));
  38.                     loser->SetMoney(loser->GetMoney() + 5000); //50 silver
  39.                 loser->GetSession()->SendNotification("Don't be sad you lost! You still earned a hefty 50 silver for trying!");
  40.                
  41.     }  
  42. };
  43.  
  44. void AddSC_duel_reset()
  45. {
  46.     new duel_reset();
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement