Advertisement
vstar0v0

PVP

Oct 2nd, 2013
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. /**************
  2. PVPstreak
  3. **************/
  4. #include "ScriptPCH.h"
  5. #include "Chat.h"
  6. //Set experience
  7. #define CONFIG_XP 100
  8. /**************************
  9. The next version include more
  10. **************************/
  11. class Kill_You : public PlayerScript
  12. {
  13. public:
  14.     Kill_You() : PlayerScript("Kill_You") { }
  15.  
  16.     void OnPVPKill(Player * Killer, Player * Deceased)
  17.  
  18.     {
  19.         if (Killer->GetGUID() == Deceased->GetGUID())
  20.             return;
  21.         {
  22.             /*--Gives Killer money--*/
  23.             Killer->ModifyMoney(Killer->GetMoney() + 1000);
  24.             //Resets casters full power
  25.             Killer->ResetAllPowers();  
  26.             //Set killer spell
  27.             Killer->CastSpell(Killer, 23128, true);
  28.             //Killer info
  29.             Killer->GetSession()->SendNotification("Well done, continue to !");
  30.             //Deceased info
  31.             Deceased->GetSession()->SendNotification("You must practice exercises !");
  32.         }
  33.         //Define kill experience
  34.         uint32 Level_One = Killer->getLevel();
  35.         uint32 Level_Two = Killer->getLevel();
  36.         uint32 XP = 0;
  37.         //Set experience
  38.         if( Level_Two <= ( Level_One - 10 ) || Level_Two >= ( 10 + Level_One) )
  39.             return;
  40.         {
  41.             //Experience config
  42.             if(Level_One <= 10)
  43.                 XP = BASIC_XP;
  44.             else if(Level_One <= 20 )
  45.                 XP = CONFIG_XP*2.5;
  46.             else if(Level_One <= 30)
  47.                 XP = CONFIG_XP*3.5;
  48.             else if (Level_One <= 40)
  49.                 XP = CONFIG_XP*4.5;
  50.             else if (Level_One <= 50)
  51.                 XP = CONFIG_XP*5.5;
  52.             else if (Level_One <= 60 )
  53.                 XP = CONFIG_XP*6.5;
  54.             Killer->GiveXP(XP, Killer);
  55.         }
  56.     }
  57. };
  58.  
  59. void AddSC_Kill_You()
  60. {
  61.     new Kill_You();
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement