From aa797ff039774752951ca5284e434ccb31b2d1e7 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 19 Feb 2024 17:31:09 -0300 Subject: [PATCH 1/9] refactor: script improvements and remove unused config (#2242) --- config.lua.dist | 2 - .../others/spawns_npc_by_time.lua | 69 ------------------- .../event-raven_herb_bush.lua | 69 +++++++------------ .../world_changes/spawns_npc_by_time.lua | 30 ++++++++ src/config/config_enums.hpp | 1 - src/config/configmanager.cpp | 1 - 6 files changed, 56 insertions(+), 116 deletions(-) delete mode 100644 data-otservbr-global/scripts/globalevents/others/spawns_npc_by_time.lua create mode 100644 data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua diff --git a/config.lua.dist b/config.lua.dist index e5188d15b65..6831b799152 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -226,7 +226,6 @@ onlyPremiumAccount = false -- Customs -- NOTE: weatherRain = true, activates weather raining effects -- NOTE: thunderEffect = true, activates thunder effects --- NOTE: allConsoleLog = true, show all message logs -- NOTE: stashMoving = true, stow an container inside your stash -- NOTE: depotChest, the non-stackable items will be moved to the selected depot chest(I - XVIII). -- NOTE: autoBank = true, the dropped coins from monsters will be automatically deposited to your bank account. @@ -241,7 +240,6 @@ onlyPremiumAccount = false -- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt weatherRain = false thunderEffect = false -allConsoleLog = false stashMoving = false depotChest = 4 autoLoot = false diff --git a/data-otservbr-global/scripts/globalevents/others/spawns_npc_by_time.lua b/data-otservbr-global/scripts/globalevents/others/spawns_npc_by_time.lua deleted file mode 100644 index 060c4277be0..00000000000 --- a/data-otservbr-global/scripts/globalevents/others/spawns_npc_by_time.lua +++ /dev/null @@ -1,69 +0,0 @@ --- enum LightState_t --- LIGHT_STATE_DAY, --- LIGHT_STATE_NIGHT, --- LIGHT_STATE_SUNSET, --- LIGHT_STATE_SUNRISE, -local periods = { - [LIGHT_STATE_NIGHT] = "Night", - [LIGHT_STATE_DAY] = "Day", - [LIGHT_STATE_SUNRISE] = "Sunrise", - [LIGHT_STATE_SUNSET] = "Sunset", -} - -local spawns = { - -- spawnByType day / night - [1] = { -- spawn in night - name = "Ghostly Wolf", - spawn = LIGHT_STATE_SUNSET, - despawn = LIGHT_STATE_SUNRISE, - position = { x = 33332, y = 32052, z = 7 }, - }, - [2] = { -- spawn in night - name = "Talila", - spawn = LIGHT_STATE_SUNSET, - despawn = LIGHT_STATE_SUNRISE, - position = { x = 33504, y = 32222, z = 7 }, - }, - [3] = { -- spawn in day - name = "Valindara", - spawn = LIGHT_STATE_SUNRISE, - despawn = LIGHT_STATE_SUNSET, - position = { x = 33504, y = 32222, z = 7 }, - }, -} - -local spawnsByTime = GlobalEvent("spawnsByTime") -function spawnsByTime.onPeriodChange(period, light) - local time = getWorldTime() - - if configManager.getBoolean(configKeys.ALL_CONSOLE_LOG) then - logger.info("Starting {} Current light is {} and it's {} Tibian Time", periods[period], light, getFormattedWorldTime(time)) - end - for index, value in pairs(spawns) do - if value.spawn == period then - -- Adding - local spawn = Game.createNpc(value.name, value.position) - if spawn then - if configManager.getBoolean(configKeys.ALL_CONSOLE_LOG) then - logger.info("NPC {} added", value.name) - end - spawn:setMasterPos(value.position) - spawn:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - end - elseif value.despawn == period then - -- Removing - local target = Npc(value.name) - if target then - if configManager.getBoolean(configKeys.ALL_CONSOLE_LOG) then - logger.info("NPC {} removed", value.name) - end - target:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - target:remove() - end - end - end - - return true -end - -spawnsByTime:register() diff --git a/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua b/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua index 7f35b07170e..089935aad41 100644 --- a/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua +++ b/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua @@ -1,74 +1,57 @@ -local ThreatenedDreams = Storage.Quest.U11_40.ThreatenedDreams -local periods = { - [LIGHT_STATE_NIGHT] = "Night", - [LIGHT_STATE_DAY] = "Day", - [LIGHT_STATE_SUNRISE] = "Sunrise", - [LIGHT_STATE_SUNSET] = "Sunset", -} local config = { - -- createByType day / night - [1] = { -- create in night - bushId = 25783, - createItem = LIGHT_STATE_NIGHT, - removeItem = LIGHT_STATE_SUNRISE, - pos = Position(33497, 32196, 7), - herbId = 5953, - herbWeight = 1, - storage = ThreatenedDreams.Mission03.RavenHerbTimer, - }, + bushId = 25783, + createItem = LIGHT_STATE_NIGHT, + removeItem = LIGHT_STATE_SUNRISE, + pos = Position(33497, 32196, 7), + herbId = 5953, + herbWeight = 1, + storage = ThreatenedDreams.Mission03.RavenHerbTimer, } local createRavenHerb = GlobalEvent("createRavenHerb") function createRavenHerb.onPeriodChange(period, light) - local time = getWorldTime() - - if configManager.getBoolean(configKeys.ALL_CONSOLE_LOG) then - logger.info("Starting {} Current light is {} and it's {} Tibian Time", periods[period], light, getFormattedWorldTime(time)) - end - for index, item in pairs(config) do - if item.createItem == period then -- Adding - local createItem = Game.createItem(item.bushId, 1, item.pos) - createItem:setActionId(item.storage) - if createItem then - item.pos:sendMagicEffect(CONST_ME_BIGPLANTS) - end - elseif item.removeItem == period then -- Removing - local target = Tile(item.pos):getItemById(item.bushId) - if target then - item.pos:removeItem(item.bushId, CONST_ME_BIGPLANTS) - end + local pos = config.pos + if config.createItem == period then + local createItem = Game.createItem(config.bushId, 1, pos) + if createItem then + pos:sendMagicEffect(CONST_ME_BIGPLANTS) + end + elseif config.removeItem == period then + local target = Tile(pos):getItemById(config.bushId) + if target then + pos:removeItem(config.bushId, CONST_ME_BIGPLANTS) end end - return true end createRavenHerb:register() local ravenHerb = Action() + function ravenHerb.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local herbConfig = config[1] - local message = "You have found a " .. getItemName(herbConfig.herbId) .. "." + local message = "You have found a " .. getItemName(config.herbId) .. "." local backpack = player:getSlotItem(CONST_SLOT_BACKPACK) if not backpack or backpack:getEmptySlots(true) < 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message .. " But you have no room to take it.") return true end - if (player:getFreeCapacity() / 100) < herbConfig.herbWeight then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message .. ". Weighing " .. herbConfig.herbWeight .. " oz, it is too heavy for you to carry.") + + if (player:getFreeCapacity() / 100) < config.herbWeight then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message .. ". Weighing " .. config.herbWeight .. " oz, it is too heavy for you to carry.") return true end - if player:getStorageValue(herbConfig.storage) > os.time() then + if player:getStorageValue(config.storage) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The raven herb cannot be collected right now.") return true end - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(herbConfig.herbId) .. ".") - player:setStorageValue(herbConfig.storage, os.time() + 60 * 30 * 1000) -- Can be collected on next cycle - player:addItem(herbConfig.herbId, 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message) + player:setStorageValue(config.storage, os.time() + 60 * 30 * 1000) + player:addItem(config.herbId, 1) return true end diff --git a/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua b/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua new file mode 100644 index 00000000000..4679804b6a5 --- /dev/null +++ b/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua @@ -0,0 +1,30 @@ +local npcSpawns = { + { name = "Ghostly Wolf", spawnPeriod = LIGHT_STATE_SUNSET, despawnPeriod = LIGHT_STATE_SUNRISE, position = { x = 33332, y = 32052, z = 7 } }, + { name = "Talila", spawnPeriod = LIGHT_STATE_SUNSET, despawnPeriod = LIGHT_STATE_SUNRISE, position = { x = 33504, y = 32222, z = 7 } }, + { name = "Valindara", spawnPeriod = LIGHT_STATE_SUNRISE, despawnPeriod = LIGHT_STATE_SUNSET, position = { x = 33504, y = 32222, z = 7 } }, +} + +local spawnsNpcByTime = GlobalEvent("SpawnsNpcByTime") + +function spawnsByTimeEvent.onPeriodChange(period) + for _, npcSpawn in ipairs(npcSpawns) do + if npcSpawn.spawnPeriod == period then + local spawnNpc = Game.createNpc(npcSpawn.name, npcSpawn.position) + if spawnNpc then + spawnNpc:setMasterPos(npcSpawn.position) + npcSpawn.position:sendMagicEffect(CONST_ME_TELEPORT) + logger.info("[NPC Spawn] {} has spawned", npcSpawn.name) + end + elseif npcSpawn.despawnPeriod == period then + local despawnNpc = Npc(npcSpawn.name) + if despawnNpc then + despawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + despawnNpc:remove() + logger.info("[NPC Despawn] {} has despawned", npcSpawn.name) + end + end + end + return true +end + +spawnsNpcByTime:register() diff --git a/src/config/config_enums.hpp b/src/config/config_enums.hpp index 7432f955ff9..102352b457e 100644 --- a/src/config/config_enums.hpp +++ b/src/config/config_enums.hpp @@ -17,7 +17,6 @@ enum ConfigKey_t : uint16_t { ALLOW_BLOCK_SPAWN, ALLOW_CHANGEOUTFIT, ALLOW_RELOAD, - ALL_CONSOLE_LOG, AUTH_TYPE, AUTOBANK, AUTOLOOT, diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 7842d7b4d88..7ca54a2db41 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -126,7 +126,6 @@ bool ConfigManager::load() { loadBoolConfig(L, WEATHER_RAIN, "weatherRain", false); loadBoolConfig(L, WEATHER_THUNDER, "thunderEffect", false); - loadBoolConfig(L, ALL_CONSOLE_LOG, "allConsoleLog", false); loadBoolConfig(L, TOGGLE_FREE_QUEST, "toggleFreeQuest", true); loadBoolConfig(L, AUTOLOOT, "autoLoot", false); loadBoolConfig(L, AUTOBANK, "autoBank", false); From 767ff40c0a3e85c160f74a5ad29aad501d2a4977 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Mon, 19 Feb 2024 18:39:11 -0300 Subject: [PATCH 2/9] feat: enable players to put items in ammo slot (#2267) Feature to enable players to put items in ammo slot (usable to use shopping functions and others). --- config.lua.dist | 2 ++ src/config/config_enums.hpp | 1 + src/config/configmanager.cpp | 1 + src/creatures/players/player.cpp | 24 +++++++++++++++++------- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/config.lua.dist b/config.lua.dist index 6831b799152..f446679911c 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -238,6 +238,7 @@ onlyPremiumAccount = false -- NOTE: teleportPlayerToVocationRoom will enable oressa to teleport player to his/her room vocation -- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward -- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt +-- NOTE: enablePlayerPutItemInAmmoSlot = true, will enable players to put any items on ammo slot, more used in custom shopping system weatherRain = false thunderEffect = false stashMoving = false @@ -255,6 +256,7 @@ toggleReceiveReward = false randomMonsterSpawn = false lootPouchMaxLimit = 2000 storeInboxMaxLimit = 2000 +enablePlayerPutItemInAmmoSlot = false -- Teleport summon -- Set to true will never remove the summon diff --git a/src/config/config_enums.hpp b/src/config/config_enums.hpp index 102352b457e..a6a3d7c24c0 100644 --- a/src/config/config_enums.hpp +++ b/src/config/config_enums.hpp @@ -54,6 +54,7 @@ enum ConfigKey_t : uint16_t { DISCORD_WEBHOOK_DELAY_MS, DISCORD_WEBHOOK_URL, EMOTE_SPELLS, + ENABLE_PLAYER_PUT_ITEM_IN_AMMO_SLOT, EXPERIENCE_FROM_PLAYERS, EXP_FROM_PLAYERS_LEVEL_RANGE, EX_ACTIONS_DELAY_INTERVAL, diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 7ca54a2db41..ec8ee7a4b82 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -326,6 +326,7 @@ bool ConfigManager::load() { loadIntConfig(L, BUY_AOL_COMMAND_FEE, "buyAolCommandFee", 0); loadIntConfig(L, BUY_BLESS_COMMAND_FEE, "buyBlessCommandFee", 0); loadBoolConfig(L, TELEPORT_PLAYER_TO_VOCATION_ROOM, "teleportPlayerToVocationRoom", true); + loadBoolConfig(L, ENABLE_PLAYER_PUT_ITEM_IN_AMMO_SLOT, "enablePlayerPutItemInAmmoSlot", false); loadBoolConfig(L, TOGGLE_HAZARDSYSTEM, "toogleHazardSystem", true); loadIntConfig(L, HAZARD_CRITICAL_INTERVAL, "hazardCriticalInterval", 2000); diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 0860d7baeda..28460082e73 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -3177,12 +3177,18 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr &thing, ReturnValue ret = RETURNVALUE_NOERROR; const int32_t &slotPosition = item->getSlotPosition(); - if ((slotPosition & SLOTP_HEAD) || (slotPosition & SLOTP_NECKLACE) || (slotPosition & SLOTP_BACKPACK) || (slotPosition & SLOTP_ARMOR) || (slotPosition & SLOTP_LEGS) || (slotPosition & SLOTP_FEET) || (slotPosition & SLOTP_RING)) { - ret = RETURNVALUE_CANNOTBEDRESSED; - } else if (slotPosition & SLOTP_TWO_HAND) { - ret = RETURNVALUE_PUTTHISOBJECTINBOTHHANDS; - } else if ((slotPosition & SLOTP_RIGHT) || (slotPosition & SLOTP_LEFT)) { - ret = RETURNVALUE_CANNOTBEDRESSED; + + bool allowPutItemsOnAmmoSlot = g_configManager().getBoolean(ENABLE_PLAYER_PUT_ITEM_IN_AMMO_SLOT, __FUNCTION__); + if (allowPutItemsOnAmmoSlot && index == CONST_SLOT_AMMO) { + ret = RETURNVALUE_NOERROR; + } else { + if ((slotPosition & SLOTP_HEAD) || (slotPosition & SLOTP_NECKLACE) || (slotPosition & SLOTP_BACKPACK) || (slotPosition & SLOTP_ARMOR) || (slotPosition & SLOTP_LEGS) || (slotPosition & SLOTP_FEET) || (slotPosition & SLOTP_RING)) { + ret = RETURNVALUE_CANNOTBEDRESSED; + } else if (slotPosition & SLOTP_TWO_HAND) { + ret = RETURNVALUE_PUTTHISOBJECTINBOTHHANDS; + } else if ((slotPosition & SLOTP_RIGHT) || (slotPosition & SLOTP_LEFT)) { + ret = RETURNVALUE_CANNOTBEDRESSED; + } } switch (index) { @@ -3324,8 +3330,12 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr &thing, } case CONST_SLOT_AMMO: { - if ((slotPosition & SLOTP_AMMO)) { + if (allowPutItemsOnAmmoSlot) { ret = RETURNVALUE_NOERROR; + } else { + if ((slotPosition & SLOTP_AMMO)) { + ret = RETURNVALUE_NOERROR; + } } break; } From e864989c8103afa1e27173bdf812cba8d4c3eb05 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 19 Feb 2024 18:39:38 -0300 Subject: [PATCH 3/9] refactor: improve code structure for Glooth Fairy lever (#2266) Refactoring of the script for the Glooth Fairy event. The clearMonstersAndTeleportPlayers function has been improved for better readability and maintainability. Lever room and boss room positions were separated for clarity. Actions for teleporting players and removing monsters were adjusted correctly. Dedicated commit for script enhancements. --- data-otservbr-global/lib/core/storages.lua | 1 + .../quests/oramond/glooth_fairy_lever.lua | 102 +++++++++--------- 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 4cfc904c716..07b6bc573ae 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -3084,6 +3084,7 @@ GlobalStorage = { NaginataStone = 65003, ExpBoost = 65004, SwordOfFury = 65005, + GloothFairyTimer = 65006, LionsRockFields = 65007, TheMummysCurse = 65008, OberonEventTime = 65009, diff --git a/data-otservbr-global/scripts/actions/quests/oramond/glooth_fairy_lever.lua b/data-otservbr-global/scripts/actions/quests/oramond/glooth_fairy_lever.lua index 1f8ece85ae5..9a22fbd150e 100644 --- a/data-otservbr-global/scripts/actions/quests/oramond/glooth_fairy_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/oramond/glooth_fairy_lever.lua @@ -1,69 +1,73 @@ -local function removeBosst(fromArea1, fromArea2, bossName) - for x = fromArea1.x, fromArea2.x do - for y = fromArea1.y, fromArea2.y do - for z = fromArea1.z, fromArea2.z do - if getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid > 0 then - if isMonster(getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid) then - if string.lower(getCreatureName(getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid)) == bossName then - doRemoveCreature(getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid) - end +local function clearMonstersAndTeleportPlayers() + local leverRoomFromPos = Position(33658, 31934, 9) + local leverRoomToPos = Position(33670, 31940, 9) + local bossRoomFromPos = Position(33678, 31922, 9) + local bossRoomToPos = Position(33699, 31943, 9) + local exitPos = Position(33657, 31943, 9) + local destinationPos = Position(33684, 31932, 9) + + for x = leverRoomFromPos.x, leverRoomToPos.x do + for y = leverRoomFromPos.y, leverRoomToPos.y do + for z = leverRoomFromPos.z, leverRoomToPos.z do + local currentTile = Tile(Position({ x = x, y = y, z = z })) + if currentTile then + local topCreature = currentTile:getTopCreature() + if topCreature and topCreature:isPlayer() then + topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + topCreature:teleportTo(exitPos) + topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end end end end - return true -end -local function teleportAllPlayersFromAreat(fromArea1, fromArea2, toPos) - for x = fromArea1.x, fromArea2.x do - for y = fromArea1.y, fromArea2.y do - for z = fromArea1.z, fromArea2.z do - local tile = Tile(Position({ x = x, y = y, z = z })) - if tile then - local player = tile:getTopCreature() - if player and player:isPlayer() then - player:teleportTo(toPos) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + for x = bossRoomFromPos.x, bossRoomToPos.x do + for y = bossRoomFromPos.y, bossRoomToPos.y do + for z = bossRoomFromPos.z, bossRoomToPos.z do + local currentTile = Tile(Position({ x = x, y = y, z = z })) + if currentTile then + local topCreature = currentTile:getTopCreature() + if topCreature and topCreature:isMonster() then + topCreature:remove() + end + end + end + end + end + + for x = bossRoomFromPos.x, bossRoomToPos.x do + for y = bossRoomFromPos.y, bossRoomToPos.y do + for z = bossRoomFromPos.z, bossRoomToPos.z do + local currentTile = Tile(Position({ x = x, y = y, z = z })) + if currentTile then + local topCreature = currentTile:getTopCreature() + if topCreature and topCreature:isPlayer() then + topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + topCreature:teleportTo(destinationPos) + topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end end end end - return true -end -local function PrepareEnter() - removeBosst({ x = 33679, y = 31919, z = 9 }, { x = 33701, y = 31941, z = 9 }, "glooth fairy") - teleportAllPlayersFromAreat({ x = 33659, y = 31935, z = 9 }, { x = 33668, y = 31939, z = 9 }, { x = 33684, y = 31935, z = 9 }) - Game.createMonster("Glooth Fairy", { x = 33688, y = 31937, z = 9 }) + Game.createMonster("Glooth Fairy", Position(33688, 31937, 9), false, true) end -local oramondGloothLever = Action() -function oramondGloothLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8913 then - if getGlobalStorageValue(15560) >= os.time() then - doPlayerSendTextMessage(player, 19, "You need to wait 15 minutes to use again.") - return true - end +local gloothFairyLever = Action() - local specs, spec = Game.getSpectators({ x = 33688, y = 31932, z = 9 }, false, false, 13, 13, 13, 13) - for i = 1, #specs do - spec = specs[i] - if spec:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the quest room.") - return true - end - spec:remove() - end - setGlobalStorageValue(18081, os.time() + 15 * 60) - player:say("Everyone in this place will be teleported into Glooth Fairy's hideout in one minute. No way back!!!", TALKTYPE_MONSTER_SAY) - addEvent(PrepareEnter, 60 * 1000) +function gloothFairyLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if Game.getStorageValue(GlobalStorage.GloothFairyTimer) >= os.time() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait 15 minutes to use again.") + return true end - item:transform(item.itemid == 8913 and 8914 or 8913) + player:say("Everyone in this place will be teleported into Glooth Fairy's hideout in one minute. No way back!!!", TALKTYPE_MONSTER_SAY) + Game.setStorageValue(GlobalStorage.GloothFairyTimer, os.time() + 15 * 60) + addEvent(clearMonstersAndTeleportPlayers, 60 * 1000) return true end -oramondGloothLever:uid(1020) -oramondGloothLever:register() +gloothFairyLever:uid(1020) +gloothFairyLever:register() From 0354cae287a1f0ec13fb4e45a9d06dd0fcb54206 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 19 Feb 2024 19:49:15 -0300 Subject: [PATCH 4/9] fix: cobras spawn and removal invalid scripts (#2264) Remove the event from the main callback and move it inside the action. Also, remove the globalevent that recreates the cobra flask because there is no information that this is the default behavior, and according to a friend who plays the global, he said it can only be picked up once per ss. --- data-otservbr-global/lib/core/storages.lua | 1 - .../scripts/actions/other/cobra_flask.lua | 19 ------------ .../scripts/globalevents/cobra_flask.lua | 14 --------- data/libs/core/global_storage.lua | 1 + data/scripts/actions/items/cobra_flask.lua | 30 +++++++++++++++++++ .../eventcallbacks/monster/on_spawn.lua | 10 +------ 6 files changed, 32 insertions(+), 43 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/other/cobra_flask.lua delete mode 100644 data-otservbr-global/scripts/globalevents/cobra_flask.lua create mode 100644 data/scripts/actions/items/cobra_flask.lua diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 07b6bc573ae..a0379401c0b 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -3090,7 +3090,6 @@ GlobalStorage = { OberonEventTime = 65009, PrinceDrazzakEventTime = 65010, ScarlettEtzelEventTime = 65011, - CobraBastionFlask = 65012, Inquisition = 65013, Yasir = 65014, IceCrack = 65016, diff --git a/data-otservbr-global/scripts/actions/other/cobra_flask.lua b/data-otservbr-global/scripts/actions/other/cobra_flask.lua deleted file mode 100644 index 50b9c3dea08..00000000000 --- a/data-otservbr-global/scripts/actions/other/cobra_flask.lua +++ /dev/null @@ -1,19 +0,0 @@ -local cobraFlask = Action() - -function cobraFlask.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if (item.itemid == 31297) and (target.itemid == 4188) then - item:transform(31296) - target:transform(4189) - target:decay() - return - elseif (item.itemid == 31296) and ((target.itemid == 31284) or (target.itemid == 31285) or (target.itemid == 31286) or (target.itemid == 31287)) then - doSendMagicEffect(target:getPosition(), CONST_ME_GREENSMOKE) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You carefully pour just a tiny, little, finely dosed... and there goes the whole content of the bottle. Stand back!") - item:transform(31297) - setGlobalStorageValue(GlobalStorage.CobraBastionFlask, os.time() + 1800) -- 30 minutes - end - return -end - -cobraFlask:id(31296, 31297) -cobraFlask:register() diff --git a/data-otservbr-global/scripts/globalevents/cobra_flask.lua b/data-otservbr-global/scripts/globalevents/cobra_flask.lua deleted file mode 100644 index b4121ae0b6d..00000000000 --- a/data-otservbr-global/scripts/globalevents/cobra_flask.lua +++ /dev/null @@ -1,14 +0,0 @@ -local position = Position(33395, 32666, 5) - -local cobraEmptyFlask = GlobalEvent("Cobraflask") - -function cobraEmptyFlask.onThink(interval) - local flask = Tile(position):getItemById(31297) - if not flask then - Game.createItem(31297, 1, position) - end - return true -end - -cobraEmptyFlask:interval(1000 * 60 * 60 * 8) -- 8 hours -cobraEmptyFlask:register() diff --git a/data/libs/core/global_storage.lua b/data/libs/core/global_storage.lua index 778073f3ca6..686595ae312 100644 --- a/data/libs/core/global_storage.lua +++ b/data/libs/core/global_storage.lua @@ -25,5 +25,6 @@ Global = { Storage = { FamiliarSummonEvent10 = 30054, FamiliarSummonEvent60 = 30055, + CobraFlask = 30055, }, } diff --git a/data/scripts/actions/items/cobra_flask.lua b/data/scripts/actions/items/cobra_flask.lua new file mode 100644 index 00000000000..ddeecf8ec4f --- /dev/null +++ b/data/scripts/actions/items/cobra_flask.lua @@ -0,0 +1,30 @@ +local applyCobraFlaskEffectOnMonsterSpawn = EventCallback() + +applyCobraFlaskEffectOnMonsterSpawn.monsterOnSpawn = function(monster, position) + if table.contains({ "cobra scout", "cobra vizier", "cobra assassin" }, monster:getName():lower()) then + if Game.getStorageValue(Global.Storage.CobraFlask) >= os.time() then + monster:setHealth(monster:getMaxHealth() * 0.75) + monster:getPosition():sendMagicEffect(CONST_ME_GREEN_RINGS) + else + Game.setStorageValue(Global.Storage.CobraFlask, -1) + end + end + return true +end + +applyCobraFlaskEffectOnMonsterSpawn:register() + +local cobraFlask = Action() + +function cobraFlask.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if table.contains({ 31284, 31285, 31286, 31287 }, target:getId()) then + target:getPosition():sendMagicEffect(CONST_ME_GREENSMOKE) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You carefully pour just a tiny, little, finely dosed... and there goes the whole content of the bottle. Stand back!") + item:transform(31297) + Game.setStorageValue(Global.Storage.CobraFlask, os.time() + 30 * 60) + end + return true +end + +cobraFlask:id(31296) +cobraFlask:register() diff --git a/data/scripts/eventcallbacks/monster/on_spawn.lua b/data/scripts/eventcallbacks/monster/on_spawn.lua index e0480d8e325..89cffb9f60d 100644 --- a/data/scripts/eventcallbacks/monster/on_spawn.lua +++ b/data/scripts/eventcallbacks/monster/on_spawn.lua @@ -1,11 +1,3 @@ -local function handleCobra(monster) - if monster:getName():lower() == "cobra scout" or monster:getName():lower() == "cobra vizier" or monster:getName():lower() == "cobra assassin" then - if getGlobalStorageValue(GlobalStorage.CobraBastionFlask) >= os.time() then - monster:setHealth(monster:getMaxHealth() * 0.75) - end - end -end - local function handleIronServantReplica(monster) if monster:getName():lower() ~= "iron servant replica" then return @@ -39,13 +31,13 @@ function callback.monsterOnSpawn(monster, position) if not monster then return end + HazardMonster.onSpawn(monster, position) if monster:getType():isRewardBoss() then monster:setReward(true) end - handleCobra(monster) handleIronServantReplica(monster) if not monster:getType():canSpawn(position) then From bcbcb55ff28ec885dc4645ac1ba5d5e533d515d7 Mon Sep 17 00:00:00 2001 From: Ramon Bernardo Date: Mon, 19 Feb 2024 19:54:24 -0300 Subject: [PATCH 5/9] improve: allow saving the player entire stash with just one insert (#2270) When saving the player's stash, currently each item is inserted individually. With this change, only one insert is executed. --- src/io/functions/iologindata_save_player.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/io/functions/iologindata_save_player.cpp b/src/io/functions/iologindata_save_player.cpp index e6adeb2f4b2..f1a70a5a8fb 100644 --- a/src/io/functions/iologindata_save_player.cpp +++ b/src/io/functions/iologindata_save_player.cpp @@ -327,16 +327,19 @@ bool IOLoginDataSave::savePlayerStash(std::shared_ptr player) { return false; } + query.str(""); + + DBInsert stashQuery("INSERT INTO `player_stash` (`player_id`,`item_id`,`item_count`) VALUES "); for (const auto &[itemId, itemCount] : player->getStashItems()) { - query.str(""); - query << "INSERT INTO `player_stash` (`player_id`,`item_id`,`item_count`) VALUES ("; - query << player->getGUID() << ", "; - query << itemId << ", "; - query << itemCount << ")"; - if (!db.executeQuery(query.str())) { + query << player->getGUID() << ',' << itemId << ',' << itemCount; + if (!stashQuery.addRow(query)) { return false; } } + + if (!stashQuery.execute()) { + return false; + } return true; } From 75563d2d7c2edd5ed0ace945364388ed73d9e3cc Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Mon, 19 Feb 2024 20:30:36 -0300 Subject: [PATCH 6/9] fix: added migration to update storage from old 'IsVip' storage (#2268) --- .../20241708362079_move_vip_system_to_kv.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 data-otservbr-global/scripts/globalevents/game_migrations/20241708362079_move_vip_system_to_kv.lua diff --git a/data-otservbr-global/scripts/globalevents/game_migrations/20241708362079_move_vip_system_to_kv.lua b/data-otservbr-global/scripts/globalevents/game_migrations/20241708362079_move_vip_system_to_kv.lua new file mode 100644 index 00000000000..8bce6971cd4 --- /dev/null +++ b/data-otservbr-global/scripts/globalevents/game_migrations/20241708362079_move_vip_system_to_kv.lua @@ -0,0 +1,17 @@ +local isVipStorage = 150001 + +local function migrateIsVipSystem(player) + local isVipValue = player:getStorageValue(isVipStorage) + if isVipValue > 0 then + player:kv():scoped("account"):set("vip-system", true) + player:setStorageValue(isVipStorage, -1) + end +end + +local migration = Migration("20241708362079_move_vip_system_to_kv") + +function migration:onExecute() + self:forEachPlayer(migrateIsVipSystem) +end + +migration:register() From 9c2b4b61b1027781b324adeba3de9fded4384e96 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 19 Feb 2024 20:31:33 -0300 Subject: [PATCH 7/9] chore: change boss levers directory (#2257) Change the path of all boss scripts to just one folder, all these scripts are already in the new system. Any levers that are outside this folder need to be converted. --- .../ahau_lever.lua => bosses_levers/ahau.lua} | 0 .../anomaly_lever.lua => bosses_levers/anomaly.lua} | 0 .../secret_library/brokul_lever.lua => bosses_levers/brokul.lua} | 0 .../count_vlarkorth.lua} | 0 .../dragonking_zyrtarch.lua} | 0 .../duke_krule_lever.lua => bosses_levers/duke_krule.lua} | 0 .../earl_osam_lever.lua => bosses_levers/earl_osam.lua} | 0 .../eradicator_lever.lua => bosses_levers/eradicator.lua} | 0 .../lever.lua => bosses_levers/faceless_bane.lua} | 0 .../quake_lever.lua => bosses_levers/foreshock.lua} | 0 .../ghulosh_lever.lua => bosses_levers/ghulosh.lua} | 0 .../gorzindel_lever.lua => bosses_levers/gorzindel.lua} | 0 .../goshnar_cruelty.lua} | 0 .../goshnar_greed_lever.lua => bosses_levers/goshnar_greed.lua} | 0 .../goshnar_hatred_lever.lua => bosses_levers/goshnar_hatred.lua} | 0 .../goshnar_malice_lever.lua => bosses_levers/goshnar_malice.lua} | 0 .../goshnar_megalomania.lua} | 0 .../goshnar_spite_lever.lua => bosses_levers/goshnar_spite.lua} | 0 .../oberon_lever.lua => bosses_levers/grand_,master_oberon.lua} | 0 .../king_zelos_lever.lua => bosses_levers/king_zelos.lua} | 0 .../tenebris_lever.lua => bosses_levers/lady_tenebris.lua} | 0 .../lloyd_lever.lua => bosses_levers/lloyd.lua} | 0 .../lokathmor_lever.lua => bosses_levers/lokathmor.lua} | 0 .../lord_azaram_lever.lua => bosses_levers/lord_azaram.lua} | 0 .../bosses_levers/magma_bubble.lua} | 0 .../mazoran_lever.lua => bosses_levers/mazoran.lua} | 0 .../mazzinor_lever.lua => bosses_levers/mazzinor.lua} | 0 .../megasylvan_yselda.lua} | 0 .../horror_lever.lua => bosses_levers/melting_frozen_horror.lua} | 0 .../outburst_lever.lua => bosses_levers/outburst.lua} | 0 .../plagirath_lever.lua => bosses_levers/plagirath.lua} | 0 .../ragiaz_lever.lua => bosses_levers/ragiaz.lua} | 0 .../ratmiral_blackwhiskers.lua} | 0 .../razzagorn_lever.lua => bosses_levers/razzagorn.lua} | 0 .../rupture_lever.lua => bosses_levers/rupture.lua} | 0 .../shulgrax_lever.lua => bosses_levers/shulgrax.lua} | 0 .../sir_baeloc_sir_nictros.lua} | 0 .../tarbaz_lever.lua => bosses_levers/tarbaz.lua} | 0 .../tentugly_lever.lua => bosses_levers/tentuglys_head.lua} | 0 .../the_brainstealer.lua} | 0 .../dread_maiden_lever.lua => bosses_levers/the_dread_maiden.lua} | 0 .../fear_feaster_lever.lua => bosses_levers/the_fear_feaster.lua} | 0 .../the_last_lore_keeper.lua} | 0 .../bosses_levers/the_monster.lua} | 0 .../the_nightmare_beast.lua} | 0 .../pale_worm_lever.lua => bosses_levers/the_pale_worm.lua} | 0 .../bosses_levers/the_primal_manace.lua} | 0 .../the_scourge_of_oblivion.lua} | 0 .../thorn_knight_lever.lua => bosses_levers/the_thorn_knight.lua} | 0 .../the_time_guardian.lua} | 0 .../unwelcome_lever.lua => bosses_levers/the_unwelcome.lua} | 0 .../timira_the_many-headed.lua} | 0 .../bosses_levers/urmahlullu_the_immaculate.lua} | 0 .../zamulosh_lever.lua => bosses_levers/zamulosh.lua} | 0 54 files changed, 0 insertions(+), 0 deletions(-) rename data-otservbr-global/scripts/actions/{quests/adventures_of_galthen/ahau_lever.lua => bosses_levers/ahau.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/heart_of_destruction/anomaly_lever.lua => bosses_levers/anomaly.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/secret_library/brokul_lever.lua => bosses_levers/brokul.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/grave_danger/count_vlarkorth_lever.lua => bosses_levers/count_vlarkorth.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/dragonking_lever.lua => bosses_levers/dragonking_zyrtarch.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/grave_danger/duke_krule_lever.lua => bosses_levers/duke_krule.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/grave_danger/earl_osam_lever.lua => bosses_levers/earl_osam.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/heart_of_destruction/eradicator_lever.lua => bosses_levers/eradicator.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/the_dream_courts/lever.lua => bosses_levers/faceless_bane.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/heart_of_destruction/quake_lever.lua => bosses_levers/foreshock.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/secret_library/ghulosh_lever.lua => bosses_levers/ghulosh.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/secret_library/gorzindel_lever.lua => bosses_levers/gorzindel.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/soul_war/goshnar_cruelty_lever.lua => bosses_levers/goshnar_cruelty.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/soul_war/goshnar_greed_lever.lua => bosses_levers/goshnar_greed.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/soul_war/goshnar_hatred_lever.lua => bosses_levers/goshnar_hatred.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/soul_war/goshnar_malice_lever.lua => bosses_levers/goshnar_malice.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/soul_war/goshnar_megalomania_lever.lua => bosses_levers/goshnar_megalomania.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/soul_war/goshnar_spite_lever.lua => bosses_levers/goshnar_spite.lua} (100%) rename data-otservbr-global/scripts/actions/{farmine/oberon_lever.lua => bosses_levers/grand_,master_oberon.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/grave_danger/king_zelos_lever.lua => bosses_levers/king_zelos.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/tenebris_lever.lua => bosses_levers/lady_tenebris.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/lloyd_lever.lua => bosses_levers/lloyd.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/secret_library/lokathmor_lever.lua => bosses_levers/lokathmor.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/grave_danger/lord_azaram_lever.lua => bosses_levers/lord_azaram.lua} (100%) rename data-otservbr-global/scripts/{quests/primal_ordeal_quest/magma_bubble_lever.lua => actions/bosses_levers/magma_bubble.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/mazoran_lever.lua => bosses_levers/mazoran.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/secret_library/mazzinor_lever.lua => bosses_levers/mazzinor.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/adventures_of_galthen/megasylvan_yselda_lever.lua => bosses_levers/megasylvan_yselda.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/horror_lever.lua => bosses_levers/melting_frozen_horror.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/heart_of_destruction/outburst_lever.lua => bosses_levers/outburst.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/plagirath_lever.lua => bosses_levers/plagirath.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/ragiaz_lever.lua => bosses_levers/ragiaz.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/a_pirates_tail/ratmiral_lever.lua => bosses_levers/ratmiral_blackwhiskers.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/razzagorn_lever.lua => bosses_levers/razzagorn.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/heart_of_destruction/rupture_lever.lua => bosses_levers/rupture.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/shulgrax_lever.lua => bosses_levers/shulgrax.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/grave_danger/baeloc_nictros_lever.lua => bosses_levers/sir_baeloc_sir_nictros.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/tarbaz_lever.lua => bosses_levers/tarbaz.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/a_pirates_tail/tentugly_lever.lua => bosses_levers/tentuglys_head.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/too_hot_to_handle/the_brainstealer_lever.lua => bosses_levers/the_brainstealer.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/feaster_of_souls/dread_maiden_lever.lua => bosses_levers/the_dread_maiden.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/feaster_of_souls/fear_feaster_lever.lua => bosses_levers/the_fear_feaster.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/last_lore_lever.lua => bosses_levers/the_last_lore_keeper.lua} (100%) rename data-otservbr-global/scripts/{quests/cradle_of_monsters/the_monster_lever.lua => actions/bosses_levers/the_monster.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/the_dream_courts/nightmare_beast_lever.lua => bosses_levers/the_nightmare_beast.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/feaster_of_souls/pale_worm_lever.lua => bosses_levers/the_pale_worm.lua} (100%) rename data-otservbr-global/scripts/{quests/primal_ordeal_quest/the_primal_manace_lever.lua => actions/bosses_levers/the_primal_manace.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/secret_library/scourge_of_oblivion_lever.lua => bosses_levers/the_scourge_of_oblivion.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/thorn_knight_lever.lua => bosses_levers/the_thorn_knight.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/forgotten_knowledge/time_guardian_lever.lua => bosses_levers/the_time_guardian.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/feaster_of_souls/unwelcome_lever.lua => bosses_levers/the_unwelcome.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/marapur/boss_lever_timira.lua => bosses_levers/timira_the_many-headed.lua} (100%) rename data-otservbr-global/scripts/{quests/kilmaresh/1-fafnars-wrath/3-urmahlullu-the-immaculate.lua => actions/bosses_levers/urmahlullu_the_immaculate.lua} (100%) rename data-otservbr-global/scripts/actions/{quests/ferumbras_ascendant/zamulosh_lever.lua => bosses_levers/zamulosh.lua} (100%) diff --git a/data-otservbr-global/scripts/actions/quests/adventures_of_galthen/ahau_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/ahau.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/adventures_of_galthen/ahau_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/ahau.lua diff --git a/data-otservbr-global/scripts/actions/quests/heart_of_destruction/anomaly_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/anomaly.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/heart_of_destruction/anomaly_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/anomaly.lua diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/brokul_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/brokul.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/secret_library/brokul_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/brokul.lua diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/count_vlarkorth_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/count_vlarkorth.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/grave_danger/count_vlarkorth_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/count_vlarkorth.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/dragonking_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/dragonking_zyrtarch.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/dragonking_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/dragonking_zyrtarch.lua diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/duke_krule_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/grave_danger/duke_krule_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/earl_osam_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/earl_osam.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/grave_danger/earl_osam_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/earl_osam.lua diff --git a/data-otservbr-global/scripts/actions/quests/heart_of_destruction/eradicator_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/eradicator.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/heart_of_destruction/eradicator_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/eradicator.lua diff --git a/data-otservbr-global/scripts/actions/quests/the_dream_courts/lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/the_dream_courts/lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua diff --git a/data-otservbr-global/scripts/actions/quests/heart_of_destruction/quake_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/foreshock.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/heart_of_destruction/quake_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/foreshock.lua diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/ghulosh_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/ghulosh.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/secret_library/ghulosh_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/ghulosh.lua diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/gorzindel_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/gorzindel.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/secret_library/gorzindel_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/gorzindel.lua diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/goshnar_cruelty.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/soul_war/goshnar_cruelty_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/goshnar_cruelty.lua diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_greed_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/goshnar_greed.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/soul_war/goshnar_greed_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/goshnar_greed.lua diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_hatred_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/goshnar_hatred.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/soul_war/goshnar_hatred_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/goshnar_hatred.lua diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_malice_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/goshnar_malice.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/soul_war/goshnar_malice_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/goshnar_malice.lua diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_megalomania_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/goshnar_megalomania.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/soul_war/goshnar_megalomania_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/goshnar_megalomania.lua diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/goshnar_spite_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/goshnar_spite.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/soul_war/goshnar_spite_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/goshnar_spite.lua diff --git a/data-otservbr-global/scripts/actions/farmine/oberon_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/grand_,master_oberon.lua similarity index 100% rename from data-otservbr-global/scripts/actions/farmine/oberon_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/grand_,master_oberon.lua diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/king_zelos_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/king_zelos.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/grave_danger/king_zelos_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/king_zelos.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/tenebris_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/lady_tenebris.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/tenebris_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/lady_tenebris.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/lloyd_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/lloyd.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/lloyd_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/lloyd.lua diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/lokathmor_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/lokathmor.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/secret_library/lokathmor_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/lokathmor.lua diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/lord_azaram_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/lord_azaram.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/grave_danger/lord_azaram_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/lord_azaram.lua diff --git a/data-otservbr-global/scripts/quests/primal_ordeal_quest/magma_bubble_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/magma_bubble.lua similarity index 100% rename from data-otservbr-global/scripts/quests/primal_ordeal_quest/magma_bubble_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/magma_bubble.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/mazoran_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/mazoran.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/mazoran_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/mazoran.lua diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/mazzinor_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/mazzinor.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/secret_library/mazzinor_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/mazzinor.lua diff --git a/data-otservbr-global/scripts/actions/quests/adventures_of_galthen/megasylvan_yselda_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/megasylvan_yselda.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/adventures_of_galthen/megasylvan_yselda_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/megasylvan_yselda.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/horror_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/melting_frozen_horror.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/horror_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/melting_frozen_horror.lua diff --git a/data-otservbr-global/scripts/actions/quests/heart_of_destruction/outburst_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/outburst.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/heart_of_destruction/outburst_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/outburst.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/plagirath_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/plagirath.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/plagirath_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/plagirath.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ragiaz_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/ragiaz.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/ragiaz_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/ragiaz.lua diff --git a/data-otservbr-global/scripts/actions/quests/a_pirates_tail/ratmiral_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/ratmiral_blackwhiskers.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/a_pirates_tail/ratmiral_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/ratmiral_blackwhiskers.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/razzagorn_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/razzagorn.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/razzagorn_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/razzagorn.lua diff --git a/data-otservbr-global/scripts/actions/quests/heart_of_destruction/rupture_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/rupture.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/heart_of_destruction/rupture_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/rupture.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/shulgrax_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/shulgrax.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/shulgrax_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/shulgrax.lua diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/baeloc_nictros_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/grave_danger/baeloc_nictros_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/tarbaz_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/tarbaz.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/tarbaz_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/tarbaz.lua diff --git a/data-otservbr-global/scripts/actions/quests/a_pirates_tail/tentugly_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/tentuglys_head.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/a_pirates_tail/tentugly_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/tentuglys_head.lua diff --git a/data-otservbr-global/scripts/actions/quests/too_hot_to_handle/the_brainstealer_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_brainstealer.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/too_hot_to_handle/the_brainstealer_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_brainstealer.lua diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/dread_maiden_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_dread_maiden.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/feaster_of_souls/dread_maiden_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_dread_maiden.lua diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/fear_feaster_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_fear_feaster.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/feaster_of_souls/fear_feaster_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_fear_feaster.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/last_lore_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_last_lore_keeper.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/last_lore_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_last_lore_keeper.lua diff --git a/data-otservbr-global/scripts/quests/cradle_of_monsters/the_monster_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_monster.lua similarity index 100% rename from data-otservbr-global/scripts/quests/cradle_of_monsters/the_monster_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_monster.lua diff --git a/data-otservbr-global/scripts/actions/quests/the_dream_courts/nightmare_beast_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_nightmare_beast.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/the_dream_courts/nightmare_beast_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_nightmare_beast.lua diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_pale_worm.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/feaster_of_souls/pale_worm_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_pale_worm.lua diff --git a/data-otservbr-global/scripts/quests/primal_ordeal_quest/the_primal_manace_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_primal_manace.lua similarity index 100% rename from data-otservbr-global/scripts/quests/primal_ordeal_quest/the_primal_manace_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_primal_manace.lua diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/scourge_of_oblivion_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_scourge_of_oblivion.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/secret_library/scourge_of_oblivion_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_scourge_of_oblivion.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/thorn_knight_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_thorn_knight.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/thorn_knight_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_thorn_knight.lua diff --git a/data-otservbr-global/scripts/actions/quests/forgotten_knowledge/time_guardian_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_time_guardian.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/forgotten_knowledge/time_guardian_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_time_guardian.lua diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/the_unwelcome.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/feaster_of_souls/unwelcome_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/the_unwelcome.lua diff --git a/data-otservbr-global/scripts/actions/quests/marapur/boss_lever_timira.lua b/data-otservbr-global/scripts/actions/bosses_levers/timira_the_many-headed.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/marapur/boss_lever_timira.lua rename to data-otservbr-global/scripts/actions/bosses_levers/timira_the_many-headed.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/3-urmahlullu-the-immaculate.lua b/data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/3-urmahlullu-the-immaculate.lua rename to data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/zamulosh_lever.lua b/data-otservbr-global/scripts/actions/bosses_levers/zamulosh.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/zamulosh_lever.lua rename to data-otservbr-global/scripts/actions/bosses_levers/zamulosh.lua From d584a3346ceb11350dcb025f677a7271f85409af Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 19 Feb 2024 22:13:58 -0300 Subject: [PATCH 8/9] chore: moving iron servant transformation to realmap (#2265) Moving Eventcallback to rlmap, as it is not part of the core as it is just a quest. --- .../iron_servant_transformation.lua | 31 +++++++++++++++++++ .../eventcallbacks/monster/on_spawn.lua | 29 ----------------- 2 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua diff --git a/data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua b/data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua new file mode 100644 index 00000000000..65e6af5a3b2 --- /dev/null +++ b/data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua @@ -0,0 +1,31 @@ +local ironServantTransformation = EventCallback() + +ironServantTransformation.monsterOnSpawn = function(monster, position) + if monster:getName():lower() ~= "iron servant replica" then + return + end + + local chance = math.random(100) + if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismDiamond) >= 1 and Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismGolden) >= 1 then + if chance > 30 then + local monsterType = math.random(2) == 1 and "diamond servant replica" or "golden servant replica" + Game.createMonster(monsterType, monster:getPosition(), false, true) + monster:remove() + end + return + end + + if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismDiamond) >= 1 and chance > 30 then + Game.createMonster("diamond servant replica", monster:getPosition(), false, true) + monster:remove() + return + end + + if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismGolden) >= 1 and chance > 30 then + Game.createMonster("golden servant replica", monster:getPosition(), false, true) + monster:remove() + end + return true +end + +ironServantTransformation:register() diff --git a/data/scripts/eventcallbacks/monster/on_spawn.lua b/data/scripts/eventcallbacks/monster/on_spawn.lua index 89cffb9f60d..e40778aafce 100644 --- a/data/scripts/eventcallbacks/monster/on_spawn.lua +++ b/data/scripts/eventcallbacks/monster/on_spawn.lua @@ -1,30 +1,3 @@ -local function handleIronServantReplica(monster) - if monster:getName():lower() ~= "iron servant replica" then - return - end - - local chance = math.random(100) - if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismDiamond) >= 1 and Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismGolden) >= 1 then - if chance > 30 then - local monsterType = math.random(2) == 1 and "diamond servant replica" or "golden servant replica" - Game.createMonster(monsterType, monster:getPosition(), false, true) - monster:remove() - end - return - end - - if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismDiamond) >= 1 and chance > 30 then - Game.createMonster("diamond servant replica", monster:getPosition(), false, true) - monster:remove() - return - end - - if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.MechanismGolden) >= 1 and chance > 30 then - Game.createMonster("golden servant replica", monster:getPosition(), false, true) - monster:remove() - end -end - local callback = EventCallback() function callback.monsterOnSpawn(monster, position) @@ -38,8 +11,6 @@ function callback.monsterOnSpawn(monster, position) monster:setReward(true) end - handleIronServantReplica(monster) - if not monster:getType():canSpawn(position) then monster:remove() else From af88e2bab806cff3987de8f3222b6d1b9b85db45 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 19 Feb 2024 22:22:05 -0300 Subject: [PATCH 9/9] fix: minor console errors (#2271) --- .../quests/threatened_dreams/event-raven_herb_bush.lua | 4 ++-- .../scripts/world_changes/spawns_npc_by_time.lua | 2 +- data/libs/core/global_storage.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua b/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua index 089935aad41..50d74d060b9 100644 --- a/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua +++ b/data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua @@ -5,7 +5,7 @@ local config = { pos = Position(33497, 32196, 7), herbId = 5953, herbWeight = 1, - storage = ThreatenedDreams.Mission03.RavenHerbTimer, + storage = Storage.Quest.U11_40.ThreatenedDreams.Mission03.RavenHerbTimer, } local createRavenHerb = GlobalEvent("createRavenHerb") @@ -55,5 +55,5 @@ function ravenHerb.onUse(player, item, fromPosition, target, toPosition, isHotke return true end -ravenHerb:aid(ThreatenedDreams.Mission03.RavenHerbTimer) +ravenHerb:id(25783) ravenHerb:register() diff --git a/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua b/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua index 4679804b6a5..5323f90cc85 100644 --- a/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua +++ b/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua @@ -6,7 +6,7 @@ local npcSpawns = { local spawnsNpcByTime = GlobalEvent("SpawnsNpcByTime") -function spawnsByTimeEvent.onPeriodChange(period) +function spawnsNpcByTime.onPeriodChange(period) for _, npcSpawn in ipairs(npcSpawns) do if npcSpawn.spawnPeriod == period then local spawnNpc = Game.createNpc(npcSpawn.name, npcSpawn.position) diff --git a/data/libs/core/global_storage.lua b/data/libs/core/global_storage.lua index 686595ae312..cfca535dc4b 100644 --- a/data/libs/core/global_storage.lua +++ b/data/libs/core/global_storage.lua @@ -25,6 +25,6 @@ Global = { Storage = { FamiliarSummonEvent10 = 30054, FamiliarSummonEvent60 = 30055, - CobraFlask = 30055, + CobraFlask = 30056, }, }