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

fix: adjusts from other pr #1970

Merged
merged 5 commits into from
Dec 9, 2023
Merged
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/monster/raids/fernfang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ monster.summon = {
monster.voices = {
interval = 5000,
chance = 10,
{ text = "You desacrated this place!", yell = false },
{ text = "You desecrated this place!", yell = false },
{ text = "Yoooohuuuu!", yell = false },
{ text = "I will cleanse this isle!", yell = false },
{ text = "Grrrrrrr", yell = false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekil
end
end

local tilePool = Tile(creature:getPosition())
if tilePool then
local pool = tilePool:getItemById(2886)
if pool then
pool:remove()
end
local pool = Tile(creature:getPosition()):getItemById(2886)
if pool then
pool:remove()
end

local vortex = Game.createItem(config.vortex, 1, creature:getPosition())
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/gamestore/gamestore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ GameStore.Categories = {
icons = { "Darkfire_Devourer.png" },
name = "Darkfire Devourer",
price = 1300,
id = 213,
id = 216,
description = "{character}\n{speedboost}\n\n<i>A wild, ancient creature, which had been hiding in the depths of the shadows for a very long time, has been spotted in Tibia again! The almighty Shadow Draptor has returned and only the bravest Tibians can control such a beast!</i>",
type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
},
Expand Down Expand Up @@ -2092,7 +2092,7 @@ GameStore.Categories = {
icons = { "Spirit_of_Purity.png" },
name = "Spirit of Purity",
price = 1000,
id = 215,
id = 217,
description = "{character}\n{speedboost}\n\n<i>A wild, ancient creature, which had been hiding in the depths of the shadows for a very long time, has been spotted in Tibia again! The almighty Shadow Draptor has returned and only the bravest Tibians can control such a beast!</i>",
type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
},
Expand Down
4 changes: 2 additions & 2 deletions data/scripts/talkactions/gm/teleport_to_active_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function teleportToCreature.onSay(player, words, param)

if #activePlayers == 0 then
player:sendCancelMessage("There are no active players.")
return false
return true
end

local targetPlayer = activePlayers[math.random(#activePlayers)]
player:teleportTo(targetPlayer:getPosition())
return false
return true
end

teleportToCreature:separator(" ")
Expand Down
9 changes: 5 additions & 4 deletions data/scripts/talkactions/gm/teleport_to_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function teleportToCreature.onSay(player, words, param)
-- create log
logCommand(player, words, param)

local onlyActive = param == "active" and true or false
local showAll = param == "all" and true or false

local players = Game.getPlayers()
local playerList = {}
Expand All @@ -14,13 +14,14 @@ function teleportToCreature.onSay(player, words, param)
goto continue
end

if not onlyActive then
if showAll then
table.insert(playerList, targetPlayer)
else
local isGhost = targetPlayer:isInGhostMode()
local isTraining = _G.OnExerciseTraining[targetPlayer:getId()]
local isIdle = targetPlayer:getIdleTime() >= 5 * 60 * 1000
local isActive = not isGhost and not isTraining and not isIdle
local isInTrainingRoom = isInRange(targetPlayer:getPosition(), Position(1015, 1109, 7), Position(1094, 1738, 7))
local isActive = not isGhost and not isTraining and not isIdle and not isInTrainingRoom
if isActive then
table.insert(playerList, targetPlayer)
end
Expand All @@ -30,7 +31,7 @@ function teleportToCreature.onSay(player, words, param)

if #playerList == 0 then
player:sendCancelMessage("There are no active players.")
return false
return true
end

local window = ModalWindow({
Expand Down
8 changes: 4 additions & 4 deletions data/scripts/talkactions/god/add_addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ function addons.onSay(player, words, param)

if not target then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Player " .. name .. " is currently not online.")
return false
return true
end

local looktype = tonumber(split[2])
if not looktype then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Invalid looktype.")
return false
return true
end

local addons = tonumber(split[3])
if not addons or addons < 0 or addons > 3 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Invalid addon.")
return false
return true
end

target:addOutfitAddon(looktype, addons)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Addon for looktype " .. looktype .. "a for " .. target:getName() .. " set to " .. addons .. ".")
return false
return true
end

addons:separator(" ")
Expand Down
4 changes: 2 additions & 2 deletions data/scripts/talkactions/god/add_bosstiary_kills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ function talkaction.onSay(player, words, param)

if not kills or kills < 1 then
player:sendCancelMessage("Invalid kill count.")
return false
return true
end

local target = targetName ~= "" and Player(targetName) or player
if not target then
player:sendCancelMessage("Target player not found.")
return false
return true
end

local message = "Added received kills: " .. kills .. ", for boss: " .. monsterName
Expand Down
6 changes: 3 additions & 3 deletions data/scripts/talkactions/god/add_money.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function addMoney.onSay(player, words, param)
local normalizedName = Game.getNormalizedPlayerName(name)
if not normalizedName then
player:sendCancelMessage("A player with name " .. name .. " does not exist.")
return false
return true
end
name = normalizedName

Expand All @@ -32,14 +32,14 @@ function addMoney.onSay(player, words, param)
-- Check if the coins is valid
if amount <= 0 or amount == nil then
player:sendCancelMessage("Invalid amount.")
return false
return true
end

if not Bank.credit(name, amount) then
player:sendCancelMessage("Failed to add money to " .. name .. ".")
-- Distro log
logger.error("[addMoney.onSay] - Failed to add money to player")
return false
return true
end

player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Successfull added " .. amount .. " gold coins to " .. name .. ".")
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/talkactions/god/goto_house.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function sellHouse.onSay(player, words, param)
player:teleportTo(house:getExitPosition())
end

return false
return true
end

sellHouse:separator(" ")
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/talkactions/god/inbox_command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function inboxCommand.onSay(player, words, param)
player:sendCancelMessage("Creature not found.")
end

return false
return true
end

inboxCommand:separator(" ")
Expand Down
12 changes: 6 additions & 6 deletions data/scripts/talkactions/god/zones.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function zones.onSay(player, words, param)
local cmd = params[1]
if not cmd then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command not found.")
return false
return true
end

if cmd == "list" then
Expand All @@ -21,12 +21,12 @@ function zones.onSay(player, words, param)
local zoneName = params[2]:trim()
if not zoneName then
player:sendTextMessage(MESSAGE_HEALED, "Zone not found.")
return false
return true
end
local zone = Zone.getByName(zoneName)
if not zone then
player:sendTextMessage(MESSAGE_HEALED, "Zone not found.")
return false
return true
end
return zone
end
Expand All @@ -36,7 +36,7 @@ function zones.onSay(player, words, param)
local pos = zone:randomPosition()
if not pos then
player:sendTextMessage(MESSAGE_HEALED, "No position found.")
return false
return true
end
player:teleportTo(pos)
player:sendTextMessage(MESSAGE_HEALED, "You have been teleported to " .. zone:getName() .. ".")
Expand Down Expand Up @@ -82,11 +82,11 @@ function zones.onSay(player, words, param)
local command = commands[cmd]
if not command then
player:sendTextMessage(MESSAGE_HEALED, "Command not found.")
return false
return true
end
local zone = zoneFromParam()
if not zone then
return false
return true
end
return command(zone)
end
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/talkactions/player/buy_house.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function buyHouse.onSay(player, words, param)

if house:hasItemOnTile() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot buy this house, as there are items inside it. Please, contact an administrator.")
return false
return true
end

local price = house:getPrice()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function talkaction.onSay(player, words, param)
player:sendTextMessage(MESSAGE_LOOK, "You activated hidden sell shop items.")
elseif param == "off" then
player:kv():set("npc-shop-hidden-sell-item", false)
player:sendTextMessage(MESSAGE_LOOK, "You desactivated hidden sell shop items")
player:sendTextMessage(MESSAGE_LOOK, "You deactivated hidden sell shop items")
end
return true
end
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/talkactions/player/leave_house.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function leaveHouse.onSay(player, words, param)
if house:hasNewOwnership() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot leave this house. Ownership is already scheduled to be transferred upon the next server restart.")
playerPosition:sendMagicEffect(CONST_ME_POFF)
return false
return true
end

-- Move hireling back to lamp
Expand Down
2 changes: 1 addition & 1 deletion src/canary_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void CanaryServer::logInfos() {
/**
*It is preferable to keep the close button off as it closes the server without saving (this can cause the player to lose items from houses and others informations, since windows automatically closes the process in five seconds, when forcing the close)
* Choose to use "CTROL + C" or "CTROL + BREAK" for security close
* To activate/desactivate window;
* To activate/deactivate window;
* \param MF_GRAYED Disable the "x" (force close) button
* \param MF_ENABLED Enable the "x" (force close) button
*/
Expand Down
2 changes: 1 addition & 1 deletion src/io/iologindata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void IOLoginData::updateOnlineStatus(uint32_t guid, bool login) {
Database::getInstance().executeQuery(query.str());
}

// The boolean "disableIrrelevantInfo" will desactivate the loading of information that is not relevant to the preload, for example, forge, bosstiary, etc. None of this we need to access if the player is offline
// The boolean "disableIrrelevantInfo" will deactivate the loading of information that is not relevant to the preload, for example, forge, bosstiary, etc. None of this we need to access if the player is offline
bool IOLoginData::loadPlayerById(std::shared_ptr<Player> player, uint32_t id, bool disableIrrelevantInfo /* = true*/) {
Database &db = Database::getInstance();
std::ostringstream query;
Expand Down
Loading