RPGFigurine
An RPGFigurine is an in-game Object of a figurine with built-in animations. It has its own class, RPGFigurine, with functions associated with it. This allows you to manipulate the special properties of these figurines.
Function Summary
Object Functions
These functions are called like this: self.RPGFigurine.attack()
.
Event Functions
These functions are called by the game whenever a figurine attacks or is attacked. See details for example usage.
Function Details
Event Function Details
onAttack(...)
Activates when an attack is performed by an identified RPGFigurine Object. An attack is triggered via the context menu or pressing the appropriate number key. If another RPGFigurine is within its attack arch, then the function will be triggered with the figurine hit passed as a parameter.
onAttack(hit_list)
-- Monitoring and announcing a cyclops attacks function onLoad() cyclops = getObjectFromGUID("aaa111") function cyclops.RPGFigurine.onAttack(hit_list) for _, v in ipairs(hit_list) do print(v.getName() .. " was hit!") end end end
onHit(...)
Activates when an attack is performed on this RPGFigurine Object. An attack is triggered via the context menu or pressing the appropriate number key. If this RPGFigurine is within the attack radius, this function is triggered, passing a parameter of the Object which attacked.
-- Monitoring and announcing a cyclops being hit function onLoad() cyclops = getObjectFromGUID("aaa111") function cyclops.RPGFigurine.onHit(attacker) print(attacker.getName() .. " attacked the Cyclops!") end end