topaz icon indicating copy to clipboard operation
topaz copied to clipboard

some mobs having issues with onMobDeath [Canary commit 908442d]

Open kaincenteno opened this issue 4 years ago • 10 comments

  • [x] I have searched existing issues (https://github.com/topaz-next/topaz/issues) to see if the issue has already been opened
  • [x] I have checked the commit log to see if the issue has been resolved since my server was last updated
  • [ ] This issue occurs on release branch (if other branch, please specify)

Additional Information (Steps to reproduce/Expected behavior) : Killing a mob, the server will complain:

[23/Jan] [14:48:54] [Error] luautils::onMobDeath (./scripts/zones/Wajaom_Woodlands/mobs/Marid.lua): undefined procedure onMobDeath

kaincenteno avatar Jan 23 '21 23:01 kaincenteno

This issue will occur when a mob script does not contain onMobDeath(). I haven't seen any detrimental effects to date, but the solution would be to either implement empty placeholders or suppress the message (not a fan of the latter).

ghost avatar Jan 23 '21 23:01 ghost

The correct should be... file not found.

Gradius2 avatar Jan 24 '21 03:01 Gradius2

Create a file called: Marid.lua Save on: \scripts\zones\Wajaom_Woodlands\mobs

-----------------------------------
-- Area: Wajaom Woodlands
--  Mob: Marid
-----------------------------------
local ID = require("scripts/zones/Wajaom_Woodlands/IDs")
require("scripts/globals/mobs")

function onMobDeath(mob, player, isKiller)
end

function onMobDespawn(mob)
    tpz.mob.phOnDespawn(mob, ID.mob.MAHISHASURA_PH, 5, 10800) -- 3 hours
end

See if it was fixed.

Gradius2 avatar Jan 24 '21 03:01 Gradius2

Also, you will need to edit (and add) on IDs.lua, under \scripts\zones\Wajaom_Woodlands:

    mob =
    {
        MAHISHASURA_PH     =
        {
             [16986144] = 16986151, -- 142.000 -26.000 284.000
        },

I don't think the POS would be correct though. Checking is necessary.

Edit: Updated POS. Still needs checking.

Gradius2 avatar Jan 24 '21 03:01 Gradius2

Searching the DB:

INSERT INTO `mob_spawn_points` VALUES (16986144,'Marid','Marid',15,142,-26,284,127);
INSERT INTO `mob_spawn_points` VALUES (16986145,'Marid','Marid',15,133,-26,304,127);
INSERT INTO `mob_spawn_points` VALUES (16986150,'Marid','Marid',15,203,-24,279,127);
INSERT INTO `mob_spawn_points` VALUES (16986151,'Marid','Marid',15,207,-25,294,127);
----
INSERT INTO `mob_spawn_points` VALUES (16990296,'Marid','Marid',20,215,-18,372,127);
INSERT INTO `mob_spawn_points` VALUES (16990297,'Marid','Marid',20,209,-19,341,127);
INSERT INTO `mob_spawn_points` VALUES (16990298,'Marid','Marid',20,153,-15,355,127);
INSERT INTO `mob_spawn_points` VALUES (16990299,'Marid','Marid',20,149,-17,310,127);
INSERT INTO `mob_spawn_points` VALUES (16990304,'Marid','Marid',20,160,-15,328,127);
INSERT INTO `mob_spawn_points` VALUES (16990305,'Marid','Marid',20,163,-16,312,127);

Some of those will give you the clue you need.

See: mob_spawn_points.sql

HINT: [16986144] = 16986151, -- 142.000 -26.000 284.000

Gradius2 avatar Jan 24 '21 03:01 Gradius2

Historically, I think mobs needed to have a script with that function defined in it. I don't think that's the case anymore, should I just snip out this error message @TeoTwawki?

zach2good avatar Jan 24 '21 05:01 zach2good

I see.

Well, if so. Why the bug?

Gradius2 avatar Jan 25 '21 00:01 Gradius2

Create a file called: Marid.lua Save on: \scripts\zones\Wajaom_Woodlands\mobs

-----------------------------------
-- Area: Wajaom Woodlands
--  Mob: Marid
-----------------------------------
local ID = require("scripts/zones/Wajaom_Woodlands/IDs")
require("scripts/globals/mobs")

function onMobDeath(mob, player, isKiller)
end

function onMobDespawn(mob)
    tpz.mob.phOnDespawn(mob, ID.mob.MAHISHASURA_PH, 5, 10800) -- 3 hours
end

See if it was fixed.

Just noting that this occurred on Canary. This script wouldn't be functional, as those functions are now cached, and that does not return a table of functions.

ghost avatar Jan 25 '21 01:01 ghost

Historically, I think mobs needed to have a script with that function defined in it. I don't think that's the case anymore, should I just snip out this error message @TeoTwawki?

old project we all spawned from did funky things that bailed out too early if a script existed but didn't define the function, so then global stuff that didn't to happen did not. Note that if a script didn't exist at all there was no problem that case was planned for. but if the script existed, the original author(s) expected that the function would be there as well. A case of "oops, didn't think of and plan for that".

Which should definitely be corrected.

TeoTwawki avatar Jan 25 '21 16:01 TeoTwawki

just a heads up, as of this comment the release I got 3 days ago also has this issue.

SirGouki avatar Feb 21 '21 05:02 SirGouki