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

Blood Money Duels

Parranoia

Insane Member
So basically the idea behind this script is to allow players to bet each other gold and the winner of the duel between them will win the gold and the loser will have that amount of gold removed. This was originally written as a modification of the Player class so I had to rewrite how all the maps were handled. I also do not currently have access to be able to test if this standalone version works as the previous did. If there are any bugs or things that need to be fixed feel free to let me know and I will update it.

How The Script Works
Player talks to an NPC and chooses to challenge somebody.
They then choose an amount to duel for and types in the players name.
The other player receives a notification of this and can then visit the NPC to either accept or decline the challenge.
The first player will be notified when the player accepts/declines this challenge.
A duel must then be initiated between the two players and the winner will receive the spoils.

Requirements
  • Both players must be online (obviously)
  • You cannot challenge somebody that has already challenged you.
  • The player you wish to challenge has to be in the same zone
  • You must have enough money(or tokens) for the bet at the time you place it and at the time you win/lose the duel.

Pastebin Link:
http://pastebin.com/AYPfrbjy
 
Last edited:

milikero

Enthusiast
Code:
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp: In member function âvirtual bool npc_blood_money::OnGossipHello(Player*, Creature*)â:
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:87:88: error: no matching function for call to âObjectAccessor::FindPlayer(const uint64&)â
                                 if (Player* plr = sObjectAccessor->FindPlayer(itr->guid))
                                                                                        ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:87:88: note: candidate is:
In file included from /home/belmont/tc60/src/server/game/Globals/ObjectMgr.h:36:0,
                 from /home/belmont/tc60/src/server/game/Spells/Spell.h:24,
                 from /home/belmont/tc60/src/server/game/Grids/Notifiers/GridNotifiers.h:33,
                 from PrecompiledHeaders/ScriptPCH.h:12:
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:167:24: note: static Player* ObjectAccessor::FindPlayer(ObjectGuid)
         static Player* FindPlayer(ObjectGuid);
                        ^
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:167:24: note:   no known conversion for argument 1 from âconst uint64 {aka const long unsigned int}â to âObjectGuidâ
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp: In member function âvirtual bool npc_blood_money::OnGossipSelect(Player*, Creature*, uint32, uint32)â:
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:125:97: error: no matching function for call to âObjectAccessor::GetPlayer(Player&, uint32&)â
                                 if (Player* target = ObjectAccessor::GetPlayer(*player, uiAction))
                                                                                                 ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:125:97: note: candidate is:
In file included from /home/belmont/tc60/src/server/game/Globals/ObjectMgr.h:36:0,
                 from /home/belmont/tc60/src/server/game/Spells/Spell.h:24,
                 from /home/belmont/tc60/src/server/game/Grids/Notifiers/GridNotifiers.h:33,
                 from PrecompiledHeaders/ScriptPCH.h:12:
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:161:24: note: static Player* ObjectAccessor::GetPlayer(const WorldObject&, ObjectGuid)
         static Player* GetPlayer(WorldObject const&, ObjectGuid guid);
                        ^
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:161:24: note:   no known conversion for argument 2 from âuint32 {aka unsigned int}â to âObjectGuidâ
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:130:51: error: âclass Creatureâ has no member named âMonsterWhisperâ
                                         creature->MonsterWhisper(msg, target, true);
                                                   ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:135:97: error: no matching function for call to âObjectAccessor::GetPlayer(Player&, uint32&)â
                                 if (Player* target = ObjectAccessor::GetPlayer(*player, uiAction))
                                                                                                 ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:135:97: note: candidate is:
In file included from /home/belmont/tc60/src/server/game/Globals/ObjectMgr.h:36:0,
                 from /home/belmont/tc60/src/server/game/Spells/Spell.h:24,
                 from /home/belmont/tc60/src/server/game/Grids/Notifiers/GridNotifiers.h:33,
                 from PrecompiledHeaders/ScriptPCH.h:12:
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:161:24: note: static Player* ObjectAccessor::GetPlayer(const WorldObject&, ObjectGuid)
         static Player* GetPlayer(WorldObject const&, ObjectGuid guid);
                        ^
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:161:24: note:   no known conversion for argument 2 from âuint32 {aka unsigned int}â to âObjectGuidâ
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:139:51: error: âclass Creatureâ has no member named âMonsterWhisperâ
                                         creature->MonsterWhisper(msg, target, true);
                                                   ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp: In member function âvirtual bool npc_blood_money::OnGossipSelectCode(Player*, Creature*, uint32, uint32, const char*)â:
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:187:91: error: no matching function for call to âObjectAccessor::GetPlayer(Player&, uint64&)â
                         if (Player* target = ObjectAccessor::GetPlayer(*player, targetGUID))
                                                                                           ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:187:91: note: candidate is:
In file included from /home/belmont/tc60/src/server/game/Globals/ObjectMgr.h:36:0,
                 from /home/belmont/tc60/src/server/game/Spells/Spell.h:24,
                 from /home/belmont/tc60/src/server/game/Grids/Notifiers/GridNotifiers.h:33,
                 from PrecompiledHeaders/ScriptPCH.h:12:
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:161:24: note: static Player* ObjectAccessor::GetPlayer(const WorldObject&, ObjectGuid)
         static Player* GetPlayer(WorldObject const&, ObjectGuid guid);
                        ^
/home/belmont/tc60/src/server/game/Globals/ObjectAccessor.h:161:24: note:   no known conversion for argument 2 from âuint64 {aka long unsigned int}â to âObjectGuidâ
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:226:75: error: âclass Creatureâ has no member named âMonsterWhisperâ
                                                                 creature->MonsterWhisper(msg, target, true);
                                                                           ^
/home/belmont/tc60/src/server/scripts/Custom/apuestas.cpp:267:75: error: âclass Creatureâ has no member named âMonsterWhisperâ
                                                                 creature->MonsterWhisper(msg, target, true);
                                                                           ^
make[2]: *** [src/server/scripts/CMakeFiles/scripts.dir/Custom/apuestas.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/server/scripts/CMakeFiles/scripts.dir/all] Error 2
make: *** [all] Error 2
 
Last edited by a moderator:

Tommy

Founder
Use code tags next time. :p

Thread posted: 07-15-2013

Of course there's going to be errors, the thread is over 1 year old. Most of the errors I see are from methods that were changed like "MonsterWhisper" and "FindPlayer". I'll update the code when I can, in the mean time you'll have to wait.
 

milikero

Enthusiast
If you are having more than a year but the code Faiver update the date of August 2014 I worked but now someone who can not upgrade would appreciate
 

Seraphim

Noble Member
If you are having more than a year but the code Faiver update the date of August 2014 I worked but now someone who can not upgrade would appreciate

If I had the time and confidence, I'd attempt at it. But it's just so long and has so many variables and functions.
 

milikero

Enthusiast
I'm trying to modify the script but I could upgrade and to work with the latest version of tirnitycore someone who can conpartir would be helpful
 
Top