From d364e3279116fb1c8955427bd5f24a55ae3cb018 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 18 Jul 2024 12:05:24 +0000 Subject: [PATCH 01/15] Code format - (Clang-format) --- .../functions/creatures/player/player_functions.cpp | 2 +- .../functions/creatures/player/player_functions.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lua/functions/creatures/player/player_functions.cpp b/src/lua/functions/creatures/player/player_functions.cpp index 9a830134737..702676ddd76 100644 --- a/src/lua/functions/creatures/player/player_functions.cpp +++ b/src/lua/functions/creatures/player/player_functions.cpp @@ -4418,4 +4418,4 @@ int PlayerFunctions::luaPlayerSendCreatureAppear(lua_State* L) { player->sendCreatureAppear(player, player->getPosition(), isLogin); pushBoolean(L, true); return 1; -} \ No newline at end of file +} diff --git a/src/lua/functions/creatures/player/player_functions.hpp b/src/lua/functions/creatures/player/player_functions.hpp index f59f92fe1c4..550ecd76539 100644 --- a/src/lua/functions/creatures/player/player_functions.hpp +++ b/src/lua/functions/creatures/player/player_functions.hpp @@ -371,12 +371,12 @@ class PlayerFunctions final : LuaScriptInterface { registerMethod(L, "Player", "addTitle", PlayerFunctions::luaPlayerAddTitle); registerMethod(L, "Player", "getTitles", PlayerFunctions::luaPlayerGetTitles); registerMethod(L, "Player", "setCurrentTitle", PlayerFunctions::luaPlayerSetCurrentTitle); - - registerMethod(L, "Player", "createTransactionSummary", PlayerFunctions::luaPlayerCreateTransactionSummary); + + registerMethod(L, "Player", "createTransactionSummary", PlayerFunctions::luaPlayerCreateTransactionSummary); registerMethod(L, "Player", "takeScreenshot", PlayerFunctions::luaPlayerTakeScreenshot); - - registerMethod(L, "Player", "sendCreatureAppear", PlayerFunctions::luaPlayerSendCreatureAppear); + + registerMethod(L, "Player", "sendCreatureAppear", PlayerFunctions::luaPlayerSendCreatureAppear); GroupFunctions::init(L); GuildFunctions::init(L); @@ -741,8 +741,8 @@ class PlayerFunctions final : LuaScriptInterface { static int luaPlayerCreateTransactionSummary(lua_State* L); static int luaPlayerTakeScreenshot(lua_State* L); - - static int luaPlayerSendCreatureAppear(lua_State* L); + + static int luaPlayerSendCreatureAppear(lua_State* L); friend class CreatureFunctions; }; From 95f1c17622b91ecbdd1d214ce9c390457a0f14b9 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Thu, 1 Aug 2024 19:05:30 -0300 Subject: [PATCH 02/15] fix: crash related to lua callback --- src/creatures/combat/combat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index 7a19a292728..a0c5fb81ec6 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -1222,7 +1222,9 @@ void Combat::CombatFunc(std::shared_ptr caster, const Position &origin if (CreatureVector* creatures = tile->getCreatures()) { const std::shared_ptr topCreature = tile->getTopCreature(); - for (auto &creature : *creatures) { + // A copy of the tile's creature list is made because modifications to this vector, such as adding or removing creatures through a Lua callback, may occur during the iteration within the for loop. + CreatureVector creaturesCopy = *creatures; + for (auto &creature : creaturesCopy) { if (params.targetCasterOrTopMost) { if (caster && caster->getTile() == tile) { if (creature != caster) { From be1179e9561899d55f55bc3e0d02dc87981b9b6b Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 2 Aug 2024 18:36:29 -0300 Subject: [PATCH 03/15] fix: addCallback check --- src/lua/callbacks/events_callbacks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lua/callbacks/events_callbacks.cpp b/src/lua/callbacks/events_callbacks.cpp index 1ab64957497..4b147d4dd6f 100644 --- a/src/lua/callbacks/events_callbacks.cpp +++ b/src/lua/callbacks/events_callbacks.cpp @@ -39,10 +39,13 @@ bool EventsCallbacks::isCallbackRegistered(const std::shared_ptr } void EventsCallbacks::addCallback(const std::shared_ptr &callback) { - if (m_callbacks.find(callback->getName()) != m_callbacks.end()) { + if (m_callbacks.find(callback->getName()) != m_callbacks.end() && !callback->skipDuplicationCheck()) { + g_logger().error("Event callback already registered: {}", callback->getName()); return; } + g_logger().trace("Registering event callback: {}", callback->getName()); + m_callbacks[callback->getName()] = callback; } From 2e89beb6be82939e8098ff276c200080b98b506a Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Wed, 7 Aug 2024 19:52:04 -0300 Subject: [PATCH 04/15] fix: ZoneEvent callback --- data/libs/functions/boss_lever.lua | 5 +-- data/libs/systems/zones.lua | 2 +- data/scripts/talkactions/god/test.lua | 44 ++++++++++++++++++++++++++ src/lua/callbacks/events_callbacks.hpp | 1 + 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index cbecfc26f8c..9cd577ee911 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -174,14 +174,15 @@ function BossLever:onUse(player) return true end - if creature:getLevel() < self.requiredLevel then + local isAccountNormal = creature:getAccountType() == ACCOUNT_TYPE_NORMAL + if isAccountNormal and creature:getLevel() < self.requiredLevel then local message = "All players need to be level " .. self.requiredLevel .. " or higher." creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, message) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message) return false end - if creature:getGroup():getId() < GROUP_TYPE_GOD and self:lastEncounterTime(creature) > os.time() then + if creature:getGroup():getId() < GROUP_TYPE_GOD and isAccountNormal and self:lastEncounterTime(creature) > os.time() then local infoPositions = lever:getInfoPositions() for _, posInfo in pairs(infoPositions) do local currentPlayer = posInfo.creature diff --git a/data/libs/systems/zones.lua b/data/libs/systems/zones.lua index 1406242517a..698a464fe87 100644 --- a/data/libs/systems/zones.lua +++ b/data/libs/systems/zones.lua @@ -148,7 +148,7 @@ function ZoneEvent:register() end if self.onSpawn then - local afterEnter = EventCallback("ZoneEventAfterEnter", true) + local afterEnter = EventCallback("ZoneEventAfterEnterOnSpawn", true) function afterEnter.zoneAfterCreatureEnter(zone, creature) if zone ~= self.zone then return true diff --git a/data/scripts/talkactions/god/test.lua b/data/scripts/talkactions/god/test.lua index 25b2fd49da2..f22f86ff921 100644 --- a/data/scripts/talkactions/god/test.lua +++ b/data/scripts/talkactions/god/test.lua @@ -36,3 +36,47 @@ end testLog:separator(" ") testLog:groupType("god") testLog:register() + +local testIcons = TalkAction("/testicons") + +local function convertIconsToBitValue(iconList) + local bitObj = NewBit(0) + for icon in string.gmatch(iconList, "%d+") do + icon = tonumber(icon) + if icon then + local flag = bit.lshift(1, icon - 1) + bitObj:updateFlag(flag) + end + end + return bitObj:getNumber() +end + +--[[Usage: +/testicons 1 +/testicons 2 +/testicons 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 +]] +function testIcons.onSay(player, words, param) + if param == "" then + player:sendCancelMessage("Icon required.") + logger.error("[testIcons.onSay] - Icon required") + return true + end + + function Player:sendIconsTest() + local msg = NetworkMessage() + msg:addByte(0xA2) + local icons = convertIconsToBitValue(param) + msg:addU32(icons) + msg:addByte(0) + msg:sendToPlayer(self) + end + + player:sendIconsTest() + return true +end + +testIcons:separator(" ") +testIcons:setDescription("[Usage]: /seticons {icon1}, {icon2}, {icon3}, ...") +testIcons:groupType("god") +testIcons:register() diff --git a/src/lua/callbacks/events_callbacks.hpp b/src/lua/callbacks/events_callbacks.hpp index 4d3758405a6..dff5cec30c5 100644 --- a/src/lua/callbacks/events_callbacks.hpp +++ b/src/lua/callbacks/events_callbacks.hpp @@ -97,6 +97,7 @@ class EventsCallbacks { }, argsCopy ); + g_logger().trace("Executed callback: {}", name); } } } From fb9a4a15517f6d5510a8a3a13a46dc3ef23b6404 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 7 Aug 2024 22:52:47 +0000 Subject: [PATCH 05/15] Lua code format - (Stylua) --- data/scripts/talkactions/god/test.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/talkactions/god/test.lua b/data/scripts/talkactions/god/test.lua index f22f86ff921..cd5e7e1aec9 100644 --- a/data/scripts/talkactions/god/test.lua +++ b/data/scripts/talkactions/god/test.lua @@ -45,7 +45,7 @@ local function convertIconsToBitValue(iconList) icon = tonumber(icon) if icon then local flag = bit.lshift(1, icon - 1) - bitObj:updateFlag(flag) + bitObj:updateFlag(flag) end end return bitObj:getNumber() From 7b2444ddac97396286c39c4c01fce4293cc6b351 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Wed, 7 Aug 2024 21:12:39 -0300 Subject: [PATCH 06/15] fix: maps bugs --- .../soul_war/ebb_and_flow/ebb-flow-empty.otbm | Bin 129560 -> 129452 bytes .../ebb_and_flow/ebb-flow-monster.xml | 3 +-- .../quest/soul_war/ebb_and_flow/ebb-flow.otbm | Bin 181546 -> 181627 bytes 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow-empty.otbm b/data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow-empty.otbm index 6d37ae4fb880709f5c9facf23687f08eb776fb95..9d3fa897425709c4d254f1ac0b598f26e2cbe0bd 100644 GIT binary patch delta 100 zcmbR7g?-Iu_6@A(H_M;Ti{HLnk8zXM^x{ZH_385?8AG@KjAVQuuJy|I|39{Fj{pDv ou~tv`$MzYCJMkaeTVJrmBoJ#lZxQ1SPLR6kAnx`bMT`pV0Po;4jQ{`u delta 211 zcmZ4UnSI6=_6@A(rT+h8VQ68fvX-QRTN6>oIQ9 zLQ+uDjH+O|Y9ymN%Rjbmj_KZ!jA3Bb_63oQ55-NoIe^x%R!#iJ_SzT3s-6H+24(@p e-unKBb0@*M(^nTV-VlaMOovNs? - - + diff --git a/data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow.otbm b/data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow.otbm index b8ba1414d09e6bdea0cf36d80dfe9f1b39ab8e17..5a8d5d16fefe7f43e2bd163cb1f86eac75068fc0 100644 GIT binary patch delta 435 zcmZ40#r?aByI~9CpwQ_#{b(V zIWUPcdw^`2%Bc-@X=INB?8urxC)DAeAtWR!!s7L2#y@ab~ishnNO& z`!uK@rUPlP+dZ4V2)1X|9@<{(^Vaq z^q86&rbjt2=`v|IPVaPJ(%!z)fk~WM8Sb#DoZ1MtOye{}aHdPRFxh3p9WoWkA(hjR zIn%+MK8ORRfE}O(;Yg(;;*F8!Zf!50BG=* Al>h($ From 60e6102b9e486b76e6a36424d954eb46f4f57f4a Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Thu, 8 Aug 2024 00:19:55 -0300 Subject: [PATCH 07/15] fix: some things --- data-otservbr-global/world/otservbr-house.xml | 3 +- .../world/otservbr-monster.xml | 6 -- data-otservbr-global/world/otservbr-npc.xml | 60 +++++++++---------- data-otservbr-global/world/otservbr-zones.xml | 2 +- src/creatures/combat/combat.cpp | 4 +- src/lua/callbacks/events_callbacks.cpp | 2 +- 6 files changed, 37 insertions(+), 40 deletions(-) diff --git a/data-otservbr-global/world/otservbr-house.xml b/data-otservbr-global/world/otservbr-house.xml index f7e5cd52370..6acaadf5bd9 100644 --- a/data-otservbr-global/world/otservbr-house.xml +++ b/data-otservbr-global/world/otservbr-house.xml @@ -284,7 +284,7 @@ - + @@ -984,4 +984,5 @@ + diff --git a/data-otservbr-global/world/otservbr-monster.xml b/data-otservbr-global/world/otservbr-monster.xml index 8441ed918a1..bde660e0c60 100644 --- a/data-otservbr-global/world/otservbr-monster.xml +++ b/data-otservbr-global/world/otservbr-monster.xml @@ -96181,7 +96181,6 @@ - @@ -118064,11 +118063,6 @@ - - - - - diff --git a/data-otservbr-global/world/otservbr-npc.xml b/data-otservbr-global/world/otservbr-npc.xml index 271d28c46ab..8bc05fa7f15 100644 --- a/data-otservbr-global/world/otservbr-npc.xml +++ b/data-otservbr-global/world/otservbr-npc.xml @@ -840,6 +840,9 @@ + + + @@ -1551,6 +1554,9 @@ + + + @@ -1932,6 +1938,9 @@ + + + @@ -2106,6 +2115,9 @@ + + + @@ -2115,6 +2127,9 @@ + + + @@ -2331,6 +2346,18 @@ + + + + + + + + + + + + @@ -2379,18 +2406,6 @@ - - - - - - - - - - - - @@ -2848,6 +2863,9 @@ + + + @@ -2983,22 +3001,4 @@ - - - - - - - - - - - - - - - - - - diff --git a/data-otservbr-global/world/otservbr-zones.xml b/data-otservbr-global/world/otservbr-zones.xml index 4740d50385c..44cff897a42 100644 --- a/data-otservbr-global/world/otservbr-zones.xml +++ b/data-otservbr-global/world/otservbr-zones.xml @@ -1,4 +1,4 @@ - + diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index a0c5fb81ec6..d65d10e4e6f 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -1167,7 +1167,9 @@ void Combat::CombatFunc(std::shared_ptr caster, const Position &origin if (CreatureVector* creatures = tile->getCreatures()) { const std::shared_ptr topCreature = tile->getTopCreature(); - for (auto &creature : *creatures) { + // A copy of the tile's creature list is made because modifications to this vector, such as adding or removing creatures through a Lua callback, may occur during the iteration within the for loop. + CreatureVector creaturesCopy = *creatures; + for (auto &creature : creaturesCopy) { if (params.targetCasterOrTopMost) { if (caster && caster->getTile() == tile) { if (creature != caster) { diff --git a/src/lua/callbacks/events_callbacks.cpp b/src/lua/callbacks/events_callbacks.cpp index 4b147d4dd6f..13a42baa15a 100644 --- a/src/lua/callbacks/events_callbacks.cpp +++ b/src/lua/callbacks/events_callbacks.cpp @@ -40,7 +40,7 @@ bool EventsCallbacks::isCallbackRegistered(const std::shared_ptr void EventsCallbacks::addCallback(const std::shared_ptr &callback) { if (m_callbacks.find(callback->getName()) != m_callbacks.end() && !callback->skipDuplicationCheck()) { - g_logger().error("Event callback already registered: {}", callback->getName()); + g_logger().trace("Event callback already registered: {}", callback->getName()); return; } From 16c20870bdf25ba0c4cb36f385cff52123374559 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Thu, 8 Aug 2024 00:29:53 -0300 Subject: [PATCH 08/15] fix: remove house --- data-otservbr-global/world/otservbr-house.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/data-otservbr-global/world/otservbr-house.xml b/data-otservbr-global/world/otservbr-house.xml index 6acaadf5bd9..7eff23b4606 100644 --- a/data-otservbr-global/world/otservbr-house.xml +++ b/data-otservbr-global/world/otservbr-house.xml @@ -984,5 +984,4 @@ - From 5c5470a02144cb42304927d774885902625a8fa9 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Thu, 8 Aug 2024 01:42:18 -0300 Subject: [PATCH 09/15] fix: change bag you desire chance --- data-otservbr-global/lib/quests/soul_war.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/lib/quests/soul_war.lua b/data-otservbr-global/lib/quests/soul_war.lua index 319d731faf7..100788d9acb 100644 --- a/data-otservbr-global/lib/quests/soul_war.lua +++ b/data-otservbr-global/lib/quests/soul_war.lua @@ -30,7 +30,7 @@ SoulWarQuest = { timeToReturnImmuneMegalomania = 70, -- In seconds - baseBagYouDesireChance = 1, -- 1% base chance + baseBagYouDesireChance = 500, -- 1000 = 1% chance, 500 = 0.5% chance bagYouDesireChancePerTaint = 1, -- Increases 1% per taint bagYouDesireMonsters = { "Bony Sea Devil", @@ -1092,7 +1092,7 @@ function Monster:generateBagYouDesireLoot(player) logger.trace("Player {} killed {} with {} taints, loot chance {}", player:getName(), monsterName, playerTaintLevel, totalChance) - if math.random(1, 100) <= totalChance then + if math.random(1, 100000) <= totalChance then local itemType = ItemType(SoulWarQuest.bagYouDesireItemId) if itemType then loot[itemType:getId()] = { count = 1 } From 784f6719f3a5b31dc33aa840a110c63484d4540c Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Thu, 8 Aug 2024 09:18:53 -0300 Subject: [PATCH 10/15] feat: add new icon --- data/scripts/talkactions/god/test.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/talkactions/god/test.lua b/data/scripts/talkactions/god/test.lua index cd5e7e1aec9..ac6ca921483 100644 --- a/data/scripts/talkactions/god/test.lua +++ b/data/scripts/talkactions/god/test.lua @@ -68,7 +68,7 @@ function testIcons.onSay(player, words, param) msg:addByte(0xA2) local icons = convertIconsToBitValue(param) msg:addU32(icons) - msg:addByte(0) + msg:addByte(tonumber(param)) msg:sendToPlayer(self) end From e337caeed3f1df7170d3599f43d098ffa15d9491 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 9 Aug 2024 02:07:50 -0300 Subject: [PATCH 11/15] fix: goshnar's greed bugs --- data-otservbr-global/lib/quests/soul_war.lua | 2 +- .../quests/soul_war/goshnars_greed.lua | 5 +-- .../monster/quests/soul_war/powerful_soul.lua | 2 +- .../monster/quests/soul_war/soul_sphere.lua | 41 ++++++++++++------- src/game/game.cpp | 2 +- .../creatures/creature_functions.cpp | 2 +- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/data-otservbr-global/lib/quests/soul_war.lua b/data-otservbr-global/lib/quests/soul_war.lua index 100788d9acb..5df73dc6115 100644 --- a/data-otservbr-global/lib/quests/soul_war.lua +++ b/data-otservbr-global/lib/quests/soul_war.lua @@ -37,7 +37,7 @@ SoulWarQuest = { "Brachiodemon", "Branchy Crawler", "Capricious Phantom", - "Cloak Of Terror", + "Cloak of Terror", "Courage Leech", "Distorted Phantom", "Druid's Apparition", diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua index 2c68f56770d..4f197ad9541 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua @@ -68,10 +68,7 @@ monster.light = { } monster.summon = { - maxSummons = 1, - summons = { - { name = "dreadful harvester", chance = 10, interval = 1000, count = 1 }, - }, + maxSummons = 1 } monster.voices = { diff --git a/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua b/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua index cee228f7185..4174abd5413 100644 --- a/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua +++ b/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua @@ -101,7 +101,7 @@ mType.onThink = function(monster, interval) boss:addReflectElement(elementType, reflectPercent) end boss:addDefense(10) - boss:setMaxHealth(boss:getHealth() + 10000) + boss:setMaxHealth(boss:getMaxHealth() + 10000) boss:addHealth(10000) end transformTimeCount = 0 diff --git a/data-otservbr-global/monster/quests/soul_war/soul_sphere.lua b/data-otservbr-global/monster/quests/soul_war/soul_sphere.lua index c0142e3e611..5cf6560132f 100644 --- a/data-otservbr-global/monster/quests/soul_war/soul_sphere.lua +++ b/data-otservbr-global/monster/quests/soul_war/soul_sphere.lua @@ -84,26 +84,39 @@ monster.immunities = { } local moveTimeCount = 0 +local stop = false mType.onThink = function(monster, interval) + if stop then + return + end + moveTimeCount = moveTimeCount + interval - if moveTimeCount == 3000 then - monster:move(DIRECTION_WEST) - moveTimeCount = 0 - local monsterPos = monster:getPosition() - local nextPos = Position(monsterPos.x - 1, monsterPos.y, monsterPos.z) - local tile = Tile(nextPos) - if not tile then - return - end + if moveTimeCount >= 3000 then + local currentPos = monster:getPosition() + local newPos = Position(currentPos.x - 1, currentPos.y, currentPos.z) - for _, creatureId in pairs(tile:getCreatures()) do - local monster = Monster(creatureId) - if monster and monster:getName() == "Goshnar's Greed" then - monster:setHealth(monster:getMaxHealth()) - break + local nextTile = Tile(newPos) + if nextTile then + for _, creatureId in pairs(nextTile:getCreatures()) do + local greedMonster = Monster(creatureId) + if greedMonster and greedMonster:getName() == "Goshnar's Greed" then + greedMonster:setHealth(greedMonster:getMaxHealth()) + stop = true + return + end end end + + if not stop then + monster:teleportTo(newPos, true) + moveTimeCount = 0 + end end end +mType.onSpawn = function(monster) + moveTimeCount = 0 + stop = false +end + mType:register(monster) diff --git a/src/game/game.cpp b/src/game/game.cpp index f3415b0cb7e..ee49b9cc7cc 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1487,7 +1487,7 @@ ReturnValue Game::internalMoveCreature(std::shared_ptr creature, Direc return RETURNVALUE_NOTPOSSIBLE; } - if (creature->getBaseSpeed() == 0 && flags != FLAG_IGNORENOTMOVABLE) { + if (creature->getBaseSpeed() == 0) { return RETURNVALUE_NOTMOVABLE; } diff --git a/src/lua/functions/creatures/creature_functions.cpp b/src/lua/functions/creatures/creature_functions.cpp index da935d05fdc..6b09945971a 100644 --- a/src/lua/functions/creatures/creature_functions.cpp +++ b/src/lua/functions/creatures/creature_functions.cpp @@ -968,7 +968,7 @@ int CreatureFunctions::luaCreatureMove(lua_State* L) { lua_pushnil(L); return 1; } - lua_pushnumber(L, g_game().internalMoveCreature(creature, direction, FLAG_IGNORENOTMOVABLE)); + lua_pushnumber(L, g_game().internalMoveCreature(creature, direction, FLAG_NOLIMIT)); } else { std::shared_ptr tile = getUserdataShared(L, 2); if (!tile) { From bfbcf19504603b0bf43b57e981102ccac7060a3f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 9 Aug 2024 05:08:29 +0000 Subject: [PATCH 12/15] Lua code format - (Stylua) --- data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua index 4f197ad9541..2ec3a528eb5 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua @@ -68,7 +68,7 @@ monster.light = { } monster.summon = { - maxSummons = 1 + maxSummons = 1, } monster.voices = { From 46da501195b92d62188550fdd5eb254d91cd1320 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 9 Aug 2024 10:46:32 -0300 Subject: [PATCH 13/15] fix: soul ghosts looktype --- data-otservbr-global/monster/quests/soul_war/powerful_soul.lua | 2 +- data-otservbr-global/monster/quests/soul_war/strong_soul.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua b/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua index 4174abd5413..0ece602eab5 100644 --- a/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua +++ b/data-otservbr-global/monster/quests/soul_war/powerful_soul.lua @@ -4,7 +4,7 @@ local monster = {} monster.description = "a powerful soul" monster.experience = 0 monster.outfit = { - lookType = 48, + lookType = 568, lookHead = 0, lookBody = 0, lookLegs = 0, diff --git a/data-otservbr-global/monster/quests/soul_war/strong_soul.lua b/data-otservbr-global/monster/quests/soul_war/strong_soul.lua index 3fb844d1f97..ae3615b6eb4 100644 --- a/data-otservbr-global/monster/quests/soul_war/strong_soul.lua +++ b/data-otservbr-global/monster/quests/soul_war/strong_soul.lua @@ -4,7 +4,7 @@ local monster = {} monster.description = "a strong soul" monster.experience = 0 monster.outfit = { - lookType = 48, + lookType = 566, lookHead = 0, lookBody = 0, lookLegs = 0, From a55a2b5381151727b4e837fc45adfcbb4e965ccc Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 9 Aug 2024 14:17:45 -0300 Subject: [PATCH 14/15] fix: final conflicts --- data/scripts/talkactions/god/test.lua | 44 --------------------------- src/enums/player_icons.hpp | 10 +++--- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/data/scripts/talkactions/god/test.lua b/data/scripts/talkactions/god/test.lua index ac6ca921483..25b2fd49da2 100644 --- a/data/scripts/talkactions/god/test.lua +++ b/data/scripts/talkactions/god/test.lua @@ -36,47 +36,3 @@ end testLog:separator(" ") testLog:groupType("god") testLog:register() - -local testIcons = TalkAction("/testicons") - -local function convertIconsToBitValue(iconList) - local bitObj = NewBit(0) - for icon in string.gmatch(iconList, "%d+") do - icon = tonumber(icon) - if icon then - local flag = bit.lshift(1, icon - 1) - bitObj:updateFlag(flag) - end - end - return bitObj:getNumber() -end - ---[[Usage: -/testicons 1 -/testicons 2 -/testicons 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -]] -function testIcons.onSay(player, words, param) - if param == "" then - player:sendCancelMessage("Icon required.") - logger.error("[testIcons.onSay] - Icon required") - return true - end - - function Player:sendIconsTest() - local msg = NetworkMessage() - msg:addByte(0xA2) - local icons = convertIconsToBitValue(param) - msg:addU32(icons) - msg:addByte(tonumber(param)) - msg:sendToPlayer(self) - end - - player:sendIconsTest() - return true -end - -testIcons:separator(" ") -testIcons:setDescription("[Usage]: /seticons {icon1}, {icon2}, {icon3}, ...") -testIcons:groupType("god") -testIcons:register() diff --git a/src/enums/player_icons.hpp b/src/enums/player_icons.hpp index c289144bd7b..7878d9e5037 100644 --- a/src/enums/player_icons.hpp +++ b/src/enums/player_icons.hpp @@ -35,11 +35,11 @@ enum class PlayerIcon : uint8_t { GreaterHex = 18, Rooted = 19, Feared = 20, - Goshnar1 = 21, - Goshnar2 = 22, - Goshnar3 = 23, - Goshnar4 = 24, - Goshnar5 = 25, + GoshnarTaint1 = 21, + GoshnarTaint2 = 22, + GoshnarTaint3 = 23, + GoshnarTaint4 = 24, + GoshnarTaint5 = 25, NewManaShield = 26, Agony = 27, From f4a8e547fc28cf20d6bc56ee48c91b35465da664 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 9 Aug 2024 14:55:35 -0300 Subject: [PATCH 15/15] fix: register missing stairs --- data/items/items.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/data/items/items.xml b/data/items/items.xml index c898c235f8d..a4750514e26 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -74771,12 +74771,31 @@ Granted by TibiaGoals.com"/> + + + + + + + + + + + + + + + + + + + @@ -74811,6 +74830,22 @@ Granted by TibiaGoals.com"/> + + + + + + + + + + + + + + + + @@ -74829,6 +74864,15 @@ Granted by TibiaGoals.com"/> + + + + + + + + +