Skip to content

Commit

Permalink
Merge branch 'opentibiabr:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoPetryx authored Oct 10, 2024
2 parents c99f0e1 + 3cd4031 commit 28c7dcc
Show file tree
Hide file tree
Showing 126 changed files with 1,073 additions and 862,487 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/analysis-qodana.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/analysis-sonarcloud.yml

This file was deleted.

8 changes: 6 additions & 2 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ serverMotd = "Welcome to the OTServBR-Global!"
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
maxItem = 2000
maxContainer = 100
maxPlayersOnlinePerAccount = 1
maxPlayersOutsidePZPerAccount = 1

Expand All @@ -81,6 +79,12 @@ freeDepotLimit = 2000
premiumDepotLimit = 10000
depotBoxes = 20

-- Item and containers limit
-- NOTE: 'maxContainerDepth' defines the maximum depth to which containers can be nested
maxItem = 5000
maxContainer = 500
maxContainerDepth = 200

-- Augments System (Get more info in: https://github.com/opentibiabr/canary/pull/2602)
-- NOTE: the following values are for all weapons and equipments that have type of "increase damage", "powerful impact" and "strong impact".
-- To customize the percentage of a particular item with these augment types, please add to the item "augments" section on items.xml as the example above.
Expand Down
8 changes: 2 additions & 6 deletions data-otservbr-global/npc/alaistar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,11 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

local formattedCategoryNames = {}
for categoryName, _ in pairs(itemsTable) do
table.insert(formattedCategoryNames, "{" .. categoryName .. "}")
end

local categoryTable = itemsTable[message:lower()]

if categoryTable then
npcHandler:say("Of course, just browse through my wares.", npc, player)
local remainingCategories = npc:getRemainingShopCategories(message:lower(), itemsTable)
npcHandler:say("Of course, just browse through my wares. You can also look at " .. remainingCategories .. ".", npc, player)
npc:openShopWindowTable(player, categoryTable)
end
return true
Expand Down
10 changes: 3 additions & 7 deletions data-otservbr-global/npc/alexander.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

local formattedCategoryNames = {}
for categoryName, _ in pairs(itemsTable) do
table.insert(formattedCategoryNames, "{" .. categoryName .. "}")
end

local categoryTable = itemsTable[message:lower()]
local itemId = items[player:getVocation():getBaseId()]
if MsgContains(message, "first rod") or MsgContains(message, "first wand") then
Expand All @@ -163,7 +158,8 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("Ok then.", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif categoryTable then
npcHandler:say("Of course, just browse through my wares.", npc, player)
local remainingCategories = npc:getRemainingShopCategories(message:lower(), itemsTable)
npcHandler:say("Of course, just browse through my wares. You can also look at " .. remainingCategories .. ".", npc, player)
npc:openShopWindowTable(player, categoryTable)
end
return true
Expand All @@ -175,7 +171,7 @@ npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, "Hi there |PLAYERNAME|, and welcome to the {magic} store.")
npcHandler:setMessage(MESSAGE_FAREWELL, "See you, |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "See you, |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just browse through my wares. Or do you want to look only at {runes} or {wands}?")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just browse through my wares. Or do you want to look only at " .. GetFormattedShopCategoryNames(itemsTable) .. ".")
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- On buy npc shop message
Expand Down
9 changes: 3 additions & 6 deletions data-otservbr-global/npc/asima.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

local formattedCategoryNames = {}
for categoryName, _ in pairs(itemsTable) do
table.insert(formattedCategoryNames, "{" .. categoryName .. "}")
end

local categoryTable = itemsTable[message:lower()]
local itemId = items[player:getVocation():getBaseId()]
if MsgContains(message, "first rod") or MsgContains(message, "first wand") then
Expand All @@ -174,12 +169,14 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("Ok then.", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif categoryTable then
npcHandler:say("Of course, just browse through my wares.", npc, player)
local remainingCategories = npc:getRemainingShopCategories(message:lower(), itemsTable)
npcHandler:say("Of course, just browse through my wares. You can also look at " .. remainingCategories .. ".", npc, player)
npc:openShopWindowTable(player, categoryTable)
end
return true
end

npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just browse through my wares. Or do you want to look only at " .. GetFormattedShopCategoryNames(itemsTable) .. ".")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
Loading

0 comments on commit 28c7dcc

Please sign in to comment.