• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[c++] Adding event to monsters without editing each file.

slavi

#define SLAVI32 _WIN32
Senator
Joined
Sep 9, 2015
Messages
681
Solutions
11
Reaction score
561
GitHub
slavidodo
Hello Otlanders.

I want to add event "onHealthChange" to some monsters.

This can be done without editing each monster file?

I thought about an idea, it's to load configmanager array but I don't know how to do so.


Why I want to do that so?
I want to add this event to bosses while (onThink) and (onHealthChange).
 
its possible.
but will have some limitations i guess. for example @zbisu did this with one of his systems (maybe he can suggest something better now)
https://otland.net/threads/tfs-1-1-extra-loot-system.230102/
in there he added this
Code:
if not self then return true end
if self:isPlayer() and target:isMonster() then
target:registerEvent("extra_loot_d")
end
in this event
Code:
function Creature:onTargetCombat(target)

which means when a player targets the monster it would regist the event onto it. but for example if the monster is killed only with aoe attacks and never was targetted, i don't think it registers which is why i said there was limitations to it.

but its also really simple to just use for example notepad++ and register events onto all monsters with a few simple clicks, i would just go with that.
 
its possible.
but will have some limitations i guess. for example @zbisu did this with one of his systems (maybe he can suggest something better now)
https://otland.net/threads/tfs-1-1-extra-loot-system.230102/
in there he added this
Code:
if not self then return true end
if self:isPlayer() and target:isMonster() then
target:registerEvent("extra_loot_d")
end
in this event
Code:
function Creature:onTargetCombat(target)

which means when a player targets the monster it would regist the event onto it. but for example if the monster is killed only with aoe attacks and never was targetted, i don't think it registers which is why i said there was limitations to it.

but its also really simple to just use for example notepad++ and register events onto all monsters with a few simple clicks, i would just go with that.
That's exactly what I wanted. Thank you very much.
 
Back
Top