Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- ///////////////////////////////////////////////////////////////////////
- /////////////////////// CONFIG /////////////////////////////
- /////////////////////////////////////////////////////////////////////
- float Version = 1.00f; //Don't touch this.
- bool LooseTokenOnPvPDeath = false; //Set to true if you want the victim to loose tokens when the victim dies.
- int32 AmountOfItemsYouWantTheVictimToLoose = 1; //Amount of items you want the victim to loose when victim dies.
- bool AddTokenOnPvPKill = false; //Set to false if you don't want the killer to be rewarded.
- int32 ItemReward = 40753; //The ItemID of the reward.
- int32 AmountOfRewardsOnKillStreak[5] = { 1, 3, 5, 7, 10 }; //With how many items you want to reward the killer when he slays the victim.
- int32 HowManyTimesYouWantTheKillerToGetAwardedForKillingTheSameVictim = 1; //Name speaks for It self.
- const int32 KillerStreak1 = 3;
- const int32 KillerStreak2 = 5;
- const int32 KillerStreak3 = 10;
- const int32 KillerStreak4 = 15;
- const int32 KillerStreak5 = 20;
- int32 KillStreaks[5] = { KillerStreak1, KillerStreak2, KillerStreak3, KillerStreak4, KillerStreak5 };//On how many kills the killstreaks should announce & Reward.
- ///////////////////////////////////////////////////////////////////
- /////////////////////// END ////////////////////////////
- /////////////////////////////////////////////////////////////////
- struct SystemInfo
- {
- uint32 KillStreak;
- uint64 LastGUIDKill;
- uint8 KillCount;
- };
- static std::map<uint32, SystemInfo> KillingStreak;
- class System_OnPvPKill : public Player
- {
- public:
- System_OnPvPKill() : Player("System_OnPvPKill") {}
- void OnPVPKill(Player *pKiller, Player *pVictim)
- {
- uint64 kGUID;
- uint64 vGUID;
- char msg[500];
- kGUID = pKiller->GetGUID();
- vGUID = pVictim->GetGUID();
- if(kGUID == vGUID)
- {
- return;
- }
- if(KillingStreak[kGUID].LastGUIDKill == vGUID)
- {
- KillingStreak[kGUID].KillCount++;
- KillingStreak[vGUID].KillCount = 1;
- //pKiller->AddItem(ItemReward, 1);
- if(LooseTokenOnPvPDeath == true)
- pVictim->DestroyItemCount(ItemReward, AmountOfItemsYouWantTheVictimToLoose, true, false);
- }
- if(KillingStreak[kGUID].LastGUIDKill != vGUID)
- {
- KillingStreak[kGUID].KillCount = 1;
- KillingStreak[vGUID].KillCount = 1;
- }
- if(KillingStreak[kGUID].KillCount == HowManyTimesYouWantTheKillerToGetAwardedForKillingTheSameVictim)
- {
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment