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

[Request for devs] Creature Scripts...

Pedro B.

OpenTibia Official Dev
Joined
Aug 8, 2007
Messages
127
Reaction score
2
Location
Brazil
Heya.

Well, I just noticed that TFS is missing something that exists on OTS: the onKill() event.

onKill() is a creature event really useful, 'cause it is only executed when registered and you know which creatures the creature X killed, not which creatures died by X(there is a difference)

Why that? Let's suppose you got a quest. And you want that a player kill 20 wolves on this quest. Instead of registering an onDeath() event on every single wolf or using onPrepareDeath() to check if the player that killed the wolves is in the quest, you can simply register the onKill() event on that player so that when he kills a creature you verify if it is a wolf.

This is my main request.

My next request is about the onPrepareDeath(), the onLook() and the onThink() events. Make they work like onDeath() and onKill(), so they are only executed when they are registered on creatures(so you could even use onThink() with monsters, when registered)! This will give a great performance fix for the server, since you will only execute scripts when necessary!
Mainly, onLook() and onThink() are the most necessary, since they are executed at least every second!


And, my last request, create onSpawn() events for monsters, that should only be executed when registered(set by their xml files).

Thank you.
 
Heya.

Well, I just noticed that TFS is missing something that exists on OTS: the onKill() event.

onKill() is a creature event really useful, 'cause it is only executed when registered and you know which creatures the creature X killed, not which creatures died by X(there is a difference)

Why that? Let's suppose you got a quest. And you want that a player kill 20 wolves on this quest. Instead of registering an onDeath() event on every single wolf or using onPrepareDeath() to check if the player that killed the wolves is in the quest, you can simply register the onKill() event on that player so that when he kills a creature you verify if it is a wolf.


This is my main request.

My next request is about the onPrepareDeath(), the onLook() and the onThink() events. Make they work like onDeath() and onKill(), so they are only executed when they are registered on creatures(so you could even use onThink() with monsters, when registered)! This will give a great performance fix for the server, since you will only execute scripts when necessary!
Mainly, onLook() and onThink() are the most necessary, since they are executed at least every second!


And, my last request, create onSpawn() events for monsters, that should only be executed when registered(set by their xml files).

Thank you.

Pedro for the president! :thumbup::thumbup::thumbup:
Actually I'm using onDeath for the monsters event :<
 
Sorry for bumping this thread, but I really think this should be seen by the developers.
 
This is really helpful as Pedro said its really dumb writing ondeath() on every single monster*
 
I'd like to see onRespawn creaturescript :p It'll be really, really(!) nice and useful future.. :)
 
Code:
* Added fully working and so waited /ghost command (Thanks to Pedro B)
(Y)

Anyways, You still use the bad way of the creaturescripts :(
Really, you should make most of the functions(specially onThink and onLook) need registering before they are executed, this should increase the performance of the server.

And onSpawn() would be rather useful, since it would work like onLogin() :p
Perhaps you can enable onLogin() to be registered on monsters?

Also, onDeSpawn() that happens when the monster "logs out"(happens when a monster walk too far away) or onLogout() beeing able to be registered on monsters.

Thank you anyways.
 
*Bump*
Anyways, You still use the bad way of the creaturescripts
Really, you should make most of the functions(specially onThink and onLook) need registering before they are executed, this should increase the performance of the server.
Done :p
 
Back
Top