• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[OutdoorPvPBT C++] How to add Autorevive code on this script?

Status
Not open for further replies.

Synth

Exalted Member
Hello Emudevs,well as title say i want to add Auto Revive code to this script,i want this code teleport players when she die,but everyone will go to place horde will go to zone,and same for alliance but when they revived and teleported i want it to get full hp+full mana.

You can check this script here:
OutdoorPvPBT - C++ - Pastebin

I think the code should be there for horde:
itr->second->GetPlayer()->MonsterTextEmote("[Borean Tundra Defense]: Alliance has 0 resources! Horde wins!",
itr->second->GetPlayer()->GetGUID());
HandleWinMessage("Horde Wins!");
HandleRewards(itr->second->GetPlayer(), 1500, true, false, false);
switch(itr->second->GetPlayer()->GetTeam())
{
and here for alliance:
itr->second->GetPlayer()->MonsterTextEmote("[Borean Tundra Defense]: Horde has 0 resources! Alliance wins!",
itr->second->GetPlayer()->GetGUID());
HandleWinMessage("Alliance Wins!");
HandleRewards(itr->second->GetPlayer(), 1500, true, false, false);
switch(itr->second->GetPlayer()->GetTeam())
{
Can anyone tell me the code for autorevive + get teleported to X,Y,Z,O + and get full mana + hp here?
Thank you!
Best regards,
Synth!
 

Tommy

Founder
First, created a void function in the header file, name it whatever you want. Second, setup the function in the source file (.cpp) and add this:


Things make need to be updated, I don't know, but this is somewhat old code.

Code:
void OutdoorPvPBT::SendToGrave(Unit* victim)
{
    victim->setDeathState(ALIVE);
    victim->ToPlayer()->SpawnCorpseBones();
    victim->ToPlayer()->SaveToDB();
    victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
    victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
    victim->RemoveAllAuras();
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
    victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
    victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}

And just call it like:

Code:
SendToGrave(player);
 
Last edited:

Synth

Exalted Member
First, created a void function in the header file, name it whatever you want. Second, setup the function in the source file (.cpp) and add this:


Things make need to be updated, I don't know, but this is somewhat old code.

Code:
void OutdoorPvPBT::SendToGrave(Unit* victim)
{
    victim->setDeathState(ALIVE);
    victim->ToPlayer()->SpawnCorpseBones();
    victim->ToPlayer()->SaveToDB();
    victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
    victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
    victim->RemoveAllAuras();
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
    victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
    victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}

And just call it like:

Code:
SendToGrave(player);
Well you can uploaded to me via pastebin with the code added,and we have to check zone-check if his dead because if he is unable to teleport he will get revived and stuck.
 
Last edited by a moderator:

Tommy

Founder
Well you can uploaded to me via pastebin with the code added,and we have to check zone-check if his dead because if he is unable to teleport he will get revived and stuck.

You don't need a check, I forgot to mention you only need to call it in the HandleKillPlayer function. :p

Also, I don't have the header file, so I can't really help on that part. All you need to do is call it under 'public:' in the header file along where the other functions are. For example:

HEADER FILE:
Code:
void SendToGrave(Unit* victim);

SOURCE:

Code:
void OutdoorPvPBT::SendToGrave(Unit* victim)
{
    victim->setDeathState(ALIVE);
    victim->ToPlayer()->SpawnCorpseBones();
    victim->ToPlayer()->SaveToDB();
    victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
    victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
    victim->RemoveAllAuras();
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
    victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
    victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}
 

Synth

Exalted Member
You don't need a check, I forgot to mention you only need to call it in the HandleKillPlayer function. :p

Also, I don't have the header file, so I can't really help on that part. All you need to do is call it under 'public:' in the header file along where the other functions are. For example:

HEADER FILE:
Code:
void SendToGrave(Unit* victim);

SOURCE:

Code:
void OutdoorPvPBT::SendToGrave(Unit* victim)
{
    victim->setDeathState(ALIVE);
    victim->ToPlayer()->SpawnCorpseBones();
    victim->ToPlayer()->SaveToDB();
    victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
    victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
    victim->RemoveAllAuras();
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
    victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
    victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}
I get 2 error with this i removed:
victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
And also i want the every race go to place not both go to same place,so alliance will go to x,y,z,o and horde will go to x,y,z,o,and i tested i didn't get autorevived and teleporter and get max mana+hp.
 
Last edited by a moderator:

Tommy

Founder
I get 2 error with this i removed:

And also i want the every race go to place not both go to same place,so alliance will go to x,y,z,o and horde will go to x,y,z,o,and i tested i didn't get autorevived and teleporter and get max mana+hp.

One reason why you got an error on the CastSpell is because the "SPELL_HONORLESS_TARGET" and "SPELL_ARCANE_BUBBLE" data types don't exist. You can search for those spells on WoWhead.

Also, the reason this doesn't have a faction check is because it use to randomize the player's position once revived. I couldn't update it because I'm quite busy at the moment, but all you have to do is:

Code:
if (victim->ToPlayer()->GetTeam() == ALLIANCE)
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
else // Horde
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
 

Synth

Exalted Member
One reason why you got an error on the CastSpell is because the "SPELL_HONORLESS_TARGET" and "SPELL_ARCANE_BUBBLE" data types don't exist. You can search for those spells on WoWhead.

Also, the reason this doesn't have a faction check is because it use to randomize the player's position once revived. I couldn't update it because I'm quite busy at the moment, but all you have to do is:

Code:
if (victim->ToPlayer()->GetTeam() == ALLIANCE)
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
else // Horde
    victim->ToPlayer()->TeleportTo(0, /* X */, /* Y */, /* Z */, /* O */);
Its not working check here what i did on source file:
#include "OutdoorPvPBT.h"

OutdoorPvPBT::OutdoorPvPBT()
{
m_TypeId = OUTDOOR_PVP_BT;
m_ally_gathered = BT_RESOURCES_A;
m_horde_gathered = BT_RESOURCES_H;
IS_ABLE_TO_SHOW_MESSAGE = false;
IS_RESOURCE_MESSAGE_A = false;
IS_RESOURCE_MESSAGE_H = false;
m_FirstLoad = false;
limit_A = 0;
limit_H = 0;
m_LastWin = 0;
limit_resources_message_A = 0;
limit_resources_message_H = 0;
}

bool OutdoorPvPBT::SetupOutdoorPvP()
{
RegisterZone(33);
return true;
}

void OutdoorPvPBT::HandlePlayerEnterZone(Player * player, uint32 zone)
{
char message[250];
if(player->GetTeam() == ALLIANCE)
snprintf(message, 250, "[Gurubashi Defense]: Alliance has %u resources!", m_ally_gathered);
else
snprintf(message, 250, "[Gurubashi Defense]: Horde has %u resources!", m_horde_gathered);

player->MonsterTextEmote(message, player->GetGUID());
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}

void OutdoorPvPBT::HandlePlayerLeaveZone(Player * player, uint32 zone)
{
player->MonsterTextEmote("You're leaving while the zone PvP is active!", player->GetGUID());
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}

void OutdoorPvPBT::HandleWinMessage(const char * message)
{
sWorld->SendZoneText(33, message);
}

void OutdoorPvPBT::playSounds(bool side)
{
SessionMap m_sessions = sWorld->GetAllSessions();
for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() ||
itr->second->GetPlayer()->GetZoneId() != 33)
continue;

if(itr->second->GetPlayer()->GetZoneId() == 33)
{
if(itr->second->GetPlayer()->GetTeam() == ALLIANCE && side == true)
itr->second->GetPlayer()->PlayDirectSound(BT_SOUND_ALLIANCE_GOOD, itr->second->GetPlayer());
else
itr->second->GetPlayer()->PlayDirectSound(BT_SOUND_HORDE_GOOD, itr->second->GetPlayer());
}
}
}

