[Release] Different PvP Systems

Level up via PvP: v2, TESTED!

[SPOILER]

[CODE]/* Made by kjanko for CENCORED */

#include “ScriptPCH.h”

class System_OnPvPKill : public PlayerScript

{

public:

    System_OnPvPKill() : PlayerScript("System_OnPvPKill") {}

void OnPVPKill(Player *pKiller, Player *pVictim)

{

uint64 kGUID;

kGUID = pKiller->GetGUID();

uint64 vGUID;

vGUID = pVictim->GetGUID();

int8 kLevel;

kLevel = pKiller->GetLevelFromDB(kGUID);

int8 vLevel;

vLevel = pVictim->GetLevelFromDB(vGUID);

int8 xy = urand(60, 64);

int8 xyz = urand(65, 69);

int8 zxy = urand(70, 74);

int8 yzx = urand(75, 80);


if(kGUID == vGUID)

	return;


if(pKiller->GetGroup())

	return;


if(kLevel == 80)

	pKiller->AddItem(49426, 1);


if(kLevel == xy && vLevel == xy)

{

	pKiller->GiveXP(29000, NULL, 1.00f);

	pVictim->GiveXP(10000, NULL, 1.00f);

	pKiller->AddItem(40753, 1);

}


if(kLevel == xy && vLevel == xyz)

{

	pKiller->GiveXP(34000, NULL, 1.00f);

	pVictim->GiveXP(2000, NULL, 1.00f);

	pKiller->AddItem(40753, 1);

}


if(kLevel == xy && vLevel == zxy)

{

	pKiller->GiveXP(39000, NULL, 1.00f);

	pVictim->GiveXP(1000, NULL, 1.00f);

	pKiller->AddItem(40753, 1);

}


if(kLevel == xy && vLevel == yzx)

{

	pKiller->GiveXP(100000, NULL, 1.00f);

	pVictim->GiveXP(1, NULL, 1.00f);

	pKiller->AddItem(40753, 1);

}


if(kLevel == xyz && vLevel == xy)

{

	pKiller->GiveXP(13000, NULL, 1.00f);

	pVictim->GiveXP(5000, NULL, 1.00f);

	pKiller->AddItem(45624, 1);

}


if(kLevel == xyz && vLevel == xyz)

{

	pKiller->GiveXP(56000, NULL, 1.00f);

	pVictim->GiveXP(29000, NULL, 1.00f);

	pKiller->AddItem(45624, 1);

}


if(kLevel == xyz && vLevel == zxy)

{

	pKiller->GiveXP(76000, NULL, 1.00f);

	pVictim->GiveXP(10000, NULL, 1.00f);

	pKiller->AddItem(45624, 1);

}


if(kLevel == xyz && vLevel == yzx);

{

	pKiller->GiveXP(86000, NULL, 1.00f);

	pVictim->GiveXP(5000, NULL, 1.00f);

	pKiller->AddItem(45624, 1);

}


if(kLevel == zxy && vLevel == xy)

{

	pKiller->GiveXP(1000, NULL, 1.00f);

	pVictim->GiveXP(5000, NULL, 1.00f);

	pKiller->AddItem(47241, 1);

}


if(kLevel = zxy && vLevel == xyz)

{

	pKiller->GiveXP(12000, NULL, 1.00f);

	pVictim->GiveXP(6000, NULL, 1.00f);

	pKiller->AddItem(47241, 1);

}


if(kLevel == zxy && vLevel == zxy)

{

	pKiller->GiveXP(120000, NULL, 1.00f);

	pVictim->GiveXP(60000, NULL, 1.00f);

	pKiller->AddItem(47241, 1);

}


if(kLevel == zxy && vLevel == yzx)

{

	pKiller->GiveXP(180000, NULL, 1.00f);

	pVictim->GiveXP(1, NULL, 1.00f);

	pKiller->AddItem(47241, 1);

}


if(kLevel == yzx && vLevel == xy)

{

	pKiller->GiveXP(1, NULL, 1.00f);

	pVictim->GiveXP(5000, NULL, 1.00f);

	pKiller->AddItem(49426, urand(0, 1));

}


if(kLevel == yzx && vLevel == xyz)

{

	pKiller->GiveXP(50000, NULL, 1.00f);

	pVictim->GiveXP(10000, NULL, 1.00f);

	pKiller->AddItem(49426, urand(0, 1));

}


if(kLevel == yzx && vLevel == zxy)

{

	pKiller->GiveXP(100000, NULL, 1.00f);

	pVictim->GiveXP(15000, NULL, 1.00f);

	pKiller->AddItem(49426, urand(0, 1));

}


if(kLevel == yzx && vLevel == yzx)

{

	pKiller->GiveXP(170000, NULL, 1.00f);

	pVictim->GiveXP(80000, NULL, 1.00f);

	pKiller->AddItem(49426, urand(0, 1));

}

}

};

void AddSC_System()

{

new System_OnPvPKill;

}[/CODE][/SPOILER]

Killing Streak PvP System: v3 TESTED

[CODE]#include “ScriptPCH.h”

///////////////////////////////////////////////////////////////////////

