Skip to content

Commit

Permalink
Update 01-03-2022
Browse files Browse the repository at this point in the history
• Adicionado um "buraco" de entrada na cave de GS (estava sem).
• Adicionado script para limitar total de itens por tile.
• Arrumado NPC Riona que estava com dois parâmetros de shop_buyable.
• Ajustado script do bank.lua
  • Loading branch information
luanluciano93 committed Mar 1, 2022
1 parent b37fce5 commit 6003ce1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 22 deletions.
1 change: 0 additions & 1 deletion data/npc/Riona.xml
Expand Up @@ -4,7 +4,6 @@
<look type="138" head="57" body="59" legs="40" feet="76" addons="0" />
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="backpack,1988,20;pick,2553,10;shovel,2554,20;rope,2120,50" />
<parameter key="shop_buyable" value="backpack,1988,20;pick,2553,10;blessed wooden stake,5942,10000;shovel,2554,20;rope,2120,50;brocade backpack,9774,50;camouflage backpack,3940,50;moon backpack,10521,50;
crown backpack,10522,50;rust remover,9930,7000;minotaur backpack,11238,100;dragon backpack,11237,150;expedition bag,11236,90;expedition backpack,11235,100;machete,2420,10000"/>
</parameters>
Expand Down
42 changes: 21 additions & 21 deletions data/npc/scripts/bank.lua
Expand Up @@ -76,7 +76,7 @@ local function creatureSayCallback(cid, type, msg)
return true
else
if string.match(msg,"%d+") then
count[cid] = getMoneyCount(msg)
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] < 1 then
npcHandler:say("You do not have enough gold.", cid)
npcHandler.topic[cid] = topicList.NONE
Expand All @@ -97,8 +97,8 @@ local function creatureSayCallback(cid, type, msg)
return false
end
elseif npcHandler.topic[cid] == topicList.DEPOSIT_GOLD then
count[cid] = getMoneyCount(msg)
if isValidMoney(count[cid]) then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] > 0 then
npcHandler:say("Would you really like to deposit " .. count[cid] .. " gold?", cid)
npcHandler.topic[cid] = topicList.DEPOSIT_CONSENT
return true
Expand All @@ -122,8 +122,8 @@ local function creatureSayCallback(cid, type, msg)
return true
elseif msgcontains(msg, "withdraw") then
if string.match(msg,"%d+") then
count[cid] = getMoneyCount(msg)
if isValidMoney(count[cid]) then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] > 0 then
npcHandler:say("Are you sure you wish to withdraw " .. count[cid] .. " gold from your bank account?", cid)
npcHandler.topic[cid] = topicList.WITHDRAW_GOLD
else
Expand All @@ -137,8 +137,8 @@ local function creatureSayCallback(cid, type, msg)
return true
end
elseif npcHandler.topic[cid] == topicList.WITHDRAW_CONSENT then
count[cid] = getMoneyCount(msg)
if isValidMoney(count[cid]) then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] > 0 then
npcHandler:say("Are you sure you wish to withdraw " .. count[cid] .. " gold from your bank account?", cid)
npcHandler.topic[cid] = topicList.WITHDRAW_GOLD
else
Expand Down Expand Up @@ -169,8 +169,8 @@ local function creatureSayCallback(cid, type, msg)
if #parts < 3 then
if #parts == 2 then
-- Immediate topicList.TRANSFER_PLAYER_GOLD simulation
count[cid] = getMoneyCount(parts[2])
if count[cid] ~= -1 then
count[cid] = tonumber(parts[2]) and getMoneyCount(parts[2]) or 0
if count[cid] > 0 then
if player:getBankBalance() < count[cid] then
npcHandler:say("There is not enough gold in your account.", cid)
npcHandler.topic[cid] = topicList.NONE
Expand Down Expand Up @@ -199,8 +199,8 @@ local function creatureSayCallback(cid, type, msg)
receiver = receiver:trim()

-- Immediate topicList.TRANSFER_PLAYER_GOLD simulation
count[cid] = getMoneyCount(parts[2])
if count[cid] ~= -1 then
count[cid] = tonumber(parts[2]) and getMoneyCount(parts[2]) or 0
if count[cid] > 0 then
if player:getBankBalance() < count[cid] then
npcHandler:say("There is not enough gold in your account.", cid)
npcHandler.topic[cid] = topicList.NONE
Expand Down Expand Up @@ -233,8 +233,8 @@ local function creatureSayCallback(cid, type, msg)
end
end
elseif npcHandler.topic[cid] == topicList.TRANSFER_PLAYER_GOLD then
count[cid] = getMoneyCount(msg)
if count[cid] ~= -1 then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] > 0 then
if player:getBankBalance() < count[cid] then
npcHandler:say("There is not enough gold in your account.", cid)
npcHandler.topic[cid] = topicList.NONE
Expand Down Expand Up @@ -305,11 +305,11 @@ local function creatureSayCallback(cid, type, msg)
npcHandler:say("How many crystal coins would you like to change into platinum?", cid)
npcHandler.topic[cid] = topicList.CHANGE_CRYSTAL_PLATINUM
elseif npcHandler.topic[cid] == topicList.CHANGE_GOLD_PLATINUM then
if getMoneyCount(msg) < 1 then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] < 1 then
npcHandler:say("Sorry, you do not have enough gold coins.", cid)
npcHandler.topic[cid] = topicList.NONE
else
count[cid] = getMoneyCount(msg)
npcHandler:say("So you would like me to change " .. count[cid] * 100 .. " of your gold coins into " .. count[cid] .. " platinum coins?", cid)
npcHandler.topic[cid] = topicList.CHANGE_GOLD_PLATINUM_CONSENT
end
Expand Down Expand Up @@ -337,11 +337,11 @@ local function creatureSayCallback(cid, type, msg)
npcHandler.topic[cid] = topicList.NONE
end
elseif npcHandler.topic[cid] == topicList.CHANGE_PLATINUM_GOLD then
if getMoneyCount(msg) < 1 then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] < 1 then
npcHandler:say("Sorry, you do not have enough platinum coins.", cid)
npcHandler.topic[cid] = topicList.NONE
else
count[cid] = getMoneyCount(msg)
npcHandler:say("So you would like me to change " .. count[cid] .. " of your platinum coins into " .. count[cid] * 100 .. " gold coins for you?", cid)
npcHandler.topic[cid] = topicList.CHANGE_PLATINUM_GOLD_CONSENT
end
Expand All @@ -362,11 +362,11 @@ local function creatureSayCallback(cid, type, msg)
end
npcHandler.topic[cid] = topicList.NONE
elseif npcHandler.topic[cid] == topicList.CHANGE_PLATINUM_CRYSTAL then
if getMoneyCount(msg) < 1 then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] < 1 then
npcHandler:say("Sorry, you do not have enough platinum coins.", cid)
npcHandler.topic[cid] = topicList.NONE
else
count[cid] = getMoneyCount(msg)
npcHandler:say("So you would like me to change " .. count[cid] * 100 .. " of your platinum coins into " .. count[cid] .. " crystal coins for you?", cid)
npcHandler.topic[cid] = topicList.CHANGE_PLATINUM_CRYSTAL_CONSENT
end
Expand All @@ -383,11 +383,11 @@ local function creatureSayCallback(cid, type, msg)
end
npcHandler.topic[cid] = topicList.NONE
elseif npcHandler.topic[cid] == topicList.CHANGE_CRYSTAL_PLATINUM then
if getMoneyCount(msg) < 1 then
count[cid] = tonumber(msg) and getMoneyCount(msg) or 0
if count[cid] < 1 then
npcHandler:say("Sorry, you do not have enough crystal coins.", cid)
npcHandler.topic[cid] = topicList.NONE
else
count[cid] = getMoneyCount(msg)
npcHandler:say("So you would like me to change " .. count[cid] .. " of your crystal coins into " .. count[cid] * 100 .. " platinum coins for you?", cid)
npcHandler.topic[cid] = topicList.CHANGE_CRYSTAL_PLATINUM_CONSENT
end
Expand Down
17 changes: 17 additions & 0 deletions data/scripts/custom/onMoveItem_maxItemsPerTile.lua
@@ -0,0 +1,17 @@
local maxItemsPerTile = 30

local maxItemsPerTile_itemMoved = EventCallback

maxItemsPerTile_itemMoved.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)

local tile = Tile(toPosition)
if tile then
if tile:getDownItemCount() >= maxItemsPerTile then
return false
end
end

return true
end

maxItemsPerTile_itemMoved:register(-1)
Binary file modified data/world/styller.otbm
Binary file not shown.

0 comments on commit 6003ce1

Please sign in to comment.