void OutdoorPvPBT::HandleReset()
{
m_ally_gathered = BT_RESOURCES_A;
m_horde_gathered = BT_RESOURCES_H;
IS_ABLE_TO_SHOW_MESSAGE = false;
IS_RESOURCE_MESSAGE_A = false;
IS_RESOURCE_MESSAGE_H = false;
m_FirstLoad = false;
limit_A = 0;
limit_H = 0;
limit_resources_message_A = 0;
limit_resources_message_H = 0;
TC_LOG_INFO(LOG_FILTER_GENERAL,"[OutdoorPvPBT]: Gurubashi : HandleReset()");
}

void OutdoorPvPBT::SendToGrave(Unit* victim)
{
victim->setDeathState(ALIVE);
victim->ToPlayer()->SpawnCorpseBones();
victim->ToPlayer()->SaveToDB();
victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
victim->RemoveAllAuras();
if(victim->ToPlayer()->GetTeam() == ALLIANCE)
victim->ToPlayer()->TeleportTo(0, -13538.283203f, 84.647690f, 28.721323f, 0.101696f);
else // Horde
victim->ToPlayer()->TeleportTo(0, -13248.278320f, -81.557045f, 19.810974f, 1.517824f);
victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}

void OutdoorPvPBT::HandleBuffs(Player * player, bool loser)
{
if(loser)
{
for(int i = 0; i < LOSE_BUFFS; i++)
player->CastSpell(player, LoseBuffs, true);
}
else
{
for(int i = 0; i < WIN_BUFFS; i++)
player->CastSpell(player, WinBuffs, true);
}
}

