mirror of
https://github.com/opentibiabr/canary
synced 2026-08-16 06:26:09 -04:00
1. Fixes a minor issue where, when emptying the balloons, they were transformed into 255 instead of being reset to 1. 2. Adjusts the usage of the "bathtub" in datapacks, in addition to the RLMap, ensuring better compatibility. 3. Makes minor aesthetic changes to enhance the code's readability. Resolves #2923
27 lines
830 B
Lua
27 lines
830 B
Lua
local monsterDeath = CreatureEvent("monsterDeath")
|
|
|
|
function monsterDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamageUnjustified)
|
|
if creature and creature:isMonster() then
|
|
local self = creature:getStorageValue(MonsterStorage.Spawn.monster_spawn_object)
|
|
self:executeFunctionMonster("onDeath", creature)
|
|
self:deleteMonster(creature)
|
|
return true
|
|
end
|
|
return true
|
|
end
|
|
|
|
monsterDeath:register()
|
|
|
|
local monsterDeathBoss = CreatureEvent("monsterDeathBoss")
|
|
|
|
function monsterDeathBoss.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamageUnjustified)
|
|
if creature and creature:isMonster() then
|
|
local self = creature:getStorageValue(MonsterStorage.Spawn.monster_spawn_object)
|
|
self:removeSpawn()
|
|
self:removeMonsters()
|
|
return true
|
|
end
|
|
return true
|
|
end
|
|
|
|
monsterDeathBoss:register()
|