Jump to content
  • Announcements

    • Xmat

      Pravidlo pro postování v TTT

      Do sekce Tipy, triky, tutoriály nepatří žádné dotazy.   Postujte sem vaše návody, tipy a různé další věci jež uznáte za vhodné sdělit zdejšímu osazenstvu, ale veškeré dotazy směřujte do sekce Všeobecná diskuse.
    • Replik

      Seznam návodů a důležitých témat v této sekci

      Pro lepší přehlednost jsem vytvořil tento seznam, který vás, méně zkušené, lépe provede touto sekcí. Věřím, že zde najdete, co hledáte. Vypsané jsou návody, které jsou oficiálně uznané jako návody. Běžné diskuze, které neposkytují postupy a rady zvěřejněny nejsou.   Instalace vlastního MaNGOS Serveru Díky těmto návodům budete (měli by jste být) schopni vytvořit a následně spustit váš vlastní server. Nastavení je pro verze s i bez datadisku.   Instalace MaNGOS Serveru (bez datadisku TBC) - Autor Benny Instalace MaNGOS Serveru (s datadiskem TBC) - Autor Malfik Instalace MaNGOS Serveru v prostředí Linux - Autor charlie Instalace MaNGOS Serveru v prostředí Linux - Autor kupkoid   Chyby a jejich řešení při přihlašování k serveru - Autor Cybe   Zálohování uživatelských dat   Dávkový soubor (BAT soubor) pro vytvoření SQL záloh - Autor Replik   Kompilování - tvoření vlastních release (revizí)   Tvorba kompilací pro Win32 (MangoScript) - Autor bLuma   Ostatní - těžko zařaditelné, ale neznamená to, že nejsou dobré   VIP Systém - Autor charlie Tvorba Webových stránek pro MaNGOS - Autor zahuba Tvorba teleportačních NPC (MangoScript) - Autor Replik Registrační web (původně předělaná SPORA) Funkční pro Antrix i MaNGOS - Autor Replik Nastavení a spuštění Minimanager pro MaNGOS - Autor BlackMartin Nastavení MaNGOS Website - Autor Artorius   Samozřejmě jsou zde i jiné návody, ale tyto jsou nejvíce používané, proto věřím, že vám budou nápomocné. Tuto sekci budeme upravovat podle potřeby. Pokud by jste něco nenašli nebo si nevěděli rady, hledejte na fóru a teprve potom založte vlastní topik. Pokud nějaký autor vytvoří kvalitní návod a chtěl by ho zveřejnit i v tomto seznamu, doporučuji, aby mi napsal zprávu skrze PM.   Díky a přeji hezký den na WoWResource   Replik
    • Aristo

      Příspěvky tam, kde nemají co dělat

      Dodržujte zákaz přispívání do topiků s repaky pokud si to zakladatelé nepřejí!! Opakované psaní příspěvků bude trestáno warnem.
    • Aristo

      Používání spoilerů

      Poslední dobou má většina uživatelů fora zvláštní nutkání postovat extrémně dlouhé texty nebo kódy, které zabírají v nejedenom případu i 80% obsahu celé stránky a hodně tak zvedají nepřehlednost v topiku. Chtěl bych všechny uživatele požádat, aby při postování citací, jakýchkoliv kódů, errorů, atp... delších než 30 řádků používali funkci spoileru.   Funkci vyvoláte příkazem [spoiler] text [/spoiler]   Ukázka:  
Sign in to follow this  
achboDCA

[PvP System] Goldy za Kill

Recommended Posts

Na OC fóre som našiel ďaľší zaujímavý script :D jedná sa o script ktorý udelí "odmenu" za PvP kill.Taktiež neni môj script! Dávam to sem pre ľudí ktorý sú lenivý zaregistrovať sa na OC fóre ...

 

Toto vložte do vrchnej časti on_events.cpp

#define MSG_COLOR_LIGHTRED      "|cffff6060"
#define MSG_COLOR_LIGHTBLUE     "|cff00ccff"
#define MSG_COLOR_BLUE          "|cff0000ff"
#define MSG_COLOR_GREEN         "|cff00ff00"
#define MSG_COLOR_ANN_GREEN     "|c1f40af20"
#define MSG_COLOR_RED           "|cffff0000"
#define MSG_COLOR_GOLD          "|cffffcc00"
#define MSG_COLOR_GREY          "|cff888888"
#define MSG_COLOR_WHITE         "|cffffffff"
#define MSG_COLOR_SUBWHITE      "|cffbbbbbb"
#define MSG_COLOR_MAGENTA       "|cffff00ff"
#define MSG_COLOR_YELLOW        "|cffffff00"
#define MSG_COLOR_CYAN            "|cff00ffff"
#define PVP_GOLD 10000

 

