From b017101ba72f7cbcdbea0e301c021cf41c0a1849 Mon Sep 17 00:00:00 2001 From: Pablo Date: Sat, 23 Aug 2025 22:26:55 -0600 Subject: [PATCH 1/2] Add missing monsters with mechanics --- .../quests/feaster_of_souls/brother_worm.lua | 104 ++++++++++++++++++ .../quests/feaster_of_souls/the_unwelcome.lua | 7 ++ .../quests/feaster_of_souls/wormling.lua | 101 +++++++++++++++++ ...lua => actions_the_dread_maiden_lever.lua} | 0 ...lua => actions_the_fear_feaster_lever.lua} | 0 ...rm.lua => actions_the_pale_worm_lever.lua} | 0 .../actions_the_unwelcome.lua | 23 ---- .../actions_the_unwelcome_lever.lua | 54 +++++++++ .../creaturescripts_brother_worm_death.lua | 28 +++++ .../creaturescripts_wormling_death.lua | 31 ++++++ 10 files changed, 325 insertions(+), 23 deletions(-) create mode 100644 data-otservbr-global/monster/quests/feaster_of_souls/brother_worm.lua create mode 100644 data-otservbr-global/monster/quests/feaster_of_souls/wormling.lua rename data-otservbr-global/scripts/quests/feaster_of_souls/{actions_the_dread_maiden.lua => actions_the_dread_maiden_lever.lua} (100%) rename data-otservbr-global/scripts/quests/feaster_of_souls/{actions_the_fear_feaster.lua => actions_the_fear_feaster_lever.lua} (100%) rename data-otservbr-global/scripts/quests/feaster_of_souls/{actions_the_pale_worm.lua => actions_the_pale_worm_lever.lua} (100%) delete mode 100644 data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome.lua create mode 100644 data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua create mode 100644 data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_brother_worm_death.lua create mode 100644 data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_wormling_death.lua diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/brother_worm.lua b/data-otservbr-global/monster/quests/feaster_of_souls/brother_worm.lua new file mode 100644 index 00000000000..bca79116636 --- /dev/null +++ b/data-otservbr-global/monster/quests/feaster_of_souls/brother_worm.lua @@ -0,0 +1,104 @@ +local mType = Game.createMonsterType("Brother Worm") +local monster = {} + +monster.description = "Brother Worm" +monster.experience = 30000 +monster.outfit = { + lookType = 295, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, + lookMount = 0, +} + +monster.events = { + "BrotherWormDeath", +} + +monster.health = 300000 +monster.maxHealth = 300000 +monster.race = "undead" +monster.corpse = 8119 +monster.speed = 250 +monster.manaCost = 0 + +monster.changeTarget = { + interval = 60000, + chance = 0, +} + +monster.strategiesTarget = { + nearest = 70, + health = 10, + damage = 10, + random = 10, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = true, + illusionable = false, + canPushItems = true, + canPushCreatures = false, + staticAttackChance = 95, + targetDistance = 1, + runHealth = 1, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, +} + +monster.light = { + level = 0, + color = 0, +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.loot = {} + +monster.attacks = { + { name = "melee", interval = 2000, chance = 100, minDamage = 600, maxDamage = -800, condition = { type = CONDITION_POISON, totalDamage = 4, interval = 4000 } }, + { name = "combat", interval = 2000, chance = 30, type = COMBAT_EARTHDAMAGE, minDamage = -1125, maxDamage = -2250, radius = 6, effect = CONST_ME_CARNIPHILA, target = false }, +} + +monster.defenses = { + defense = 15, + armor = 10, + -- mitigation = ???, + { name = "speed", interval = 10000, chance = 40, speedChange = 510, effect = CONST_ME_MAGIC_GREEN, target = false, duration = 20000 }, + { name = "combat", interval = 2000, chance = 60, type = COMBAT_HEALING, minDamage = 350, maxDamage = 600, effect = CONST_ME_MAGIC_BLUE, target = false }, +} + +monster.elements = { + { type = COMBAT_PHYSICALDAMAGE, percent = 90 }, + { type = COMBAT_ENERGYDAMAGE, percent = 90 }, + { type = COMBAT_EARTHDAMAGE, percent = 90 }, + { type = COMBAT_FIREDAMAGE, percent = 90 }, + { type = COMBAT_LIFEDRAIN, percent = 90 }, + { type = COMBAT_MANADRAIN, percent = 90 }, + { type = COMBAT_DROWNDAMAGE, percent = 90 }, + { type = COMBAT_ICEDAMAGE, percent = 90 }, + { type = COMBAT_HOLYDAMAGE, percent = 90 }, + { type = COMBAT_DEATHDAMAGE, percent = 90 }, +} + +monster.immunities = { + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua index a3a283b0a7f..06a82b29be8 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua @@ -66,6 +66,13 @@ monster.light = { color = 0, } +monster.summon = { + maxSummons = 3, + summons = { + { name = "wormling", chance = 40, interval = 2000, count = 3 }, + }, +} + monster.voices = { interval = 5000, chance = 10, diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/wormling.lua b/data-otservbr-global/monster/quests/feaster_of_souls/wormling.lua new file mode 100644 index 00000000000..0d2f3cb0950 --- /dev/null +++ b/data-otservbr-global/monster/quests/feaster_of_souls/wormling.lua @@ -0,0 +1,101 @@ +local mType = Game.createMonsterType("Wormling") +local monster = {} + +monster.description = "a wormling" +monster.experience = 0 +monster.outfit = { + lookType = 1275, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, + lookMount = 0, +} + +monster.events = { + "WormlingDeath", +} + +monster.health = 5000 +monster.maxHealth = 5000 +monster.race = "venom" +monster.corpse = 32733 +monster.speed = 220 +monster.manaCost = 0 + +monster.changeTarget = { + interval = 4000, + chance = 0, +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = true, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 70, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, +} + +monster.light = { + level = 0, + color = 0, +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.loot = {} + +monster.attacks = { + { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -600 }, + { name = "combat", interval = 1000, chance = 40, type = COMBAT_PHYSICALDAMAGE, minDamage = -0, maxDamage = -350, radius = 2, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_HITBYPOISON, target = false }, + { name = "drunk", interval = 1000, chance = 70, range = 7, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_ENERGYAREA, target = false }, +} + +monster.defenses = { + defense = 15, + armor = 10, + mitigation = 0.28, + { name = "speed", interval = 10000, chance = 40, speedChange = 510, effect = CONST_ME_MAGIC_GREEN, target = false, duration = 5000 }, +} + +monster.elements = { + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 0 }, + { type = COMBAT_EARTHDAMAGE, percent = 0 }, + { type = COMBAT_FIREDAMAGE, percent = 0 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 0 }, +} + +monster.immunities = { + { type = "paralyze", condition = true }, + { type = "outfit", condition = true }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, +} + +mType:register(monster) diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_dread_maiden.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_dread_maiden_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_dread_maiden.lua rename to data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_dread_maiden_lever.lua diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_fear_feaster.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_fear_feaster_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_fear_feaster.lua rename to data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_fear_feaster_lever.lua diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_pale_worm.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_pale_worm_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_pale_worm.lua rename to data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_pale_worm_lever.lua diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome.lua deleted file mode 100644 index 92d952503a6..00000000000 --- a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome.lua +++ /dev/null @@ -1,23 +0,0 @@ -local config = { - boss = { - name = "The Unwelcome", - 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 }, - { pos = Position(33738, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33739, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33740, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33699, 31529, 14), - to = Position(33719, 31546, 14), - }, - exit = Position(33611, 31528, 10), -} - -local lever = BossLever(config) -lever:position({ x = 33735, y = 31537, z = 14 }) -lever:register() diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua new file mode 100644 index 00000000000..91f1706917b --- /dev/null +++ b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua @@ -0,0 +1,54 @@ +local config = { + boss = { + name = "The Unwelcome", + createFunction = function() + local pos1 = Position(33705, 31539, 14) + local pos2 = Position(33708, 31539, 14) + + -- Spawn The Unwelcome immediately + local theUnwelcome = Game.createMonster("The Unwelcome", pos2) + if not theUnwelcome then + print("Failed to spawn The Unwelcome.") + return + end + + local id = os.time() + theUnwelcome:beginSharedLife(id) + theUnwelcome:registerEvent("SharedLife") + pos2:sendMagicEffect(CONST_ME_TELEPORT) + + -- Delay Brother Worm spawn by 20 seconds (20000 ms) + addEvent(function() + local brotherWorm = Game.createMonster("Brother Worm", pos1) + if not brotherWorm then + print("Failed to spawn Brother Worm.") + return + end + + local id = os.time() + brotherWorm:beginSharedLife(id) + brotherWorm:registerEvent("SharedLife") + pos1:sendMagicEffect(CONST_ME_TELEPORT) + end, 20000) + return true + end + }, + timeToFightAgain = 20 * 60 * 60, -- 20 hours + 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 }, + { pos = Position(33738, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33739, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33740, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33699, 31529, 14), + to = Position(33719, 31546, 14), + }, + exit = Position(33611, 31528, 10), +} + +local lever = BossLever(config) +lever:position(Position(33735, 31537, 14)) +lever:register() diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_brother_worm_death.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_brother_worm_death.lua new file mode 100644 index 00000000000..41eb6856979 --- /dev/null +++ b/data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_brother_worm_death.lua @@ -0,0 +1,28 @@ +local event = CreatureEvent("BrotherWormDeath") + +function event.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified) + local centerPos = creature:getPosition() + local searchArea = { + startPos = Position(centerPos.x - 30, centerPos.y - 30, centerPos.z), + endPos = Position(centerPos.x + 30, centerPos.y + 30, centerPos.z), + } + + for x = searchArea.startPos.x, searchArea.endPos.x do + for y = searchArea.startPos.y, searchArea.endPos.y do + local tile = Tile(Position(x, y, centerPos.z)) + if tile then + local creatures = tile:getCreatures() + for _, targetCreature in ipairs(creatures) do + if targetCreature:isMonster() and targetCreature:getName():lower() == "the unwelcome" then + targetCreature:addHealth(-targetCreature:getMaxHealth()) + targetCreature:getPosition():sendMagicEffect(CONST_ME_MORTAREA) + return true + end + end + end + end + end + return true +end + +event:register() diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_wormling_death.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_wormling_death.lua new file mode 100644 index 00000000000..2d2c207f925 --- /dev/null +++ b/data-otservbr-global/scripts/quests/feaster_of_souls/creaturescripts_wormling_death.lua @@ -0,0 +1,31 @@ +local event = CreatureEvent("WormlingDeath") + +local explode = Combat() +explode:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) +local area = createCombatArea(AREA_SQUARE1X1) +explode:setArea(area) + +function onTargetTile(cid, pos) + local tile = Tile(pos) + local target = tile:getTopCreature() + + if tile then + if target and target:isPlayer() then + doTargetCombatHealth(0, target, COMBAT_EARTHDAMAGE, -750, -750) + end + end +end + +explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") + +function event.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified) + local centerPos = creature:getPosition() + + local var = { type = 1, number = creature:getId() } + + explode:execute(creature, var) + + return true +end + +event:register() From 50a72b5f76a11ca1eaa814b1858a11572aeb5594 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 24 Aug 2025 04:27:31 +0000 Subject: [PATCH 2/2] Lua code format - (Stylua) --- .../quests/feaster_of_souls/actions_the_unwelcome_lever.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua index 91f1706917b..8406cce6c6d 100644 --- a/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua +++ b/data-otservbr-global/scripts/quests/feaster_of_souls/actions_the_unwelcome_lever.lua @@ -31,7 +31,7 @@ local config = { pos1:sendMagicEffect(CONST_ME_TELEPORT) end, 20000) return true - end + end, }, timeToFightAgain = 20 * 60 * 60, -- 20 hours requiredLevel = 250,