Here on .h file:
/* Updates */
bool Update(uint32 diff);

/* Sounds */
void PlaySounds(bool side);

/*Send To Grave*/
void SendToGrave(Unit* victim);

private:
uint32 m_ally_gathered;
uint32 m_horde_gathered;
uint32 m_LastWin;
bool IS_ABLE_TO_SHOW_MESSAGE;
bool IS_RESOURCE_MESSAGE_A;
bool IS_RESOURCE_MESSAGE_H;
bool m_FirstLoad;
int limit_A;
int limit_H;
int limit_resources_message_A;
int limit_resources_message_H;
};
#endif
 

Tommy

Founder
Its not working check here what i did on source file:

Here on .h file:

It isn't working because I said you have to put it in the function "HandleKill"...


New = THIS COLOR

Code:
#include "OutdoorPvPBT.h"
     
    OutdoorPvPBT::OutdoorPvPBT()
    {
            m_TypeId = OUTDOOR_PVP_BT;
            m_ally_gathered = BT_RESOURCES_A;
            m_horde_gathered = BT_RESOURCES_H;
            IS_ABLE_TO_SHOW_MESSAGE = false;
            IS_RESOURCE_MESSAGE_A = false;
            IS_RESOURCE_MESSAGE_H = false;
            m_FirstLoad = false;
            limit_A = 0;
            limit_H = 0;
            m_LastWin = 0;
            limit_resources_message_A = 0;
            limit_resources_message_H = 0;
    }
     
    bool OutdoorPvPBT::SetupOutdoorPvP()
    {
        RegisterZone(33);
        return true;
    }
     
    void OutdoorPvPBT::HandlePlayerEnterZone(Player * player, uint32 zone)
    {      
            char message[250];
            if(player->GetTeam() == ALLIANCE)
                    snprintf(message, 250, "[Gurubashi Defense]: Alliance has %u resources!", m_ally_gathered);
            else
                    snprintf(message, 250, "[Gurubashi Defense]: Horde has %u resources!", m_horde_gathered);
     
            player->MonsterTextEmote(message, player->GetGUID());
            OutdoorPvP::HandlePlayerEnterZone(player, zone);
    }
     
    void OutdoorPvPBT::HandlePlayerLeaveZone(Player * player, uint32 zone)
    {
            player->MonsterTextEmote("You're leaving while the zone PvP is active!", player->GetGUID());
            OutdoorPvP::HandlePlayerLeaveZone(player, zone);
    }
     
    void OutdoorPvPBT::HandleWinMessage(const char * message)
    {
            sWorld->SendZoneText(33, message);
    }
     
    void OutdoorPvPBT::PlaySounds(bool side)
    {
            SessionMap m_sessions = sWorld->GetAllSessions();
            for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
            {
                    if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() ||
                            itr->second->GetPlayer()->GetZoneId() != 33)
                            continue;
     
                    if(itr->second->GetPlayer()->GetZoneId() == 33)
                    {
                            if(itr->second->GetPlayer()->GetTeam() == ALLIANCE && side == true)
                                     itr->second->GetPlayer()->PlayDirectSound(BT_SOUND_ALLIANCE_GOOD,  itr->second->GetPlayer());
                            else
                                     itr->second->GetPlayer()->PlayDirectSound(BT_SOUND_HORDE_GOOD,  itr->second->GetPlayer());
                    }
            }
    }
     
    void OutdoorPvPBT::HandleReset()
    {
            m_ally_gathered = BT_RESOURCES_A;
            m_horde_gathered = BT_RESOURCES_H;
            IS_ABLE_TO_SHOW_MESSAGE = false;
            IS_RESOURCE_MESSAGE_A = false;
            IS_RESOURCE_MESSAGE_H = false;
            m_FirstLoad = false;
            limit_A = 0;
            limit_H = 0;
            limit_resources_message_A = 0;
            limit_resources_message_H = 0;
            TC_LOG_INFO(LOG_FILTER_GENERAL,"[OutdoorPvPBT]: Gurubashi : HandleReset()");
    }

    [COLOR=#00ff00]void OutdoorPvPBT::HandleKill(Player* /* killer */, Unit* killed)
    {
       SendToGrave(killed);
    }[/COLOR]

    void OutdoorPvPBT::SendToGrave(Unit* victim)
{
    victim->setDeathState(ALIVE);
    victim->ToPlayer()->SpawnCorpseBones();
    victim->ToPlayer()->SaveToDB();
    victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
    victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
    victim->RemoveAllAuras();
    if(victim->ToPlayer()->GetTeam() == ALLIANCE)
    victim->ToPlayer()->TeleportTo(0, -13538.283203f, 84.647690f, 28.721323f, 0.101696f);
    else // Horde
    victim->ToPlayer()->TeleportTo(0, -13248.278320f, -81.557045f, 19.810974f, 1.517824f);
    victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
    victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}
     
    void OutdoorPvPBT::HandleBuffs(Player * player, bool loser)
    {
            if(loser)
            {
                    for(int i = 0; i < LOSE_BUFFS; i++)
                            player->CastSpell(player, LoseBuffs[i], true);
            }
            else
            {
                    for(int i = 0; i < WIN_BUFFS; i++)
                            player->CastSpell(player, WinBuffs[i], true);
            }
    }


Code:
/* Updates */
       bool Update(uint32 diff);
       
       /* Sounds */
       void PlaySounds(bool side);

       /*Send To Grave*/
       void SendToGrave(Unit* victim);

       [COLOR=#00ff00]void[/COLOR][COLOR=#00ff00] HandleKill(Player* killer, Unit* killed);[/COLOR]

    private:
        uint32 m_ally_gathered;
        uint32 m_horde_gathered;
        uint32 m_LastWin;
        bool IS_ABLE_TO_SHOW_MESSAGE;
        bool IS_RESOURCE_MESSAGE_A;
        bool IS_RESOURCE_MESSAGE_H;
        bool m_FirstLoad;
        int limit_A;
        int limit_H;
        int limit_resources_message_A;
        int limit_resources_message_H;
};
#endif
 

Synth

Exalted Member
It isn't working because I said you have to put it in the function "HandleKill"...


New = THIS COLOR

Code:
#include "OutdoorPvPBT.h"
     
    OutdoorPvPBT::OutdoorPvPBT()
    {
            m_TypeId = OUTDOOR_PVP_BT;
            m_ally_gathered = BT_RESOURCES_A;
            m_horde_gathered = BT_RESOURCES_H;
            IS_ABLE_TO_SHOW_MESSAGE = false;
            IS_RESOURCE_MESSAGE_A = false;
            IS_RESOURCE_MESSAGE_H = false;
            m_FirstLoad = false;
            limit_A = 0;
            limit_H = 0;
            m_LastWin = 0;
            limit_resources_message_A = 0;
            limit_resources_message_H = 0;
    }
     
    bool OutdoorPvPBT::SetupOutdoorPvP()
    {
        RegisterZone(33);
        return true;
    }
     
    void OutdoorPvPBT::HandlePlayerEnterZone(Player * player, uint32 zone)
    {      
            char message[250];
            if(player->GetTeam() == ALLIANCE)
                    snprintf(message, 250, "[Gurubashi Defense]: Alliance has %u resources!", m_ally_gathered);
            else
                    snprintf(message, 250, "[Gurubashi Defense]: Horde has %u resources!", m_horde_gathered);
     
            player->MonsterTextEmote(message, player->GetGUID());
            OutdoorPvP::HandlePlayerEnterZone(player, zone);
    }
     
    void OutdoorPvPBT::HandlePlayerLeaveZone(Player * player, uint32 zone)
    {
            player->MonsterTextEmote("You're leaving while the zone PvP is active!", player->GetGUID());
            OutdoorPvP::HandlePlayerLeaveZone(player, zone);
    }
     
    void OutdoorPvPBT::HandleWinMessage(const char * message)
    {
            sWorld->SendZoneText(33, message);
    }
     
    void OutdoorPvPBT::PlaySounds(bool side)
    {
            SessionMap m_sessions = sWorld->GetAllSessions();
            for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
            {
                    if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() ||
                            itr->second->GetPlayer()->GetZoneId() != 33)
                            continue;
     
                    if(itr->second->GetPlayer()->GetZoneId() == 33)
                    {
                            if(itr->second->GetPlayer()->GetTeam() == ALLIANCE && side == true)
                                     itr->second->GetPlayer()->PlayDirectSound(BT_SOUND_ALLIANCE_GOOD,  itr->second->GetPlayer());
                            else
                                     itr->second->GetPlayer()->PlayDirectSound(BT_SOUND_HORDE_GOOD,  itr->second->GetPlayer());
                    }
            }
    }
     
    void OutdoorPvPBT::HandleReset()
    {
            m_ally_gathered = BT_RESOURCES_A;
            m_horde_gathered = BT_RESOURCES_H;
            IS_ABLE_TO_SHOW_MESSAGE = false;
            IS_RESOURCE_MESSAGE_A = false;
            IS_RESOURCE_MESSAGE_H = false;
            m_FirstLoad = false;
            limit_A = 0;
            limit_H = 0;
            limit_resources_message_A = 0;
            limit_resources_message_H = 0;
            TC_LOG_INFO(LOG_FILTER_GENERAL,"[OutdoorPvPBT]: Gurubashi : HandleReset()");
    }

    [COLOR=#00ff00]void OutdoorPvPBT::HandleKill(Player* /* killer */, Unit* killed)
    {
       SendToGrave(killed);
    }[/COLOR]

    void OutdoorPvPBT::SendToGrave(Unit* victim)
{
    victim->setDeathState(ALIVE);
    victim->ToPlayer()->SpawnCorpseBones();
    victim->ToPlayer()->SaveToDB();
    victim->SetUInt32Value(UNIT_FIELD_HEALTH, victim->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
    victim->SetUInt32Value(UNIT_FIELD_POWER1, victim->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
    victim->RemoveAllAuras();
    if(victim->ToPlayer()->GetTeam() == ALLIANCE)
    victim->ToPlayer()->TeleportTo(0, -13538.283203f, 84.647690f, 28.721323f, 0.101696f);
    else // Horde
    victim->ToPlayer()->TeleportTo(0, -13248.278320f, -81.557045f, 19.810974f, 1.517824f);
    victim->ToPlayer()->CastSpell(victim, SPELL_HONORLESS_TARGET, true);
    victim->ToPlayer()->CastSpell(victim, SPELL_ARCANE_BUBBLE, true);
}
     
    void OutdoorPvPBT::HandleBuffs(Player * player, bool loser)
    {
            if(loser)
            {
                    for(int i = 0; i < LOSE_BUFFS; i++)
                            player->CastSpell(player, LoseBuffs[i], true);
            }
            else
            {
                    for(int i = 0; i < WIN_BUFFS; i++)
                            player->CastSpell(player, WinBuffs[i], true);
            }
    }


Code:
/* Updates */
       bool Update(uint32 diff);
       
       /* Sounds */
       void PlaySounds(bool side);

       /*Send To Grave*/
       void SendToGrave(Unit* victim);

       [COLOR=#00ff00]void[/COLOR][COLOR=#00ff00] HandleKill(Player* killer, Unit* killed);[/COLOR]

    private:
        uint32 m_ally_gathered;
        uint32 m_horde_gathered;
        uint32 m_LastWin;
        bool IS_ABLE_TO_SHOW_MESSAGE;
        bool IS_RESOURCE_MESSAGE_A;
        bool IS_RESOURCE_MESSAGE_H;
        bool m_FirstLoad;
        int limit_A;
        int limit_H;
        int limit_resources_message_A;
        int limit_resources_message_H;
};
#endif

Well didn't worked i got error while i'm compiling:
2>c:\program files\source\src\server\scripts\custom\OutdoorPvPBT.h(91) : error C2535: 'void OutdoorPvPBT::HandleKill(Player *,Unit *)' : member function already defined or declared
2> c:\program files\source\src\server\scripts\custom\OutdoorPvPBT.h(65) : see declaration of 'OutdoorPvPBT::HandleKill'
2>..\..\..\..\Source\src\server\scripts\Custom\OutdoorPvPBT.cpp(340) : error C2084: function 'void OutdoorPvPBT::HandleKill(Player *,Unit *)' already has a body
2> c:\program files\source\src\server\scripts\custom\OutdoorPvPBT.h(65) : see previous definition of 'HandleKill'
2>Build log was saved at "file://c:\Program Files\Build\src\server\scripts\scripts.dir\Release\BuildLog.htm"
2>scripts - 2 error(s), 0 warning(s)
But i remove the code you send it on header + source i search for the handlekill i find this one and i add the color one:
void OutdoorPvPBT::HandleKill(Player * player, Unit * killed)
{
SendToGrave(killed);
uint32 take = POINTS_LOSE_ON_NPC_KILL;
if(killed->GetTypeId() == TYPEID_PLAYER) // Killing players will take their resources away. It also gives extra honor.
{
if(player->GetGUID() != killed->GetGUID())
return;

switch(killed->ToPlayer()->GetTeam())
Then i go to tested in-game i didn't worked cz i was using die command :p
Now its working like what i change on this quote.
Thank you. if i add the code wrong tell me please where i should add it but its working 100% now.
 
Last edited:

Tommy

Founder
Well didn't worked i got error while i'm compiling:

But i remove the code you send it on header + source i search for the handlekill i find this one and i add the color one:

Then i go to tested in-game i didn't worked cz i was using die command :p
Now its working like what i change on this quote.
Thank you. if i add the code wrong tell me please where i should add it but its working 100% now.

Glad I didn't have to explain anything else, it makes you learn faster if you try and do everything without needing support. \o/

Anyway, if you need anything else, just create a new thread and I'll be on it! Marking as solved..
 
Status
Not open for further replies.
Top