a toto tiež do on_events.cpp

 

   if(attacker->isGameMaster() == true || victim->isGameMaster() == true)
       {
               attacker->GetSession()->SendNotification("Debug Line: PvP Trigger Started");
       }
       else
       {
               if(attacker == victim)
               {
                       attacker->GetSession()->SendNotification("%s[PvP System]%s Suecide!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);
                       attacker->TotalDeaths++;
                       return;
               }

               if (victim->HasAura(2479,0) || victim->HasAura(2479,1))
               {
                       attacker->GetSession()->SendNotification("%s[PvP System]%s Hes not worth money or honor yet!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);
                       return;
               }

               if(attacker->GetSession()->GetRemoteAddress() == victim->GetSession()->GetRemoteAddress())
               {
                       attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You have same ip as your victim (%u)", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE,attacker->GetSession()->GetRemoteAddress());
                       attacker->GetSession()->SendNotification("%sthis means you are on same network and could farm money together.", MSG_COLOR_WHITE);
                       return;
               }

               if(victim->GetGUID() == attacker->LastGuid)
               {
                       attacker->LastGuidCount++;
                       if(attacker->LastGuidCount >= 3 || attacker->LastGuidCount <= 5)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You don't get awarded for killing a player more than 3 times in a row!.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
                               return;
                       }
                       else if(attacker->LastGuidCount > 5 && attacker->LastGuidCount < 10)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You have killed this guy %u times in a row now whats your problem?", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->LastGuidCount);
                               return;
                       }
                       else if(attacker->LastGuidCount >= 10)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s We don't like gankers GTFO!", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
                               attacker->KillPlayer();
                               attacker->GetSession()->KickPlayer();
                               return;
                       }
               }
       }

       attacker->CurrentKills++;
       attacker->TotalKills++;
       if(!attacker->GetGroup())
       {
               uint32 currgold = attacker->GetUInt32Value(PLAYER_FIELD_COINAGE);
               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+PVP_GOLD);
               attacker->GetSession()->SendNotification("%s[PvP System]%s Current Kills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->CurrentKills);
               if(attacker->LastGuid != victim->GetGUID())
               {
                       attacker->LastGuidCount = 0;
               }
       }
       else
       {
               uint32 currgold = attacker->GetUInt32Value(PLAYER_FIELD_COINAGE);
               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+(PVP_GOLD/2));
               Group* grp = attacker->GetGroup();
               uint32 grpgold = (uint32)((PVP_GOLD * 2) / grp->GetMembersCount());
               for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
               {
                       Player *gp = itr->getSource();
                       if(gp && (gp->GetDistance(attacker->GetPositionX(),attacker->GetPositionY(),attacker->GetPositionZ()) < 100.0f || gp == attacker))
                       {
                               //Player *pm = gp->GetGUID();
                               if(!gp) continue;
                               if(gp->LastGuid != victim->GetGUID())
                               {
                                       attacker->GroupKills++;
                                       if(gp->LastGuid != victim->GetGUID())
                                       {
                                               gp->LastGuidCount = 0;
                                       }
                                       gp->LastGuid = victim->GetGUID();
                                       gp->GetSession()->SendNotification("%s[PvP System]%s GroupKills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->GroupKills);
                                       attacker->GetSession()->SendNotification("%s[PvP System]%s GroupKills: %u, CurrentKills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->GroupKills, attacker->CurrentKills);
                                       uint32 currgold = gp->GetUInt32Value(PLAYER_FIELD_COINAGE);
                                       gp->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+grpgold);
                                       if (gp->GetGroup()->GetMembersCount() >= 4)
                                       {
                                               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+(grpgold*2));
                                       }
                                       else
                                       {
                                               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+grpgold);
                                       }
                               }
                       }
               }
       }
       attacker->LastGuid = victim->GetGUID();
       victim->CurrentKills = 0;
       victim->TotalDeaths++;
       victim->GetSession()->SendNotification("You got ass raped by .:;%s;:.",attacker->GetName());
       return;

 

  • Upvote 3

