Log in
Most Viewed Topics
Latest topics
2000>
(C++) Killstreak PvP System – TrinityCore
Page 1 of 1 • Share •
(C++) Killstreak PvP System – TrinityCore
<blockquote>
#include "ScriptPCH.h"
class System_OnPvPKill : public PlayerScript
{
public:
System_OnPvPKill() : PlayerScript("System_OnPvPKill") {}
struct SystemInfo
{
uint32 KillStreak;
uint32 LastGUIDKill;
};
static std::map<uint32, SystemInfo> KillingStreak;
void OnPvPKill(Player *pKiller, Player *pVictim)
{
uint32 kGUID;
uint32 vGUID;
kGUID = pKiller->GetGUID();
vGUID = pVictim->GetGUID();
if(kGUID == vGUID)
{
return;
}
if(KillingStreak[kGUID].LastGUIDKill == vGUID)
{
return;
}
KillingStreak[kGUID].KillStreak++;
KillingStreak[vGUID].KillStreak = 0;
KillingStreak[kGUID].LastGUIDKill = vGUID;
KillingStreak[vGUID].LastGUIDKill = 0;
switch(KillingStreak[kGUID].KillStreak)
{
case 10:
char msg[500];
sprintf(msg, "[PvP System]: %s killed %s
and is on a 10 kill streak. ",
pKiller->GetName(), pVictim->GetName());
sWorld.SendWorldText(LANG_SYSTEMMESSAGE, msg);
break;
}
}
};
void AddSC_System()
{
new System_OnPvPKill;
</blockquote>
Added only announce if the player is on 10 kill streak, however you can easily add more if you want.
This script is TESTED and It’s working properly.
#include "ScriptPCH.h"
class System_OnPvPKill : public PlayerScript
{
public:
System_OnPvPKill() : PlayerScript("System_OnPvPKill") {}
struct SystemInfo
{
uint32 KillStreak;
uint32 LastGUIDKill;
};
static std::map<uint32, SystemInfo> KillingStreak;
void OnPvPKill(Player *pKiller, Player *pVictim)
{
uint32 kGUID;
uint32 vGUID;
kGUID = pKiller->GetGUID();
vGUID = pVictim->GetGUID();
if(kGUID == vGUID)
{
return;
}
if(KillingStreak[kGUID].LastGUIDKill == vGUID)
{
return;
}
KillingStreak[kGUID].KillStreak++;
KillingStreak[vGUID].KillStreak = 0;
KillingStreak[kGUID].LastGUIDKill = vGUID;
KillingStreak[vGUID].LastGUIDKill = 0;
switch(KillingStreak[kGUID].KillStreak)
{
case 10:
char msg[500];
sprintf(msg, "[PvP System]: %s killed %s
and is on a 10 kill streak. ",
pKiller->GetName(), pVictim->GetName());
sWorld.SendWorldText(LANG_SYSTEMMESSAGE, msg);
break;
}
}
};
void AddSC_System()
{
new System_OnPvPKill;
</blockquote>
Added only announce if the player is on 10 kill streak, however you can easily add more if you want.
This script is TESTED and It’s working properly.
____________________________________________________________/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\/\_/\_/\_/\_/\_/\_/\_/\_/\______________________________________________________
Idea Motion Group

Motion- Owner

- Posts: 338
Join date: 2012-05-28
Age: 20
Location: Myanmar

Similar topics» 90's best 'other' system
» Points System
» How to develop on KDE & Amarok without trashing your System
» Understanding the Thai lotto System
» [A-1170] BZR (Bazaar revision control system) 2.2.1
» Points System
» How to develop on KDE & Amarok without trashing your System
» Understanding the Thai lotto System
» [A-1170] BZR (Bazaar revision control system) 2.2.1
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Home





» မရွားဘူး မွားတာ – အရိပ္ကေလး
» အလြမ္းေတြၾကား ခရီးသြားရသူ – အရိပ္ကေလး
» ေက်ာင္းပိတ္ခ်ိန္ – အရိပ္ကေလး
» ထားခဲ့ျပီးမွ ပို ခ်စ္သည္. – အရိပ္ကေလး