01-29-2014, 08:38 PM
The combat code was originally designed so that you could use either static class combat tasks or the skillmanager. If you look at the add_combat cne which is used for grinding and fate grinding, you'll see the following:
If the skillmanager is not enabled, then we will create a task using the current class, which is set in ffxiv.lua whenever we switch classes. You will see all the original class_routines in the class_routines subdirectory. Here's an example from the archer task:
It's pretty straightforward. Basically, you just create a cne for each spell and then add them to the task cne lists at whatever priority you choose. Unfortunately, nobody has toyed with this idea much since our initial beta testing so everything is horribly out of date. On top of that, much of the newer functionality was written without the option to use the class combat task - it only calls the skillmanager (pvp/duty both ignore the class combat tasks, for instance). You can play with creating a custom combat task and if it works out well for you then we can try to add the functionality for using it back into the rest of the newer code. I don't want to make any radical changes until I see whether it will actually be worthwhile or not.
Code:
function e_add_combat:execute()
if ( gSMactive == "1" ) then
local newTask = ffxiv_task_skillmgrAttack.Create()
newTask.targetid = ml_task_hub:CurrentTask().targetid
ml_task_hub:CurrentTask():AddSubTask(newTask)
else
local newTask = ml_global_information.CurrentClass.Create()
newTask.targetid = ml_task_hub:CurrentTask().targetid
ml_task_hub:CurrentTask():AddSubTask(newTask)
end
end
If the skillmanager is not enabled, then we will create a task using the current class, which is set in ffxiv.lua whenever we switch classes. You will see all the original class_routines in the class_routines subdirectory. Here's an example from the archer task:
Code:
c_ragingstrikes = inheritsFrom( ml_cause )
e_ragingstrikes = inheritsFrom( ml_effect )
function c_ragingstrikes:evaluate()
local skill = ActionList:Get(101,1)
if (skill ~= nil and skill.cd == 0) then
if (not HasBuff(Player.id, 125)) then
return true
end
end
return false
end
function e_ragingstrikes:execute()
local skill = ActionList:Get(101,1)
if (skill ~= nil and skill.cd == 0) then
skill:Cast() -- THIS NEEDS A TARGET
ml_task_hub:CurrentTask().prevSkillID = 101
end
end
function ffxiv_combat_archer:Init()
--init cnes
local ke_heavyshot = ml_element:create( "HeavyShot", c_heavyshot, e_heavyshot, 5 )
self:add( ke_heavyshot, self.process_elements)
local ke_straightshot = ml_element:create( "StraightShot", c_straightshot, e_straightshot, 10 )
self:add( ke_straightshot, self.process_elements)
local ke_venomousbite = ml_element:create( "VenomousBite", c_venomousbite, e_venomousbite, 11 )
self:add( ke_venomousbite, self.process_elements)
local ke_miserysend = ml_element:create( "MiserysEnd", c_miserysend, e_miserysend, 15 )
self:add( ke_miserysend, self.process_elements)
local ke_ragingstrikes = ml_element:create( "RagingStrikes", c_ragingstrikes, e_ragingstrikes, 15 )
self:add( ke_ragingstrikes, self.process_elements)
self:AddTaskCheckCEs()
end
It's pretty straightforward. Basically, you just create a cne for each spell and then add them to the task cne lists at whatever priority you choose. Unfortunately, nobody has toyed with this idea much since our initial beta testing so everything is horribly out of date. On top of that, much of the newer functionality was written without the option to use the class combat task - it only calls the skillmanager (pvp/duty both ignore the class combat tasks, for instance). You can play with creating a custom combat task and if it works out well for you then we can try to add the functionality for using it back into the rest of the newer code. I don't want to make any radical changes until I see whether it will actually be worthwhile or not.