I've uploaded a version for LoG2 that includes almost ALL (40+) of the basic monsters. (
video here or
download demo and source here)
With a few lines of scripting it's easy to interact with them, give them something or command them to move.
Code: Select all
mdNPC.source:registerNPC("myNPC") -- registers the npc at the framework
mdNPC.source:setRoute("myNPC", "f") -- moves the npc one square forward (use 'f' for forward, 'l' for turn left, 'r' for turn right and 'w' to wait a tiny bit)
You can register functions that are called if the player clicks on the npc or gives something to the npc.
Warning: these functions are only called if the npc is not moving.
Code: Select all
mdNPC.source:setOnInteract("myNPC", myScriptEntity.script.myFunction) -- Means: Call the 'myFunction' in the script 'myScript' if the npc 'myNPC' is clicked on while the player has NO item on the cursor
mdNPC.source:setOnGive("myNPC", myScriptEntity.script.myFunction) -- Means: call the 'myFunctoin' in the script 'myScript' if the npc 'myNPC' is clicked while the player HAS an item on the cursor
For more info, check the source in the example from the link above.
Edit: It is not possible to add custom voices or sounds to the npcs