PvP System

oops is 100 arena xD

I could’nt make it work at rev 10870. Seems like the script is not loading.

You sure that you dont kill the same player all the time, since it has a check for it:)

Well, what i did was i made a 2nd account, change the case to 1, so if i kill 1 person the message will be shown.


                        case 1:

                        sprintf(msg, "[PvP System]: %s killed %s and is on 1st kill streak. (Bonus +50 honor) ", pKiller->GetName(), pVictim->GetName());

                        sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                                pKiller->ModifyHonorPoints(50);

It compiles perfectly but it seems like its not loading.

Post your whole script

here


#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 killer; 

                uint32 killed;

                killer = pKiller->GetGUID();

                killed = pVictim->GetGUID();     


				if(killer == killed) return;

                if ((pKiller->getLevel() - pVictim->getLevel()) < 5) return;


				char msg[500];


                        sprintf(msg, "[PvP System]: %s killed %s and is on 1st kill streak. (Bonus +50 honor) ", pKiller->GetName(), pVictim->GetName());

                        sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                                pKiller->ModifyHonorPoints(50);


                KillingStreak[killer].KillStreak++;

                KillingStreak[killed].KillStreak = 0;

                KillingStreak[killer].LastGUIDKill = killed;

                KillingStreak[killed].LastGUIDKill = 0;


                switch(KillingStreak[killer].KillStreak)

                {


                        break;


                        case 10:

                        sprintf(msg, "[PvP System]: %s killed %s and is on a 10 kill streak. (Bonus + 2500 honor + 20 arena) ", pKiller->GetName(), pVictim->GetName());

                        sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                                pKiller->ModifyHonorPoints(2500);

                                                pKiller->ModifyArenaPoints(20);

                        break;


                        case 15:

                        sprintf(msg, "[PvP System]: %s killed %s and is on a 15 kill streak. (Bonus + 5000 honor + 30 arena) ", pKiller->GetName(), pVictim->GetName());

                        sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                                pKiller->ModifyHonorPoints(5000);

                                                pKiller->ModifyArenaPoints(30);

                        break;


                        case 20:

                        sprintf(msg, "[PvP System]: %s killed %s and is on a 20 kill streak. (Bonus + 10000 honor + 50 arena) ", pKiller->GetName(), pVictim->GetName());

                        sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                                pKiller->ModifyHonorPoints(10000);

                                                pKiller->ModifyArenaPoints(50);

                        break;


                        case 25:

                        sprintf(msg, "[PvP System]: %s killed %s and is on a EPIC 25 kill streak. (Bonus + 25000 honor + 1000 arena) ", pKiller->GetName(), pVictim->GetName());

                        sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                                pKiller->ModifyHonorPoints(25000);

                                                pKiller->ModifyArenaPoints(100);

                                                        break;


                }

        }

};


void AddSC_PVP_System()

{

    new System_OnPvPKill;

}

Remove the first

break;

in

[CODE]switch(KillingStreak[killer].KillStreak)

            { 


                    break; // this one , remove THISSSSSSSSSS!!!!


                    case 10: 

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 10 kill streak. (Bonus + 2500 honor + 20 arena) ", pKiller->GetName(), pVictim->GetName()); 

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(2500); 

                                            pKiller->ModifyArenaPoints(20); 

                    break; 

[/CODE]

Btw you sure you added it right in ScriptLoader.cpp???

Since this code :

[CODE]char msg[500];

                    sprintf(msg, "[PvP System]: %s killed %s and is on 1st kill streak. (Bonus +50 honor) ", pKiller->GetName(), pVictim->GetName()); 



                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(50); 

[/CODE] Should always occur on PvP Kill

EDIT: Found your bug had the same before what gaves me alot of headaches /emoticons/default_sad.png, you made a typo:

void OnPvPKill(Player *pKiller, Player *pVictim)change to OnPVPKill so with big V

this happen


3>scripts.lib(PVP_System_Streaks.obj) : error LNK2001: unresolved external symbol "public: static class std::map<unsigned int,struct System_OnPVPKill::SystemInfo,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct System_OnPVPKill::SystemInfo> > > System_OnPVPKill::KillingStreak" (?KillingStreak@System_OnPVPKill@@2V?$map@IUSystemInfo@System_OnPVPKill@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIUSystemInfo@System_OnPVPKill@@@std@@@4@@std@@A)

This should work :

[CODE]

#include “ScriptPCH.h”

struct SystemInfo

    {

            uint32 KillStreak;

            uint32 LastGUIDKill;


    };

static std::map<uint32, SystemInfo> KillingStreak;

class System_OnPvPKill : public PlayerScript

{

    public:

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

void OnPvPKill(Player *pKiller, Player *pVictim)

    {

            uint32 killer; 

            uint32 killed;

            killer = pKiller->GetGUID();

            killed = pVictim->GetGUID();     


                            if(killer == killed) return;

            if ((pKiller->getLevel() - pVictim->getLevel()) < 5) return;


                            char msg[500];


                    sprintf(msg, "[PvP System]: %s killed %s and is on 1st kill streak. (Bonus +50 honor) ", pKiller->GetName(), pVictim->GetName());

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                            pKiller->ModifyHonorPoints(50);


            KillingStreak[killer].KillStreak++;

            KillingStreak[killed].KillStreak = 0;

            KillingStreak[killer].LastGUIDKill = killed;

            KillingStreak[killed].LastGUIDKill = 0;


            switch(KillingStreak[killer].KillStreak)

            {                                         

                    case 10:

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 10 kill streak. (Bonus + 2500 honor + 20 arena) ", pKiller->GetName(), pVictim->GetName());

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                            pKiller->ModifyHonorPoints(2500);

                                            pKiller->ModifyArenaPoints(20);

                    break;


                    case 15:

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 15 kill streak. (Bonus + 5000 honor + 30 arena) ", pKiller->GetName(), pVictim->GetName());

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                            pKiller->ModifyHonorPoints(5000);

                                            pKiller->ModifyArenaPoints(30);

                    break;


                    case 20:

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 20 kill streak. (Bonus + 10000 honor + 50 arena) ", pKiller->GetName(), pVictim->GetName());

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                            pKiller->ModifyHonorPoints(10000);

                                            pKiller->ModifyArenaPoints(50);

                    break;


                    case 25:

                    sprintf(msg, "[PvP System]: %s killed %s and is on a EPIC 25 kill streak. (Bonus + 25000 honor + 1000 arena) ", pKiller->GetName(), pVictim->GetName());

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg);

                                            pKiller->ModifyHonorPoints(25000);

                                            pKiller->ModifyArenaPoints(100);

                                                    break;


            }

    }

};

