Skip to content

Commit

Permalink
Lua code format - (Stylua)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 24, 2023
1 parent da2539c commit a31b7ec
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions data-otservbr-global/npc/jeronimo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("In our game store -> Tournament Shop", npc, creature)
return true
elseif message == "balance" then
npcHandler:say(string.format("Your balance is %i %s%s!", amountTournamentCoins, tournamentCoinName:lower(), amountTournamentCoins > 1 and 's' or ''), npc, creature)
npcHandler:say(string.format("Your balance is %i %s%s!", amountTournamentCoins, tournamentCoinName:lower(), amountTournamentCoins > 1 and "s" or ""), npc, creature)
return true
elseif MsgContains(message, "categor") then
npcHandler:say("You can see items by category: {Exercise Weapons}, {Dolls}, {House Decorations}, {Utils}, {Outfits} or {Mounts}.", npc, creature)
Expand Down Expand Up @@ -166,12 +166,11 @@ local function creatureSayCallback(npc, creature, type, message)
end

if (npcHandler:getTopic(playerId) == 2 or npcHandler:getTopic(playerId) == 0) and eventShopItems[message] ~= nil then

local selected = eventShopItems[message]
local itemCount, itemPrice, itemCharge = selected[2], selected[3], selected[5] or 0
local descCharge = ''
local descCharge = ""
if itemCharge > 0 and (itemCharge ~= 9999999 and itemCharge ~= 8888888) then
descCharge = ' with ' .. itemCharge .. ' charges'
descCharge = " with " .. itemCharge .. " charges"
end

if amountTournamentCoins > 0 and amountTournamentCoins >= itemPrice then
Expand Down Expand Up @@ -218,7 +217,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("You already own this mount.", npc, creature)
return true
end
player:updateTournamentCoins(itemPrice, 'remove')
player:updateTournamentCoins(itemPrice, "remove")
player:addMount(itemId)
local mountName = npcHandler:getTopic("mount")
local msg = string.format("You bought %s mount for %i {%s}!", mountName, itemPrice, tournamentCoinName)
Expand All @@ -233,7 +232,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("You already own this outfit.", npc, creature)
return true
end
player:updateTournamentCoins(itemPrice, 'remove')
player:updateTournamentCoins(itemPrice, "remove")
player:addOutfitAddon(female, 3)
player:addOutfitAddon(male, 3)
local outfitName = npcHandler:getTopic("outfit")
Expand All @@ -248,8 +247,7 @@ local function creatureSayCallback(npc, creature, type, message)
local itemT = ItemType(itemId)
if amountTournamentCoins >= itemPrice then
if inbox and inbox:getEmptySlots() > 0 and player:getFreeCapacity() >= itemT:getCapacity() then

player:updateTournamentCoins(itemPrice, 'remove')
player:updateTournamentCoins(itemPrice, "remove")

if itemCharge > 0 then
local addedItem = player:addItem(itemId, itemCount, true)
Expand All @@ -267,7 +265,7 @@ local function creatureSayCallback(npc, creature, type, message)
player:addItem(itemId, itemCount)
end
end
local descCharge = itemCharge > 0 and ' with ' .. itemCharge .. ' charges' or ''
local descCharge = itemCharge > 0 and " with " .. itemCharge .. " charges" or ""
local msg = string.format("You bought %ix %s%s for %i {%s} and received in your store inbox!", itemCount, itemT:getName(), descCharge, itemPrice, tournamentCoinName)
player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
npcHandler:say(msg, npc, creature)
Expand Down

0 comments on commit a31b7ec

Please sign in to comment.