Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions data-otservbr-global/monster/quests/feaster_of_souls/brother_worm.lua
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
101 changes: 101 additions & 0 deletions data-otservbr-global/monster/quests/feaster_of_souls/wormling.lua
Original file line number Diff line number Diff line change
@@ -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)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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()