Idea Motion Group
လူၾကီးမင္းတြင္ Idea Motion Group မွမွတ္ပံုတင္ျပီးေသာ Member Account ရွိပါက Log In မွ တဆင့္ဝင္ေရာက္ပါ။
New Guest ျဖစ္ပါက Register ျပဳလုပ္၍ဝင္ေရာက္ေပးပို႔ႏိုင္ပါသည္။။
*********Idea Motion Group*********
Log in

I forgot my password

Latest topics
Country Codes

Timer

Total
  • >

/>

Test

(C++) Killstreak PvP System – TrinityCore

View previous topic View next topic Go down

default (C++) Killstreak PvP System – TrinityCore

Post   on Thu Jul 05, 2012 5:23 pm

<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.


Join date: 1970-01-01

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum