Advertisement
vstar0v0

Dueling

Oct 2nd, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.30 KB | None | 0 0
  1. /**************
  2. PKstreak
  3. **************/
  4. #include "ScriptPCH.h"
  5. #include "Chat.h"
  6. /**************************
  7. The next version include more
  8. **************************/
  9. class PK_Win : public PlayerScript
  10. {
  11. public:
  12.     PK_Win() : PlayerScript("PK_Win") { }
  13.  
  14.     void OnDuelStart(Player* Player1, Player* Player2)
  15.     {
  16.         /*--PK BEGIN--*/
  17.         //Gives casters full power
  18.         Player1->SetHealth(Player1->GetMaxHealth());
  19.         Player2->SetHealth(Player2->GetMaxHealth());
  20.         Player1->SetPower(POWER_MANA, Player1->GetMaxPower(POWER_MANA));
  21.         Player2->SetPower(POWER_MANA, Player2->GetMaxPower(POWER_MANA));
  22.         Player1->SetPower(POWER_RAGE, Player1->GetMaxPower(POWER_RAGE));
  23.         Player2->SetPower(POWER_RAGE, Player2->GetMaxPower(POWER_RAGE));
  24.         Player1->SetPower(POWER_ENERGY, Player1->GetMaxPower(POWER_ENERGY));
  25.         Player2->SetPower(POWER_ENERGY, Player2->GetMaxPower(POWER_ENERGY));
  26.         Player1->SetPower(POWER_RUNIC_POWER, Player1->GetMaxPower(POWER_RUNIC_POWER));
  27.         Player2->SetPower(POWER_RUNIC_POWER, Player2->GetMaxPower(POWER_RUNIC_POWER));
  28.         //Resets CDs
  29.         Player1->RemoveArenaSpellCooldowns();
  30.         Player2->RemoveArenaSpellCooldowns();
  31.         //Begin info
  32.         Player1->GetSession()->SendNotification("Good luck !");
  33.         Player2->GetSession()->SendNotification("Good luck !");
  34.     }
  35.  
  36.     void OnDuelEnd(Player* Winner, Player* Loser, DuelCompleteType type)
  37.     {
  38.         if (type != DUEL_WON)
  39.             return;
  40.         {
  41.             /*--PK END--*/
  42.             //Gives winner money and Decrease Loser money
  43.             Winner->SetMoney(Winner->GetMoney() + 1000);
  44.             Loser->SetMoney(Loser->GetMoney() - 1000);
  45.             if (Loser->GetMoney() >=0)
  46.                 Loser->SetMoney(Loser->GetMoney() - 0);
  47.             else if(Winner->GetMoney() <100000)
  48.                 Winner->SetMoney(Winner->GetMoney() + 0);
  49.             //Set winner auras
  50.             Winner->AddAura(6119, Winner);
  51.             //Gives winner items
  52.             Winner->AddItem(11966, 1);
  53.             //Resets casters full power
  54.             Winner->SetHealth(Winner->GetMaxHealth());
  55.             Loser->SetHealth(Loser->GetMaxHealth());
  56.             Winner->ResetAllPowers();
  57.             Loser->ResetAllPowers();
  58.             //Resets CDs
  59.             Winner->RemoveArenaSpellCooldowns();
  60.             Loser->RemoveArenaSpellCooldowns();
  61.             //Over info
  62.             Winner->GetSession()->SendNotification("Well done, continue to !");
  63.             Loser->GetSession()->SendNotification("You must practice exercises !");
  64.         }
  65.     }
  66.  
  67. };
  68.  
  69. void AddSC_PK_Win()
  70. {
  71.     new PK_Win();
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement