Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 1.25 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include "ScriptPCH.h"
  2.  
  3. class Duel_Reset : public PlayerScript
  4. {
  5.         public:
  6.                 Duel_Reset() : PlayerScript("Duel_Reset"){}
  7.  
  8.                 void OnDuelRequest(Player* Player1, Player* Player2)
  9.                 {
  10.                         if(Player1->GetAreaId() == 2477)
  11.                         {
  12.                                 Player1->RemoveAllSpellCooldown();
  13.                                 Player2->RemoveAllSpellCooldown();
  14.                                 Player1->SetHealth(Player1->GetMaxHealth());
  15.                                 if ( Player1->getPowerType() == POWER_MANA )
  16.                                         Player1->SetPower(POWER_MANA, Player1->GetMaxPower(POWER_MANA));
  17.                                 Player2->SetHealth(Player2->GetMaxHealth());
  18.                                 if ( Player2->getPowerType() == POWER_MANA )
  19.                                         Player2->SetPower(POWER_MANA,  Player2->GetMaxPower(POWER_MANA));
  20.                         }
  21.                 }
  22.  
  23.                 void OnDuelEnd(Player* pWinner, Player* pLoser, DuelCompleteType /*type*/)
  24.                 {
  25.                         if(pWinner->GetAreaId() == 2477)
  26.                         {
  27.                                 pWinner->RemoveAllSpellCooldown();
  28.                                 pLoser->RemoveAllSpellCooldown();
  29.                                 pWinner->SetHealth(pWinner->GetMaxHealth());
  30.                                 if ( pWinner->getPowerType() == POWER_MANA )
  31.                                         pWinner->SetPower(POWER_MANA, pWinner->GetMaxPower(POWER_MANA));
  32.                                 pLoser->SetHealth(pLoser->GetMaxHealth());
  33.                                 if ( pLoser->getPowerType() == POWER_MANA )
  34.                                         pLoser->SetPower(POWER_MANA,  pLoser->GetMaxPower(POWER_MANA));
  35.                         }
  36.                 }
  37. };
  38.  
  39. void AddSC_Duel_Reset()
  40. {
  41.         new Duel_Reset();
  42. }