• 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!

Feature [TFS 1.2] Monster:onSpawn(position, startup, artificial)

I am creating a system in which it is necessary to use such a function, in the same way I would have liked to see another solution to the problem, there should be no things that block the server in any way.
why would you need to create the monster just to remove? its an spawn monster event function so just return false. If the spawn teleport effect matters you can also remove or add it into a new "if" check
 
I am creating a system in which it is necessary to use such a function, in the same way I would have liked to see another solution to the problem, there should be no things that block the server in any way.
I've already seen the system you made, it's not necessary. You can respawn the monster without forcing monster:remove() and using return false instead.
 
If your pulls are up-to-date.

Don't do this:
events.cpp

replace
C++:
if (className == "Creature")
with
C++:
if (className == "Monster") {
   if (methodName == "onSpawn") {
       info.monsterOnSpawn = event;
   }
} else if (className == "Creature") {

Do this instead:
replace:
C++:
if (methodName == "onDropLoot") {
    info.monsterOnDropLoot = event;
} else {
with:
C++:
if (methodName == "onDropLoot") {
    info.monsterOnDropLoot = event;
} else if (methodName == "onSpawn") { // put it here instead
    info.monsterOnSpawn = event;
} else {
 
If your pulls are up-to-date.

Don't do this:


Do this instead:

replace:
C++:
if (methodName == "onDropLoot") {
    info.monsterOnDropLoot = event;
} else {
with:
C++:
if (methodName == "onDropLoot") {
    info.monsterOnDropLoot = event;
} else if (methodName == "onSpawn") { // put it here instead
    info.monsterOnSpawn = event;
} else {
 
Back
Top