From 44a8014109afe611303aeea230df4b08d18691a1 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 14 Nov 2023 16:09:39 -0300 Subject: [PATCH 01/23] exercise_training: improved msg. broadcast: removed unnecessary Webhook.sendMessage. reward: fixes charges. prision bosses: created flag to enable minus players. removed functions already created. login: removed create torch when player login. bosses teleports: fixes in 'clearBossRoom' function usage. --- config.lua.dist | 1 - .../actions/roshamuul/prison/golden.lua | 36 +++++++++++-------- .../scripts/creaturescripts/others/login.lua | 2 +- data/libs/exercise_training.lua | 2 +- data/scripts/talkactions/gm/broadcast.lua | 1 - data/scripts/talkactions/player/reward.lua | 13 +++---- 6 files changed, 31 insertions(+), 24 deletions(-) diff --git a/config.lua.dist b/config.lua.dist index a6bd7b6ccaf..b309ecc4bfe 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -165,7 +165,6 @@ pvpRateDamageTakenPerLevel = 0.0 -- recommended to start with 0.1 pvpRateDamageReductionPerLevel = 0.0 -- recommended to start with 0.1 pvpMaxLevelDifference = 0 - -- Wheel of destiny system -- NOTE: set wheelSystemEnabled = false to disable the wheel of destiny -- NOTE: only the wheel points are modified, all other data is on the client executable and cannot be modified diff --git a/data-otservbr-global/scripts/actions/roshamuul/prison/golden.lua b/data-otservbr-global/scripts/actions/roshamuul/prison/golden.lua index 0e5c8f40934..aa3c9d950fb 100644 --- a/data-otservbr-global/scripts/actions/roshamuul/prison/golden.lua +++ b/data-otservbr-global/scripts/actions/roshamuul/prison/golden.lua @@ -1,26 +1,28 @@ local setting = { timeToFightAgain = 10, - clearRoomTime = 60, -- In hour - centerRoom = { x = 33528, y = 32334, z = 12 }, + ignorePlayersCount = true, + clearRoomTime = 60, -- In minutes + leverPosition = Position(33606, 32362, 11), + centerRoom = Position(33528, 32334, 12), range = 10, storage = Storage.PrinceDrazzakTime, clearRoomStorage = GlobalStorage.PrinceDrazzakEventTime, - bossName = "prince drazzak", - bossPosition = { x = 33528, y = 32333, z = 12 }, + bossName = "Prince Drazzak", + bossPosition = Position(33528, 32333, 12), } local playerPositions = { - { fromPos = { x = 33607, y = 32362, z = 11 }, toPos = { x = 33526, y = 32341, z = 12 } }, - { fromPos = { x = 33608, y = 32362, z = 11 }, toPos = { x = 33527, y = 32341, z = 12 } }, - { fromPos = { x = 33609, y = 32362, z = 11 }, toPos = { x = 33528, y = 32341, z = 12 } }, - { fromPos = { x = 33610, y = 32362, z = 11 }, toPos = { x = 33529, y = 32341, z = 12 } }, - { fromPos = { x = 33611, y = 32362, z = 11 }, toPos = { x = 33530, y = 32341, z = 12 } }, + { fromPos = Position(33607, 32362, 11), toPos = Position(33526, 32341, 12) }, + { fromPos = Position(33608, 32362, 11), toPos = Position(33527, 32341, 12) }, + { fromPos = Position(33609, 32362, 11), toPos = Position(33528, 32341, 12) }, + { fromPos = Position(33610, 32362, 11), toPos = Position(33529, 32341, 12) }, + { fromPos = Position(33611, 32362, 11), toPos = Position(33530, 32341, 12) }, } local golden = Action() -function golden.onUse(player, item, fromPosition, target, toPosition, monster, isHotkey) - if toPosition == Position(33606, 32362, 11) then +function golden.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if toPosition == setting.leverPosition and not setting.ignorePlayersCount then for i = 1, #playerPositions do local creature = Tile(playerPositions[i].fromPos):getTopCreature() if not creature then @@ -30,11 +32,15 @@ function golden.onUse(player, item, fromPosition, target, toPosition, monster, i end end - if toPosition == Position(33606, 32362, 11) then - if roomIsOccupied(setting.centerRoom, false, setting.range, setting.range) or Game.getStorageValue(setting.clearRoomStorage) == 1 then + if toPosition == setting.leverPosition then + if roomIsOccupied(setting.centerRoom, false, setting.range, setting.range) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.") return true end + if Game.getStorageValue(setting.clearRoomStorage) == 1 then + Game.setStorageValue(setting.clearRoomStorage, 0) + clearRoom(setting.centerRoom, setting.range, setting.range, setting.clearRoomStorage) + end for i = 1, #playerPositions do local creature = Tile(playerPositions[i].fromPos):getTopCreature() @@ -49,7 +55,9 @@ function golden.onUse(player, item, fromPosition, target, toPosition, monster, i creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end else - return false + if not setting.ignorePlayersCount then + return false + end end end item:remove() diff --git a/data-otservbr-global/scripts/creaturescripts/others/login.lua b/data-otservbr-global/scripts/creaturescripts/others/login.lua index 45e2cabc7fc..43914430533 100644 --- a/data-otservbr-global/scripts/creaturescripts/others/login.lua +++ b/data-otservbr-global/scripts/creaturescripts/others/login.lua @@ -33,7 +33,7 @@ function playerLogin.onLogin(player) backpack:addItem(items[i][1], items[i][2]) end end - player:addItem(2920, 1, true, 1, CONST_SLOT_AMMO) + db.query("UPDATE `players` SET `istutorial` = 0 where `id`=" .. player:getGuid()) -- Open channels if table.contains({ TOWNS_LIST.DAWNPORT, TOWNS_LIST.DAWNPORT_TUTORIAL }, player:getTown():getId()) then diff --git a/data/libs/exercise_training.lua b/data/libs/exercise_training.lua index 3fcbf89dd87..74ea2492f46 100644 --- a/data/libs/exercise_training.lua +++ b/data/libs/exercise_training.lua @@ -55,7 +55,7 @@ function ExerciseEvent(playerId, tilePosition, weaponId, dummyId) end if player:isTraining() == 0 then - player:sendTextMessage(MESSAGE_FAILURE, "You left training!") + player:sendTextMessage(MESSAGE_FAILURE, "You've stopped training!") return LeaveTraining(playerId) end diff --git a/data/scripts/talkactions/gm/broadcast.lua b/data/scripts/talkactions/gm/broadcast.lua index ca8171e3635..503462e4f6f 100644 --- a/data/scripts/talkactions/gm/broadcast.lua +++ b/data/scripts/talkactions/gm/broadcast.lua @@ -11,7 +11,6 @@ function broadcast.onSay(player, words, param) local text = player:getName() .. " broadcasted: " .. param logger.info(text) - Webhook.sendMessage("Broadcast", text, WEBHOOK_COLOR_WARNING, announcementChannels["serverAnnouncements"]) for _, targetPlayer in ipairs(Game.getPlayers()) do targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST) end diff --git a/data/scripts/talkactions/player/reward.lua b/data/scripts/talkactions/player/reward.lua index a1ad754a309..8a2e89930f8 100644 --- a/data/scripts/talkactions/player/reward.lua +++ b/data/scripts/talkactions/player/reward.lua @@ -1,11 +1,12 @@ local config = { items = { - { id = 35284, charges = 64000 }, - { id = 35279, charges = 64000 }, - { id = 35281, charges = 64000 }, - { id = 35283, charges = 64000 }, - { id = 35282, charges = 64000 }, - { id = 35280, charges = 64000 }, + { id = 35284, charges = 64400 }, + { id = 35279, charges = 64400 }, + { id = 35281, charges = 64400 }, + { id = 35283, charges = 64400 }, + { id = 35282, charges = 64400 }, + { id = 35280, charges = 64400 }, + { id = 44066, charges = 64400 }, }, storage = tonumber(Storage.PlayerWeaponReward), -- storage key, player can only win once } From d7f69a4cafb913ea4d055bedcc38aadae613c4dc Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 15 Nov 2023 14:20:48 -0300 Subject: [PATCH 02/23] cask_kegs: redo. --- data-otservbr-global/scripts/actions/other/cask_kegs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/actions/other/cask_kegs.lua b/data-otservbr-global/scripts/actions/other/cask_kegs.lua index f15ea2fd0e7..872d30d613c 100644 --- a/data-otservbr-global/scripts/actions/other/cask_kegs.lua +++ b/data-otservbr-global/scripts/actions/other/cask_kegs.lua @@ -39,7 +39,7 @@ function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey) return false end - local charges = item:getCharges() + local charges = target:getCharges() local itemCount = item:getCount() local recharged = itemCount From 41576b726a5c56c75b54fdb7c93c827722bdf727 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 11:25:31 -0300 Subject: [PATCH 03/23] xp boost: removed the reset of xp boost storage on server save. (on every ss, the xp boost storage was cleaned) --- data-canary/scripts/globalevents/global_server_save.lua | 2 -- .../scripts/globalevents/others/global_server_save.lua | 2 -- data/scripts/talkactions/god/close_server.lua | 2 -- 3 files changed, 6 deletions(-) diff --git a/data-canary/scripts/globalevents/global_server_save.lua b/data-canary/scripts/globalevents/global_server_save.lua index 4ec9b873d4e..51e1ed1fc35 100644 --- a/data-canary/scripts/globalevents/global_server_save.lua +++ b/data-canary/scripts/globalevents/global_server_save.lua @@ -10,8 +10,6 @@ local function ServerSave() end -- Updating daily reward next server save UpdateDailyRewardGlobalStorage(DailyReward.storages.lastServerSave, os.time()) - -- Reset gamestore exp boost count. - db.query("UPDATE `player_storage` SET `value` = 0 WHERE `player_storage`.`key` = 51052") end local function ServerSaveWarning(time) diff --git a/data-otservbr-global/scripts/globalevents/others/global_server_save.lua b/data-otservbr-global/scripts/globalevents/others/global_server_save.lua index 6cdb27447b6..c65255b592b 100644 --- a/data-otservbr-global/scripts/globalevents/others/global_server_save.lua +++ b/data-otservbr-global/scripts/globalevents/others/global_server_save.lua @@ -10,8 +10,6 @@ local function ServerSave() end -- Updating daily reward next server save. UpdateDailyRewardGlobalStorage(DailyReward.storages.lastServerSave, os.time()) - -- Reset gamestore exp boost count. - db.query("UPDATE `player_storage` SET `value` = 0 WHERE `player_storage`.`key` = 51052") end local function ServerSaveWarning(time) diff --git a/data/scripts/talkactions/god/close_server.lua b/data/scripts/talkactions/god/close_server.lua index 9f020e289d6..a807b4f72a1 100644 --- a/data/scripts/talkactions/god/close_server.lua +++ b/data/scripts/talkactions/god/close_server.lua @@ -19,8 +19,6 @@ function closeServer.onSay(player, words, param) end -- Updating daily reward next server save. UpdateDailyRewardGlobalStorage(DailyReward.storages.lastServerSave, os.time()) - -- Reset gamestore exp boost count. - db.query("UPDATE `player_storage` SET `value` = 0 WHERE `player_storage`.`key` = 51052") elseif param == "maintainance" then Game.setGameState(GAME_STATE_MAINTAIN) player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Server is set to maintenance mode.") From fa46072524dfb5fc54f253ed9c400abd6579d5bf Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 13:16:47 -0300 Subject: [PATCH 04/23] firewalker boots transform: removed 'worn leather boots' to transforming when uses small enchanted ruby. --- data-otservbr-global/scripts/actions/other/enchanting.lua | 2 +- data-otservbr-global/scripts/actions/other/surprise_bag.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/scripts/actions/other/enchanting.lua b/data-otservbr-global/scripts/actions/other/enchanting.lua index efd59489110..3f7418ba7c4 100644 --- a/data-otservbr-global/scripts/actions/other/enchanting.lua +++ b/data-otservbr-global/scripts/actions/other/enchanting.lua @@ -66,7 +66,7 @@ function enchanting.onUse(player, item, fromPosition, target, toPosition, isHotk return true end - if item.itemid == 676 and table.contains({ 3123, 9020 }, target.itemid) then + if item.itemid == 676 and target.itemid == 9020 then target:transform(9019) item:remove(1) toPosition:sendMagicEffect(CONST_ME_MAGIC_RED) diff --git a/data-otservbr-global/scripts/actions/other/surprise_bag.lua b/data-otservbr-global/scripts/actions/other/surprise_bag.lua index 71520c03ebf..bbe76e26055 100644 --- a/data-otservbr-global/scripts/actions/other/surprise_bag.lua +++ b/data-otservbr-global/scripts/actions/other/surprise_bag.lua @@ -52,7 +52,7 @@ local config = { 5917, 3273, 10302, - 3123, + 9019, 5928, 5926, 5927, From 6dbe55babfd12ac117feca11510315bde6b83bf3 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 15:25:28 -0300 Subject: [PATCH 05/23] gamestore & mounts: added 13.21 new mounts, reordered and fixed typos, changed the word moveable to movable (https://grammarist.com/spelling/movable-moveable/#:~:text=Moveable%20is%20the%20older%20spelling,so%20for%20over%20a%20century.) --- data/XML/mounts.xml | 6 +- data/modules/scripts/gamestore/gamestore.lua | 96 +++++++++++++++----- data/modules/scripts/gamestore/init.lua | 28 +++--- 3 files changed, 94 insertions(+), 36 deletions(-) diff --git a/data/XML/mounts.xml b/data/XML/mounts.xml index b0922f3f431..23bea06f950 100644 --- a/data/XML/mounts.xml +++ b/data/XML/mounts.xml @@ -216,5 +216,9 @@ - + + + + + diff --git a/data/modules/scripts/gamestore/gamestore.lua b/data/modules/scripts/gamestore/gamestore.lua index c4313dc9d5b..20e51a4167e 100644 --- a/data/modules/scripts/gamestore/gamestore.lua +++ b/data/modules/scripts/gamestore/gamestore.lua @@ -1114,14 +1114,6 @@ GameStore.Categories = { rookgaard = true, state = GameStore.States.STATE_NONE, offers = { - { - icons = { "Arctic_Unicorn.png" }, - name = "Artic Unicorn", - price = 870, - id = 114, - description = "{character}\n{speedboost}\n\nThe Arctic Unicorn lives in a deep rivalry with its cousin the Blazing Unicorn. Even though they were born in completely different areas, they somehow share the same bloodline. The eternal battle between fire and ice continues. Who will win? Tangerine vs.crystal blue! The choice is yours!", - type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, - }, { icons = { "Armoured_War_Horse.png" }, name = "Armoured War Horse", @@ -1130,6 +1122,14 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nThe Armoured War Horse is a dangerous black beauty! When you see its threatening, blood-red eyes coming towards you, you'll know trouble is on its way. Protected by its heavy armour plates, the warhorse is the perfect partner for dangerous hunting sessions and excessive enemy slaughtering.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Arctic_Unicorn.png" }, + name = "Artic Unicorn", + price = 870, + id = 114, + description = "{character}\n{speedboost}\n\nThe Arctic Unicorn lives in a deep rivalry with its cousin the Blazing Unicorn. Even though they were born in completely different areas, they somehow share the same bloodline. The eternal battle between fire and ice continues. Who will win? Tangerine vs.crystal blue! The choice is yours!", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + }, { icons = { "Batcat.png" }, name = "Batcat", @@ -1178,6 +1178,14 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nYou are fascinated by insectoid creatures and can picture yourself riding one during combat or just for travelling? The Bloodcurl will carry you through the Tibian wilderness with ease.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Bogwurm.png" }, + name = "Bogwurm", + price = 870, + id = 189, + description = "{character}\n{speedboost}\n\nThe Bogwurm, Gloomwurm, and Rustwurm belong to a little known subset of the dragon family, and usually live out their lives in habitats far away from human interaction. Them being cunning hunters, and their keen sense of perception make these wurms great companions for whomever can locate and tame them.", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + }, { icons = { "Boreal_Owl.png" }, name = "Boreal Owl", @@ -1194,14 +1202,6 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nThe vibrant colours and elegance of a Tangerine Flecked Koi, a Brass Speckled Koi, and an Ink Spotted Koi make them a fascinating sight to behold, and their boisterous nature and speed will make you the first to arrive wherever there are riches to gain. Wield your weapon as gracefully and effortlessly as your swimming companion glides through the water, and the two of you will make the perfect and most deadly pair.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, - { - icons = { "Bogwurm.png" }, - name = "Bogwurm", - price = 870, - id = 189, - description = "{character}\n{speedboost}\n\nThe Bogwurm, Gloomwurm, and Rustwurm belong to a little known subset of the dragon family, and usually live out their lives in habitats far away from human interaction. Them being cunning hunters, and their keen sense of perception make these wurms great companions for whomever can locate and tame them.", - type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, - }, { icons = { "Bunny_Dray.png" }, name = "Bunny Dray", @@ -1274,6 +1274,16 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nIf the Coralripper moves its fins, it generates enough air pressure that it can even float over land. Its numerous eyes allow it to quickly detect dangers even in confusing situations and eliminate them with one powerful bite. If you watch your fingers, you are going to be good friends.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Corpsefire_Skull.png" }, + name = "Corpsefire Skull", + price = 750, + id = 220, + description = "{character}\n{speedboost}\n\nSkulls are the infernal heralds of untamed power. Bodies are obsolete when sinister forces animate your being. Embrace their presence and command the devastating might that awaits on the back of an eerie Corpsefire Skull!", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + state = GameStore.States.STATE_NEW, + home = true, + }, { icons = { "Cranium_Spider.png" }, name = "Cranium Spider", @@ -1306,6 +1316,14 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nBorn from the depths of the forest, where flora and fauna intertwine in mysterious ways, the Floral Beast is a colourful creature that is sure to turn some heads. The Hyacinth, Peony, and Dandelion mount are loyal companions that will safely carry you through their natural habitat of the woods, or lands unknown to them.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Darkfire_Devourer.png" }, + name = "Darkfire Devourer", + price = 1300, + id = 213, + description = "{character}\n{speedboost}\n\nA 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!", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + }, { icons = { "Dawn_Strayer.png" }, name = "Dawn Strayer", @@ -1330,6 +1348,16 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nIts roaring is piercing marrow and bone and can be heard over ten miles away. The Desert King is the undisputed ruler of its territory and no one messes with this animal. Show no fear and prove yourself worthy of its trust and you will get yourself a valuable companion for your adventures.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Doom_Skull.png" }, + name = "Doom Skull", + price = 750, + id = 219, + description = "{character}\n{speedboost}\n\nSkulls are the infernal heralds of untamed power. Bodies are obsolete when sinister forces animate your being. Embrace their presence and command the devastating might that awaits on the back of a grim Doom Skull.", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + state = GameStore.States.STATE_NEW, + home = true, + }, { icons = { "Doombringer.png" }, name = "Doombringer", @@ -1498,6 +1526,14 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nThe Flying Divan is the perfect mount for those who are too busy to take care of an animal mount or simply like to travel on a beautiful, magic hand-woven carpet.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Foxmouse.png" }, + name = "Foxmouse", + price = 750, + id = 218, + description = "{character}\n{speedboost}\n\nA 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!", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + }, { icons = { "Frostbringer.png" }, name = "Frostbringer", @@ -1698,6 +1734,16 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nThe Magic Carpet is the perfect mount for those who are too busy to take care of an animal mount or simply like to travel on a beautiful, magic hand-woven carpet.", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Magma_Skull.png" }, + name = "Magma Skull", + price = 750, + id = 220, + description = "{character}\n{speedboost}\n\nSkulls are the infernal heralds of untamed power. Bodies are obsolete when sinister forces animate your being. Embrace their presence and command the devastating might that awaits on the back of a blazing Magma Skull.", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + state = GameStore.States.STATE_NEW, + home = true, + }, { icons = { "Marsh_Toad.png" }, name = "Marsh Toad", @@ -2026,6 +2072,14 @@ GameStore.Categories = { description = "{character}\n{speedboost}\n\nIncredible strength and smartness, an irrepressible will to survive, passionately hunting in groups. If these attributes apply to your character, we have found the perfect partner for you. Have a proper look at Snow Pelt, which stands loyally by its master's side in every situation. It is time to become the leader of the wolf pack!", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, + { + icons = { "Snow_Strider.png" }, + name = "Snow Strider", + price = 870, + id = 164, + description = "{character}\n{speedboost}\n\nA magical fire burns inside these wolves. Bred as the faithful guardians for an eccentric wizard's tower, these creatures make for loyal companions during your travels. While not originally intended for riding, their sturdy frame makes the Dawn Strayer, Dusk Pryer and Snow Strider suitable mounts.", + type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, + }, { icons = { "Snowy_Owl.png" }, name = "Snowy Owl", @@ -2035,11 +2089,11 @@ GameStore.Categories = { type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, { - icons = { "Snow_Strider.png" }, - name = "Snow Strider", - price = 870, - id = 164, - description = "{character}\n{speedboost}\n\nA magical fire burns inside these wolves. Bred as the faithful guardians for an eccentric wizard's tower, these creatures make for loyal companions during your travels. While not originally intended for riding, their sturdy frame makes the Dawn Strayer, Dusk Pryer and Snow Strider suitable mounts.", + icons = { "Spirit_of_Purity.png" }, + name = "Spirit of Purity", + price = 1000, + id = 215, + description = "{character}\n{speedboost}\n\nA 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!", type = GameStore.OfferTypes.OFFER_TYPE_MOUNT, }, { diff --git a/data/modules/scripts/gamestore/init.lua b/data/modules/scripts/gamestore/init.lua index 86c2c60d4bc..81fbd421e59 100644 --- a/data/modules/scripts/gamestore/init.lua +++ b/data/modules/scripts/gamestore/init.lua @@ -438,7 +438,7 @@ function parseBuyStoreOffer(playerId, msg) -- Handled errors have a code index and unhandled errors do not local pcallOk, pcallError = pcall(function() if offer.type == GameStore.OfferTypes.OFFER_TYPE_ITEM then - GameStore.processItemPurchase(player, offer.itemtype, offer.count, offer.moveable) + GameStore.processItemPurchase(player, offer.itemtype, offer.count, offer.movable) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_POUCH then GameStore.processItemPurchase(player, offer.itemtype, offer.count) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_INSTANT_REWARD_ACCESS then @@ -446,13 +446,13 @@ function parseBuyStoreOffer(playerId, msg) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_CHARMS then GameStore.processCharmsPurchase(player) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_BLESSINGS then - GameStore.processSignleBlessingPurchase(player, offer.blessid, offer.count) + GameStore.processSingleBlessingPurchase(player, offer.blessid, offer.count) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_ALLBLESSINGS then GameStore.processAllBlessingsPurchase(player, offer.count) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_PREMIUM then GameStore.processPremiumPurchase(player, offer.id) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_STACKABLE then - GameStore.processStackablePurchase(player, offer.itemtype, offer.count, offer.name, offer.moveable) + GameStore.processStackablePurchase(player, offer.itemtype, offer.count, offer.name, offer.movable) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_HOUSE then GameStore.processHouseRelatedPurchase(player, offer) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_OUTFIT then @@ -477,7 +477,7 @@ function parseBuyStoreOffer(playerId, msg) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_TEMPLE then GameStore.processTempleTeleportPurchase(player) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_CHARGES then - GameStore.processChargesPurchase(player, offer.itemtype, offer.name, offer.charges, offer.moveable) + GameStore.processChargesPurchase(player, offer.itemtype, offer.name, offer.charges, offer.movable) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_HIRELING then local hirelingName = msg:getString() local sex = msg:getByte() @@ -1495,7 +1495,7 @@ end -- take a table {code = ..., message = ...} if the error is handled. When no code -- index is present the error is assumed to be unhandled. -function GameStore.processItemPurchase(player, offerId, offerCount, moveable) +function GameStore.processItemPurchase(player, offerId, offerCount, movable) if player:getFreeCapacity() < ItemType(offerId):getWeight(offerCount) then return error({ code = 0, message = "Please make sure you have free capacity to hold this item." }) end @@ -1504,7 +1504,7 @@ function GameStore.processItemPurchase(player, offerId, offerCount, moveable) if inbox then for t = 1, offerCount do local inboxItem = inbox:addItem(offerId, offerCount or 1) - if moveable ~= true and inboxItem then + if movable ~= true and inboxItem then inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) end end @@ -1513,7 +1513,7 @@ function GameStore.processItemPurchase(player, offerId, offerCount, moveable) end end -function GameStore.processChargesPurchase(player, itemtype, name, charges, moveable) +function GameStore.processChargesPurchase(player, itemtype, name, charges, movable) if player:getFreeCapacity() < ItemType(itemtype):getWeight(1) then return error({ code = 0, message = "Please make sure you have free capacity to hold this item." }) end @@ -1522,7 +1522,7 @@ function GameStore.processChargesPurchase(player, itemtype, name, charges, movea if inbox then local inboxItem = inbox:addItem(itemtype, charges) - if moveable ~= true and inboxItem then + if movable ~= true and inboxItem then inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) end else @@ -1530,7 +1530,7 @@ function GameStore.processChargesPurchase(player, itemtype, name, charges, movea end end -function GameStore.processSignleBlessingPurchase(player, blessId, count) +function GameStore.processSingleBlessingPurchase(player, blessId, count) player:addBlessing(blessId, count) end @@ -1563,7 +1563,7 @@ function GameStore.processPremiumPurchase(player, offerId) end end -function GameStore.processStackablePurchase(player, offerId, offerCount, offerName, moveable) +function GameStore.processStackablePurchase(player, offerId, offerCount, offerName, movable) local function isKegItem(itemId) return itemId >= ITEM_KEG_START and itemId <= ITEM_KEG_END end @@ -1599,12 +1599,12 @@ function GameStore.processStackablePurchase(player, offerId, offerCount, offerNa local kegItem = parcel:addItem(offerId, 1) kegItem:setAttribute(ITEM_ATTRIBUTE_CHARGES, pack) - if moveable ~= true and kegItem then + if movable ~= true and kegItem then kegItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) end else local parcelItem = parcel:addItem(offerId, pack) - if moveable ~= true and parcelItem then + if movable ~= true and parcelItem then parcelItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) end end @@ -1613,7 +1613,7 @@ function GameStore.processStackablePurchase(player, offerId, offerCount, offerNa end else local item = inbox:addItem(offerId, isKeg and 1 or offerCount) - if moveable ~= true and item then + if movable ~= true and item then item:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) end if item and isKeg then @@ -1645,7 +1645,7 @@ function GameStore.processHouseRelatedPurchase(player, offer) decoKit:setAttribute(ITEM_ATTRIBUTE_DATE, offer.count) end - if offer.moveable ~= true then + if offer.movable ~= true then decoKit:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) end end From 9f62539f217fe873f009812fc9bd1eaf75f2bd68 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 15:25:50 -0300 Subject: [PATCH 06/23] npc: added npc name in logs. --- data/npclib/npc.lua | 4 ++-- data/npclib/npc_system/npc_handler.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/npclib/npc.lua b/data/npclib/npc.lua index f4e8feddd96..7fbae9961de 100644 --- a/data/npclib/npc.lua +++ b/data/npclib/npc.lua @@ -54,12 +54,12 @@ end function SayEvent(npcId, playerId, messageDelayed, npcHandler, textType) local npc = Npc(npcId) if not npc then - return logger.error("[NpcHandler:say] - Npc parameter is missing, nil or not found") + return logger.error("[{} NpcHandler:say] - Npc parameter is missing, nil or not found", npc:getName()) end local player = Player(playerId) if not player then - return logger.error("[NpcHandler:say] - Player parameter is missing, nil or not found") + return logger.error("[{} NpcHandler:say] - Player parameter is missing, nil or not found", npc:getName()) end local parseInfo = { diff --git a/data/npclib/npc_system/npc_handler.lua b/data/npclib/npc_system/npc_handler.lua index 980e9d5f371..11420778e4a 100644 --- a/data/npclib/npc_system/npc_handler.lua +++ b/data/npclib/npc_system/npc_handler.lua @@ -221,7 +221,7 @@ if NpcHandler == nil then function NpcHandler:removeInteraction(npc, player) local playerId = player:getId() if Player(player) == nil then - return logger.error("[NpcHandler:removeInteraction] - Player is missing or nil") + return logger.error("[{} NpcHandler:removeInteraction] - Player is missing or nil", npc:getName()) end if self:getEventDelayedSay(playerId) then From a2e755c1e1744e9af16a32b1298cd63d9e727180 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 15:26:01 -0300 Subject: [PATCH 07/23] typo in movable: fixed typos, changed the word moveable to movable (https://grammarist.com/spelling/movable-moveable/#:~:text=Moveable%20is%20the%20older%20spelling,so%20for%20over%20a%20century.) --- data/scripts/talkactions/god/add_mounts.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/talkactions/god/add_mounts.lua b/data/scripts/talkactions/god/add_mounts.lua index 6a589327039..3de09916505 100644 --- a/data/scripts/talkactions/god/add_mounts.lua +++ b/data/scripts/talkactions/god/add_mounts.lua @@ -18,7 +18,7 @@ function mounts.onSay(player, words, param) return true end - for i = 1, 217 do + for i = 1, 221 do target:addMount(i) end From 45c73aa2bd8895eee680faf77f0a653749b238a0 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 15:37:54 -0300 Subject: [PATCH 08/23] quests: removed unnecessary spaces. broadcast: undo removed commented (Webhook.sendMessage) on broadcast, to resolve in further problems with encoding. --- .../actions/quests/feaster_of_souls/dread_maiden_lever.lua | 1 - .../actions/quests/feaster_of_souls/fear_feaster_lever.lua | 1 - .../scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua | 1 - .../scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua | 1 - .../actions/quests/grave_danger/count_vlarkorth_lever.lua | 1 - .../scripts/actions/quests/grave_danger/duke_krule_lever.lua | 1 - .../scripts/actions/quests/grave_danger/earl_osam_lever.lua | 1 - .../scripts/actions/quests/grave_danger/king_zelos_lever.lua | 1 - .../scripts/actions/quests/grave_danger/lord_azaram_lever.lua | 1 - .../scripts/actions/quests/secret_library/ghulosh_lever.lua | 1 - .../scripts/actions/quests/secret_library/gorzindel_lever.lua | 1 - .../scripts/actions/quests/secret_library/lokathmor_lever.lua | 1 - .../scripts/actions/quests/secret_library/mazzinor_lever.lua | 1 - .../actions/quests/secret_library/scourge_of_oblivion_lever.lua | 1 - .../scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua | 1 - .../scripts/actions/quests/soul_war/goshnar_greed_lever.lua | 1 - .../scripts/actions/quests/soul_war/goshnar_hatred_lever.lua | 1 - .../scripts/actions/quests/soul_war/goshnar_malice_lever.lua | 1 - .../actions/quests/soul_war/goshnar_megalomania_lever.lua | 1 - .../scripts/actions/quests/soul_war/goshnar_spite_lever.lua | 1 - .../scripts/actions/quests/the_dream_courts/lever.lua | 1 - .../actions/quests/the_dream_courts/nightmare_beast_lever.lua | 1 - data/scripts/talkactions/gm/broadcast.lua | 1 + 23 files changed, 1 insertion(+), 22 deletions(-) diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/dread_maiden_lever.lua b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/dread_maiden_lever.lua index db104351609..564c8770647 100644 --- a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/dread_maiden_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/dread_maiden_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33712, 31503, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33739, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33740, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/fear_feaster_lever.lua b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/fear_feaster_lever.lua index 2640ad97d95..af870accd41 100644 --- a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/fear_feaster_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/fear_feaster_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33711, 31469, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33734, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33735, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua index ec64dd43de2..13940be3e9a 100644 --- a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33805, 31504, 14), }, requiredLevel = 250, - timeToDefeat = 25 * 60, playerPositions = { { pos = Position(33772, 31504, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua index dbcec1c9c93..92d952503a6 100644 --- a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33708, 31539, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33736, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33737, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/count_vlarkorth_lever.lua b/data-otservbr-global/scripts/actions/quests/grave_danger/count_vlarkorth_lever.lua index ea83f2419a7..184d5fa6eca 100644 --- a/data-otservbr-global/scripts/actions/quests/grave_danger/count_vlarkorth_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/grave_danger/count_vlarkorth_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33456, 31434, 13), }, requiredLevel = 250, - playerPositions = { { pos = Position(33455, 31413, 13), teleport = Position(33454, 31445, 13), effect = CONST_ME_TELEPORT }, { pos = Position(33456, 31413, 13), teleport = Position(33454, 31445, 13), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/duke_krule_lever.lua b/data-otservbr-global/scripts/actions/quests/grave_danger/duke_krule_lever.lua index 2ab2dc6d573..11c3d36a231 100644 --- a/data-otservbr-global/scripts/actions/quests/grave_danger/duke_krule_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/grave_danger/duke_krule_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33456, 31473, 13), }, requiredLevel = 250, - playerPositions = { { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/earl_osam_lever.lua b/data-otservbr-global/scripts/actions/quests/grave_danger/earl_osam_lever.lua index db3da443500..363e3b2ba55 100644 --- a/data-otservbr-global/scripts/actions/quests/grave_danger/earl_osam_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/grave_danger/earl_osam_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33488, 31441, 13), }, requiredLevel = 250, - playerPositions = { { pos = Position(33516, 31444, 13), teleport = Position(33488, 31430, 13), effect = CONST_ME_TELEPORT }, { pos = Position(33517, 31444, 13), teleport = Position(33488, 31430, 13), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/king_zelos_lever.lua b/data-otservbr-global/scripts/actions/quests/grave_danger/king_zelos_lever.lua index fe58b304f17..aa14e575107 100644 --- a/data-otservbr-global/scripts/actions/quests/grave_danger/king_zelos_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/grave_danger/king_zelos_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33443, 31545, 13), }, requiredLevel = 250, - playerPositions = { { pos = Position(33485, 31546, 13), teleport = Position(33443, 31554, 13), effect = CONST_ME_TELEPORT }, { pos = Position(33485, 31547, 13), teleport = Position(33443, 31554, 13), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/lord_azaram_lever.lua b/data-otservbr-global/scripts/actions/quests/grave_danger/lord_azaram_lever.lua index 8baeee2a471..28a9369bc55 100644 --- a/data-otservbr-global/scripts/actions/quests/grave_danger/lord_azaram_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/grave_danger/lord_azaram_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33424, 31473, 13), }, requiredLevel = 250, - playerPositions = { { pos = Position(33422, 31493, 13), teleport = Position(33423, 31465, 13), effect = CONST_ME_TELEPORT }, { pos = Position(33423, 31493, 13), teleport = Position(33423, 31465, 13), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/ghulosh_lever.lua b/data-otservbr-global/scripts/actions/quests/secret_library/ghulosh_lever.lua index 7e7e3d57c3c..df703dc9030 100644 --- a/data-otservbr-global/scripts/actions/quests/secret_library/ghulosh_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/secret_library/ghulosh_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32756, 32720, 10), }, requiredLevel = 250, - playerPositions = { { pos = Position(32747, 32773, 10), teleport = Position(32757, 32727, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32748, 32773, 10), teleport = Position(32757, 32727, 10), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/gorzindel_lever.lua b/data-otservbr-global/scripts/actions/quests/secret_library/gorzindel_lever.lua index fe2fcd74cda..874d2411a57 100644 --- a/data-otservbr-global/scripts/actions/quests/secret_library/gorzindel_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/secret_library/gorzindel_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32687, 32715, 10), }, requiredLevel = 250, - playerPositions = { { pos = Position(32747, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32748, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/lokathmor_lever.lua b/data-otservbr-global/scripts/actions/quests/secret_library/lokathmor_lever.lua index d63560f6fca..3489b82a9c0 100644 --- a/data-otservbr-global/scripts/actions/quests/secret_library/lokathmor_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/secret_library/lokathmor_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32751, 32689, 10), }, requiredLevel = 250, - playerPositions = { { pos = Position(32721, 32749, 10), teleport = Position(32751, 32685, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32722, 32749, 10), teleport = Position(32751, 32685, 10), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/mazzinor_lever.lua b/data-otservbr-global/scripts/actions/quests/secret_library/mazzinor_lever.lua index eb7afac5509..891b4bb38d2 100644 --- a/data-otservbr-global/scripts/actions/quests/secret_library/mazzinor_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/secret_library/mazzinor_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32725, 32719, 10), }, requiredLevel = 250, - playerPositions = { { pos = Position(32721, 32773, 10), teleport = Position(32726, 32726, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32722, 32773, 10), teleport = Position(32726, 32726, 10), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/scourge_of_oblivion_lever.lua b/data-otservbr-global/scripts/actions/quests/secret_library/scourge_of_oblivion_lever.lua index 0739407172d..60d828b7822 100644 --- a/data-otservbr-global/scripts/actions/quests/secret_library/scourge_of_oblivion_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/secret_library/scourge_of_oblivion_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32726, 32727, 11), }, requiredLevel = 250, - playerPositions = { { pos = Position(32676, 32743, 11), teleport = Position(32726, 32733, 11), effect = CONST_ME_TELEPORT }, { pos = Position(32676, 32744, 11), teleport = Position(32726, 32733, 11), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua index ff8ebbadec6..2e01880589d 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33856, 31866, 7), }, requiredLevel = 250, - playerPositions = { { pos = Position(33854, 31854, 6), teleport = Position(33856, 31872, 7), effect = CONST_ME_TELEPORT }, { pos = Position(33855, 31854, 6), teleport = Position(33856, 31872, 7), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_greed_lever.lua b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_greed_lever.lua index 9283f09c06a..522cde76845 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_greed_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_greed_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33746, 31666, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33776, 31665, 14), teleport = Position(33747, 31671, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33777, 31665, 14), teleport = Position(33747, 31671, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_hatred_lever.lua b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_hatred_lever.lua index 6364779657f..963404c8d85 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_hatred_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_hatred_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33744, 31599, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33773, 31601, 14), teleport = Position(33743, 31604, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33774, 31601, 14), teleport = Position(33743, 31604, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_malice_lever.lua b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_malice_lever.lua index 5b0644bd35a..44d102ad598 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_malice_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_malice_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33710, 31599, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33679, 31599, 14), teleport = Position(33710, 31605, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33680, 31599, 14), teleport = Position(33710, 31605, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_megalomania_lever.lua b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_megalomania_lever.lua index c45d2bfdc33..5896faa74c4 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_megalomania_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_megalomania_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33710, 31634, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33676, 31634, 14), teleport = Position(33710, 31639, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33677, 31634, 14), teleport = Position(33710, 31639, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_spite_lever.lua b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_spite_lever.lua index d7687077daf..0fd2396ae03 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_spite_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_spite_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33743, 31632, 14), }, requiredLevel = 250, - playerPositions = { { pos = Position(33774, 31634, 14), teleport = Position(33742, 31639, 14), effect = CONST_ME_TELEPORT }, { pos = Position(33775, 31634, 14), teleport = Position(33742, 31639, 14), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/the_dream_courts/lever.lua b/data-otservbr-global/scripts/actions/quests/the_dream_courts/lever.lua index 606b2b30b04..75dcc91bbb9 100644 --- a/data-otservbr-global/scripts/actions/quests/the_dream_courts/lever.lua +++ b/data-otservbr-global/scripts/actions/quests/the_dream_courts/lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(33617, 32561, 13), }, requiredLevel = 250, - timeToDefeat = 15 * 60, playerPositions = { { pos = Position(33638, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, diff --git a/data-otservbr-global/scripts/actions/quests/the_dream_courts/nightmare_beast_lever.lua b/data-otservbr-global/scripts/actions/quests/the_dream_courts/nightmare_beast_lever.lua index fc47fe72006..cde19598da3 100644 --- a/data-otservbr-global/scripts/actions/quests/the_dream_courts/nightmare_beast_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/the_dream_courts/nightmare_beast_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32208, 32046, 15), }, requiredLevel = 250, - playerPositions = { { pos = Position(32212, 32070, 15), teleport = Position(32208, 32052, 15), effect = CONST_ME_TELEPORT }, { pos = Position(32210, 32070, 15), teleport = Position(32208, 32052, 15), effect = CONST_ME_TELEPORT }, diff --git a/data/scripts/talkactions/gm/broadcast.lua b/data/scripts/talkactions/gm/broadcast.lua index 503462e4f6f..2362a8e0ad5 100644 --- a/data/scripts/talkactions/gm/broadcast.lua +++ b/data/scripts/talkactions/gm/broadcast.lua @@ -11,6 +11,7 @@ function broadcast.onSay(player, words, param) local text = player:getName() .. " broadcasted: " .. param logger.info(text) + --Webhook.sendMessage("Broadcast", text, WEBHOOK_COLOR_WARNING, announcementChannels["serverAnnouncements"]) for _, targetPlayer in ipairs(Game.getPlayers()) do targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST) end From d79d7041d9437c2b4c64edcd84613488a088dd65 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 15:38:31 -0300 Subject: [PATCH 09/23] adjusted scripts. --- .../scripts/globalevents/vip/online_coins.lua | 2 +- .../globalevents/vip/online_tokens.lua | 2 +- .../gm/teleport_set_destination.lua | 34 ++++++++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/data-otservbr-global/scripts/globalevents/vip/online_coins.lua b/data-otservbr-global/scripts/globalevents/vip/online_coins.lua index 074df6d6be3..59ae6cb08de 100644 --- a/data-otservbr-global/scripts/globalevents/vip/online_coins.lua +++ b/data-otservbr-global/scripts/globalevents/vip/online_coins.lua @@ -31,7 +31,7 @@ function onlineCoinsEvent.onThink(interval) local checkIp = {} for _, player in pairs(players) do - if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then + if player:getGroup():getId() >= GROUP_TYPE_SENIORTUTOR then goto continue end diff --git a/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua b/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua index 8733f4fa0d3..55db572e385 100644 --- a/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua +++ b/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua @@ -32,7 +32,7 @@ function onlineTokensEvent.onThink(interval) local checkIp = {} for _, player in pairs(players) do - if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then + if player:getGroup():getId() >= GROUP_TYPE_SENIORTUTOR then goto continue end diff --git a/data/scripts/talkactions/gm/teleport_set_destination.lua b/data/scripts/talkactions/gm/teleport_set_destination.lua index cc1520db08e..62e8d12ffc7 100644 --- a/data/scripts/talkactions/gm/teleport_set_destination.lua +++ b/data/scripts/talkactions/gm/teleport_set_destination.lua @@ -1,38 +1,32 @@ -- Script for set teleport destination -- /teleport xxxx, xxxx, x -local teleportSetDestination = TalkAction("/teleport") +local teleportSetDestination = TalkAction("/teleport", "/tp") function teleportSetDestination.onSay(player, words, param) -- create log logCommand(player, words, param) if param == "" then - player:sendCancelMessage("Teleport position required.") + player:sendCancelMessage("Command param required.") return true end - local position = player:getPosition() - position:getNextPosition(player:getDirection(), 1) - local tile = Tile(position) - local teleport = tile and tile:getItemByType(ITEM_TYPE_TELEPORT) - if teleport then - local split = param:split(",") -- Split always return a table, even if it's empty - if #split ~= 3 then - player:sendCancelMessage('You need to declare the X, Y of Z of destination. Please use "/teleport X, Y, Z".') - return true - else - local destPosition = Position(split[1], split[2], split[3]) - if destPosition and destPosition:getTile() then - teleport:setDestination(destPosition) + local params = param:split(",") + if params[3] then + local position = player:getPosition() + position:getNextPosition(player:getDirection(), 1) + local destination = Position(params[1], params[2], params[3]) + if destination and destination:getTile() then + local tp = Game.createItem(35502, 1, position) + if tp then + tp:setDestination(destination) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("New position: %s", param)) - else - player:sendCancelMessage("Destination position is not valid.") - return true end + else + player:sendCancelMessage("Destination position is not valid.") end else - player:sendCancelMessage("The item is not a teleport type") - return true + player:sendCancelMessage('You need to declare the X, Y of Z of destination. Please use "/teleport X, Y, Z".') end return true end From ebd39c5b764532e9ebbd091822d4b9bc353254f6 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 16 Nov 2023 16:38:29 -0300 Subject: [PATCH 10/23] reward: added message on reward item. --- data/scripts/talkactions/player/reward.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/data/scripts/talkactions/player/reward.lua b/data/scripts/talkactions/player/reward.lua index 8a2e89930f8..b6c882eb9a2 100644 --- a/data/scripts/talkactions/player/reward.lua +++ b/data/scripts/talkactions/player/reward.lua @@ -30,6 +30,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))) else player:sendTextMessage(MESSAGE_LOOK, "You need to have capacity and empty slots to receive.") return From f35a3b53fa36d58f1a5ed01f4f836b62dfddb274 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sun, 19 Nov 2023 06:52:34 -0300 Subject: [PATCH 11/23] player.lua: removed unused function. ferumbras_lever: fixed script and your summons creation. soul war mount: created function to gives to the player the mount. otservbr-custom-zones.xml: added to repository. --- .../bosses/ferumbras_soul_splinter.lua | 4 +- .../ferumbras_ascendant/ferumbras_essence.lua | 12 ++++-- .../megasylvan_yselda_lever.lua | 1 - .../ferumbras_ascendant/ferumbras_lever.lua | 43 +++++++------------ .../quests/soul_war/reward_soul_war.lua | 35 +++++++++++++++ .../ferumbras_ascendant/bosses_kill.lua | 2 +- .../ferumbras_mortal_shell_death.lua | 7 ++- .../ferumbras_soul_splinter.lua | 15 ++++--- .../rift_invader_death.lua | 16 +++++-- .../quests/ferumbras_ascendant/vortex.lua | 8 ++-- .../world/custom/otservbr-custom-zones.xml | 2 + .../world/otservbr-monster.xml | 15 ------- data/libs/functions/player.lua | 22 ---------- 13 files changed, 97 insertions(+), 85 deletions(-) create mode 100644 data-otservbr-global/world/custom/otservbr-custom-zones.xml diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_soul_splinter.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_soul_splinter.lua index 8c95fb9cb89..91b329140a0 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_soul_splinter.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_soul_splinter.lua @@ -38,7 +38,7 @@ monster.flags = { hostile = true, convinceable = false, pushable = false, - rewardBoss = true, + rewardBoss = false, illusionable = false, canPushItems = true, canPushCreatures = true, @@ -53,7 +53,7 @@ monster.flags = { } monster.events = { - "FerumbrasSoulSplinter", + "FerumbrasSoulSplinterDeath", } monster.light = { diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/ferumbras_essence.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/ferumbras_essence.lua index c6ebbfd4321..973fa02afea 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/ferumbras_essence.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/ferumbras_essence.lua @@ -1,7 +1,7 @@ local mType = Game.createMonsterType("Ferumbras Essence") local monster = {} -monster.description = " ferumbras essence" +monster.description = "ferumbras essence" monster.experience = 0 monster.outfit = { lookType = 294, @@ -13,8 +13,12 @@ monster.outfit = { lookMount = 0, } -monster.health = 115 -monster.maxHealth = 115 +monster.events = { + "FerumbrasEssenceImmortal", +} + +monster.health = 35000 +monster.maxHealth = 35000 monster.race = "undead" monster.corpse = 9591 monster.speed = 100 @@ -38,7 +42,7 @@ monster.flags = { hostile = true, convinceable = false, pushable = false, - rewardBoss = true, + rewardBoss = false, illusionable = false, canPushItems = true, canPushCreatures = false, diff --git a/data-otservbr-global/scripts/actions/quests/adventures_of_galthen/megasylvan_yselda_lever.lua b/data-otservbr-global/scripts/actions/quests/adventures_of_galthen/megasylvan_yselda_lever.lua index 098630b3965..0c4f9542360 100644 --- a/data-otservbr-global/scripts/actions/quests/adventures_of_galthen/megasylvan_yselda_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/adventures_of_galthen/megasylvan_yselda_lever.lua @@ -4,7 +4,6 @@ local config = { position = Position(32619, 32493, 12), }, requiredLevel = 250, - playerPositions = { { pos = Position(32578, 32500, 12), teleport = Position(32619, 32498, 12) }, { pos = Position(32578, 32501, 12), teleport = Position(32619, 32498, 12) }, diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua index 674d6d77e4e..b374fb6435d 100644 --- a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua @@ -1,30 +1,20 @@ -local config = { +AscendingFerumbrasConfig = { bossName = "Ascending Ferumbras", summonName = "Rift Invader", + maxSummon = 15, + leverPos = Position(33270, 31477, 14), bossPos = Position(33392, 31473, 14), centerRoom = Position(33392, 31473, 14), -- Center Room exitPosition = Position(33266, 31479, 14), -- Exit Position newPos = Position(33392, 31479, 14), -- Player Position on room - playerPositions = { - Position(33269, 31477, 14), - Position(33269, 31478, 14), - Position(33269, 31479, 14), - Position(33269, 31480, 14), - Position(33269, 31481, 14), - Position(33270, 31477, 14), - Position(33270, 31478, 14), - Position(33270, 31479, 14), - Position(33270, 31480, 14), - Position(33270, 31481, 14), - Position(33271, 31477, 14), - Position(33271, 31478, 14), - Position(33271, 31479, 14), - Position(33271, 31480, 14), - Position(33271, 31481, 14), - }, + days = 14, range = 20, - time = 30, -- time in minutes to remove the player + time = 60, -- time in minutes to remove the player + vortex = 20121 } + +local config = AscendingFerumbrasConfig + local function clearFerumbrasRoom() local spectators = Game.getSpectators(config.bossPos, false, false, 20, 20, 20, 20) for i = 1, #spectators do @@ -42,7 +32,7 @@ end local ferumbrasAscendantLever = Action() function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 8911 then - if player:getPosition() ~= Position(33270, 31477, 14) then + if player:getPosition() ~= config.leverPos then return true end @@ -51,7 +41,7 @@ function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPos local playerTile = Tile(Position(x, y, 14)):getTopCreature() if playerTile and playerTile:isPlayer() then if not playerTile:canFightBoss("Ferumbras Mortal Shell") then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You or a member in your team have to wait 5 days to face Ferumbras again!") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You or a member in your team have to wait %d days to face Ferumbras again!", config.days)) item:transform(8912) return true end @@ -83,16 +73,15 @@ function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPos playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) playerTile:teleportTo(config.newPos) playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - playerTile:setBossCooldown("Ferumbras Mortal Shell", os.time() + 280 * 60 * 3600) -- 14 days - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.") - addEvent(clearFerumbrasRoom, 60 * config.time * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition) + playerTile:setBossCooldown("Ferumbras Mortal Shell", os.time() + config.days * 24 * 3600) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", config.time)) + addEvent(clearFerumbrasRoom, config.time * 60 * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition) - for b = 1, 10 do + for b = 1, config.maxSummon do local xrand = math.random(-10, 10) local yrand = math.random(-10, 10) local position = Position(33392 + xrand, 31473 + yrand, 14) - if Game.createMonster("rift invader", position) then - end + Game.createMonster(config.summonName, position) end Game.createMonster(config.bossName, config.bossPos, true, true) diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/reward_soul_war.lua b/data-otservbr-global/scripts/actions/quests/soul_war/reward_soul_war.lua index 2ab572b9376..1e3c9c773e0 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/reward_soul_war.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/reward_soul_war.lua @@ -52,3 +52,38 @@ end rewardSoulWar:position({ x = 33620, y = 31400, z = 10 }) rewardSoulWar:register() + +----------------------------- +-- Phantasmal Jade Mount function + +local phantasmalJadeMount = Action() +function phantasmalJadeMount.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local storage = Storage.Quest.U12_40.SoulWar.MountReward + if player:getStorageValue(storage) == 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have Phantasmal Jade mount!") + return false + end + + if table.contains({ 34072, 34073, 34074 }, item.itemid) then + -- check items + if player:getItemCount(34072) >= 4 and player:getItemCount(34073) == 1 and player:getItemCount(34074) == 1 then + player:removeItem(34072, 4) + player:removeItem(34073, 1) + player:removeItem(34074, 1) + player:addMount(167) + player:setStorageValue(storage, 1) + player:addAchievement("You got Horse Power") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! You won Phantasmal Jade mount.") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! You won You got Horse Power achievement.") + player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE) + return true + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't have the necessary items!") + player:getPosition():sendMagicEffect(CONST_ME_POFF) + return false + end + end +end + +phantasmalJadeMount:id(34072, 34073, 34074) +phantasmalJadeMount:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua index f141f4f5089..5d81cf2f22c 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua @@ -49,7 +49,7 @@ function ascendantBossesKill.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) if creature:getName():lower() == "ferumbras mortal shell" then - player:setBossCooldown(creature:getName(), os.time() + 60 * 60 * 14 * 24) + player:setBossCooldown(creature:getName(), os.time() + AscendingFerumbrasConfig.days * 24 * 3600) elseif creature:getName():lower() == "the lord of the lice" then player:setStorageValue(Storage.FerumbrasAscension.TheLordOfTheLiceAccess, 1) end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_mortal_shell_death.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_mortal_shell_death.lua index 9add0b883ff..877e987ac02 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_mortal_shell_death.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_mortal_shell_death.lua @@ -1,15 +1,18 @@ local ferumbrasMortalShell = CreatureEvent("FerumbrasMortalShell") + +local config = AscendingFerumbrasConfig + function ferumbrasMortalShell.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) if creature:getName():lower() ~= "destabilized ferumbras" then return true end - local monster = Game.createMonster("Ferumbras Mortal Shell", Position(33392, 31473, 14), true, true) + local monster = Game.createMonster("Ferumbras Mortal Shell", config.bossPos, true, true) if not monster then return true end monster:say("AAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHH!", TALKTYPE_MONSTER_SAY) - lasthitkiller:say("FINALY YOU FORCED FERUMBRAS BACK INTO A MORTAL FORM - HE IS NOT AMUSED!", TALKTYPE_MONSTER_SAY, nil, nil, Position(33392, 31475, 14)) + lasthitkiller:say("FINALY YOU FORCED FERUMBRAS BACK INTO A MORTAL FORM - HE IS NOT AMUSED!", TALKTYPE_MONSTER_SAY, nil, nil, config.bossPos) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua index 73238b09b03..81582993ef1 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua @@ -1,10 +1,15 @@ -local ferumbrasSoulSplinter = CreatureEvent("FerumbrasSoulSplinter") +local ferumbrasSoulSplinter = CreatureEvent("FerumbrasSoulSplinterDeath") + function ferumbrasSoulSplinter.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) - local monster = Game.createMonster("ferumbras essence", creature:getPosition(), true, true) - if not monster then - return true - end + Game.createMonster("ferumbras essence", creature:getPosition(), true, true) return true end ferumbrasSoulSplinter:register() + +local ferumbrasEssenceImmortal = CreatureEvent("FerumbrasEssenceImmortal") +function ferumbrasEssenceImmortal.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) + return 0, 0, 0, 0 +end + +ferumbrasEssenceImmortal:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua index 29eb15c99df..18042d9dc11 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua @@ -9,6 +9,8 @@ local crystals = { [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 }, } +local config = AscendingFerumbrasConfig + local riftInvaderDeath = CreatureEvent("RiftInvaderDeath") function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) local pos = Position(33392 + math.random(-10, 10), 31473 + math.random(-10, 10), 14) @@ -30,7 +32,7 @@ function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekil Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) + 1) end if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) == 8 then - local creature = Tile(Position(33392, 31473, 14)):getTopCreature() + local creature = Tile(config.bossPos):getTopCreature() creature:say("NOOOOOOOOOOO!", TALKTYPE_MONSTER_YELL) creature:say("FERUMBRAS BURSTS INTO SOUL SPLINTERS!", TALKTYPE_MONSTER_YELL, nil, nil, Position(33392, 31475, 14)) creature:remove() @@ -46,12 +48,20 @@ function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekil end end - local vortex = Game.createItem(22455, 1, creature:getPosition()) + local tilePool = Tile(creature:getPosition()) + if tilePool then + local pool = tilePool:getItemById(2886) + if pool then + pool:remove() + end + end + + local vortex = Game.createItem(config.vortex, 1, creature:getPosition()) if vortex then addEvent(function(pos) local tile = Tile(pos) if tile then - local vortexItem = tile:getItemById(22455) + local vortexItem = tile:getItemById(config.vortex) if vortexItem then vortexItem:remove(1) end diff --git a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua index 2c74fc917dd..eaa838cd8e1 100644 --- a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua +++ b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua @@ -1,5 +1,7 @@ local vortex = MoveEvent() +local config = AscendingFerumbrasConfig + function vortex.onStepIn(creature, item, position, fromPosition) local monster = creature:getMonster() if not monster or monster:getName():lower() ~= "ferumbras essence" then @@ -10,8 +12,8 @@ function vortex.onStepIn(creature, item, position, fromPosition) position:sendMagicEffect(CONST_ME_POFF) Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence) + 1) if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence) >= 8 then - Game.createMonster("Destabilized Ferumbras", Position(33392, 31473, 14), true, true) - for i = 1, 20 do + Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true) + for i = 1, config.maxSummon do Game.createMonster("Rift Fragment", Position(math.random(33381, 33403), math.random(31462, 31483), 14), true, true) end end @@ -19,5 +21,5 @@ function vortex.onStepIn(creature, item, position, fromPosition) end vortex:type("stepin") -vortex:id(20121) +vortex:id(config.vortex) vortex:register() diff --git a/data-otservbr-global/world/custom/otservbr-custom-zones.xml b/data-otservbr-global/world/custom/otservbr-custom-zones.xml new file mode 100644 index 00000000000..a9224bd3c2d --- /dev/null +++ b/data-otservbr-global/world/custom/otservbr-custom-zones.xml @@ -0,0 +1,2 @@ + + diff --git a/data-otservbr-global/world/otservbr-monster.xml b/data-otservbr-global/world/otservbr-monster.xml index 493d167b02b..bc326a9fb21 100644 --- a/data-otservbr-global/world/otservbr-monster.xml +++ b/data-otservbr-global/world/otservbr-monster.xml @@ -161325,11 +161325,6 @@ - - - - - @@ -161398,9 +161393,6 @@ - - - @@ -161443,10 +161435,6 @@ - - - - @@ -161583,13 +161571,10 @@ - - - diff --git a/data/libs/functions/player.lua b/data/libs/functions/player.lua index c2bdde967f6..ba7167539f8 100644 --- a/data/libs/functions/player.lua +++ b/data/libs/functions/player.lua @@ -554,28 +554,6 @@ function Player.updateHazard(self) return true end -function Player:addItemStoreInbox(itemId, amount, moveable) - local inbox = self:getSlotItem(CONST_SLOT_STORE_INBOX) - if not moveable then - for _, item in pairs(inbox:getItems()) do - if item:getId() == itemId then - item:removeAttribute(ITEM_ATTRIBUTE_STORE) - end - end - end - - local newItem = inbox:addItem(itemId, amount, INDEX_WHEREEVER, FLAG_NOLIMIT) - - if not moveable then - for _, item in pairs(inbox:getItems()) do - if item:getId() == itemId then - item:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) - end - end - end - return newItem -end - ---@param monster Monster ---@return {factor: number, msgSuffix: string} function Player:calculateLootFactor(monster) From db0f01caced61c2455d1f80bd8f811cffeacee63 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 19 Nov 2023 12:03:12 +0000 Subject: [PATCH 12/23] Lua code format - (Stylua) --- .../actions/quests/ferumbras_ascendant/ferumbras_lever.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua index b374fb6435d..f774f861e53 100644 --- a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua @@ -10,7 +10,7 @@ AscendingFerumbrasConfig = { days = 14, range = 20, time = 60, -- time in minutes to remove the player - vortex = 20121 + vortex = 20121, } local config = AscendingFerumbrasConfig From cb91876332b2a42515b4abb8d18437782312d558 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 21 Nov 2023 10:39:41 -0300 Subject: [PATCH 13/23] Implemented luan review. Co-authored-by: Luan Santos --- data/scripts/talkactions/gm/broadcast.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/talkactions/gm/broadcast.lua b/data/scripts/talkactions/gm/broadcast.lua index 2362a8e0ad5..ca8171e3635 100644 --- a/data/scripts/talkactions/gm/broadcast.lua +++ b/data/scripts/talkactions/gm/broadcast.lua @@ -11,7 +11,7 @@ function broadcast.onSay(player, words, param) local text = player:getName() .. " broadcasted: " .. param logger.info(text) - --Webhook.sendMessage("Broadcast", text, WEBHOOK_COLOR_WARNING, announcementChannels["serverAnnouncements"]) + Webhook.sendMessage("Broadcast", text, WEBHOOK_COLOR_WARNING, announcementChannels["serverAnnouncements"]) for _, targetPlayer in ipairs(Game.getPlayers()) do targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST) end From 5e2f9af4bc5b2af11388bdac238c2d3f164a9b45 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 24 Nov 2023 10:09:45 -0300 Subject: [PATCH 14/23] set parameter boss position in checkBoss functions. --- data-otservbr-global/scripts/globalevents/spawn/mawhawk.lua | 2 +- data-otservbr-global/scripts/globalevents/spawn/tyrn.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/scripts/globalevents/spawn/mawhawk.lua b/data-otservbr-global/scripts/globalevents/spawn/mawhawk.lua index 36817060264..e34657d211c 100644 --- a/data-otservbr-global/scripts/globalevents/spawn/mawhawk.lua +++ b/data-otservbr-global/scripts/globalevents/spawn/mawhawk.lua @@ -8,7 +8,7 @@ local config = { local mawhawk = GlobalEvent("mawhawk") function mawhawk.onThink(interval, lastExecution) - if not checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName) then + if not checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition) then addEvent(Game.broadcastMessage, 150, "Beware! Mawhawk!", MESSAGE_EVENT_ADVANCE) end return true diff --git a/data-otservbr-global/scripts/globalevents/spawn/tyrn.lua b/data-otservbr-global/scripts/globalevents/spawn/tyrn.lua index 79959d1a28d..47e7756f2ba 100644 --- a/data-otservbr-global/scripts/globalevents/spawn/tyrn.lua +++ b/data-otservbr-global/scripts/globalevents/spawn/tyrn.lua @@ -8,7 +8,7 @@ local config = { local tyrn = GlobalEvent("tyrn") function tyrn.onThink(interval, lastExecution) - if not checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName) then + if not checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition) then addEvent(Game.broadcastMessage, 150, "Beware of Tyrn!", MESSAGE_EVENT_ADVANCE) end return true From c9611711e37c257bc5c5fcf61ad028a3255fe00a Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 24 Nov 2023 11:57:15 -0300 Subject: [PATCH 15/23] ferumbra ascendant quest: fixes. --- .../quests/ferumbras_ascendant/rift_invader_death.lua | 4 ++-- .../scripts/movements/quests/ferumbras_ascendant/seal.lua | 3 ++- .../scripts/movements/quests/ferumbras_ascendant/vortex.lua | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua index 18042d9dc11..ae000aaf097 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/rift_invader_death.lua @@ -58,8 +58,8 @@ function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekil local vortex = Game.createItem(config.vortex, 1, creature:getPosition()) if vortex then - addEvent(function(pos) - local tile = Tile(pos) + addEvent(function(creaturePos) + local tile = Tile(creaturePos) if tile then local vortexItem = tile:getItemById(config.vortex) if vortexItem then diff --git a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/seal.lua b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/seal.lua index 1d7d88a9d0c..f8727da061e 100644 --- a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/seal.lua +++ b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/seal.lua @@ -98,7 +98,8 @@ function seal.onStepIn(creature, item, position, fromPosition) player:teleportTo(setting.toPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) elseif item.actionid == 24846 then - player:say("You cannot enter, you must wait fourteen days after preventing the ascension of Ferumbras.", TALKTYPE_MONSTER_SAY) + local days = AscendingFerumbrasConfig.days + player:say("You cannot enter, you must wait " .. days .. " days after preventing the ascension of Ferumbras.", TALKTYPE_MONSTER_SAY) else player:teleportTo(setting.backPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) diff --git a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua index eaa838cd8e1..237f2452021 100644 --- a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua +++ b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua @@ -21,5 +21,5 @@ function vortex.onStepIn(creature, item, position, fromPosition) end vortex:type("stepin") -vortex:id(config.vortex) +vortex:id(23482) vortex:register() From caf1d8c37d9ab6e22d703af3627c80c58e9ec242 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sat, 25 Nov 2023 09:10:21 -0300 Subject: [PATCH 16/23] Edu suggestion. Co-authored-by: Eduardo Dantas --- .../actions/quests/ferumbras_ascendant/ferumbras_lever.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua index f774f861e53..7d8f9706a8f 100644 --- a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua @@ -81,7 +81,9 @@ function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPos local xrand = math.random(-10, 10) local yrand = math.random(-10, 10) local position = Position(33392 + xrand, 31473 + yrand, 14) - Game.createMonster(config.summonName, position) + if not Game.createMonster(config.summonName, position) then + logger.error("[ferumbrasAscendantLever.onUse] can't create monster {}, on position {}", config.summonName, position:toString()) + end end Game.createMonster(config.bossName, config.bossPos, true, true) From c3576a505d461121150ebc48d238d9e5fd444abf Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sat, 25 Nov 2023 09:10:32 -0300 Subject: [PATCH 17/23] Edu suggestion. Co-authored-by: Eduardo Dantas --- data-otservbr-global/scripts/globalevents/vip/online_tokens.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua b/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua index 55db572e385..4cde5ae926d 100644 --- a/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua +++ b/data-otservbr-global/scripts/globalevents/vip/online_tokens.lua @@ -32,7 +32,7 @@ function onlineTokensEvent.onThink(interval) local checkIp = {} for _, player in pairs(players) do - if player:getGroup():getId() >= GROUP_TYPE_SENIORTUTOR then + if player:getGroup():getId() > GROUP_TYPE_SENIORTUTOR then goto continue end From 0edd09adf075d30ba239ad2003a7103ecd4a7d29 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sat, 25 Nov 2023 09:10:57 -0300 Subject: [PATCH 18/23] Edu suggestion. Co-authored-by: Eduardo Dantas --- .../quests/ferumbras_ascendant/ferumbras_soul_splinter.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua index 81582993ef1..cfcf638251c 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/ferumbras_soul_splinter.lua @@ -1,7 +1,11 @@ local ferumbrasSoulSplinter = CreatureEvent("FerumbrasSoulSplinterDeath") function ferumbrasSoulSplinter.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) - Game.createMonster("ferumbras essence", creature:getPosition(), true, true) + local monster = Game.createMonster("ferumbras essence", creature:getPosition(), true, true) + if not monster then + logger.error("[ferumbrasSoulSplinter.onDeath] cannot create monster on position {}", creature:getPosition():toString()) + return true + end return true end From e6017d1e02ccec3a30956485e5cbff83ac323124 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sat, 25 Nov 2023 09:16:14 -0300 Subject: [PATCH 19/23] Re-added function. Moved global config to a register lib. --- .../ferumbras_ascendant/ferumbras_lever.lua | 15 ------------- .../register_ascending_ferumbras_configs.lua | 14 ++++++++++++ data/libs/functions/player.lua | 22 +++++++++++++++++++ 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua index 7d8f9706a8f..c259b308c0b 100644 --- a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ferumbras_lever.lua @@ -1,18 +1,3 @@ -AscendingFerumbrasConfig = { - bossName = "Ascending Ferumbras", - summonName = "Rift Invader", - maxSummon = 15, - leverPos = Position(33270, 31477, 14), - bossPos = Position(33392, 31473, 14), - centerRoom = Position(33392, 31473, 14), -- Center Room - exitPosition = Position(33266, 31479, 14), -- Exit Position - newPos = Position(33392, 31479, 14), -- Player Position on room - days = 14, - range = 20, - time = 60, -- time in minutes to remove the player - vortex = 20121, -} - local config = AscendingFerumbrasConfig local function clearFerumbrasRoom() diff --git a/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua b/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua new file mode 100644 index 00000000000..eef71a4e85a --- /dev/null +++ b/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua @@ -0,0 +1,14 @@ +AscendingFerumbrasConfig = { + bossName = "Ascending Ferumbras", + summonName = "Rift Invader", + maxSummon = 15, + leverPos = Position(33270, 31477, 14), + bossPos = Position(33392, 31473, 14), + centerRoom = Position(33392, 31473, 14), -- Center Room + exitPosition = Position(33266, 31479, 14), -- Exit Position + newPos = Position(33392, 31479, 14), -- Player Position on room + days = 3, + range = 20, + time = 60, -- time in minutes to remove the player + vortex = 23482 +} diff --git a/data/libs/functions/player.lua b/data/libs/functions/player.lua index 12392e7e6cf..90565679a12 100644 --- a/data/libs/functions/player.lua +++ b/data/libs/functions/player.lua @@ -554,6 +554,28 @@ function Player.updateHazard(self) return true end +function Player:addItemStoreInbox(itemId, amount, moveable) + local inbox = self:getSlotItem(CONST_SLOT_STORE_INBOX) + if not moveable then + for _, item in pairs(inbox:getItems()) do + if item:getId() == itemId then + item:removeAttribute(ITEM_ATTRIBUTE_STORE) + end + end + end + + local newItem = inbox:addItem(itemId, amount, INDEX_WHEREEVER, FLAG_NOLIMIT) + + if not moveable then + for _, item in pairs(inbox:getItems()) do + if item:getId() == itemId then + item:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) + end + end + end + return newItem +end + ---@param monster Monster ---@return {factor: number, msgSuffix: string} function Player:calculateLootFactor(monster) From 3f57f48b163f912226d492cca02b2afa45e81379 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sat, 25 Nov 2023 09:16:55 -0300 Subject: [PATCH 20/23] Fix vortex. --- .../scripts/movements/quests/ferumbras_ascendant/vortex.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua index 237f2452021..eaa838cd8e1 100644 --- a/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua +++ b/data-otservbr-global/scripts/movements/quests/ferumbras_ascendant/vortex.lua @@ -21,5 +21,5 @@ function vortex.onStepIn(creature, item, position, fromPosition) end vortex:type("stepin") -vortex:id(23482) +vortex:id(config.vortex) vortex:register() From 138343740da68ac5033459eaceb0f228e1b1b04f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 25 Nov 2023 12:19:46 +0000 Subject: [PATCH 21/23] Lua code format - (Stylua) --- .../scripts/lib/register_ascending_ferumbras_configs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua b/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua index eef71a4e85a..ce8ad6a02b8 100644 --- a/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua +++ b/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua @@ -10,5 +10,5 @@ AscendingFerumbrasConfig = { days = 3, range = 20, time = 60, -- time in minutes to remove the player - vortex = 23482 + vortex = 23482, } From 49532c5d63ab368577e655342f528b4176a563aa Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Tue, 28 Nov 2023 04:30:03 -0300 Subject: [PATCH 22/23] fix: wrong condition --- data-otservbr-global/scripts/globalevents/vip/online_coins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/globalevents/vip/online_coins.lua b/data-otservbr-global/scripts/globalevents/vip/online_coins.lua index 59ae6cb08de..bbd4e98f9d7 100644 --- a/data-otservbr-global/scripts/globalevents/vip/online_coins.lua +++ b/data-otservbr-global/scripts/globalevents/vip/online_coins.lua @@ -31,7 +31,7 @@ function onlineCoinsEvent.onThink(interval) local checkIp = {} for _, player in pairs(players) do - if player:getGroup():getId() >= GROUP_TYPE_SENIORTUTOR then + if player:getGroup():getId() > GROUP_TYPE_SENIORTUTOR then goto continue end From a761a9b1b5379280e71d35f5917ef2b6399558ed Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Tue, 28 Nov 2023 04:34:50 -0300 Subject: [PATCH 23/23] fix: final changes --- ...ending_ferumbras_configs.lua => register_lever_tables.lua} | 0 data/npclib/npc.lua | 4 ++-- data/npclib/npc_system/npc_handler.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename data-otservbr-global/scripts/lib/{register_ascending_ferumbras_configs.lua => register_lever_tables.lua} (100%) diff --git a/data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua b/data-otservbr-global/scripts/lib/register_lever_tables.lua similarity index 100% rename from data-otservbr-global/scripts/lib/register_ascending_ferumbras_configs.lua rename to data-otservbr-global/scripts/lib/register_lever_tables.lua diff --git a/data/npclib/npc.lua b/data/npclib/npc.lua index 7fbae9961de..5ca017e1f73 100644 --- a/data/npclib/npc.lua +++ b/data/npclib/npc.lua @@ -54,12 +54,12 @@ end function SayEvent(npcId, playerId, messageDelayed, npcHandler, textType) local npc = Npc(npcId) if not npc then - return logger.error("[{} NpcHandler:say] - Npc parameter is missing, nil or not found", npc:getName()) + return logger.error("[NpcHandler:say] - Npc parameter for npc '{}' is missing, nil or not found", npc:getName()) end local player = Player(playerId) if not player then - return logger.error("[{} NpcHandler:say] - Player parameter is missing, nil or not found", npc:getName()) + return logger.error("[NpcHandler:say] - Player parameter for npc '{}' is missing, nil or not found", npc:getName()) end local parseInfo = { diff --git a/data/npclib/npc_system/npc_handler.lua b/data/npclib/npc_system/npc_handler.lua index 11420778e4a..27b941366ee 100644 --- a/data/npclib/npc_system/npc_handler.lua +++ b/data/npclib/npc_system/npc_handler.lua @@ -221,7 +221,7 @@ if NpcHandler == nil then function NpcHandler:removeInteraction(npc, player) local playerId = player:getId() if Player(player) == nil then - return logger.error("[{} NpcHandler:removeInteraction] - Player is missing or nil", npc:getName()) + return logger.error("[NpcHandler:removeInteraction] - Player parameter for npc '{}' is missing or nil", npc:getName()) end if self:getEventDelayedSay(playerId) then