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

I forgot my password

Latest topics
» Big Cock Hurt
Tue Jun 02, 2015 4:55 am by egorkabbo

» Big Cock Hurt
Tue Jun 02, 2015 4:52 am by egorkabbo

» SolidWoW BlizzLike 4.0.6-4.3.0 Repack stable UPDATED
Thu Apr 10, 2014 5:39 pm by ycabrerag

» JZY’s Trinity Blizzlike Repack 3.35a (updated)
Sun Dec 01, 2013 8:38 am by Bottscan

» Hello Everyone Well
Thu Jun 27, 2013 12:56 pm by 

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

- Similar topics

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