Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename removeMoneyBank to removeTotalMoney and fix format i… #2912

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/ahmet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 5)
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
if player:removeMoneyBank(1000) then
if player:removeTotalMoney(1000) then
player:addItem(7866, 1)
player:setStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission04, 5)
npcHandler:say("And here they are! Now forget where you got them from.", npc, creature)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/aldo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

if not player:removeMoneyBank(10000) then
if not player:removeTotalMoney(10000) then
npcHandler:say("Sorry, you don't have enough gold.", npc, creature)
return true
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/alia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ local stoneKeyword = keywordHandler:addKeyword({ "adventurer stone" }, StdModule
stoneKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are. Take care.", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 30
end, function(player)
if player:removeMoneyBank(30) then
if player:removeTotalMoney(30) then
player:addItem(16277, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/altar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

if not player:removeMoneyBank(50000000) then
if not player:removeTotalMoney(50000000) then
npcHandler:say("Sorry, you don't have enough gold.", npc, creature)
return true
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/amanda.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ local stoneKeyword = keywordHandler:addKeyword({ "adventurer stone" }, StdModule
stoneKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are. Take care.", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 30
end, function(player)
if player:removeMoneyBank(30) then
if player:removeTotalMoney(30) then
player:addItem(16277, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/andrew_lyze.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end
if player:getMoney() + player:getBankBalance() >= 5000 then
player:removeMoneyBank(5000)
player:removeTotalMoney(5000)
player:addItem(10302, 1)
end
npcHandler:setTopic(playerId, 0)
Expand Down
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/appaloosa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

if not player:removeMoneyBank(125) then
if not player:removeTotalMoney(125) then
npcHandler:say("You don't have enough money.", npc, creature)
return true
end
Expand All @@ -87,7 +87,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

if not player:removeMoneyBank(500) then
if not player:removeTotalMoney(500) then
npcHandler:say("You do not have enough money to rent a horse!", npc, creature)
return true
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/aruda.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("I would never have guessed that.", npc, creature)
npcHandler:setTopic(playerId, nil)
elseif npcHandler:getTopic(playerId) == 2 then
if player:removeMoneyBank(price[playerId]) then
if player:removeTotalMoney(price[playerId]) then
npcHandler:say("Oh, sorry, I was distracted, what did you say?", npc, creature)
else
npcHandler:say("Oh, I just remember I have some work to do, sorry. Bye!", npc, creature)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/azalea.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ local stoneKeyword = keywordHandler:addKeyword({ "adventurer stone" }, StdModule
stoneKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are. Take care.", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 30
end, function(player)
if player:removeMoneyBank(30) then
if player:removeTotalMoney(30) then
player:addItem(16277, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/beatrice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getMoney() + player:getBankBalance() >= 111 then
npcHandler:say("Here it is.", npc, creature)
player:addItem(2990, 1)
player:removeMoneyBank(111)
player:removeTotalMoney(111)
else
npcHandler:say("You don't have enough money.", npc, creature)
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/bertha.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getMoney() + player:getBankBalance() >= 111 then
npcHandler:say("Here it is.", npc, creature)
player:addItem(2990, 1)
player:removeMoneyBank(111)
player:removeTotalMoney(111)
else
npcHandler:say("You don't have enough money.", npc, creature)
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/blind_orc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ local function addBuyableKeyword(keywords, itemid, amount, price, text)
keyword:addChildKeyword({ "mok" }, StdModule.say, { npcHandler = npcHandler, text = "Maruk rambo zambo!", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= price
end, function(player)
if player:removeMoneyBank(price) then
if player:removeTotalMoney(price) then
player:addItem(itemid, amount)
end
end)
Expand Down
6 changes: 3 additions & 3 deletions data-otservbr-global/npc/bozo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ jobKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler,
return player:getMoney() < 50
end)
jobKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Thank you very much. I will have a drink or two on your health!", reset = true }, nil, function(player)
if player:removeMoneyBank(50) then
if player:removeTotalMoney(50) then
end
end)
jobKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "Well, perhaps later.", reset = true })
Expand All @@ -884,7 +884,7 @@ magicKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler
return player:getMoney() < 200
end)
magicKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are, I already lessened your load.", reset = true }, nil, function(player)
if player:removeMoneyBank(200) then
if player:removeTotalMoney(200) then
end
end)
magicKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "You don't know what offer you are missing!", reset = true })
Expand All @@ -895,7 +895,7 @@ weaponKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandle
return player:getMoney() < 250
end)
weaponKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "And here it is, it suits you well!", reset = true }, nil, function(player)
if player:removeMoneyBank(250) then
if player:removeTotalMoney(250) then
player:addItem(3473, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/brewster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ local stoneKeyword = keywordHandler:addKeyword({ "adventurer stone" }, StdModule
stoneKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are. Take care.", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 30
end, function(player)
if player:removeMoneyBank(30) then
if player:removeTotalMoney(30) then
player:addItem(16277, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/briasol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("Here it is.", npc, creature)
player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04, 2)
player:addItem(227, 1)
player:removeMoneyBank(1000)
player:removeTotalMoney(1000)
else
npcHandler:say("You don't have enought money.", npc, creature)
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/brodrosch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) > 0 then
local player = Player(creature)
if npcHandler:getTopic(playerId) == 1 then
if not player:removeMoneyBank(250) then
if not player:removeTotalMoney(250) then
npcHandler:say("You don't have enough money.", npc, creature)
npcHandler:setTopic(playerId, 0)
return true
Expand Down
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/captain_waverider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
if player:removeMoneyBank(50) then
if player:removeTotalMoney(50) then
npcHandler:say("And there we go!", npc, creature)
player:teleportTo(Position(32346, 32625, 7))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
Expand All @@ -80,7 +80,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
end
elseif npcHandler:getTopic(playerId) == 2 then
if player:removeMoneyBank(200) then
if player:removeTotalMoney(200) then
npcHandler:say("And there we go!", npc, creature)
player:teleportTo(Position(32131, 32913, 7))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/carina.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 2)
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
if player:removeMoneyBank(5000) then
if player:removeTotalMoney(5000) then
player:removeItem(7940, 1)
player:addItem(7939, 1)
npcHandler:say("Here you go kind sir.", npc, creature)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/cedrik.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ local stoneKeyword = keywordHandler:addKeyword({ "adventurer stone" }, StdModule
stoneKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are. Take care.", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 30
end, function(player)
if player:removeMoneyBank(30) then
if player:removeTotalMoney(30) then
player:addItem(16277, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/ceiron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("I can give you a new one, but I fear that I have to take a small fee for it. Would you like to buy a waterskin for 1000 gold?", npc, creature)
npcHandler:setTopic(playerId, 13)
elseif npcHandler:getTopic(playerId) == 13 then
if player:removeMoneyBank(1000) then
if player:removeTotalMoney(1000) then
player:addItem(5938, 1)
npcHandler:setTopic(playerId, 0)
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/charlotta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message)
end
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
if player:removeMoneyBank(200) then
if player:removeTotalMoney(200) then
npcHandler:say("Hmm, it seems that Eleonore does trust you. Perhaps she is even right. However. Since we need some help right now I guess we can't be too picky. Return to Eleonore and tell her the secret password: 'peg leg'. She will tell you more about her problem.", npc, creature)
player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand, 2)
npcHandler:setTopic(playerId, 2)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/chester_kahs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("I already heard that our little trick worked quite well. Several officials of Carlin are already on their way to repair the damage done to their diplomatic efforts. It will not only cost them much money but also quite some time.", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 12 then
if player:removeMoneyBank(1000) then
if player:removeTotalMoney(1000) then
player:addItem(397, 1)
npcHandler:say("Here you are. Better don't loose it again.", npc, creature)
else
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/cillia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ local function creatureSayCallback(npc, creature, type, message)

if MsgContains(message, "yes") then
local player = Player(creature)
if not player:removeMoneyBank(50) then
if not player:removeTotalMoney(50) then
npcHandler:say("The exhibition is not for free. You have to pay 50 Gold to get in. Next please!", npc, creature)
return true
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/dermot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
end
elseif npcHandler:getTopic(playerId) == 2 then
if player:removeMoneyBank(2000) then
if player:removeTotalMoney(2000) then
npcHandler:say("Here it is.", npc, creature)
local key = player:addItem(2968, 1)
if key then
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/dukosch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
if player:getMoney() + player:getBankBalance() >= 250 then
player:removeMoneyBank(250)
player:removeTotalMoney(250)
player:setStorageValue(Storage.WagonTicket, os.time() + 7 * 24 * 60 * 60)
npcHandler:say("Here is your stamp. It can't be transferred to another person and will last one week from now. You'll get notified upon using an ore wagon when it isn't valid anymore.", npc, creature)
else
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/elathriel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
local player = Player(creature)
if player:removeMoneyBank(5000) then
if player:removeTotalMoney(5000) then
npcHandler:say("Here it is.", npc, creature)
local key = player:addItem(2970, 1)
if key then
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/elvith.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ local function creatureSayCallback(npc, creature, type, message)
if npcHandler:getTopic(playerId) == 1 then
npcHandler:setTopic(playerId, 0)
local player = Player(creature)
if not player:removeMoneyBank(200) then
if not player:removeTotalMoney(200) then
npcHandler:say("You don't have enough money.", npc, creature)
return true
end
Expand Down
6 changes: 3 additions & 3 deletions data-otservbr-global/npc/emperor_kruzak.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ local function creatureSayCallback(npc, creature, type, message)
decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item in the Store.\nUnwrap it in your own house to create a " .. decoItemName .. ".")
decoKit:setActionId(36345)
npcHandler:say("Take this armor as a token of great gratitude. Let us forever remember this day, my friend!", npc, creature)
player:removeMoneyBank(500000000)
player:removeTotalMoney(500000000)
player:addOutfit(1211)
player:addOutfit(1210)
player:getPosition():sendMagicEffect(171)
Expand All @@ -110,7 +110,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:removeTotalMoney(250000000)
player:addOutfitAddon(1210, 1)
player:addOutfitAddon(1211, 1)
player:getPosition():sendMagicEffect(171)
Expand All @@ -136,7 +136,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:removeTotalMoney(250000000)
player:addOutfitAddon(1210, 2)
player:addOutfitAddon(1211, 2)
player:getPosition():sendMagicEffect(171)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/faloriel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ potionTalk:addChildKeyword({ "yes" }, StdModule.say, {
}, function(player)
return player:getMoney() + player:getBankBalance() >= 1000
end, function(player)
player:removeMoneyBank(1000)
player:removeTotalMoney(1000)
player:addItem(31350, 1) -- flask of hallucinogen
end)

Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/ferus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ local stoneKeyword = keywordHandler:addKeyword({ "adventurer stone" }, StdModule
stoneKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Here you are. Take care.", reset = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 30
end, function(player)
if player:removeMoneyBank(30) then
if player:removeTotalMoney(30) then
player:addItem(16277, 1)
end
end)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/frosty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ local function creatureSayCallback(npc, creature, type, message)
end
end
end
if player:removeMoneyBank(sleightInfo[rtnt[playerId]].cost) and (items_number == table.maxn(sleightInfo[rtnt[playerId]].items)) then
if player:removeTotalMoney(sleightInfo[rtnt[playerId]].cost) and (items_number == table.maxn(sleightInfo[rtnt[playerId]].items)) then
if table.maxn(sleightInfo[rtnt[playerId]].items) > 0 then
for i = 1, table.maxn(sleightInfo[rtnt[playerId]].items) do
local item = sleightInfo[rtnt[playerId]].items[i]
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/gamon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ end)
stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Argh... my heart aches! Alright... a promise is a promise. Here - take this wooden stake, and now get lost.", ungreet = true }, function(player)
return player:getMoney() + player:getBankBalance() >= 5000
end, function(player)
player:removeMoneyBank(5000)
player:removeTotalMoney(5000)
player:addItem(5941, 1)
end)

Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/gareth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ local function creatureSayCallback(npc, creature, type, message)
if (player:getMoney() + player:getBankBalance()) >= valor then
npcHandler:say({ "This is a very wise decision. You won't regret it. Congratulations! As your first task I like you to investigate the crime scene of a theft wich occurred last night. ...", "A very varuable artefact has been stolen. I open the door for you. You can find the room on the same floor as we are right now." }, npc, creature)
npcHandler:setTopic(playerId, 3)
player:removeMoneyBank(valor)
player:removeTotalMoney(valor)
player:addItem(25689, 1)
player:setStorageValue(Storage.CultsOfTibia.MotA.Mission, 2)
player:setStorageValue(Storage.CultsOfTibia.MotA.AccessDoorInvestigation, 1)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/gewen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 1)
elseif npcHandler:getTopic(playerId) == 1 then
if MsgContains(message, "yes") then
if not player:removeMoneyBank(250) then
if not player:removeTotalMoney(250) then
npcHandler:say("You don't have enough money.", npc, creature)
return true
end
Expand Down
6 changes: 3 additions & 3 deletions data-otservbr-global/npc/ghost_of_a_priest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ local function creatureSayCallback(npc, creature, type, message)
if npcHandler:getTopic(playerId) == 2 then
if player:getMoney() + player:getBankBalance() >= 5000 then
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.GhostOfAPriest01, 1)
player:removeMoneyBank(5000)
player:removeTotalMoney(5000)
player:addItem(11368, 1)
npcHandler:say("So be it! Here is my part of the sceptre. Combine it with the other parts on the altar of the Great Snake in the depths of this temple.", npc, creature)
npcHandler:setTopic(playerId, 0)
end
elseif npcHandler:getTopic(playerId) == 3 then
if player:getMoney() + player:getBankBalance() >= 5000 then
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.GhostOfAPriest02, 1)
player:removeMoneyBank(5000)
player:removeTotalMoney(5000)
player:addItem(11369, 1)
npcHandler:say("So be it! Here is my part of the sceptre. Combine it with the other parts on the altar of the Great Snake in the depths of this temple.", npc, creature)
npcHandler:setTopic(playerId, 0)
end
elseif npcHandler:getTopic(playerId) == 4 then
if player:getMoney() + player:getBankBalance() >= 5000 then
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.GhostOfAPriest03, 1)
player:removeMoneyBank(5000)
player:removeTotalMoney(5000)
player:addItem(11370, 1)
npcHandler:say("So be it! Here is my part of the sceptre. Combine it with the other parts on the altar of the Great Snake in the depths of this temple.", npc, creature)
npcHandler:setTopic(playerId, 0)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/gnominus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ local function creatureSayCallback(npc, creature, type, message)
if MsgContains(message, "yes") then
if player:getMoney() + player:getBankBalance() >= 10 then
npcHandler:say("And here it is! Drink it quick, it gets stale quite fast!", npc, creature)
player:removeMoneyBank(10)
player:removeTotalMoney(10)
local beerItem = player:addItem(15794)
if beerItem then
beerItem:decay()
Expand Down
Loading
Loading