Share this post


Link to post
Share on other sites

Ten spoiler má člověk pak hodit kam?Vždyť si to neupřesnil.Takhle to hodí nakonec. Nazačátek, doprostřed. To asi nebude jedno.

Share this post


Link to post
Share on other sites

Ten spoiler má člověk pak hodit kam?Vždyť si to neupřesnil.Takhle to hodí nakonec. Nazačátek, doprostřed. To asi nebude jedno.

Písané tam nebolo nič o tom kam to dať, len dostal za to veľa veľa repky plus samé pozitívne ohlasy.Pozeral som sa do toho scriptu pretože by som to rád zaviedol na servery.Obsah on_events.cpp

 

#include "ScriptPCH.h"
#include <cstring>

//This function is called when the player logs in (every login)
void OnLogin(Player *pPlayer)
{

}

//This function is called when the player logs out
void OnLogout(Player *pPlayer)
{

}

//This function is called when the player kills another player
void OnPVPKill(Player *killer, Player *killed)
{

}

void AddSC_onevents()
{
   Script *newscript;
   newscript = new Script;
   newscript->Name = "scripted_on_events";
   newscript->pOnLogin = &OnLogin;
   newscript->pOnLogout = &OnLogout;
   newscript->pOnPVPKill = &OnPVPKill;

   newscript->RegisterSelf();
}

 

Takto je to originálne po stiahnutí z OC repo :)

Share this post


Link to post
Share on other sites

Písané tam nebolo nič o tom kam to dať, len dostal za to veľa veľa repky plus samé pozitívne ohlasy.Pozeral som sa do toho scriptu pretože by som to rád zaviedol na servery.Obsah on_events.cpp

 

#include "ScriptPCH.h"
#include <cstring>

//This function is called when the player logs in (every login)
void OnLogin(Player *pPlayer)
{

}

//This function is called when the player logs out
void OnLogout(Player *pPlayer)
{

}

//This function is called when the player kills another player
void OnPVPKill(Player *killer, Player *killed)
{

}

void AddSC_onevents()
{
   Script *newscript;
   newscript = new Script;
   newscript->Name = "scripted_on_events";
   newscript->pOnLogin = &OnLogin;
   newscript->pOnLogout = &OnLogout;
   newscript->pOnPVPKill = &OnPVPKill;

   newscript->RegisterSelf();
}

 

Takto je to originálne po stiahnutí z OC repo :)

Je to super ale už vím co by se celej den dělalo. Bugovaly Goldy.

Share this post


Link to post
Share on other sites

jsou lepsi postupy, jak docilit toho, pokud chce nekdo nastavit goldy za kill, nebo jakykoliv jiny item.

Share this post


Link to post
Share on other sites

jsou lepsi postupy, jak docilit toho, pokud chce nekdo nastavit goldy za kill, nebo jakykoliv jiny item.

podel sa ak chceš :) veľa ľudí ti bude vďačných :)

Share this post


Link to post
Share on other sites

Mne to príde ako úplna hlúposť, skôr si to mal nazvať" bugovanie dvoch vecí naraz"

Ak farmiš honor a prideľuje ti to určitú časť goldov tak obecne povedane: zabíjaš dve muchy jednou ranou...

Share this post


Link to post
Share on other sites

Podívejte se do kódu, je to docela slušně ošetřený :-)

 

Pokud mají oba hráči stejnou IP, nedostanou honory ani goldy, pokud zabiješ stejného hráče 3x nebo víckrát v řadě, nedostaneš opět nic.

 

Mě osobně se ten systém líbí :-)

  • Upvote 1

Share this post


Link to post
Share on other sites

No a teraz si predstav že si vo WSG a vždy killuješ nejakého lowika viac než 3x, tak potom zato nemáš nič ? B)

Inak, pardón do kodu som nepozeral.

  • Downvote 1

Share this post


Link to post
Share on other sites

Takže asi neviem pridávať .cpp súbory alebo je niečo zle :D

Chcel som to aplikovať a pridal som to do on_events.cpp nasledovne

 

 

 

#include "ScriptPCH.h"
#include <cstring>

