-
Notifications
You must be signed in to change notification settings - Fork 52
Action
MMOMinion edited this page Nov 30, 2013
·
6 revisions
- An Action is the central word we use for any kind of action your player can do, this includes skills/spells, usage of mounts, items, minions as well as interaction, some movement (jump etc) and all kinds of things you can see in your ingame Action and Traits menu. Actions are returned by the ActionList or by some functions like ActionList:Get(actionID) for directly accessing it.
- The Action object is a lua metatable itself, meaning it has attributes as well as functions.
- Here we are calling the ActionList to give us all Actions of the summoner. The 'd' - debug prints into the console the ID of the Actions as well as the Name.
- Example:
local al = ActionList("type=1,job=26")
if ( al ) then
local i,action = next(al)
while (i~=nil and action ~=nil) do
-- the 'd' command is a global command for printing out information into the console
d("ActionID: ".. tostring(i).. " ActionName: "..tostring(action.name))
i,action = next (al,i)
end
end
- The returned action is a lua table.
- The Action attributes can be accessed like this:
-- the 'd' command is a global command for printing out information into the console
d(action.id)
-- returns the unique ID of that action
d(action.casttime)
-- returns the casttime of that action
d(action.cd)
-- returns the cooldown of that action
d(action.range)
-- returns the range of that action
- name
- Returns Action Name (string).
- description
- Returns Action Description (string).
- id
- Returns Action ID (number).
- type
- Returns the ACTIONTYPE(number).
- cost
- Returns Action cost (MP/TP) (number).
- casttime
- Returns Action cast time (number).
- recasttime
- Returns Action recast time (number).
- cd
- Returns Action cooldown time (number).
- cdmax
- Returns Action maximum cooldown time (number).
- isoncd
- Returns if the Action is on cooldown (boolean).
- level
- Returns Action level (number).
- range
- Returns Action range (number).
- radius
- Returns Action radius (number).
- job
- Returns the JOB limitation of that Action (number).
- iscasting
- Returns if that Action is currently be cast (boolean).
- isready
- Returns if that Action is ready to be cast (boolean).
- Each Action has functions that can be used directly. In this example we are getting the action with the unique ID "190", which is the summoner's physick spell, and we are just casting it on the EntityID given to the castspell.
local mytarget = Player:GetTarget()
local myspell = ActionList:Get(190)
if ( mytarget and myspell.isready ) then
myspell:Cast(mytarget.id)
end
- :Cast()
- Casts this Action onto the currently selected target or on yourself if it is not an attack action.
- :Cast(EntityID)
- Casts this Action onto the EntityID or on yourself if the EntityID is not valid for this action./dd>