void AddSC_PVP_System()

{

new System_OnPvPKill;

}[/CODE]

Still doesnt work. I think its not compatible with the new rev.

this defo should work , made a typo above:

[CODE]#include “ScriptPCH.h”

struct SystemInfo

    { 

            uint32 KillStreak; 

            uint32 LastGUIDKill; 


    }; 

static std::map<uint32, SystemInfo> KillingStreak;

class System_OnPvPKill : public PlayerScript

{

    public: 

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

void OnPVPKill(Player *pKiller, Player *pVictim)

    { 

            uint32 killer;  

            uint32 killed; 

            killer = pKiller->GetGUID(); 

            killed = pVictim->GetGUID();      


                            if(killer == killed) return; 

            if ((pKiller->getLevel() - pVictim->getLevel()) < 5) return; 


                            char msg[500]; 


                    sprintf(msg, "[PvP System]: %s killed %s and is on 1st kill streak. (Bonus +50 honor) ", pKiller->GetName(), pVictim->GetName()); 

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(50); 


            KillingStreak[killer].KillStreak++; 

            KillingStreak[killed].KillStreak = 0; 

            KillingStreak[killer].LastGUIDKill = killed; 

            KillingStreak[killed].LastGUIDKill = 0; 


            switch(KillingStreak[killer].KillStreak) 

            {                                          

                    case 10: 

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 10 kill streak. (Bonus + 2500 honor + 20 arena) ", pKiller->GetName(), pVictim->GetName()); 

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(2500); 

                                            pKiller->ModifyArenaPoints(20); 

                    break; 


                    case 15: 

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 15 kill streak. (Bonus + 5000 honor + 30 arena) ", pKiller->GetName(), pVictim->GetName()); 

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(5000); 

                                            pKiller->ModifyArenaPoints(30); 

                    break; 


                    case 20: 

                    sprintf(msg, "[PvP System]: %s killed %s and is on a 20 kill streak. (Bonus + 10000 honor + 50 arena) ", pKiller->GetName(), pVictim->GetName()); 

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(10000); 

                                            pKiller->ModifyArenaPoints(50); 

                    break; 


                    case 25: 

                    sprintf(msg, "[PvP System]: %s killed %s and is on a EPIC 25 kill streak. (Bonus + 25000 honor + 1000 arena) ", pKiller->GetName(), pVictim->GetName()); 

                    sWorld->SendWorldText(LANG_SYSTEMMESSAGE, msg); 

                                            pKiller->ModifyHonorPoints(25000); 

                                            pKiller->ModifyArenaPoints(100); 

                                                    break; 


            } 

    } 

};

void AddSC_System_OnPvPKill()

{

new System_OnPvPKill; 

}

[/CODE]

Change your Scriptloader.cpp to void AddSC_System_OnPvPKill();

It compiles properly, but it doesnt work.

Im using rev. 10870

Может кто дать патч под ласт ревы этот патч.

There is a russian subforum, go there, or write in English.

Who can give a patch under last rev this patch.

If you start using the correct topic, I might get some free time to update my code.

And somebody can present it in the form of a patch???

[off-topic]

Does ANYBODY use spoiler tags anymore? scrolling through this thread has become quite the ordeal.

[/off-topic]

public:

System_OnPvPKill() : PlayerScript(“System_OnPvPKill”) {}

ok where to put this : System_OnPvPKill