#define MSG_COLOR_LIGHTRED      "|cffff6060"
#define MSG_COLOR_LIGHTBLUE     "|cff00ccff"
#define MSG_COLOR_BLUE          "|cff0000ff"
#define MSG_COLOR_GREEN         "|cff00ff00"
#define MSG_COLOR_ANN_GREEN     "|c1f40af20"
#define MSG_COLOR_RED           "|cffff0000"
#define MSG_COLOR_GOLD          "|cffffcc00"
#define MSG_COLOR_GREY          "|cff888888"
#define MSG_COLOR_WHITE         "|cffffffff"
#define MSG_COLOR_SUBWHITE      "|cffbbbbbb"
#define MSG_COLOR_MAGENTA       "|cffff00ff"
#define MSG_COLOR_YELLOW        "|cffffff00"
#define MSG_COLOR_CYAN            "|cff00ffff"
#define PVP_GOLD 10000

//This function is called when the player logs in (every login)
void OnLogin(Player *pPlayer)
{

}

//This function is called when the player logs out
void OnLogout(Player *pPlayer)
{

}

//This function is called when the player kills another player
void OnPVPKill(Player *killer, Player *killed)
{
 if(attacker->isGameMaster() == true || victim->isGameMaster() == true)
       {
               attacker->GetSession()->SendNotification("Debug Line: PvP Trigger Started");
       }
       else
       {
               if(attacker == victim)
               {
                       attacker->GetSession()->SendNotification("%s[PvP System]%s Suecide!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);
                       attacker->TotalDeaths++;
                       return;
               }

               if (victim->HasAura(2479,0) || victim->HasAura(2479,1))
               {
                       attacker->GetSession()->SendNotification("%s[PvP System]%s Hes not worth money or honor yet!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);
                       return;
               }

               if(attacker->GetSession()->GetRemoteAddress() == victim->GetSession()->GetRemoteAddress())
               {
                       attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You have same ip as your victim (%u)", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE,attacker->GetSession()->GetRemoteAddress());
                       attacker->GetSession()->SendNotification("%sthis means you are on same network and could farm money together.", MSG_COLOR_WHITE);
                       return;
               }

               if(victim->GetGUID() == attacker->LastGuid)
               {
                       attacker->LastGuidCount++;
                       if(attacker->LastGuidCount >= 3 || attacker->LastGuidCount <= 5)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You don't get awarded for killing a player more than 3 times in a row!.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
                               return;
                       }
                       else if(attacker->LastGuidCount > 5 && attacker->LastGuidCount < 10)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You have killed this guy %u times in a row now whats your problem?", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->LastGuidCount);
                               return;
                       }
                       else if(attacker->LastGuidCount >= 10)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s We don't like gankers GTFO!", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
                               attacker->KillPlayer();
                               attacker->GetSession()->KickPlayer();
                               return;
                       }
               }
       }

       attacker->CurrentKills++;
       attacker->TotalKills++;
       if(!attacker->GetGroup())
       {
               uint32 currgold = attacker->GetUInt32Value(PLAYER_FIELD_COINAGE);
               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+PVP_GOLD);
               attacker->GetSession()->SendNotification("%s[PvP System]%s Current Kills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->CurrentKills);
               if(attacker->LastGuid != victim->GetGUID())
               {
                       attacker->LastGuidCount = 0;
               }
       }
       else
       {
               uint32 currgold = attacker->GetUInt32Value(PLAYER_FIELD_COINAGE);
               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+(PVP_GOLD/2));
               Group* grp = attacker->GetGroup();
               uint32 grpgold = (uint32)((PVP_GOLD * 2) / grp->GetMembersCount());
               for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
               {
                       Player *gp = itr->getSource();
                       if(gp && (gp->GetDistance(attacker->GetPositionX(),attacker->GetPositionY(),attacker->GetPositionZ()) < 100.0f || gp == attacker))
                       {
                               //Player *pm = gp->GetGUID();
                               if(!gp) continue;
                               if(gp->LastGuid != victim->GetGUID())
                               {
                                       attacker->GroupKills++;
                                       if(gp->LastGuid != victim->GetGUID())
                                       {
                                               gp->LastGuidCount = 0;
                                       }
                                       gp->LastGuid = victim->GetGUID();
                                       gp->GetSession()->SendNotification("%s[PvP System]%s GroupKills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->GroupKills);
                                       attacker->GetSession()->SendNotification("%s[PvP System]%s GroupKills: %u, CurrentKills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->GroupKills, attacker->CurrentKills);
                                       uint32 currgold = gp->GetUInt32Value(PLAYER_FIELD_COINAGE);
                                       gp->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+grpgold);
                                       if (gp->GetGroup()->GetMembersCount() >= 4)
                                       {
                                               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+(grpgold*2));
                                       }
                                       else
                                       {
                                               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+grpgold);
                                       }
                               }
                       }
               }
       }
       attacker->LastGuid = victim->GetGUID();
       victim->CurrentKills = 0;
       victim->TotalDeaths++;
       victim->GetSession()->SendNotification("You got ass raped by .:;%s;:.",attacker->GetName());
       return;
}

