melia
melia copied to clipboard
AI
Monsters and pets need server-side AIs to be able to do combat and follow their masters. For this purpose, I'm currently working on a script-based AI system in the branch add/ai.
Example:
function init()
on("idle", "hit", "on_hit")
end
function idle()
wander()
wait(5000)
end
function aggro()
say("I hate you!")
wait(1000)
attack()
wait(3000)
end
function on_hit(attacker)
say("Ouchie!")
end