From 398b089f46460ac6b8324dc1fbaae7cea168590a Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 13 Nov 2024 12:47:03 -0300 Subject: [PATCH 1/5] feat: add EventCallbacks for item movement restrictions and boss interactions --- .../cults_of_tibia/event_on_item_moved.lua | 46 +++++++++++++++++++ .../event_on_item_moved.lua | 13 ++++++ data/events/scripts/player.lua | 43 ----------------- 3 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua create mode 100644 data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua diff --git a/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua b/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua new file mode 100644 index 00000000000..13ecaa37431 --- /dev/null +++ b/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua @@ -0,0 +1,46 @@ +local callback = EventCallback("CultsOnItemMoved") + +function callback.onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) + local fromPos = Position(33023, 31904, 14) + local toPos = Position(33052, 31932, 15) + local removeItem = false + + if player:getPosition():isInRange(fromPos, toPos) and item:getId() == 23729 then + local tile = Tile(toPosition) + if tile then + local tileBoss = tile:getTopCreature() + if tileBoss and tileBoss:isMonster() then + local bossName = tileBoss:getName():lower() + if bossName == "the remorseless corruptor" then + tileBoss:addHealth(-17000) + tileBoss:remove() + + local monster = Game.createMonster("The Corruptor of Souls", toPosition) + if not monster then + return false + end + + removeItem = true + monster:registerEvent("CheckTile") + + local storedHealth = Game.getStorageValue("healthSoul") + if storedHealth > 0 then + monster:addHealth(-(monster:getHealth() - storedHealth)) + end + + Game.setStorageValue("CheckTile", os.time() + 30) + elseif bossName == "the corruptor of souls" then + Game.setStorageValue("CheckTile", os.time() + 30) + removeItem = true + end + end + end + + if removeItem then + item:remove(1) + end + end + return true +end + +callback:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua new file mode 100644 index 00000000000..d165d2be73a --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua @@ -0,0 +1,13 @@ +local callback = EventCallback("SecretOnItemMoved") + +function callback.onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) + if toPosition == Position(32460, 32928, 7) and item.itemid == 3578 then + toPosition:sendMagicEffect(CONST_ME_HEARTS) + player:say("You feed the turtle, now you may pass.", TALKTYPE_MONSTER_SAY) + Game.setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.SmallIslands.Turtle, os.time() + 10 * 60) + item:remove(1) + end + return true +end + +callback:register() diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 78653733b58..67f663fd1a8 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -370,49 +370,6 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, end function Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) - if IsRunningGlobalDatapack() then - -- The Secret Library Quest - if toPosition == Position(32460, 32928, 7) and item.itemid == 3578 then - toPosition:sendMagicEffect(CONST_ME_HEARTS) - self:say("You feed the turtle, now you may pass.", TALKTYPE_MONSTER_SAY) - Game.setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.SmallIslands.Turtle, os.time() + 10 * 60) - item:remove(1) - end - - -- Cults of Tibia begin - local frompos = Position(33023, 31904, 14) - local topos = Position(33052, 31932, 15) - local removeItem = false - if self:getPosition():isInRange(frompos, topos) and item:getId() == 23729 then - local tile = Tile(toPosition) - if tile then - local tileBoss = tile:getTopCreature() - if tileBoss and tileBoss:isMonster() then - if tileBoss:getName():lower() == "the remorseless corruptor" then - tileBoss:addHealth(-17000) - tileBoss:remove() - local monster = Game.createMonster("The Corruptor of Souls", toPosition) - if not monster then - return false - end - removeItem = true - monster:registerEvent("CheckTile") - if Game.getStorageValue("healthSoul") > 0 then - monster:addHealth(-(monster:getHealth() - Game.getStorageValue("healthSoul"))) - end - Game.setStorageValue("CheckTile", os.time() + 30) - elseif tileBoss:getName():lower() == "the corruptor of souls" then - Game.setStorageValue("CheckTile", os.time() + 30) - removeItem = true - end - end - end - if removeItem then - item:remove(1) - end - end - -- Cults of Tibia end - end return true end From d713301d04a7172ec76f914ac658a0f357c798eb Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 20 Nov 2024 03:00:34 -0300 Subject: [PATCH 2/5] feat: add events for reporting rule violations and bugs by players --- data/events/scripts/player.lua | 82 +------------------ .../eventcallbacks/player/on_report_bug.lua | 30 +++++++ .../player/on_report_rule_violation.lua | 45 ++++++++++ 3 files changed, 78 insertions(+), 79 deletions(-) create mode 100644 data/scripts/eventcallbacks/player/on_report_bug.lua create mode 100644 data/scripts/eventcallbacks/player/on_report_rule_violation.lua diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 67f663fd1a8..d7f1eb786fd 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -369,9 +369,7 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, return true end -function Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) - return true -end +function Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) end function Player:onMoveCreature(creature, fromPosition, toPosition) local player = creature:getPlayer() @@ -382,82 +380,8 @@ function Player:onMoveCreature(creature, fromPosition, toPosition) return true end -local function hasPendingReport(playerGuid, targetName, reportType) - local player = Player(playerGuid) - if not player then - return false - end - local name = player:getName():gsub("%s+", "_") - FS.mkdir_p(string.format("%s/reports/players/%s", CORE_DIRECTORY, name)) - local file = io.open(string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType), "r") - if file then - io.close(file) - return true - end - return false -end - -function Player:onReportRuleViolation(targetName, reportType, reportReason, comment, translation) - local name = self:getName() - if hasPendingReport(self:getGuid(), targetName, reportType) then - self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your report is being processed.") - return - end - - local file = io.open(string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType), "a") - if not file then - self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There was an error when processing your report, please contact a gamemaster.") - return - end - - io.output(file) - io.write("------------------------------\n") - io.write("Reported by: " .. name .. "\n") - io.write("Target: " .. targetName .. "\n") - io.write("Type: " .. reportType .. "\n") - io.write("Reason: " .. reportReason .. "\n") - io.write("Comment: " .. comment .. "\n") - if reportType ~= REPORT_TYPE_BOT then - io.write("Translation: " .. translation .. "\n") - end - io.write("------------------------------\n") - io.close(file) - self:sendTextMessage( - MESSAGE_EVENT_ADVANCE, - string.format( - "Thank you for reporting %s. Your report \z - will be processed by %s team as soon as possible.", - targetName, - configManager.getString(configKeys.SERVER_NAME) - ) - ) - return -end - -function Player:onReportBug(message, position, category) - local name = self:getName():gsub("%s+", "_") - FS.mkdir_p(string.format("%s/reports/bugs/%s", CORE_DIRECTORY, name)) - local file = io.open(string.format("%s/reports/bugs/%s/report.txt", CORE_DIRECTORY, name), "a") - - if not file then - self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There was an error when processing your report, please contact a gamemaster.") - return true - end - - io.output(file) - io.write("------------------------------\n") - io.write("Name: " .. name) - if category == BUG_CATEGORY_MAP then - io.write(" [Map position: " .. position.x .. ", " .. position.y .. ", " .. position.z .. "]") - end - local playerPosition = self:getPosition() - io.write(" [Player Position: " .. playerPosition.x .. ", " .. playerPosition.y .. ", " .. playerPosition.z .. "]\n") - io.write("Comment: " .. message .. "\n") - io.close(file) - - self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your report has been sent to " .. configManager.getString(configKeys.SERVER_NAME) .. ".") - return true -end +function Player:onReportRuleViolation(targetName, reportType, reportReason, comment, translation) end +function Player:onReportBug(message, position, category) end function Player:onTurn(direction) if self:getGroup():getAccess() and self:getDirection() == direction then diff --git a/data/scripts/eventcallbacks/player/on_report_bug.lua b/data/scripts/eventcallbacks/player/on_report_bug.lua new file mode 100644 index 00000000000..49526f66383 --- /dev/null +++ b/data/scripts/eventcallbacks/player/on_report_bug.lua @@ -0,0 +1,30 @@ +local callback = EventCallback("PlayerOnReportBug") + +function callback.playerOnReportBug(player, message, position, category) + local name = player:getName() + local filePath = string.format("%s/reports/bugs/%s.txt", CORE_DIRECTORY, name) + local file = io.open(filePath, "a") + + if not file then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There was an error when processing your report, please contact a gamemaster.") + return true + end + + file:write("------------------------------\n") + file:write(string.format("Name: %s", name)) + + if category == BUG_CATEGORY_MAP then + file:write(string.format(" [Map position: %d, %d, %d]", position.x, position.y, position.z)) + end + + local playerPosition = player:getPosition() + file:write(string.format(" [Player Position: %d, %d, %d]\n", playerPosition.x, playerPosition.y, playerPosition.z)) + file:write(string.format("Comment: %s\n", message)) + file:write("------------------------------\n") + file:close() + + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Your report has been sent to %s.", configManager.getString(configKeys.SERVER_NAME))) + return true +end + +callback:register() diff --git a/data/scripts/eventcallbacks/player/on_report_rule_violation.lua b/data/scripts/eventcallbacks/player/on_report_rule_violation.lua new file mode 100644 index 00000000000..8c92c84b8ee --- /dev/null +++ b/data/scripts/eventcallbacks/player/on_report_rule_violation.lua @@ -0,0 +1,45 @@ +local function hasPendingReport(name, targetName, reportType) + local filePath = string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType) + local file = io.open(filePath, "r") + if file then + io.close(file) + return true + end + return false +end + +local callback = EventCallback("PlayerOnReportRuleViolation") + +function callback.playerOnReportRuleViolation(player, targetName, reportType, reportReason, comment, translation) + local name = player:getName() + + if hasPendingReport(name, targetName, reportType) then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your report is being processed.") + return + end + + local filePath = string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType) + local file = io.open(filePath, "a") + if not file then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There was an error when processing your report, please contact a gamemaster.") + return + end + + file:write("------------------------------\n") + file:write(string.format("Reported by: %s\n", name)) + file:write(string.format("Target: %s\n", targetName)) + file:write(string.format("Type: %d\n", reportType)) + file:write(string.format("Reason: %s\n", reportReason)) + file:write(string.format("Comment: %s\n", comment)) + + if reportType ~= REPORT_TYPE_BOT then + file:write(string.format("Translation: %s\n", translation)) + end + + file:write("------------------------------\n") + file:close() + + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Thank you for reporting %s. Your report will be processed by %s team as soon as possible.", targetName, configManager.getString(configKeys.SERVER_NAME))) +end + +callback:register() From 6c5413f673ded50fd234a65994afc7f3a6cbe28f Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 11 Dec 2024 17:52:29 -0300 Subject: [PATCH 3/5] refactor: integrate pending report check into main function --- .../player/on_report_rule_violation.lua | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/data/scripts/eventcallbacks/player/on_report_rule_violation.lua b/data/scripts/eventcallbacks/player/on_report_rule_violation.lua index 8c92c84b8ee..99a1c99fda7 100644 --- a/data/scripts/eventcallbacks/player/on_report_rule_violation.lua +++ b/data/scripts/eventcallbacks/player/on_report_rule_violation.lua @@ -1,25 +1,16 @@ -local function hasPendingReport(name, targetName, reportType) - local filePath = string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType) - local file = io.open(filePath, "r") - if file then - io.close(file) - return true - end - return false -end - local callback = EventCallback("PlayerOnReportRuleViolation") function callback.playerOnReportRuleViolation(player, targetName, reportType, reportReason, comment, translation) local name = player:getName() - - if hasPendingReport(name, targetName, reportType) then + local filePath = string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType) + local file = io.open(filePath, "r") + if file then + io.close(file) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your report is being processed.") return end - local filePath = string.format("%s/reports/players/%s-%s-%d.txt", CORE_DIRECTORY, name, targetName, reportType) - local file = io.open(filePath, "a") + file = io.open(filePath, "a") if not file then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There was an error when processing your report, please contact a gamemaster.") return From 0634c45eebe8277e2fa6b90853882b237974a409 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 11 Dec 2024 17:57:58 -0300 Subject: [PATCH 4/5] fix: server name --- data-otservbr-global/npc/testserver_assistant.lua | 2 +- data/global.lua | 5 ----- data/libs/functions/constants.lua | 3 +++ data/scripts/eventcallbacks/player/on_report_bug.lua | 2 +- .../eventcallbacks/player/on_report_rule_violation.lua | 2 +- data/scripts/talkactions/player/reward.lua | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/data-otservbr-global/npc/testserver_assistant.lua b/data-otservbr-global/npc/testserver_assistant.lua index 05814590bdd..220dcb1437b 100644 --- a/data-otservbr-global/npc/testserver_assistant.lua +++ b/data-otservbr-global/npc/testserver_assistant.lua @@ -113,7 +113,7 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -npcHandler:setMessage(MESSAGE_GREET, "Hey |PLAYERNAME|. I'm Testserver Assistant and I can give {money}, {experience} and {blessing} which will be useful for testing on " .. configManager.getString(configKeys.SERVER_NAME) .. " server." .. " You can too to back to level 8 with {reset}.") +npcHandler:setMessage(MESSAGE_GREET, "Hey |PLAYERNAME|. I'm Testserver Assistant and I can give {money}, {experience} and {blessing} which will be useful for testing on " .. SERVER_NAME .. " server." .. " You can too to back to level 8 with {reset}.") npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data/global.lua b/data/global.lua index 85987d559d0..35e3db9c906 100644 --- a/data/global.lua +++ b/data/global.lua @@ -47,11 +47,6 @@ DIRECTIONS_TABLE = { DIRECTION_NORTHEAST, } -SERVER_NAME = configManager.getString(configKeys.SERVER_NAME) -SERVER_MOTD = configManager.getString(configKeys.SERVER_MOTD) - -AUTH_TYPE = configManager.getString(configKeys.AUTH_TYPE) - -- Bestiary charm GLOBAL_CHARM_GUT = 120 -- 20% more chance to get creature products from looting GLOBAL_CHARM_SCAVENGE = 125 -- 25% more chance to get creature products from skinning diff --git a/data/libs/functions/constants.lua b/data/libs/functions/constants.lua index e5b8d9170b0..5c383dcc787 100644 --- a/data/libs/functions/constants.lua +++ b/data/libs/functions/constants.lua @@ -8,3 +8,6 @@ BATHTUB_FILLED_NOTMOVABLE = 26100 BAG_YOU_DESIRE = 34109 PRIMAL_BAG = 39546 BAG_YOU_COVET = 43895 + +SERVER_NAME = configManager.getString(configKeys.SERVER_NAME) +AUTH_TYPE = configManager.getString(configKeys.AUTH_TYPE) diff --git a/data/scripts/eventcallbacks/player/on_report_bug.lua b/data/scripts/eventcallbacks/player/on_report_bug.lua index 49526f66383..15077b2759b 100644 --- a/data/scripts/eventcallbacks/player/on_report_bug.lua +++ b/data/scripts/eventcallbacks/player/on_report_bug.lua @@ -23,7 +23,7 @@ function callback.playerOnReportBug(player, message, position, category) file:write("------------------------------\n") file:close() - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Your report has been sent to %s.", configManager.getString(configKeys.SERVER_NAME))) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Your report has been sent to %s.", SERVER_NAME)) return true end diff --git a/data/scripts/eventcallbacks/player/on_report_rule_violation.lua b/data/scripts/eventcallbacks/player/on_report_rule_violation.lua index 99a1c99fda7..3c1c52424af 100644 --- a/data/scripts/eventcallbacks/player/on_report_rule_violation.lua +++ b/data/scripts/eventcallbacks/player/on_report_rule_violation.lua @@ -30,7 +30,7 @@ function callback.playerOnReportRuleViolation(player, targetName, reportType, re file:write("------------------------------\n") file:close() - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Thank you for reporting %s. Your report will be processed by %s team as soon as possible.", targetName, configManager.getString(configKeys.SERVER_NAME))) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Thank you for reporting %s. Your report will be processed by %s team as soon as possible.", targetName, SERVER_NAME)) end callback:register() diff --git a/data/scripts/talkactions/player/reward.lua b/data/scripts/talkactions/player/reward.lua index a05dab3a933..56dde7499e0 100644 --- a/data/scripts/talkactions/player/reward.lua +++ b/data/scripts/talkactions/player/reward.lua @@ -31,7 +31,7 @@ local function sendExerciseRewardModal(player) if item then item:setActionId(IMMOVABLE_ACTION_ID) item:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) - item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, string.format("You won this exercise weapon as a reward to be a %s player. Use it in a dummy!\nHave a nice game..", configManager.getString(configKeys.SERVER_NAME))) + item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, string.format("You won this exercise weapon as a reward to be a %s player. Use it in a dummy!\nHave a nice game..", SERVER_NAME)) else player:sendTextMessage(MESSAGE_LOOK, "You need to have capacity and empty slots to receive.") return From ff48f7ea37ba84a0a68514422b98229f86d61fe7 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 12 Dec 2024 13:07:49 -0300 Subject: [PATCH 5/5] refactor: simplify and optimize CultsOnItemMoved event logic --- .../cults_of_tibia/event_on_item_moved.lua | 58 +++++++++---------- .../event_on_item_moved.lua | 1 - data/events/scripts/player.lua | 12 +++- .../eventcallbacks/player/on_report_bug.lua | 1 - 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua b/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua index 13ecaa37431..15fc805c37d 100644 --- a/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua +++ b/data-otservbr-global/scripts/quests/cults_of_tibia/event_on_item_moved.lua @@ -3,44 +3,42 @@ local callback = EventCallback("CultsOnItemMoved") function callback.onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) local fromPos = Position(33023, 31904, 14) local toPos = Position(33052, 31932, 15) - local removeItem = false if player:getPosition():isInRange(fromPos, toPos) and item:getId() == 23729 then local tile = Tile(toPosition) - if tile then - local tileBoss = tile:getTopCreature() - if tileBoss and tileBoss:isMonster() then - local bossName = tileBoss:getName():lower() - if bossName == "the remorseless corruptor" then - tileBoss:addHealth(-17000) - tileBoss:remove() - - local monster = Game.createMonster("The Corruptor of Souls", toPosition) - if not monster then - return false - end - - removeItem = true - monster:registerEvent("CheckTile") - - local storedHealth = Game.getStorageValue("healthSoul") - if storedHealth > 0 then - monster:addHealth(-(monster:getHealth() - storedHealth)) - end - - Game.setStorageValue("CheckTile", os.time() + 30) - elseif bossName == "the corruptor of souls" then - Game.setStorageValue("CheckTile", os.time() + 30) - removeItem = true - end - end + if not tile then + return + end + + local tileBoss = tile:getTopCreature() + if not (tileBoss and tileBoss:isMonster()) then + return end - if removeItem then + local bossName = tileBoss:getName():lower() + if bossName == "the remorseless corruptor" then + tileBoss:addHealth(-17000) + tileBoss:remove() + + local monster = Game.createMonster("The Corruptor of Souls", toPosition) + if not monster then + return + end + + monster:registerEvent("CheckTile") + + local storedHealth = Game.getStorageValue("healthSoul") + if storedHealth > 0 then + monster:addHealth(-(monster:getHealth() - storedHealth)) + end + + Game.setStorageValue("CheckTile", os.time() + 30) + item:remove(1) + elseif bossName == "the corruptor of souls" then + Game.setStorageValue("CheckTile", os.time() + 30) item:remove(1) end end - return true end callback:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua index d165d2be73a..01bb4ef715e 100644 --- a/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/event_on_item_moved.lua @@ -7,7 +7,6 @@ function callback.onItemMoved(item, count, fromPosition, toPosition, fromCylinde Game.setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.SmallIslands.Turtle, os.time() + 10 * 60) item:remove(1) end - return true end callback:register() diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 8e96828ac74..a8fe0bfb679 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -370,7 +370,9 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, return true end -function Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) end +function Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) + return true +end function Player:onMoveCreature(creature, fromPosition, toPosition) local player = creature:getPlayer() @@ -381,8 +383,12 @@ function Player:onMoveCreature(creature, fromPosition, toPosition) return true end -function Player:onReportRuleViolation(targetName, reportType, reportReason, comment, translation) end -function Player:onReportBug(message, position, category) end +function Player:onReportRuleViolation(targetName, reportType, reportReason, comment, translation) + return +end +function Player:onReportBug(message, position, category) + return true +end function Player:onTurn(direction) if self:getGroup():getAccess() and self:getDirection() == direction then diff --git a/data/scripts/eventcallbacks/player/on_report_bug.lua b/data/scripts/eventcallbacks/player/on_report_bug.lua index 15077b2759b..ede9ad0e4ac 100644 --- a/data/scripts/eventcallbacks/player/on_report_bug.lua +++ b/data/scripts/eventcallbacks/player/on_report_bug.lua @@ -24,7 +24,6 @@ function callback.playerOnReportBug(player, message, position, category) file:close() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Your report has been sent to %s.", SERVER_NAME)) - return true end callback:register()