void AddSC_onevents()
{
   Script *newscript;
   newscript = new Script;
   newscript->Name = "scripted_on_events";
   newscript->pOnLogin = &OnLogin;
   newscript->pOnLogout = &OnLogout;
   newscript->pOnPVPKill = &OnPVPKill;

   newscript->RegisterSelf();
}

 

 

a pri kompilácii mi to hodí

 

4>..\..\..\src\scripts\Custom\on_events.cpp(34) : error C2065: 'attacker' : undeclared identifier

5>OS_NS_arpa_inet.cpp

4>..\..\..\src\scripts\Custom\on_events.cpp(34) : error C2227: left of '->isGameMaster' must point to class/struct/union/generic type

4> type is ''unknown-type''

4>..\..\..\src\scripts\Custom\on_events.cpp(34) : error C2065: 'victim' : undeclared identifier

4>..\..\..\src\scripts\Custom\on_events.cpp(34) : error C2227: left of '->isGameMaster' must point to class/struct/union/generic type

4> type is ''unknown-type''

4>..\..\..\src\scripts\Custom\on_events.cpp(36) : error C2065: 'attacker' : undeclared identifier

4>..\..\..\src\scripts\Custom\on_events.cpp(36) : error C2227: left of '->GetSession' must point to class/struct/union/generic type

4> type is ''unknown-type''

4>..\..\..\src\scripts\Custom\on_events.cpp(36) : error C2227: left of '->SendNotification' must point to class/struct/union/generic type

 

nevie niekdo kde som čo spravil zle ?

Share this post


Link to post
Share on other sites

Mne to príde ako úplna hlúposť, skôr si to mal nazvať" bugovanie dvoch vecí naraz"

Ak farmiš honor a prideľuje ti to určitú časť goldov tak obecne povedane: zabíjaš dve muchy jednou ranou...

 

prepac ale je mi zle z ludi ktory toto nazyvaju "bugovanie", toto je obycajne "illegalne" farmenie honoru, slovo "bug" ma vela vyznamov (napr hmyz) ale v nasom termine je to "chyba", tak mi teraz prosimta povedz aka je tu CHYBA? bugovanie je napriklad ak daju 2 roguny na bossa naraz cheap shot a on potom cely cas nerobi nic ale len stoji (to bolo niekedy davno na wowscape), ale nie farmenie svojho druheho charu, pochopil?

 

Takže asi neviem pridávať .cpp súbory alebo je niečo zle :D

Chcel som to aplikovať a pridal som to do on_events.cpp nasledovne

 

 

 

#include "ScriptPCH.h"
#include <cstring>

#define MSG_COLOR_LIGHTRED      "|cffff6060"
#define MSG_COLOR_LIGHTBLUE     "|cff00ccff"
#define MSG_COLOR_BLUE          "|cff0000ff"
#define MSG_COLOR_GREEN         "|cff00ff00"
#define MSG_COLOR_ANN_GREEN     "|c1f40af20"
#define MSG_COLOR_RED           "|cffff0000"
#define MSG_COLOR_GOLD          "|cffffcc00"
#define MSG_COLOR_GREY          "|cff888888"
#define MSG_COLOR_WHITE         "|cffffffff"
#define MSG_COLOR_SUBWHITE      "|cffbbbbbb"
#define MSG_COLOR_MAGENTA       "|cffff00ff"
#define MSG_COLOR_YELLOW        "|cffffff00"
#define MSG_COLOR_CYAN            "|cff00ffff"
#define PVP_GOLD 10000

//This function is called when the player logs in (every login)
void OnLogin(Player *pPlayer)
{

}

//This function is called when the player logs out
void OnLogout(Player *pPlayer)
{

}