/////////////////////// CONFIG /////////////////////////////

/////////////////////////////////////////////////////////////////////

float Version = 2.50f; //Don’t touch this.

bool PvPSystemEnabled = true; //Set to false if you want to disable the PvP System

bool OnlyInBattlegrounds = false; //Set to true if you want to enable this only in battlegrounds.

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 = true; //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 = 10;

const int32 KillerStreak2 = 20;

const int32 KillerStreak3 = 30;

const int32 KillerStreak4 = 40;

const int32 KillerStreak5 = 50;

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 PlayerScript

{

public:

    System_OnPvPKill() : PlayerScript("System_OnPvPKill") {}

void OnPVPKill(Player *pKiller, Player *pVictim)

{

if(!PvPSystemEnabled)

{

         return;

}

else if(PvPSystemEnabled)

{

    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;

  }


  if(OnlyInBattlegrounds)

  {

      if(!pKiller->GetMap()->IsBattleground())

          return;

  }


  KillingStreak[kGUID].KillStreak++;

  KillingStreak[vGUID].KillStreak = 0;

  KillingStreak[kGUID].LastGUIDKill = vGUID;

  KillingStreak[vGUID].LastGUIDKill = 0;

  if(AddTokenOnPvPKill == true)

      pKiller->AddItem(ItemReward, 1);

  if(LooseTokenOnPvPDeath == true)

      pVictim->DestroyItemCount(ItemReward, AmountOfItemsYouWantTheVictimToLoose, true, false);


    switch(KillingStreak[kGUID].KillStreak)

    {

    case KillerStreak1:

    sprintf(msg, "[PvP System]: %s killed %s and is on a %u kill streak. ", pKiller->GetName(), pVictim->GetName(), KillStreaks[1]);

    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

    pKiller->AddItem(ItemReward, AmountOfRewardsOnKillStreak[1]);

    break;


    case KillerStreak2:

    sprintf(msg, "[PvP System]: %s killed %s and is on a %u kill streak. ", pKiller->GetName(), pVictim->GetName(), KillStreaks[2]);

    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

    pKiller->AddItem(ItemReward, AmountOfRewardsOnKillStreak[2]);

    break;


    case KillerStreak3:

    sprintf(msg, "[PvP System]: %s killed %s and is on a %u kill streak. ", pKiller->GetName(), pVictim->GetName(), KillStreaks[3]);

    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

    pKiller->AddItem(ItemReward, AmountOfRewardsOnKillStreak[3]);

    break;


    case KillerStreak4:

    sprintf(msg, "[PvP System]: %s killed %s and is on a %u kill streak. ", pKiller->GetName(), pVictim->GetName(), KillStreaks[4]);

    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

    pKiller->AddItem(ItemReward, AmountOfRewardsOnKillStreak[4]);

    break;


    case KillerStreak5:

    sprintf(msg, "[PvP System]: %s killed %s and is on a %u kill streak. ", pKiller->GetName(), pVictim->GetName(), KillStreaks[5]);

    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

    pKiller->AddItem(ItemReward, AmountOfRewardsOnKillStreak[5]);

    KillingStreak[kGUID].KillStreak = 0;

    break;

 }

}

}

};

void AddSC_PVP_System()

{

new System_OnPvPKill;

}[/CODE]

Credits:

-Kjanko

-TrinityCore Community for providing ideas

Enjoy & Do not re-release without permission.

OUTDATED

Damn, it’s compile fine but scripts don’t work for me /emoticons/default_sad.png

It do this on every playerscript…

But thank You very much, it looks fine /emoticons/default_wink.png

both look good

Thanks Kjanko. /emoticons/default_smile.png

Must we add a specific scriptname in the database for activate this script ?!

i get this error when i compile them.

FAILED....SendWorldText must have class/struct/union

Any help? using TC 10868

Change

sWorld.SendWorldText(LANG_SYSTEMMESSAGE, msg);

to

sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

Thats work for me.

thx gonna try…one more question:D Will this type of message work? added codes for colors to make it interesting.

sprintf(msg, "|cffffff00[|cffff00ff PvP|cffffff00]:|cFFFF0000%s |cffffff00killed |cff0000ff%s |cffffff00and is on a |cffff00ff%u |cffffff00kill streak.", pKiller->GetName(), pVictim->GetName(), KillStreaks[1]);

Any suggestions?

What lines to add in a config a file?

Updated the first PvP System, tested and working.

Amazing, the only suggestion I might make is already given in another thread. Make it not exploitable with giving a level restriction.

Sorry please but, what “Killing Streak PvP” exactly do? /emoticons/default_smile.png

#include “ScriptPCH.h”

/* Made by kjanko for BrutalWoW */

#include “ScriptPCH.h”

ehm…

any patch for last rev?

Updated.

i have trouble to add player scripts to game i compile it but i dont know hot to add it to game. /emoticons/default_sad.png is in DB or config files or what?

Whether it is necessary to add something in a config a file, or the config is in a script? /emoticons/default_blink.png

This was not made by you, it was made by spectre, don’t take credit for other people’s work, its rather pathetic.