-
Notifications
You must be signed in to change notification settings - Fork 52
ActionList
aceRage edited this page May 7, 2014
·
11 revisions
- The ActionList is a lua metatable and holds all the Spell/Skill/Action/Itemusage/Trait data there is.
- The ActionList returns a lua table, where the index of each entry represents the ActionID (aka. SpellID or SkillID) and the value is an object of type ACTION.
- IMPORTANT: Some Actions have the same ActionID, therefore you NEED to use the type filter when accessing the ActionList, else you may get weird results.
- The ActionList can be called with several filters, seperated by comma, which can be combined to get the Actions wanted. Make sure you use a combination of filters which can logically combined, meaning, using "type=1,type=9" wont work, since each of it excludes the usage of the other.
- 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))
local i,e = next(al,i)
end
end
- actionid=number
- Returns the Action with the ID of "number".
- type=number
- Returns all Actions of ACTIONTYPE "number".
- job=number
- Returns all Actions that belong to the JOB of "number". NOTE: This excludes all crossclass actions as well as general actions incl limitbreakers!
- minlevel=number
- Returns all Actions with a level larger than "number".
- maxlevel=number
- Returns all Actions with a level below "number".
- The ActionList has several functions that can be used to make your life easier ;).
- Example usage:
local action = ActionList:Get(ActionID)
if ( action ) then
d("ActionID: ".. tostring(action.id).. " ActionName : "..tostring(action.name))
end
- :Get(number,actiontype)
- Returns Action from the ActionList which has the unique ActionID "number". If that Action does not exist, an empty table will be returned. The argument ActionType is optional, if not used, the default ActionType "ACTION" is beeing used (which are basicly all your attack and healing skills).
- :Cast(actionID,TargetID,ActionType) -- please avoid the use of this, each action has its own functions refer to Action
- Casts the Action which has the actionID onto the Entity with the TargetID. For TargetID a 0 can be used, then the action will be cast onto the Player. The argument ActionType is optional, if not used, the default ActionType "ACTION" is beeing used (which are basicly all your attack and healing skills).
- :IsCasting()
- Returns if the Player is currently casting or is on global cooldown (boolean).
- :CanCast(ActionID,TargetID,ActionType)
- Checks if the Action with the ActionID can be Cast onto the Entity with TargetID. It basicly checks if that action is suitable for the target (you cant heal an enemy ;) ) and also if the target is in actionrange, if you are facing the target and if you have line of sight towards it. The argument ActionType is optional, if not used, the default ActionType "ACTION" is beeing used (which are basicly all your attack and healing skills).