//This function is called when the player kills another player
void OnPVPKill(Player *killer, Player *killed)
{
 if(attacker->isGameMaster() == true || victim->isGameMaster() == true)
       {
               attacker->GetSession()->SendNotification("Debug Line: PvP Trigger Started");
       }
       else
       {
               if(attacker == victim)
               {
                       attacker->GetSession()->SendNotification("%s[PvP System]%s Suecide!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);
                       attacker->TotalDeaths++;
                       return;
               }

               if (victim->HasAura(2479,0) || victim->HasAura(2479,1))
               {
                       attacker->GetSession()->SendNotification("%s[PvP System]%s Hes not worth money or honor yet!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);
                       return;
               }

               if(attacker->GetSession()->GetRemoteAddress() == victim->GetSession()->GetRemoteAddress())
               {
                       attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You have same ip as your victim (%u)", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE,attacker->GetSession()->GetRemoteAddress());
                       attacker->GetSession()->SendNotification("%sthis means you are on same network and could farm money together.", MSG_COLOR_WHITE);
                       return;
               }

               if(victim->GetGUID() == attacker->LastGuid)
               {
                       attacker->LastGuidCount++;
                       if(attacker->LastGuidCount >= 3 || attacker->LastGuidCount <= 5)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You don't get awarded for killing a player more than 3 times in a row!.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
                               return;
                       }
                       else if(attacker->LastGuidCount > 5 && attacker->LastGuidCount < 10)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s You have killed this guy %u times in a row now whats your problem?", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->LastGuidCount);
                               return;
                       }
                       else if(attacker->LastGuidCount >= 10)
                       {
                               attacker->GetSession()->SendNotification("%s[Anti Farming System]%s We don't like gankers GTFO!", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
                               attacker->KillPlayer();
                               attacker->GetSession()->KickPlayer();
                               return;
                       }
               }
       }

       attacker->CurrentKills++;
       attacker->TotalKills++;
       if(!attacker->GetGroup())
       {
               uint32 currgold = attacker->GetUInt32Value(PLAYER_FIELD_COINAGE);
               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+PVP_GOLD);
               attacker->GetSession()->SendNotification("%s[PvP System]%s Current Kills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->CurrentKills);
               if(attacker->LastGuid != victim->GetGUID())
               {
                       attacker->LastGuidCount = 0;
               }
       }
       else
       {
               uint32 currgold = attacker->GetUInt32Value(PLAYER_FIELD_COINAGE);
               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+(PVP_GOLD/2));
               Group* grp = attacker->GetGroup();
               uint32 grpgold = (uint32)((PVP_GOLD * 2) / grp->GetMembersCount());
               for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
               {
                       Player *gp = itr->getSource();
                       if(gp && (gp->GetDistance(attacker->GetPositionX(),attacker->GetPositionY(),attacker->GetPositionZ()) < 100.0f || gp == attacker))
                       {
                               //Player *pm = gp->GetGUID();
                               if(!gp) continue;
                               if(gp->LastGuid != victim->GetGUID())
                               {
                                       attacker->GroupKills++;
                                       if(gp->LastGuid != victim->GetGUID())
                                       {
                                               gp->LastGuidCount = 0;
                                       }
                                       gp->LastGuid = victim->GetGUID();
                                       gp->GetSession()->SendNotification("%s[PvP System]%s GroupKills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->GroupKills);
                                       attacker->GetSession()->SendNotification("%s[PvP System]%s GroupKills: %u, CurrentKills: %u", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, attacker->GroupKills, attacker->CurrentKills);
                                       uint32 currgold = gp->GetUInt32Value(PLAYER_FIELD_COINAGE);
                                       gp->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+grpgold);
                                       if (gp->GetGroup()->GetMembersCount() >= 4)
                                       {
                                               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+(grpgold*2));
                                       }
                                       else
                                       {
                                               attacker->SetUInt32Value(PLAYER_FIELD_COINAGE,currgold+grpgold);
                                       }
                               }
                       }
               }
       }
       attacker->LastGuid = victim->GetGUID();
       victim->CurrentKills = 0;
       victim->TotalDeaths++;
       victim->GetSession()->SendNotification("You got ass raped by .:;%s;:.",attacker->GetName());
       return;
}

