stoneharry

Untitled

May 25th, 2011
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.52 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. ///////////////////////////////////////////////////////////////////////
  4. ///////////////////////      CONFIG      /////////////////////////////
  5. /////////////////////////////////////////////////////////////////////
  6.  
  7. float Version = 1.00f; //Don't touch this.
  8. bool LooseTokenOnPvPDeath = false; //Set to true if you want the victim to loose tokens when the victim dies.
  9. int32 AmountOfItemsYouWantTheVictimToLoose = 1; //Amount of items you want the victim to loose when victim dies.
  10. bool AddTokenOnPvPKill = false; //Set to false if you don't want the killer to be rewarded.
  11. int32 ItemReward = 40753; //The ItemID of the reward.
  12. int32 AmountOfRewardsOnKillStreak[5] = { 1, 3, 5, 7, 10 }; //With how many items you want to reward the killer when he slays the victim.
  13. int32 HowManyTimesYouWantTheKillerToGetAwardedForKillingTheSameVictim = 1; //Name speaks for It self.
  14. const int32 KillerStreak1 = 3;
  15. const int32 KillerStreak2 = 5;
  16. const int32 KillerStreak3 = 10;
  17. const int32 KillerStreak4 = 15;
  18. const int32 KillerStreak5 = 20;
  19. int32 KillStreaks[5] = { KillerStreak1, KillerStreak2, KillerStreak3, KillerStreak4, KillerStreak5 };//On how many kills the killstreaks should announce & Reward.
  20. ///////////////////////////////////////////////////////////////////
  21. ///////////////////////      END      ////////////////////////////
  22. /////////////////////////////////////////////////////////////////
  23.  
  24. struct SystemInfo
  25. {
  26.     uint32              KillStreak;
  27.     uint64              LastGUIDKill;
  28.     uint8               KillCount;
  29. };
  30.  
  31. static std::map<uint32, SystemInfo> KillingStreak;
  32.  
  33. class System_OnPvPKill : public Player
  34. {
  35.     public:
  36.         System_OnPvPKill() : Player("System_OnPvPKill") {}
  37.  
  38.        
  39. void OnPVPKill(Player *pKiller, Player *pVictim)
  40. {
  41.     uint64 kGUID;
  42.     uint64 vGUID;
  43.     char msg[500];
  44.     kGUID = pKiller->GetGUID();
  45.     vGUID = pVictim->GetGUID();                
  46.     if(kGUID == vGUID)
  47.     {
  48.         return;
  49.     }
  50.  
  51.     if(KillingStreak[kGUID].LastGUIDKill == vGUID)
  52.     {
  53.       KillingStreak[kGUID].KillCount++;
  54.       KillingStreak[vGUID].KillCount = 1;
  55.       //pKiller->AddItem(ItemReward, 1);
  56.       if(LooseTokenOnPvPDeath == true)
  57.           pVictim->DestroyItemCount(ItemReward, AmountOfItemsYouWantTheVictimToLoose, true, false);
  58.     }
  59.  
  60.     if(KillingStreak[kGUID].LastGUIDKill != vGUID)
  61.     {
  62.       KillingStreak[kGUID].KillCount = 1;
  63.       KillingStreak[vGUID].KillCount = 1;
  64.     }
  65.  
  66.     if(KillingStreak[kGUID].KillCount == HowManyTimesYouWantTheKillerToGetAwardedForKillingTheSameVictim)
  67.     {
  68.       return;
  69.     }
Advertisement
Add Comment
Please, Sign In to add comment