|
GearSwap: Custom commands for nuking
Server: Shiva
Game: FFXI
Posts: 28
By Shiva.Tilanna 2015-11-06 15:22:45
A couple weeks ago a few LS mates were talking about trying to adapt Mote's DNC custom commands ( found here) to nuking for SCH and BLM. I decided to take them up on the challenge and we've been using them to save tons of macro space, so I figured I'd share with the rest of the community as well in case anyone else would like to use them.
I should note, these require Mote's libraries, as they use a lot of the functionality provided by them.
Custom commands: Code gs c nuke # [ga/ja/ra/helix/am] [recast]
Casts a nuke of the tier of the number entered (#)
Optionally use ga for -ga spells (e.g. Thundaga II), ja for -ja spells (e.g. Thundaja), etc
Optionally add recast as the last argument to send a /recast message to the chat (e.g. /recast “Thunder VI”)
Configuration commands: Code gs c cycle nuketype
Cycles through the available nuke elements
gs c set nuketype Ice
Set the nuke element to ice
These commands will allow you to cast any main nukes. Basically, my thought with making these commands was, you could have one macro (or button, if you use custom keybinds as well) which cycles through the elements in order. Then, you could have as many macros as your job has spells to cast. Also, since NukeType is just another Mode (like OffenseMode, CastingMode, etc), you can set it directly to the element you want, like in the second example under the Configuration commands.
So for example, on SCH, since I generally stick to casting with whatever Storm buff I’ve used on myself, my nuking macro line goes something like this:
1: /console gs c cycle nuketype
2: /console gs c nuke 1 recast
3: /console gs c nuke 2 recast
4: /console gs c nuke 3 recast
5: /console gs c nuke 4 recast
6: /console gs c nuke 5 recast
7: /console gs c nuke 1 helix recast
That first macro allows me to cycle through the element types until I get the one I’m using (e.g. Wind for Aero spells), and then 2-6 do my tier 1-5 nuke spells, with 7 having my helix (I don’t have 1200 JPs on SCH yet, but the only change there would be change 1 to 2 for tier 2 helix).
BLM is a bit different, since I’m generally not getting storms and may want to change up nukes to double burst tier 6s if the mob doesn’t have some specific weakness. In this case, my CTRL macros 1-8 set the nuke type specifically (rather than cycling through it), and my ALT macros are tiers 1-6, ja, ga3, and ancient magic.
CTRL:
1: /console gs c set nuketype Earth
2: /console gs c set nuketype Wind
3: /console gs c set nuketype Ice
4: /console gs c set nuketype Fire
5: /console gs c set nuketype Water
6: /console gs c set nuketype Lightning
7: /console gs c set nuketype Light
8: /console gs c set nuketype Dark
ALT:
1: /console gs c nuke 1 recast
2: /console gs c nuke 2 recast
3: /console gs c nuke 3 recast
4: /console gs c nuke 4 recast
5: /console gs c nuke 5 recast
6: /console gs c nuke 6 recast
7: /console gs c nuke 1 ja recast
8: /console gs c nuke 3 ga recast
9: /console gs c nuke 1 am recast
10: /console gs c nuke 2 am recast
If this sounds like something you’d like to have for yourself, here’s how to go about adding it to your GearSwap:
First, here is a link to my GearSwap files for reference. I’ll be including code snippets in this post so you can easily copy/paste into your own files, but if you’re having trouble following, take a look at what I’ve done in mine and hopefully that will help.
Almost all of the code goes in your user-globals.lua file. It could all go into a <job>.lua file if you wanted, but since I use it across multiple jobs, I wanted to put it in globals to make it easier to modify.
Ok, first up is some spell mappings to make generating the input command easier:
Code elements.nuke_of = {
['Light']="Banish",
['Dark']="Comet",
['Fire']="Fire",
['Earth']="Stone",
['Water']="Water",
['Wind']="Aero",
['Ice']="Blizzard",
['Lightning']="Thunder"
}
elements.nukega_of = {
['Light']="Banishga",
['Fire']="Firaga",
['Earth']="Stonega",
['Water']="Waterga",
['Wind']="Aeroga",
['Ice']="Blizzaga",
['Lightning']="Thundaga"
}
elements.nukeja_of = {
['Fire']="Firaja",
['Earth']="Stoneja",
['Water']="Waterja",
['Wind']="Aeroja",
['Ice']="Blizzaja",
['Lightning']="Thundaja"
}
elements.nukera_of = {
['Fire']="Fira",
['Earth']="Stonera",
['Water']="Watera",
['Wind']="Aerora",
['Ice']="Blizzara",
['Lightning']="Thundara"
}
elements.helix_of = {
['Light']="Luminohelix",
['Dark']="Noctohelix",
['Fire']="Pyrohelix",
['Earth']="Geohelix",
['Water']="Hydrohelix",
['Wind']="Anemohelix",
['Ice']="Cryohelix",
['Lightning']="Ionohelix"
}
elements.ancientmagic_of = {
['Fire']="Flare",
['Earth']="Quake",
['Water']="Flood",
['Wind']="Tornado",
['Ice']="Freeze",
['Lightning']="Burst"
}
This adds a few extra tables to the elements table that gets created in the Mote-Mappings.lua file.
Next is adding the NukeType Mode:
Code function job_setup()
state.NukeType = M{['description']='Nuke Type', 'Earth', 'Wind', 'Ice', 'Fire', 'Water', 'Lightning', 'Light', 'Dark'}
end
Again, you could add this in your <job>.lua file, but putting it in globals makes it available for all jobs that may want to use it.
Then, we get to the meat of it, actually handling the custom commands:
Code function handle_nuking(cmdParams)
-- cmdParams[1] = nuke
-- cmdParams[2] = number (tier of nuke)
-- cmdParams[3] = ga, ja, ra for AoE, helix for helix, or am for ancient magic (or recast)
-- cmdParams[4] = recast
local fullSpell = ""
local spellName = ""
local spellTier = ""
-- get spell name based on the third parameter
-- if type isn't one of the known types (ga, ja, ra, helix), then default to elemental nuke
if cmdParams[3] == "ga" then
if elements.nukega_of[state.NukeType.current] then
spellName = elements.nukega_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ga spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "ja" then
if elements.nukeja_of[state.NukeType.current] then
spellName = elements.nukeja_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ja spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "ra" then
if elements.nukera_of[state.NukeType.current] then
spellName = elements.nukera_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ra spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "helix" then
if elements.helix_of[state.NukeType.current] then
spellName = elements.helix_of[state.NukeType.current]
else
add_to_chat(123,'Error: No helix spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "am" then
if elements.ancientmagic_of[state.NukeType.current] then
spellName = elements.ancientmagic_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ancient magic spell for element ['..state.NukeType.current..']')
return
end
else
if elements.nuke_of[state.NukeType.current] then
spellName = elements.nuke_of[state.NukeType.current]
else
add_to_chat(123,'Error: No nuke spell for element ['..state.NukeType.current..']')
return
end
end
spellTier = get_tier_roman(cmdParams[2])
if spellTier then
fullSpell = spellName.." "..spellTier
else
fullSpell = spellName
end
if cmdParams[3] == "recast" or cmdParams[4] == "recast" then
send_command('@input /recast "'..fullSpell..'"')
end
send_command('@input /ma "'..fullSpell..'" <t>')
end
function get_tier_roman(numeric)
if numeric == "1" then
return nil
elseif numeric == "2" then
return "II"
elseif numeric == "3" then
return "III"
elseif numeric == "4" then
return "IV"
elseif numeric == "5" then
return "V"
elseif numeric == "6" then
return "VI"
else
return nil
end
end
And finally, this is where you’ll need to modify your <job>.lua files:
NOTE: Your job file may already have the job_self_command function. If so, you will need to modify that function by adding the following:
Code if cmdParams[1]:lower() == 'nuke' then
handle_nuking(cmdParams)
eventArgs.handled = true
end
If your job file does not have the job_self_command function, you will need to add it:
Code function job_self_command(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'nuke' then
handle_nuking(cmdParams)
eventArgs.handled = true
end
end
You’ll need to do this for any job you want to use these commands on.
And that should be everything.
Some final notes, the reason for including Light and Dark elements is mostly for SCH to allow for helixes, but I did make Light map to Banish/Banishga for those who want to use this on WHM or /WHM. Dark also maps to Comet for use on BLM.
Hopefully you find this useful. If you have any questions or comments, let me know.
A couple weeks ago a few LS mates were talking about trying to adapt Mote's DNC custom commands ( found here) to nuking for SCH and BLM. I decided to take them up on the challenge and we've been using them to save tons of macro space, so I figured I'd share with the rest of the community as well in case anyone else would like to use them.
I should note, these require Mote's libraries, as they use a lot of the functionality provided by them.
Custom commands: Code gs c nuke # [ga/ja/ra/helix/am] [recast]
Casts a nuke of the tier of the number entered (#)
Optionally use ga for -ga spells (e.g. Thundaga II), ja for -ja spells (e.g. Thundaja), etc
Optionally add recast as the last argument to send a /recast message to the chat (e.g. /recast “Thunder VI”)
Configuration commands: Code gs c cycle nuketype
Cycles through the available nuke elements
gs c set nuketype Ice
Set the nuke element to ice
These commands will allow you to cast any main nukes. Basically, my thought with making these commands was, you could have one macro (or button, if you use custom keybinds as well) which cycles through the elements in order. Then, you could have as many macros as your job has spells to cast. Also, since NukeType is just another Mode (like OffenseMode, CastingMode, etc), you can set it directly to the element you want, like in the second example under the Configuration commands.
So for example, on SCH, since I generally stick to casting with whatever Storm buff I’ve used on myself, my nuking macro line goes something like this:
1: /console gs c cycle nuketype
2: /console gs c nuke 1 recast
3: /console gs c nuke 2 recast
4: /console gs c nuke 3 recast
5: /console gs c nuke 4 recast
6: /console gs c nuke 5 recast
7: /console gs c nuke 1 helix recast
That first macro allows me to cycle through the element types until I get the one I’m using (e.g. Wind for Aero spells), and then 2-6 do my tier 1-5 nuke spells, with 7 having my helix (I don’t have 1200 JPs on SCH yet, but the only change there would be change 1 to 2 for tier 2 helix).
BLM is a bit different, since I’m generally not getting storms and may want to change up nukes to double burst tier 6s if the mob doesn’t have some specific weakness. In this case, my CTRL macros 1-8 set the nuke type specifically (rather than cycling through it), and my ALT macros are tiers 1-6, ja, ga3, and ancient magic.
CTRL:
1: /console gs c set nuketype Earth
2: /console gs c set nuketype Wind
3: /console gs c set nuketype Ice
4: /console gs c set nuketype Fire
5: /console gs c set nuketype Water
6: /console gs c set nuketype Lightning
7: /console gs c set nuketype Light
8: /console gs c set nuketype Dark
ALT:
1: /console gs c nuke 1 recast
2: /console gs c nuke 2 recast
3: /console gs c nuke 3 recast
4: /console gs c nuke 4 recast
5: /console gs c nuke 5 recast
6: /console gs c nuke 6 recast
7: /console gs c nuke 1 ja recast
8: /console gs c nuke 3 ga recast
9: /console gs c nuke 1 am recast
10: /console gs c nuke 2 am recast
If this sounds like something you’d like to have for yourself, here’s how to go about adding it to your GearSwap:
First, here is a link to my GearSwap files for reference. I’ll be including code snippets in this post so you can easily copy/paste into your own files, but if you’re having trouble following, take a look at what I’ve done in mine and hopefully that will help.
Almost all of the code goes in your user-globals.lua file. It could all go into a <job>.lua file if you wanted, but since I use it across multiple jobs, I wanted to put it in globals to make it easier to modify.
Ok, first up is some spell mappings to make generating the input command easier:
Code elements.nuke_of = {
['Light']="Banish",
['Dark']="Comet",
['Fire']="Fire",
['Earth']="Stone",
['Water']="Water",
['Wind']="Aero",
['Ice']="Blizzard",
['Lightning']="Thunder"
}
elements.nukega_of = {
['Light']="Banishga",
['Fire']="Firaga",
['Earth']="Stonega",
['Water']="Waterga",
['Wind']="Aeroga",
['Ice']="Blizzaga",
['Lightning']="Thundaga"
}
elements.nukeja_of = {
['Fire']="Firaja",
['Earth']="Stoneja",
['Water']="Waterja",
['Wind']="Aeroja",
['Ice']="Blizzaja",
['Lightning']="Thundaja"
}
elements.nukera_of = {
['Fire']="Fira",
['Earth']="Stonera",
['Water']="Watera",
['Wind']="Aerora",
['Ice']="Blizzara",
['Lightning']="Thundara"
}
elements.helix_of = {
['Light']="Luminohelix",
['Dark']="Noctohelix",
['Fire']="Pyrohelix",
['Earth']="Geohelix",
['Water']="Hydrohelix",
['Wind']="Anemohelix",
['Ice']="Cryohelix",
['Lightning']="Ionohelix"
}
elements.ancientmagic_of = {
['Fire']="Flare",
['Earth']="Quake",
['Water']="Flood",
['Wind']="Tornado",
['Ice']="Freeze",
['Lightning']="Burst"
}
This adds a few extra tables to the elements table that gets created in the Mote-Mappings.lua file.
Next is adding the NukeType Mode:
Code function job_setup()
state.NukeType = M{['description']='Nuke Type', 'Earth', 'Wind', 'Ice', 'Fire', 'Water', 'Lightning', 'Light', 'Dark'}
end
Again, you could add this in your <job>.lua file, but putting it in globals makes it available for all jobs that may want to use it.
Then, we get to the meat of it, actually handling the custom commands:
Code function handle_nuking(cmdParams)
-- cmdParams[1] = nuke
-- cmdParams[2] = number (tier of nuke)
-- cmdParams[3] = ga, ja, ra for AoE, helix for helix, or am for ancient magic (or recast)
-- cmdParams[4] = recast
local fullSpell = ""
local spellName = ""
local spellTier = ""
-- get spell name based on the third parameter
-- if type isn't one of the known types (ga, ja, ra, helix), then default to elemental nuke
if cmdParams[3] == "ga" then
if elements.nukega_of[state.NukeType.current] then
spellName = elements.nukega_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ga spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "ja" then
if elements.nukeja_of[state.NukeType.current] then
spellName = elements.nukeja_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ja spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "ra" then
if elements.nukera_of[state.NukeType.current] then
spellName = elements.nukera_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ra spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "helix" then
if elements.helix_of[state.NukeType.current] then
spellName = elements.helix_of[state.NukeType.current]
else
add_to_chat(123,'Error: No helix spell for element ['..state.NukeType.current..']')
return
end
elseif cmdParams[3] == "am" then
if elements.ancientmagic_of[state.NukeType.current] then
spellName = elements.ancientmagic_of[state.NukeType.current]
else
add_to_chat(123,'Error: No ancient magic spell for element ['..state.NukeType.current..']')
return
end
else
if elements.nuke_of[state.NukeType.current] then
spellName = elements.nuke_of[state.NukeType.current]
else
add_to_chat(123,'Error: No nuke spell for element ['..state.NukeType.current..']')
return
end
end
spellTier = get_tier_roman(cmdParams[2])
if spellTier then
fullSpell = spellName.." "..spellTier
else
fullSpell = spellName
end
if cmdParams[3] == "recast" or cmdParams[4] == "recast" then
send_command('@input /recast "'..fullSpell..'"')
end
send_command('@input /ma "'..fullSpell..'" <t>')
end
function get_tier_roman(numeric)
if numeric == "1" then
return nil
elseif numeric == "2" then
return "II"
elseif numeric == "3" then
return "III"
elseif numeric == "4" then
return "IV"
elseif numeric == "5" then
return "V"
elseif numeric == "6" then
return "VI"
else
return nil
end
end
And finally, this is where you’ll need to modify your <job>.lua files:
NOTE: Your job file may already have the job_self_command function. If so, you will need to modify that function by adding the following:
Code if cmdParams[1]:lower() == 'nuke' then
handle_nuking(cmdParams)
eventArgs.handled = true
end
If your job file does not have the job_self_command function, you will need to add it:
Code function job_self_command(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'nuke' then
handle_nuking(cmdParams)
eventArgs.handled = true
end
end
You’ll need to do this for any job you want to use these commands on.
And that should be everything.
Some final notes, the reason for including Light and Dark elements is mostly for SCH to allow for helixes, but I did make Light map to Banish/Banishga for those who want to use this on WHM or /WHM. Dark also maps to Comet for use on BLM.
Hopefully you find this useful. If you have any questions or comments, let me know.
|
|