|
Scholar Gearswap .lua
Serveur: Cerberus
Game: FFXI
Posts: 1809
By Cerberus.Shadowmeld 2017-08-15 13:55:33
You do have all your if Statements closed looking more in depth, but your rules for Enfeebling and Dark Magic are nested inside the check for Elemental Magic and will never equip.
elseif spell.skill == "ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
end
if spell.skill == "ElementalMagic" then
equip(sets.midcast_ElementalMagic)
if spell.skill == 'EnfeeblingMagic' then
equip(sets.midcast_EnfeeblingMagic)
if spell.skill == 'DarkMagic' then
equip(sets.midcast_DarkMagic)
end
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Phalanx' then
Cerberus.Lauranna
Serveur: Cerberus
Game: FFXI
Posts: 17
By Cerberus.Lauranna 2017-08-16 11:15:39
Cerberus.Shadowmeld said: »You've got a lot of issues, but here are a few
Code
function midcast(spell, action, spellMap, eventArgs)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
if sets.staves.damage[spell.element] then
equip(sets.staves.damage[spell.element])
end
elseif spell.skill == "ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
end
if spell.skill == "ElementalMagic" then
equip(sets.midcast_ElementalMagic)
if spell.skill == 'EnfeeblingMagic' then
equip(sets.midcast_EnfeeblingMagic)
if spell.skill == 'DarkMagic' then
equip(sets.midcast_DarkMagic)
end
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Phalanx' then
equip(sets['midcast_Phalanx'])
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'EnhancingMagic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
You've got a bunch of un-ended if statements. I'm surprised it actually loads properly honestly.
Key info.
Magic skills are not one word. ElementalMagic should be Elemental Magic. You have errors of this nature on lines 132, 136, 138, 140, and 163
On line 135 you inexplicably end your if-else checks and then do 3 consecutive if statements, only 1 of which is ended properly, then you have a rogue else statement that isn't tied to any specific if statement.
I think those two would fix most of your issues, but I would also like to point out that you have some really inefficient steps in your code.
If I might suggest, I would structure it closer to this: Code
function midcast(spell)
if spell.skill == 'Healing Magic' then
if spell.name:startswith("Cure") or spell.name:startswith("Curaga") then
-- I changed this because the way you had it before it would catch Cursna as well. This way you can make rules for cursna later
equip(sets.midcast_Cure)
-- Chatoyant staff and obi rules here
end
elseif spell.skill == 'Elemental Magic' then
if spell.name == 'Impact' then
-- Impact rule
elseif spell.name:find("helix") then
-- Helix Rule
else
equip(sets.midcast_ElementalMagic)
-- obi rule here
end
elseif spell.skill == 'Enhancing Magic' then
elseif spell.skill == 'Enfeebling Magic' then
elseif spell.skill == 'Dark Magic' then
end
end
This way your if statements flow properly and your code would be more efficient. Does that make sense?
Thank you for your advice, i'll make the change.
I'm having 2 more issues if you have a clue about these
When I cast Impact it properly change to my fast cast set + twilight cloak but it never change to my Impact set.
When I use any JA, it changes to my fast cast set Oo
Here is the link of the new script: https://pastebin.com/KrBzAAA2
Cerberus.Lauranna
Serveur: Cerberus
Game: FFXI
Posts: 17
By Cerberus.Lauranna 2017-08-16 11:17:21
Cerberus.Shadowmeld said: »You do have all your if Statements closed looking more in depth, but your rules for Enfeebling and Dark Magic are nested inside the check for Elemental Magic and will never equip.
elseif spell.skill == "ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
end
if spell.skill == "ElementalMagic" then
equip(sets.midcast_ElementalMagic)
if spell.skill == 'EnfeeblingMagic' then
equip(sets.midcast_EnfeeblingMagic)
if spell.skill == 'DarkMagic' then
equip(sets.midcast_DarkMagic)
end
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Phalanx' then
As a total noob in progamming, can you explain to me what's the difference between elseif and if and when they need to be ended ? (English isn't my birth language so it's not obvious to me ^^)
By Sidiov 2017-08-16 13:21:28
Cerberus.Lauranna said: »As a total noob in progamming, can you explain to me what's the difference between elseif and if and when they need to be ended ? (English isn't my birth language so it's not obvious to me ^^) You can refer to the lua site for documentation on stuff like this:
https://www.lua.org/pil/4.3.1.html
Cerberus.Lauranna
Serveur: Cerberus
Game: FFXI
Posts: 17
By Cerberus.Lauranna 2017-08-16 13:47:24
Cerberus.Lauranna said: »As a total noob in progamming, can you explain to me what's the difference between elseif and if and when they need to be ended ? (English isn't my birth language so it's not obvious to me ^^) You can refer to the lua site for documentation on stuff like this:
https://www.lua.org/pil/4.3.1.html
Oh thanks a lot !
Serveur: Cerberus
Game: FFXI
Posts: 1809
By Cerberus.Shadowmeld 2017-08-17 07:55:43
Line 116, you say if spell.english == 'Elemental Magic', it should be spell.skill. Also line 138 with Enhancing magicThat might fix your issue.
Specific to lua, if you write an if statement. It thinks everything following the if statement is inside of it until it comes to an else, elseif, or end. end is like closing the brackets in other programming languages. So when you have something like this
if spell.skill == 'Elemental Magic' then
equip(someset)
if spell.skill == 'Enhancing Magic' then
equip(someset)
end
that end is ending the Enhancing Magic rule, but....
it can never actually get to the Enhancing Magic equip because before it can do that it has to pass an if check of whether it is Elemental Magic.
You're also not going to want to do multiple checks for the same skill the way you are doing it. Specifically Elemental and Enhancing Magic.
Change: Code
elseif spell.english == 'Elemental Magic' then
if spell.name == 'Impact' then
equip(sets['midcast_Impact'])
elseif spell.name:find("helix") then
equip(sets['midcast_Helix'])
end
elseif spell.skill == 'Elemental Magic' then
equip(sets.midcast_ElementalMagic)
To: Code
elseif spell.english == 'Elemental Magic' then
if spell.name == 'Impact' then
equip(sets['midcast_Impact'])
elseif spell.name:find("helix") then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
end
if buffactive.Ebullience then
equip({head = "Svnt. Bonnet +2"})
end
if buffactive.Klimaform then
equip({feet = "Svnt. Loafers +2"})
end
and Change: Code
elseif spell.skill == "Enhancing Magic" then
if string.find(spell.english,'storm') then
equip(sets['midcast_EnhancingMagic'])
end
--[[
These are in the wrong place. Should be in your elemental magic rules.
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end]]
elseif spell.english == 'Enhancing Magic' then
if spell.name == 'Phalanx' then
equip(sets['midcast_Phalanx'])
if spell.name == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
if spell.name == 'Embrava' then
equip(sets['midcast_Embrava'])
end
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
To: Code
elseif spell.skill == 'Enhancing Magic' then
if spell.name == 'Phalanx' then
equip(sets.midcast_Phalanx)
elseif spell.name == 'Stoneskin' then
equip(sets.midcast_Stoneskin)
elseif spell.name == 'Embrava' then
equip(sets.midcast_Embrava)
if not buffactive.Perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.Accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.Penury then
add_to_chat(8,'--------- Penury is down ---------')
end
else
equip(sets.midcast_EnhancingMagic)
end
if buffactive.Perpetuance then
equip({hands = "Svnt. Bracers +2"})
end
end
One last note. Capitalization matters.
if buffactive.perpetuance will always return false. This is because the name is capitalized. if buffactive.Perpetuance is correct.
Cerberus.Lauranna
Serveur: Cerberus
Game: FFXI
Posts: 17
By Cerberus.Lauranna 2017-08-17 12:25:51
Cerberus.Shadowmeld said: »Line 116, you say if spell.english == 'Elemental Magic', it should be spell.skill. Also line 138 with Enhancing magicThat might fix your issue.
Specific to lua, if you write an if statement. It thinks everything following the if statement is inside of it until it comes to an else, elseif, or end. end is like closing the brackets in other programming languages. So when you have something like this
if spell.skill == 'Elemental Magic' then
equip(someset)
if spell.skill == 'Enhancing Magic' then
equip(someset)
end
Thank you for all your advices, it's more clear now. I'll make the change :)
that end is ending the Enhancing Magic rule, but....
it can never actually get to the Enhancing Magic equip because before it can do that it has to pass an if check of whether it is Elemental Magic.
You're also not going to want to do multiple checks for the same skill the way you are doing it. Specifically Elemental and Enhancing Magic.
Change: Code
elseif spell.english == 'Elemental Magic' then
if spell.name == 'Impact' then
equip(sets['midcast_Impact'])
elseif spell.name:find("helix") then
equip(sets['midcast_Helix'])
end
elseif spell.skill == 'Elemental Magic' then
equip(sets.midcast_ElementalMagic)
To: Code
elseif spell.english == 'Elemental Magic' then
if spell.name == 'Impact' then
equip(sets['midcast_Impact'])
elseif spell.name:find("helix") then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
end
if buffactive.Ebullience then
equip({head = "Svnt. Bonnet +2"})
end
if buffactive.Klimaform then
equip({feet = "Svnt. Loafers +2"})
end
and Change: Code
elseif spell.skill == "Enhancing Magic" then
if string.find(spell.english,'storm') then
equip(sets['midcast_EnhancingMagic'])
end
--[[
These are in the wrong place. Should be in your elemental magic rules.
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end]]
elseif spell.english == 'Enhancing Magic' then
if spell.name == 'Phalanx' then
equip(sets['midcast_Phalanx'])
if spell.name == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
if spell.name == 'Embrava' then
equip(sets['midcast_Embrava'])
end
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
To: Code
elseif spell.skill == 'Enhancing Magic' then
if spell.name == 'Phalanx' then
equip(sets.midcast_Phalanx)
elseif spell.name == 'Stoneskin' then
equip(sets.midcast_Stoneskin)
elseif spell.name == 'Embrava' then
equip(sets.midcast_Embrava)
if not buffactive.Perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.Accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.Penury then
add_to_chat(8,'--------- Penury is down ---------')
end
else
equip(sets.midcast_EnhancingMagic)
end
if buffactive.Perpetuance then
equip({hands = "Svnt. Bracers +2"})
end
end
One last note. Capitalization matters.
if buffactive.perpetuance will always return false. This is because the name is capitalized. if buffactive.Perpetuance is correct.
Thanks for your advices, i'm gonna make the change
By Antisense 2017-08-17 13:12:01
I haven't had issues with capitalization of abilities. I have used Byrth's sample lua scripts as examples and they do not have ability names capitalized for the buffactive state
Serveur: Cerberus
Game: FFXI
Posts: 1809
By Cerberus.Shadowmeld 2017-08-18 07:49:15
Interesting. I didn't know that. I guess I just assumed that it was case sensitive like other tables.
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-23 16:56:27
Can anyone post a up-to-date SCH lua that they're currently using that they dont mind sharing xD. THX!
Bahamut.Ayasha
Serveur: Bahamut
Game: FFXI
Posts: 96
By Bahamut.Ayasha 2017-08-23 17:07:08
If you check your inbox, I sent you a link to the one I use. Here it is again, though.
[+]
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-23 18:13:37
Thanks! A lot, also finding out a few here and there gear that i need lol. Reading it now trying to understand this thing while i camp nms.
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-23 18:50:30
Hmmmm... How is this going to work, i currently main Ames (club) ammurapi shield on light arts and akademos on dark arts.
Does this mean i cannot lockstyle with Lua till i get a healer staff or a nuking wand/shield?
Can lua automatically apply lockstyle sets on conditions?
Leviathan.Isiolia
Serveur: Leviathan
Game: FFXI
Posts: 472
By Leviathan.Isiolia 2017-08-23 19:44:09
There are LUAs that lock/unlock gear (Mote's THF one with TH sets for instance). You can likely have it push the command in when you use arts.
An alternative, if you simply have times you want to ensure you don't blink or lose TP or whatnot is to disable the slot(s) and just manually equip the weapon you want. That way you can still set up optimal sets for times when swapping is okay.
For instance, if I want to keep TP for Myrkr, I just open the console and type:
gs disable main
gs disable sub
Then equip Akademos and grip. To get it all swapping again:
gs enable all
You can also do that for things like CP capes.
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 09:09:38
Trying to understand the lua pasted above before i start using it.
Can someone explain what the lines below mean?
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'Normal' then
disable('main','sub','range')
else
enable('main','sub','range')
end
end
end
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 09:51:30
I also have a question about this line on Precast:
feet="Peda. Loafers +1"
Question 1: Can I just type in the entire name of the item? I.E. Pedagogy Loafers +1
Question 2: Wouldn't it be better to use Academic Loafers +2 since it reduces spellcasting time by 10%?
Thx!
Shiva.Spynx
Serveur: Shiva
Game: FFXI
Posts: 371
By Shiva.Spynx 2017-08-24 10:08:16
Regarding the first question: Code
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'Normal' then
disable('main','sub','range')
else
enable('main','sub','range')
end
end
end
job_state_change triggers when you use one of the F# shortcuts (by default, then you can define your own) on your keyboard, in this particular case it is F9 that changes your "Offense mode" between the options defined in user_setup.
Quote: state.OffenseMode:options('None', 'Normal') The code flow is:
Check if the status changes meaning "Did the user press a F#?"
Check if the value that changed was "Offense Mode" meaning "Did the user press F9?"
Check the new value, if it's "Normal" then disable main/sub/range slots to avoid losing TP on swaps (e.g. you will need to WS or use Myrkr)
If the value is "None" then enable the slots back so you can for instance swap in enhancing duration or DT weapons
Moving to the second set of questions:
1. You can use either the full or contract version of the equip name so "Peda. Loafers +1" and "Pedagogy Loafers +1" both work in the same way.
2. "Grimoire: Spellcasting time" is awesome as it goes beyond fast cast but if you can't reach the fast cast cap(80) you are better off using something like merlinic feet (up to 12FC with Fern). If you can reach 80FC with other slots/traits, use Academic by all means, if you cannot go with higher FC options (at least 10 or grimoire will still win). With Celerity/Alacrity, Pedagody will win so you can make a rule for that
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 10:16:10
Thx!
Another question, on my Lugh's Cape the 3rd Augment says "Mag.Acc+20/Mag.Dmg.+20"
How do I write that down in code?
'Mag.Acc.+20 Mag.Dmg.+20' or 'Mag.Acc.+20/Mag.Dmg.+20'
Trying to make this code right or else it would take hours debugging xD.
Shiva.Spynx
Serveur: Shiva
Game: FFXI
Posts: 371
By Shiva.Spynx 2017-08-24 10:23:39
For augmented gear, use the gearswap export functionality that will export all the augments in the right format. Just equip the item and run
Or if you want to run it on your whole inventory
This will create a file in your Windower4\addons\GearSwap\data\export folder with a list of all the gear(including augs!) that you can just copy over to your GS file. Anyways, the syntax for your Lugh cape would be: Code { name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}}
Remove the INT+10 part if you didn't use dye Code { name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}}
[+]
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 10:25:11
Also this line.
sets.precast.FC.Stoneskin = set_combine(sets.precast.FC, {head="Umuthi hat", hands="Carapacho cuffs", legs="Doyen pants", waist="Siegel sash"})
I only have the Doyen Pants, can I just leave the code as it is and the code will just ignore the other 3 missing equipment gearswaps or should I change/remove it?
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 10:27:12
O wow Thanks That helped a lot!!
Leviathan.Isiolia
Serveur: Leviathan
Game: FFXI
Posts: 472
By Leviathan.Isiolia 2017-08-24 10:32:08
Something you can also do for augmented items is define them so that you can just use a short, convenient name instead (and only have to worry about changing one line if you upgrade further or get better augments later).
In the Gearswap support thread, back a few pages ( http://www.ffxiah.com/forum/topic/41580/gearswap-support-thread/123/ ) you can use the same information about how to use multiples of the same augmentable item.
You can leave items you don't have in gear sets. It's no different than if you left them in your mog safe or something.
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 10:41:25
Thx, quick question, does anyone know how to unload those spell timers on the left? cant see my gear's stats...
Serveur: Cerberus
Game: FFXI
Posts: 1809
By Cerberus.Shadowmeld 2017-08-24 10:57:09
In console:
unload timers
In chat:
//unload timers
Leviathan.Hirasaki
Serveur: Leviathan
Game: FFXI
Posts: 26
By Leviathan.Hirasaki 2017-08-24 14:50:09
thx!
Another question: Is spell interruption rate down gear supposed to be on pre-cast or midcast?
Shiva.Spynx
Serveur: Shiva
Game: FFXI
Posts: 371
By Shiva.Spynx 2017-08-24 15:22:23
Midcast but it's one of those thing where either you cap it (need 102% between gear/merits) or you will still be interrupted pretty often if you have several mobs on you
Necro Bump Detected!
[271 days between previous and next post]
By mrlooolz 2018-05-22 19:24:08
Reviving an old thread!
With the new options of Regal earring and bonus accessories from Omen. I was wondering if someone could share a good updated lua with me. Just got back into the game after a 15 months break and really enjoying going back to SCH. I forgot how powerful they are.
I'd love for some to share their lua , so I can take a look what gear I need to update and also upgrade my current simple lua that is from 2015.
Valefor.Madranta
Serveur: Valefor
Game: FFXI
Posts: 89
By Valefor.Madranta 2018-05-22 22:34:56
You can take a look at my SCH lua in the below Google Drive. I just recently leveled the job so I'm not the best to refer to for top gear but the lua itself is quite functional.
https://drive.google.com/open?id=1cG5jhLZg4BXUmGN3oXRAA-gqpktfV1Ie
By mrlooolz 2018-05-23 01:37:42
hey. It is really neat.
many thanks. I am looking for a more update lua in terms of gear. I'd like to look into helix sets, mb sets . See what AF pieces i need to focus on.
Posted below is a _SCH.lua file that I wrote using Byrths original file as an example, and tweaked and edited to work out any errors. I will not call it complete, due to me potentially missing specific rules for certain JAs or spells. However, I would say that it covers the majority of what is needed.
If you have any questions about it, please feel free to post them here for Byrths or myself to answer. Also, if you noticed I missed anything crucial, let me know and we can add it in.
This same file is included in the Gearswap download in the examples section, and I will try to keep it as up-to-date as possible.
Code function get_sets()
sets = {}
sets.aftercast_Idle_noSub = {main="Owleyes",sub="Genbu's Shield",ammo="Incantor Stone",
head="Savant's bonnet +2",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Serpentes Sabots"}
sets.aftercast_Idle_Sub = {main="Owleyes",sub="Genbu's Shield",ammo="Incantor Stone",
head="Savant's bonnet +2",neck="Twilight Torque",ear1="Savant's Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Serpentes Sabots"}
sets.aftercast_Idle = sets.aftercast_Idle_noSub
sets.precast_FastCast = {ammo="Incantor Stone",head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",back="Swith Cape",legs="Orvail Pants",feet="Chelona Boots"}
sets.Resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Nares Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Chelona Boots"}
sets.midcast_ElementalMagic = {main="Atinian Staff",sub="Wizzan Grip",ammo="Witchstone",
head="Nares Cap",neck="Eddy Necklace",ear1="Hecate's Earring",ear2="Novio Earring",
body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Icesoul Ring",
back="Searing Cape",waist="Maniacus Sash",legs="Hagondes Pants",feet="Bokwus Boots"}
sets.midcast_DarkMagic = {main="Chatoyant Staff",sub="Arbuda Grip",ammo="Hasty Pinion",
head="Appetence Crown",neck="Aesir Torque",ear1="Hirudinea Earring",ear2="Loquacious Earring",
body="Hedera Cotehardie",hands="Ayao's Gages",ring1="Balrahn's Ring",ring2="Excelsis Ring",
back="Merciful Cape",waist="Goading Belt",legs="Auspex Slops",feet="Bokwus Boots"}
sets.midcast_EnfeeblingMagic = {main="Atinian Staff",sub="Mephitis Grip",ammo="Savant's Treatise",
head="Nahtirah Hat",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Hagondes Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Merciful Cape",waist="Cascade Belt",legs="Orvail Pants",feet="Rubeus Boots"}
sets.midcast_Impact = {main="Atinian Staff",sub="Wizzan Grip",ammo="Witchstone",
neck="Eddy Necklace",ear1="Hecate's Earring",ear2="Novio Earring",
hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Icesoul Ring",
back="Searing Cape",waist="Maniacus Sash",legs="Hagondes Pants",feet="Bokwus Boots"}
sets.midcast_Embrava = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Savant's Treatise",
head="Svnt. Bonnet +2",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Savant's Bracers +2",
back="Merciful Cape",waist="Cascade Belt",legs="Shedir Seraweels",feet="Rubeus Boots"}
sets.midcast_EnhancingMagic = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",
back="Swith Cape",waist="Ninurta's Sash",legs="Orvail Pants",feet="Chelona Boots"}
sets.precast_Stun = {main="Apamajas II",sub="Mephitis Grip",ranged="Aureole",
head="Nahtirah Hat",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Gendewitha Gages",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Swith Cape",waist="Ninurta's Sash",legs="Bokwus Slops",feet="Argute Loafers +2"}
sets.midcast_Cure = {main="Chatoyant Staff",head="Paean Mitra",neck="Phalaina Locket",
body="Anhur Robe",hands="Bokwus Gloves",back="Oretanis's Cape",legs="Nares Trews"}
sets.midcast_Helix = {main="Chatoyant Staff",sub="Wizzan Grip",ammo="Snow Sachet",
head="Nahtirah Hat",neck="Stoicheion Medal",ear1="Hecate's Earring",ear2="Novio Earring",
body="Nares Saio",hands="Nares Cuffs",ring1="Icesoul Ring",ring2="Icesoul Ring",
back="Twilight Cape",waist="Wanion Belt",legs="Akasha Chaps",feet="Nares Clogs"}
sets.midcast_Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.staves = {}
sets.staves.damage = {}
sets.staves.damage.Thunder = {main="Apamajas I"}
sets.staves.damage.Fire = {main="Atar I"}
sets.staves.accuracy = {}
sets.staves.damage.Thunder = {main="Apamajas II"}
sets.staves.damage.Ice = {main="Vourukasha II"}
stuntarg = 'Shantotto'
end
function precast(spell,action)
if spell.english == 'Impact' then
cast_delay(2)
equip(sets['precast_FastCast'],{body="Twilight Cloak"})
if not buffactive['elemental seal'] then
add_to_chat(8,'--------- Elemental Seal is down ---------')
end
elseif spell.skill=='ElementalMagic' and spell.casttime < 3 then
cast_delay(0.1)
equip(sets.midcast_ElementalMagic)
if spell.element == 'Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element and sets.Obi[spell.element] then
equip(sets.Obi[spell.element])
end
elseif spell.english == 'Stun' then
cast_delay(0.1)
equip(sets['precast_Stun'])
if not buffactive.thunderstorm then
add_to_chat(8,'--------- Thunderstorm is down ---------')
elseif not buffactive.klimaform then
add_to_chat(8,'----------- Klimaform is down -----------')
end
if stuntarg ~= 'Shantotto' then
send_command('@input /t '..stuntarg..' ---- Byrth Stunned!!! ---- ')
end
else
equip(sets['precast_FastCast'])
cast_delay(0.5)
end
if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then
equip({feet='Argute Loafers +2'})
end
end
function midcast(spell,action)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
if sets.staves.damage[spell.element] then
equip(sets.staves.damage[spell.element])
end
elseif spell.skill=="ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'EnhancingMagic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function aftercast(spell,action)
equip(sets['aftercast_Idle'])
if spell.english == 'Sleep' or spell.english == 'Sleepga' then
send_command('@wait 50;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
send_command('@wait 80;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Break' or spell.english == 'Breakga' then
send_command('@wait 20;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
end
end
function status_change(new,tab)
if new == 'Resting' then
equip(sets['Resting'])
else
equip(sets['aftercast_Idle'])
end
end
function buff_change(status,gain_or_loss)
if status == 'Sublimation: Complete' and gain_or_loss == 'gain' and not 'stunmode' then -- True whether gained or lost
sets.aftercast_Idle = sets.aftercast_Idle_noSub
elseif status == 'Sublimation: Activated' and gain_or_loss == 'gain' and not 'stunmode' then
sets.aftercast_Idle = sets.aftercast_Idle_Sub
end
equip(sets.aftercast_Idle)
end
function pet_midcast(spell,action)
end
function pet_aftercast(spell,action)
end
function self_command(command)
if command == 'stuntarg' then
stuntarg = target.name
elseif command == 'stunmode' then
windower.add_to_chat(100,'Stun Mode')
if sets.aftercast_Idle ~= sets.precast_Stun then
stunmode = true
sets.aftercast_Idle = sets.precast_Stun
elseif buffactive['Sublimation: Activated'] then
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_Sub
else
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_noSub
end
equip(sets.aftercast_Idle)
end
end
-- This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set)
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets['Obi_'..spell_element])
else
equip(set)
end
end
|
|