|
Scholar Gearswap .lua
Server: Asura
Game: FFXI
Posts: 20
By Asura.Yamoman 2016-08-21 12:11:55
Thx, guess i'll wait to see if Siveria updates his files, Guess it's back to old school vanilla macros to shoot off scs.
Server: Asura
Game: FFXI
Posts: 334
By Asura.Krystela 2016-08-21 12:56:45
Ragnarok.Flippant said: »Your aftercast is equipping sets.aftercast.Defense, which has both Terra's Staff and Sors Shield. Sub is equipped after main, so this would remove your Terra's Staff. You don't hit any of your other rules unless your MP is less than 80%, you have Sublimation: Activated on, you're in CP mode, or you're in town. Should be fine if you just add a grip or sub=empty
By the way, your status_change function equips nothing unless you meet any of the aforementioned conditions. I also recommend cleaning up your aftercast/status_change: Code function aftercast(spell,action)
status_change(player.status)
end
function status_change(new,tab,old)
if new == 'Idle' then
if player.mpp>80 then
equip(sets.aftercast.Defense)
if Town:contains(world.zone) then
equip(sets.aftercast.Town)
end
else
equip(sets.aftercast.Idle)
if player.mpp<50 then
equip({waist="Fucho-no-obi"})
end
end
if Capacity == 'ON' then
equip({back="Mecisto. Mantle"})
end
if buffactive['Sublimation: Activated'] then
equip(sets.aftercast.Sublimation)
end
elseif new == 'Resting' then
equip(sets.resting)
end
end Oh crap, this is smart. I didn't know you could pretty much empty out aftercast and just put all in status change. (I am a self learner, not a programmer)
I will sure do that to my luas to make them more simple.
Thanks flippant <3
PS: Ive been working on them to be more all user friendly, so people dont have to go change gears in the rules. Those were luas intented for me and me only, but people asked for them so I made them public. Always looking to improve them, so feedbacks and tricks are welcomed and awesome.
Necro Bump Detected!
[46 days between previous and next post]
Valefor.Gorns
Server: Valefor
Game: FFXI
Posts: 159
By Valefor.Gorns 2016-10-06 11:35:05
Got some issues, i added all the files in Silvxiii/gearswap-scholarFFxi to my GS folder and just kept my SCH_gear should work no problems i assume,i load it says loaded succesfully but when i cast any spell ie sneak, i get
Gearswap lua runtime rror: gearswap/flow.lua:336
Gearswap has detected an error in the user function aftercast:
,,,, files x86)windower4/addons........../sch.lua:928: attemp to index global 'soloSC' (a nil value) error message
also did /console gs solosc1 fusion to see if working got same error cept last line was get_current_'strategem_count' (a nil value)
where did i mess up? thx
Hi,
Did you get any feedback on this problem ?
I got the same and dont know how to fix it.
Many thx !
By DanielH 2016-10-06 12:16:13
Got some issues, i added all the files in Silvxiii/gearswap-scholarFFxi to my GS folder and just kept my SCH_gear should work no problems i assume,i load it says loaded succesfully but when i cast any spell ie sneak, i get
Gearswap lua runtime rror: gearswap/flow.lua:336
Gearswap has detected an error in the user function aftercast:
,,,, files x86)windower4/addons........../sch.lua:928: attemp to index global 'soloSC' (a nil value) error message
also did /console gs solosc1 fusion to see if working got same error cept last line was get_current_'strategem_count' (a nil value)
where did i mess up? thx
Hi,
Did you get any feedback on this problem ?
I got the same and dont know how to fix it.
Many thx !
stratagem error is because line 160 in (SCH_soloSC.lua): Code local nbStrat = get_current_strategem_count()
should be: Code local nbStrat = getNbStratagems()
Other ERROR you can avoid by changing Line 931 (sch.LUA): Code if (soloSC.active==true) and (spell.english==soloSC.step.spell or spell.english=='Immanence') then
to: Code if (soloSC ~= nil) and (soloSC.active==true) and (spell.english==soloSC.step.spell or spell.english=='Immanence') then
Valefor.Gorns
Server: Valefor
Game: FFXI
Posts: 159
By Valefor.Gorns 2016-10-07 04:10:14
Many thanks Daniel !
So from now, I just have to edit the SCH.lua file with my equip set w/o making any changes to the other files ?
(asides of the lines dealing with stratagem recast like "fullRechargeTime = 5*48" to 5*33 when I'll unlock the 550 JP gifts)
Lakshmi.Vadian
Server: Lakshmi
Game: FFXI
Posts: 55
By Lakshmi.Vadian 2016-11-04 19:02:08
So I notice in every GS code i look at, and i've only recently started trying to get GS setup with all my gear and stuff. But There's always a PDT, MDT, and sometimes and HybridDT section. I never see in the code that it notices you getting hit by X and it changing into that gear. I also noticed that when I use GS and i'm taking hits I don't swap into PDT, MDT, or HybridDT gear at all. How is this function supposed to work?
Shiva.Hiep
Server: Shiva
Game: FFXI
Posts: 669
By Shiva.Hiep 2016-11-04 19:05:33
So I notice in every GS code i look at, and i've only recently started trying to get GS setup with all my gear and stuff. But There's always a PDT, MDT, and sometimes and HybridDT section. I never see in the code that it notices you getting hit by X and it changing into that gear. I also noticed that when I use GS and i'm taking hits I don't swap into PDT, MDT, or HybridDT gear at all. How is this function supposed to work?
Assuming that you're using mote's SCH GS, there's toggles for PDT, MDT, HybridDT sets. F10 puts you into PDT, F11 MDT, Alt F10 Kiting, and Alt F12 takes you off defense mode (puts you in idle mode set). You have to either manually hit these keys on your keyboard or make a macro (I forgot the macro way) to force you into these modes, GS doesn't auto detect a move/spell and swaps you into PDT or MDT as far as I know.
Lakshmi.Vadian
Server: Lakshmi
Game: FFXI
Posts: 55
By Lakshmi.Vadian 2016-11-04 19:11:47
So I notice in every GS code i look at, and i've only recently started trying to get GS setup with all my gear and stuff. But There's always a PDT, MDT, and sometimes and HybridDT section. I never see in the code that it notices you getting hit by X and it changing into that gear. I also noticed that when I use GS and i'm taking hits I don't swap into PDT, MDT, or HybridDT gear at all. How is this function supposed to work?
Assuming that you're using mote's SCH GS, there's toggles for PDT, MDT, HybridDT sets. F10 puts you into PDT, F11 MDT, Alt F10 Kiting, and Alt F12 takes you off defense mode (puts you in idle mode set). You have to either manually hit these keys on your keyboard or make a macro (I forgot the macro way) to force you into these modes, GS doesn't auto detect a move/spell and swaps you into PDT or MDT as far as I know.
Ok, that makes a lot of sense then. Now i need to find a mote, lol.
Shiva.Hiep
Server: Shiva
Game: FFXI
Posts: 669
By Shiva.Hiep 2016-11-04 19:15:07
By mrlooolz 2016-11-21 07:03:59
Been following this close. How are the latest version of the lua's coming along. excited to take one and test it out.
Necro Bump Detected!
[102 days between previous and next post]
Carbuncle.Darkiori
Server: Carbuncle
Game: FFXI
Posts: 8
By Carbuncle.Darkiori 2017-03-02 22:52:18
Ok, so I have this random lua i found, but it only has casting mode normal and resistant then something that says magic burst modes none single double locked and i have no idea what those mean... can someone help me change the modes to have them as casting normal, resistant, mb and mb resistant? idk how to bind them to the keys so that persay f10 is my "free nuke/resistant nuke" and f10 is "MB/resistant MB"
Code options.CastingModes = {'Normal', 'Resistant'}
options.OffenseModes = {'None', 'Normal'}
options.DefenseModes = {'Normal'}
options.WeaponskillModes = {'Normal'}
options.IdleModes = {'Normal', 'Refresh', 'PDT'}
options.RestingModes = {'Normal'}
options.PhysicalDefenseModes = {'PDT'}
options.MagicalDefenseModes = {'MDT'}
options.MagicBurstModes = {'None', 'Single', 'Double', 'Locked'}
options.EnhancingModes = {'Potency', 'Duration'}
state.OffenseMode = 'None'
state.Defense.PhysicalMode = 'PDT'
state.MagicBurstMode = 'None'
state.EnhancingMode = 'Potency'
gear.default.obi_waist = "Refoccilation Stone"
send_command('bind ^= gs c cycle MagicBurst')
send_command('bind != gs c cycle MagicBurst')
send_command('bind ^` gs c cycle Enhancing')
send_command('bind !` gs c cycle Enhancing')
Bismarck.Kyaaadaa
Server: Bismarck
Game: FFXI
Posts: 585
By Bismarck.Kyaaadaa 2017-03-03 04:36:38
Takes this command at the beginning of your .lua.
Code
function user_setup()
state.CastingMode:options('Normal', 'Acc', 'MB1', 'MB2')
send_command('bind f2 gs c set castingmode normal')
send_command('bind f3 gs c set castingmode Acc')
send_command('bind f4 gs c set castingmode MB1')
send_command('bind f5 gs c set castingmode MB2')
send_command('bind f6 gs equip sets.idle.kiting')
end
You had that bit at the bottom, but it was bound to other keys. This will make it f2, f3, etc.
By Sammeh 2017-03-03 06:23:34
Carbuncle.Darkiori said: »i have no idea what those mean...
I may not be deciphering this correctly - but what I assume is basically set the next 2 spells to be in Magic Burst mode and then likely it has logic to go back to normal mode.
I have a logictech G11 keyboard which has 18 (x3) extra function keys - so I bind a quick perss to the 'gs c set castingmode MagicBurst' (or normal/macc and a storetp mode - because every good sch has an Occult accumen set right????).
Anyway I just manually toggle but the auto-swap back to 'normal' intrigues me. I wonder if a better option would be to combine that logic w/ some skillchain packet watching and auto-adjust if you're within the magic burst window. Oh if I'm bored enough this weekend I may just attempt this.
Carbuncle.Darkiori
Server: Carbuncle
Game: FFXI
Posts: 8
By Carbuncle.Darkiori 2017-03-03 13:47:37
Do i need to change something in this hook to make sure the lua does the MB set? or just in the beginning, also how do I name the sets for it to recognize it when i put in the equip
like is it
set.midcast.????? =
Code -------------------------------------------------------------------------------------------------------------------
-- Customization hooks for idle and melee sets, after they've been automatically constructed.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if world.weather_element == 'Light' then
return 'CureWithLightWeather'
end
elseif spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
if not lowTierNukes:contains(spell.english) then
return 'HighTierNuke'
end
end
end
end
function customize_idle_set(idleSet)
if state.Buff.Sublimation then
if state.IdleMode == 'Normal' then
idleSet = set_combine(idleSet, sets.buff.FullSublimation)
elseif state.IdleMode == 'PDT' then
idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
end
end
return idleSet
end
Bismarck.Snprphnx
Server: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2017-03-03 14:35:53
Correct me if I'm wrong, but aren't the F1-F8 keys natively assigned to auto-target players or mobs. May not want to use those.
Shiva.Spynx
Server: Shiva
Game: FFXI
Posts: 371
By Shiva.Spynx 2017-03-03 14:45:07
I suggest you to put the magic burst logic in the job_post_midcast method that is always executed post the default one (handling the spellmap classes like HighTierNuke). Something like this will work and you won't have to make any changes to job_get_spell_map:
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
-- Handle MB if elemental magic and any MB mode is set
if spell.skill == 'Elemental Magic' and options.MagicBurstModes.value ~= 'None' then
-- Equip correct MB gear based on CastingMode
if options.CastingModes.value == 'Resistant' then
equip(sets.magic_burst_resist)
else
equip(sets.magic_burst)
end
end
end
Carbuncle.Darkiori
Server: Carbuncle
Game: FFXI
Posts: 8
By Carbuncle.Darkiori 2017-03-03 16:56:08
i dont seem to have that, or do i just add that? i might have to get another lua since this one might be missing stuff from what it looks like... is there a lua already that has what i'm talking about? or how do I post the lua i have on here?
Server: Shiva
Game: FFXI
Posts: 1052
By Shiva.Arislan 2017-03-03 19:02:38
Bismarck.Kyaaadaa
Server: Bismarck
Game: FFXI
Posts: 585
By Bismarck.Kyaaadaa 2017-03-04 18:17:20
Bismarck.Snprphnx said: »Correct me if I'm wrong, but aren't the F1-F8 keys natively assigned to auto-target players or mobs. May not want to use those. Some people don't like to, as they are used for targeting yourself, your party members, and nearest enemy, but other people don't really care. I don't mess with F1, but I do use F2-F5 for switching modes.
Necro Bump Detected!
[41 days between previous and next post]
By wick 2017-04-15 03:36:33
fixed, carry on
Necro Bump Detected!
[112 days between previous and next post]
Server: Asura
Game: FFXI
Posts: 50
By Asura.Kogasho 2017-08-05 13:33:04
I was using a old SCH gearswap an apparently it hasnt been putting Relic equipment in slots for JAs Im looking for a new gearswap, does this GS equip the gear used for JAs? My old GS wouldnt equip Peda. M.Board +1 for focalization, +1 Pants for TR. It was a complete mess but my Nuking an buffing set work.
<GS NOOB :(
Server: Shiva
Game: FFXI
Posts: 1052
By Shiva.Arislan 2017-08-05 15:28:45
AFAIK, everything works great.
Server: Asura
Game: FFXI
Posts: 50
By Asura.Kogasho 2017-08-05 17:50:20
does it automatically equip my MB set when im going to MB or do i have to hit a Key to set it like how F10 is dt set?
Server: Shiva
Game: FFXI
Posts: 1052
By Shiva.Arislan 2017-08-05 22:02:09
Toggle: Alt + ~
Cerberus.Lauranna
Server: Cerberus
Game: FFXI
Posts: 17
By Cerberus.Lauranna 2017-08-15 10:14:42
Hey Everyone.
I recently started to use GearSwap for my Sch.
As a newbie with code and everything, I'm having an issue with my Nuking and Enfeebling swap.
When I nuke it swap to my FastCast gears as required but it never change to my nuking gears. Same for Enfeebling.
Which means I cast very fast but not very strong which is disturbing ^^'
I think the problem is between the screen and the chair but more precisely from line 136 to line 141...
Do you have any ideas what I did wrong ?
Thanks in advance.
https://pastebin.com/x6vmAH9i
Leviathan.Isiolia
Server: Leviathan
Game: FFXI
Posts: 472
By Leviathan.Isiolia 2017-08-15 10:34:34
Try changing
Code if spell.skill == "ElementalMagic" then
to
Code if spell.skill == 'Elemental Magic' then
Phoenix.Sevrina
Server: Phoenix
Game: FFXI
Posts: 30
By Phoenix.Sevrina 2017-08-15 10:49:55
try changing also:
Code sets.midcast_ElementalMagic
to Code sets.midcast['Elemental Magic']
for each type of magic you'll need to fix as the same
Server: Cerberus
Game: FFXI
Posts: 1809
By Cerberus.Shadowmeld 2017-08-15 11:09:39
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?
Cerberus.Lauranna
Server: Cerberus
Game: FFXI
Posts: 17
By Cerberus.Lauranna 2017-08-15 11:29:22
Leviathan.Isiolia said: »Try changing
Code if spell.skill == "ElementalMagic" then
to
Code if spell.skill == 'Elemental Magic' then try changing also:
Code sets.midcast_ElementalMagic
to Code sets.midcast['Elemental Magic']
for each type of magic you'll need to fix as the same
Thanks it worked !
[+]
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
|
|