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

Lua "Preprogrammed" monsters / NPCs, is it possible?

Astrax

Well-Known Member
Joined
May 18, 2008
Messages
106
Reaction score
73
As the title says, is it possible to make NPCs or monsters with "preprogrammed" movements and attacks?

i.e. a Boss npc/monster placed on a certain map that is programmed to move from one specific spot to another, and uses certain attacks when on certain spot (doesn't just just follow and attack the player blindly like a normal monster).
 
As far as I know, the monsters walk states are either within x sqm range from target, or attack with "follow" mode.

But it is possible to create AI to make lots of awesome stuff. I made some monsters cooperate, heal each other and decide to cast spells simultaneously to nuke you and so on.
You can also make monsters teleport around and so on. But this requires additional AI coding which can be done with creaturescripts.
(Basically any LUA function which uses "cid" in parameter can also be used with monsters). Cid = creature id, it just happens that players are simulated as humans in tibia which is a creature.

Basically use onThink and create their "brain" in LUA which triggers aprox 2 times each second.
 
Back
Top