melia icon indicating copy to clipboard operation
melia copied to clipboard

AI

Open exectails opened this issue 4 years ago • 0 comments

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

exectails avatar Oct 17 '21 22:10 exectails