diff options
| author | Nay <dnpd.dd@gmail.com> | 2012-07-24 15:27:42 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2012-07-24 15:27:42 +0100 |
| commit | 0f04b2fc36593526cf1cc86667d37779691e1135 (patch) | |
| tree | 7945001bf56ba7194e3846153613f9af95822e95 /src/server/scripts | |
| parent | 4364f80d37560ba50ef01bdcea147e1d7cba0067 (diff) | |
Core/Misc: Update money to 64 bits (from 32), increasing the maximum gold possible
This got a bit messy and will be further fixed when all related packets are updated.
(Also fixed a typo in atoll msvc macro)
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 7 | ||||
| -rw-r--r-- | src/server/scripts/World/npc_professions.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 8 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 57d13fd2fa1..a227070895c 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ObjectMgr.h" #include "Chat.h" +#include <stdlib.h> class modify_commandscript : public CommandScript { @@ -1002,13 +1003,13 @@ public: if (handler->HasLowerSecurity(target, 0)) return false; - int32 addmoney = atoi((char*)args); + int64 addmoney = atoll((char*)args); - uint32 moneyuser = target->GetMoney(); + uint64 moneyuser = target->GetMoney(); if (addmoney < 0) { - int32 newmoney = int32(moneyuser) + addmoney; + int64 newmoney = int32(moneyuser) + addmoney; sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney); if (newmoney <= 0) diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 2afa80dd42c..a55fe2c7ffa 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -209,7 +209,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) { - if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost)) + if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost)) { player->CastSpell(player, triggeredSpellId, true); player->ModifyMoney(-cost); @@ -347,11 +347,11 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui { if (EquippedOk(player, spellId)) { - if (player->HasEnoughMoney(cost)) + if (player->HasEnoughMoney(int64(cost))) { player->CastSpell(player, spellId, true); ProfessionUnlearnSpells(player, spellId); - player->ModifyMoney(-cost); + player->ModifyMoney(-int64(cost)); if (alternativeSpellId) creature->CastSpell(player, alternativeSpellId, true); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 57a65423b6f..04b74122955 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1287,7 +1287,7 @@ public: case GOSSIP_OPTION_LEARNDUALSPEC: if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { - if (!player->HasEnoughMoney(10000000)) + if (!player->HasEnoughMoney(UI64LIT(10000000))) { player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); player->PlayerTalkClass->SendCloseGossip(); @@ -1295,7 +1295,7 @@ public: } else { - player->ModifyMoney(-10000000); + player->ModifyMoney(SI64LIT(-10000000)); // Cast spells that teach dual spec // Both are also ImplicitTarget self and must be cast by player @@ -2600,11 +2600,11 @@ public: } if (doSwitch) { - if (!player->HasEnoughMoney(EXP_COST)) + if (!player->HasEnoughMoney(uint64(EXP_COST))) player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); else if (noXPGain) { - player->ModifyMoney(-EXP_COST); + player->ModifyMoney(-int64(EXP_COST)); player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); } else if (!noXPGain) |