void AddSC_onevents()
{
   Script *newscript;
   newscript = new Script;
   newscript->Name = "scripted_on_events";
   newscript->pOnLogin = &OnLogin;
   newscript->pOnLogout = &OnLogout;
   newscript->pOnPVPKill = &OnPVPKill;

   newscript->RegisterSelf();
}

 

 

a pri kompilácii mi to hodí

 

 

 

nevie niekdo kde som čo spravil zle ?

 

skus

 

void OnPVPKill(Player *attacker, Player *victim)

Edited by NecroVisioN

Share this post


Link to post
Share on other sites

Tam kde je attacker (útočník), to přepiš na killer (zabiják)

a tam kde je victim (oběť), to přepiš na killed (zabitý)

 

EDIT: Ano, nebo uprav názvy argumentů funkce. (Osobně bych je ale spíš ponechal a upravil obsah funkce).

PS @ SEnergy!: Nauč se editovat příspěvky a používat multi-citaci! Dodržuj pravidla a nepostuj více přízpěvků za sebou v tak stupidně krátkým čase. <_<

Edited by Wolf Officious

Share this post


Link to post
Share on other sites

poprepisoval som attacker na killer a victim na killed VC teraz píše

 

 

4>..\..\..\src\scripts\Custom\on_events.cpp(43) : error C2039: 'TotalDeaths' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(60) : error C2039: 'LastGuid' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(62) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(63) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

6>OS_main.cpp

4>..\..\..\src\scripts\Custom\on_events.cpp(63) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(68) : error C2039: 'LastGuidCount' : is not a member of 'Player'

6>OS_Log_Msg_Attributes.cpp

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(68) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(70) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

6>OS_Errno.cpp

4>..\..\..\src\scripts\Custom\on_events.cpp(73) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(83) : error C2039: 'CurrentKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>custom_example.cpp

4>..\..\..\src\scripts\Custom\on_events.cpp(84) : error C2039: 'TotalKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(89) : error C2039: 'CurrentKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(90) : error C2039: 'LastGuid' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(92) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(108) : error C2039: 'LastGuid' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(110) : error C2039: 'GroupKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(111) : error C2039: 'LastGuid' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(113) : error C2039: 'LastGuidCount' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(115) : error C2039: 'LastGuid' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(116) : error C2039: 'GroupKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(117) : error C2039: 'GroupKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(117) : error C2039: 'CurrentKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(132) : error C2039: 'LastGuid' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(133) : error C2039: 'CurrentKills' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

4>..\..\..\src\scripts\Custom\on_events.cpp(134) : error C2039: 'TotalDeaths' : is not a member of 'Player'

4> c:\documents and settings\achbo\desktop\test core\src\game\Player.h(857) : see declaration of 'Player'

 

Edited by achboDCA

Share this post


Link to post
Share on other sites

Píše ti to že ty metody nejsou členy třídy Player. Nezbývá než vyhledat náhrady. Někdy se jména metod liší jen nepatrně, třeba jen velikostí písmen.

 

EIDT: Nebo tam ty metody prostě nejsou a máš smůlu. Musíš si je buďto někde sehnat, napsat si je sám, nebo to pustit k vodě. Nezdá se mi že by to, co jsi napsal v prvním postu bylo kompletní. Něco tam na tom OC foru museli psát. Ani jsi nehodil link na originál.

Edited by Wolf Officious
  • Upvote 1

Share this post


Link to post
Share on other sites

Chcem sa spýtať, či by bolo možné script upraviť pre najnovšiu revíziu TC2? :D a ak áno či by to pre mňa nespravila nejaká dobrá duša, bol by som veľmi vďačný :)

Share this post


Link to post
Share on other sites
#include "ScriptPCH.h"
enum goldCost
{
  WINNER_GOLD = 50000,
  LOSER_GOLD = 20000
};
class GoldOnKill : public PlayerScript
{
   public:
 GoldOnKill() : PlayerScript("GoldOnKill") {}
void OnPVPKill(Player * killer, Player * killed)
{
	    if(killer->GetGUID() == killed->GetGUID())
		   return;

	   if(killed->GetMoney() < LOSER_GOLD)
	   {
			 killer->GetSession()->SendNotification("The person you killed doesn't have enough gold; therefore, you cannot receive any.");
	   }
	   else
	   {
  killer->SetMoney(killer->GetMoney() + 50000);
  killed->SetMoney(killed->GetMoney() - 20000);
	   }
}
};

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×