Gearswap Support Thread

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 45 46 47 ... 182 183 184
Offline
Posts: 19
By Darknightleo 2014-12-29 08:18:18
Link | Quote | Reply
 
Hello! I posted this on the BG GS help thread but a page later it seems it was overlooked. So I'll try here, instead.
I've been a GS user for a while, loving the program. However, my GEO lua are slightly out of date. I've tried my best to update, grabbing the newest version from github, then adding my settings to the gear file. However, now whenever I load GS I get console errors telling me there's problems in everything from flow.lua to Mote-SelfCommands.lua whenever I try to switch my offense/defense modes, etc.

I'm not sure what I'm doing wrong. So I've made a pastebin of both my geo.lua, my geo_gear.lua, and my console log when I try to use any of my mode swapping keys (offensemode, etc.) If you need me to pastebin my currently working (but slightly out of date) lua, then I can, for comparison.

Any help is appreciated, because I have absolutely no idea where I'm going wrong. Thank you!

geo.lua: http://pastebin.com/MCWuZKNN
geo_gear.lua: http://pastebin.com/jBJFgVSB
Windower Console Log: http://pastebin.com/4wb24bKk
 Cerberus.Leires
Offline
Server: Cerberus
Game: FFXI
user: Shadowkun
Posts: 24
By Cerberus.Leires 2014-12-31 14:10:31
Link | Quote | Reply
 
I just recently downloaded the GS DNC.lua and I love it, thank you for all your hard work.

Looking for some help, would someone be so kind to direct me how to disable the automatic Waltz tier adjustment based on hp/tp? I cannot seem to find a way to do it.

Thank you
Offline
Posts: 1431
By fractalvoid 2015-01-03 03:36:57
Link | Quote | Reply
 
I'm using Bokura's Thief gearswap file as a template for my own and was curious about sets for SA+TA. The rules for SA and TA are defined, but separately. For instances in which I'm using the two abilities combined I'm not sure which set's gear would be taking priority, if any.

I can test this after I wake up, but was more curious as to what I would need to do to make a set for when both abilities are active in addition to when they're isolated.

Fairly sure I can write the rule for it following this format:
Code
                if SA then
                        equipSet = set_combine(equipSet,sets.JA["Sneak Attack"])
                end
                if TA then
                        equipSet = set_combine(equipSet,sets.JA["Trick Attack"])
                end


ie:
Code
 if SA and TA then
equipSet = set_combine(equipSet,sets.JA.SATA)


But was just curious how other people have their rules set up before I start testing by trial-and-error in the morning.

Thanks
Offline
By Nyruul 2015-01-03 04:17:11
Link | Quote | Reply
 
Idk if this has been asked. How would I write a rule to disable my main and sub slot for certain sub jobs and enable them for other sub jobs?

I know the command //gs disable main

Just want to know if there is a way to make a rule for it so I don't have to manually do it every time.
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2015-01-03 05:20:39
Link | Quote | Reply
 
Nyruul said: »
Idk if this has been asked. How would I write a rule to disable my main and sub slot for certain sub jobs and enable them for other sub jobs?

I know the command //gs disable main

Just want to know if there is a way to make a rule for it so I don't have to manually do it every time.
Something like this should work:
Code
if player.sub_job == 'RUN' or 'Sam' or 'THF'  then
		disable('main','sub')
elseif player.sub_job == 'MNK' then
		disable('main','sub','ammo')
else
		enable('main','sub','ammo')
[+]
Offline
Posts: 107
By Miang 2015-01-03 05:27:42
Link | Quote | Reply
 
There's actually a function that's triggered when your sub job changes that you could put it in:
Code
function sub_job_change(new,old)
	if player.sub_job == 'NIN' or player.sub_job == 'THF' or player.sub_job == 'DNC'  then
		disable('main','sub')
	else
		enable('main','sub')
	end
end
[+]
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2015-01-03 05:37:45
Link | Quote | Reply
 
Ok after looking at your GS file and seeing how its coded.
It should stop at the SA and never get to the TA check if both were up.

Your going to want to add that BEFORE the SA check.
Code
if SA and TA then
equipSet = set_combine(equipSet,sets.JA.SATA)
end


Edit: I would personally go with Arcon's example. I had typed it out like that at first too but then fully edited this post after looking at how Bok had his file coded.
Offline
Posts: 1431
By fractalvoid 2015-01-03 11:08:07
Link | Quote | Reply
 
Asura.Darvamos said: »
Ok after looking at your GS file and seeing how its coded.
It should stop at the SA and never get to the TA check if both were up.

Your going to want to add that BEFORE the SA check.
Code
if SA and TA then
equipSet = set_combine(equipSet,sets.JA.SATA)
end

Added that rule before SA check and made SATA sets before all the SA or TA sets in WS rules, but after the base WS sets. Didn't throw any errors but I will check it's functionality later.

Thanks
 Leviathan.Arcon
VIP
Offline
Server: Leviathan
Game: FFXI
user: Zaphor
Posts: 660
By Leviathan.Arcon 2015-01-03 12:11:38
Link | Quote | Reply
 
Code
if SA then
    equipSet = set_combine(equipSet,sets.JA["Sneak Attack"])
end
if TA then
    equipSet = set_combine(equipSet,sets.JA["Trick Attack"])
end
if SA and TA then
    equipSet = set_combine(equipSet,sets.JA.SATA)
end


Instead of doing this like these, several cases of which only one should be true, use elseif instead:
Code
if SA and TA then
    equipSet = set_combine(equipSet,sets.JA.SATA)
elseif SA then
    equipSet = set_combine(equipSet,sets.JA["Sneak Attack"])
elseif TA then
    equipSet = set_combine(equipSet,sets.JA["Trick Attack"])
end
[+]
 Cerberus.Tidis
MSPaint Winner
Offline
Server: Cerberus
Game: FFXI
user: tidis
Posts: 3927
By Cerberus.Tidis 2015-01-03 13:40:54
Link | Quote | Reply
 
Hi, I've been trying to set up a rdm gearswap all afternoon, I'm not very good at it so it's been confusing the hell out of me.

I found this one where I've been mostly just swapping out my gear:
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
	
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end


-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
    state.Buff.Saboteur = buffactive.saboteur or false
end

-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------

-- Setup vars that are user-dependent.  Can override this function in a sidecar file.
function user_setup()
    state.OffenseMode:options('None', 'Normal')
    state.HybridMode:options('Normal', 'PhysicalDef', 'MagicalDef')
    state.CastingMode:options('Normal', 'Resistant')
    state.IdleMode:options('Normal', 'PDT', 'MDT')

    gear.default.obi_waist = "Sekhmet Corset"
end


-- Define sets and vars used by this job file.
function init_gear_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------
    
    -- Precast Sets
    
    -- Precast sets to enhance JAs
    sets.precast.JA['Chainspell'] = {body="Vitivation Tabard"}
    

    -- Waltz set (chr and vit)
    sets.precast.Waltz = {
        head="Atrophy Chapeau +1",
        body="Atrophy Tabard +1",hands="Yaoyotl Gloves",
        back="Refraction Cape",legs="Hagondes Pants",feet="Hagondes Sabots"}
        
    -- Don't need any special gear for Healing Waltz.
    sets.precast.Waltz['Healing Waltz'] = {}

    -- Fast cast sets for spells
    
    -- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
    -- No other FC sets necessary.
    sets.precast.FC = {head="Atrophy Chapeau +1",body="Duelist's Tabard +1",hands="Gendewitha Gages +1",
		neck="Orunmila's Torque",back="Swith Cape",waist="Witful Belt",legs="Orvail Pants +1",feet="Regal Pumps +1"}

    sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
       
    -- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {
        head="Atrophy Chapeau +1",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
        body="Atrophy Tabard",hands="Atrophy Gloves +1",ring1="Rajas Ring",ring2="K'ayres Ring",
        back="Bleating Mantle",waist="Windbuffet Belt +1",legs="Atrophy Tights +1",feet="Regal Pumps +1"}

    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, 
        {})
	
	sets.precast.WS['Savage Blade'] = {ammo="Ginsen",
		head="Atrophy Chapeau +1",neck="Breeze Gorget",ear1="Moonshade Earring",ear2="Brutal Earring",
		body="Wayfarer Robe",hands="Atrophy Gloves +1",ring1="Aquasoul Ring",ring2="Karieyh Ring",
		back="Bleating Mantle",waist="Windbuffet Belt +1",legs="Atrophy Tights +1",feet="Regal Pumps +1"}
	
    sets.precast.WS['Sanguine Blade'] = {}

    
    -- Midcast Sets
    
    sets.midcast.FastRecast = {
        head="Atrophy Chapeau +1",ear2="Loquacious Earring",
        body="Duelist's Tabard +1",hands="Gendewitha Gages +1",back="Swith Cape",
		waist="Witful Belt",legs="Orvail Pants +1",feet="Regal Pumps +1"}

    sets.midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",
        head="Gendewitha Caubeen",neck="Orunmila's Torque",ear1="Estq. Earring",ear2="Loquacious Earring",
        body="Duelist's Tabard +1",hands="Serpentes Cuffs",ring1="Ephedra Ring",ring2="Sirona's Ring",
        back="Oretenia's Cape",waist="Witful Belt",legs="Atrophy Tights +1",feet="Serpentes Sabots"}
        
    sets.midcast.Curaga = sets.midcast.Cure
    sets.midcast.CureSelf = {}

    sets.midcast['Enhancing Magic'] = {
        head="Atrophy Chapeau +1",neck="Orunmila's Torque",
        body="Duelist's Tabard +1",hands="Atrophy Gloves +1",
        back="Estoqueur's Cape",waist="Witful Belt",legs="Atrophy Tights +1",feet="Estoqueur's Houseaux +2"}

    sets.midcast.Refresh = {legs="Estoqueur's Fuseau +2"}

    sets.midcast.Stoneskin = {neck="Stone Gorget",ring1="Patricius Ring",ring2="Dark Ring",legs="Haven Hose",
		feet="Estq. Houseaux +2",back="Estoqueur's Cape",waist="Siegel Sash"}
    
    sets.midcast['Enfeebling Magic'] = {main="Twebuliij",sub="Reign Grip",ammo="Kalboron Stone",
        head="Atrophy Chapeau +1",neck="Weike Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
        body="Atrophy Tabard",hands="Yaoyotl Gloves",ring1="Aquasoul Ring",ring2="Sangoma Ring",
        back="Refraction Cape",waist="Demonry Sash",legs="Orvail Pants +1",feet="Orvail Souliers +1"}

    sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Duelist's Chapeau +1"})

    sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Duelist's Chapeau +1"})
    
    sets.midcast['Elemental Magic'] = {main="Twebuliij",sub="Zuuxowu Grip",ammo="Dosis Tathlum",
        head="Hagondes Hat",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Novio Earring",
        body="Atrophy Tabard",hands="Hagondes Cuffs",ring1="Icesoul Ring",ring2="Acumen Ring",
        back="Toro Cape",waist="Witch Sash",legs="Hagondes Pants",feet="Umbani Boots"}
        
    --sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})

    sets.midcast['Dark Magic'] = {main="Twebuliij",sub="Zuuxowu Grip",ammo="Dosis Tathlum",
        head="Hagondes Hat",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Novio Earring",
        body="Atrophy Tabard",hands="Hagondes Cuffs",ring1="Icesoul Ring",ring2="Acumen Ring",
        back="Toro Cape",waist="Witch Sash",legs="Hagondes Pants",feet="Umbani Boots"}

    sets.midcast.Stun = set_combine(sets.midcast.FC, {ear1="Lifestorm Earring",ear2="Psystorm Earring",ring1="Balrahn's Ring",ring2="Sangoma's Ring"})

    sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {ring1="Excelsis Ring", waist="Fucho-no-Obi"})

    sets.midcast.Aspir = sets.midcast.Drain


    -- Sets for special buff conditions on spells.

    sets.midcast.EnhancingDuration = {hands="Atrophy Gloves +1",back="Estoqueur's Cape",feet="Estoqueur's Houseaux +2"}
        
    sets.buff.ComposureOther = {head="Estoqueur's Chappel +2",
        body="Estoqueur's Sayon +2",hands="Estoqueur's Gantherots +2",
        legs="Estoqueur's Fuseau +2",feet="Estoqueur's Houseaux +2"}

    sets.buff.Saboteur = {hands="Estoqueur's Gantherots +2"}
    

    -- Sets to return to when not performing an action.
    
    -- Resting sets
    sets.resting = {main="Chatoyant Staff",
        head="Duelist's Chapeau +1",
        body="Atrophy Tabard +1",hands="Serpentes Cuffs",
        legs="Assiduity Pants",feet="Serpentes Sabots"}
    

    -- Idle sets
    sets.idle = {main="Buramenk'ah",sub="Genbu's Shield",ammo="Demonry Stone",
        head="Duelist's Chapeau +1",neck="Asperity Necklace",ear1="Estq. Earring",ear2="Loquacious Earring",
        body="Atrophy Tabard",hands="Serpentes Cuffs",ring1="Patricius Ring",ring2=gear.DarkRing.physical,
        back="Shadow Mantle",waist="Flume Belt",legs="Assiduity Pants",feet="Serpentes Sabots"}

    sets.idle.Town = {main="Buramenk'ah",sub="Genbu's Shield",ammo="Demonry Stone",
        head="Duelist's Chapeau +1",neck="Asperity Necklace",ear1="Estq. Earring",ear2="Loquacious Earring",
        body="Atrophy Tabard",hands="Serpentes Cuffs",ring1="Patricius Ring",ring2=gear.DarkRing.physical,
        back="Shadow Mantle",waist="Flume Belt",legs="Assiduity Pants",feet="Serpentes Sabots"}
    
    sets.idle.Weak = {main="Buramenk'ah",sub="Genbu's Shield",ammo="Demonry Stone",
        head="Duelist's Chapeau +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
        body="Atrophy Tabard +1",hands="Serpentes Cuffs",ring1="Patricius Ring",ring2=gear.DarkRing.physical,
        back="Shadow Mantle",waist="Flume Belt",legs="Assiduity Pants",feet="Serpentes Sabots"}

    sets.idle.PDT = {}

    sets.idle.MDT = {}
    
    
    -- Defense sets
    sets.defense.PDT = {}

    sets.defense.MDT = {}

    sets.Kiting = {legs="Crimson Cuisses"}

    sets.latent_refresh = {waist="Fucho-no-obi"}

    -- Engaged sets

    -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
    -- sets if more refined versions aren't defined.
    -- If you create a set with both offense and defense modes, the offense mode should be first.
    -- EG: sets.engaged.Dagger.Accuracy.Evasion
    
    -- Normal melee group
    sets.engaged.Normal = {
        head="Atrophy Chapeau +1",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
        body="Atrophy Tabard",hands="Atrophy Gloves +1",ring1="Rajas Ring",ring2="K'ayres Ring",
        back="Bleating Mantle",waist="Goading Belt",legs="Atrophy Tights +1",feet="Atrophy Boots"}

		
	sets.engaged.DW = set_combine{sets.engaged.Normal, {ear1="Heartseeker Earring",ear2="Dudgeon Earring"}}
end

-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------

-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
        equip(sets.buff.Saboteur)
    elseif spell.skill == 'Enhancing Magic' then
        equip(sets.midcast.EnhancingDuration)
        if buffactive.composure and spell.target.type == 'PLAYER' then
            equip(sets.buff.ComposureOther)
        end
    elseif spellMap == 'Cure' and spell.target.type == 'SELF' then
        equip(sets.midcast.CureSelf)
    end
end

-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------

-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
    if stateField == 'Offense Mode' then
        if newValue == 'None' then
            enable('main','sub','range')
        else
            disable('main','sub','range')
        end
    end
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------

-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
    if player.mpp < 51 then
        idleSet = set_combine(idleSet, sets.latent_refresh)
    end
    
    return idleSet
end

-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end


The problem I have is that as far as I can tell it doesn't have any way to toggle a DW set, as far as I can tell what you have equipped while engaged is just 1 set and there's an offensemode thing where you can lock and unlock main, sub and ranged.

As you can see, my DW set is very bare right now, just my standard TP set with DW earrings but I can't see a way to change into it, this is the first time I have tried to uses Mote's include files and I'm getting stumped.

I have something on my THF gearswap where I was able to just hit a macro and rotate between a few sets but anything I have tried just isn't working, so any help would be appreciated! Thank you.
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2015-01-03 13:49:56
Link | Quote | Reply
 
Mote has a wiki for his GS files. Here is the link to the commands:
Mote Commands

IIRC there is no way by default to swap your weapons to DW in Mote's GS but it will automatically swap to your DW sets once you equip a second weapon into the sub slot manually.

Nevermind that only for some of his GS files exp. BLU.
 Cerberus.Tidis
MSPaint Winner
Offline
Server: Cerberus
Game: FFXI
user: tidis
Posts: 3927
By Cerberus.Tidis 2015-01-03 13:59:03
Link | Quote | Reply
 
I still don't understand how it could switch to my Dual wield set, it doesn't matter that I called it sets.engaged.DW, it's just a name, I could have called it sets.engaged.PotatoSalad, as far as I can see there is no way in my file for it to recognise when to equip my dual wield set.

That's what's throwing me off, I can't see what I can specifically put, whether it's toggled or done automatically, to equip dual wield.
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2015-01-03 14:24:52
Link | Quote | Reply
 
You are correct it can't; it is not built like his BLU one that I had looked at for a friend before.

This is the code out of his BLU GS that you need.
Code
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
update_combat_form()
end

function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == "Genbu's Shield" or player.equipment.sub == 'empty' then -- Your going to wanna probably add or change some of these subs or change it to check for dualwield first based on what is in your sub slot...
state.CombatForm:reset()
else
state.CombatForm:set('DW')
end
end


Also under the "function user_setup()" add:
Code
update_combat_form()


There very well may be some extra code you need out of it that I missed. You also going to wanna toggle the main sub disabel that you mentioned before or add that into the Dualwield check.
Offline
Posts: 1431
By fractalvoid 2015-01-03 16:19:33
Link | Quote | Reply
 
Leviathan.Arcon said: »
Code
if SA then
    equipSet = set_combine(equipSet,sets.JA["Sneak Attack"])
end
if TA then
    equipSet = set_combine(equipSet,sets.JA["Trick Attack"])
end
if SA and TA then
    equipSet = set_combine(equipSet,sets.JA.SATA)
end


Instead of doing this like these, several cases of which only one should be true, use elseif instead:
Code
if SA and TA then
    equipSet = set_combine(equipSet,sets.JA.SATA)
elseif SA then
    equipSet = set_combine(equipSet,sets.JA["Sneak Attack"])
elseif TA then
    equipSet = set_combine(equipSet,sets.JA["Trick Attack"])
end

Hm, the WS sets seem to work fine, as far as I can tell,but I'm having trouble getting it to keep my SA and/or TA gear locked if I've used the JAs and am not using using a WS in conjunction.

I've tried adding this:
Code
	if buffactive["Sneak Attack"] and equipSet["SA"] then
        equipSet = sets.JA["Sneak Attack"]
	elseif buffactive["Trick Attack"] and equipSet["TA"] then
        equipSet = sets.JA["Trick Attack"]
	end


into my midcast functions, and while it doesn't throw any errors, it will use my regular TP gear despite the buff(s) being active.

edit: I seem to have figured it out. I added that bit of code I just posted into my aftercast functions and it seems to be working properly now.
 Cerberus.Tidis
MSPaint Winner
Offline
Server: Cerberus
Game: FFXI
user: tidis
Posts: 3927
By Cerberus.Tidis 2015-01-03 16:46:23
Link | Quote | Reply
 
So I've been messing with my sets a bit, it seems that if I engage something while dual wielding it equips my dual wield set, if I am single wielding, it equips my normal set.

The problem now is that it doesn't update, so if I'm single wielding and engage a mob then late decide to change to dual wielding, it still equips my normal set.
 
Offline
Posts:
By 2015-01-03 17:02:54
 Undelete | Edit  | Link | Quote | Reply
 
Post deleted by User.
 Cerberus.Tidis
MSPaint Winner
Offline
Server: Cerberus
Game: FFXI
user: tidis
Posts: 3927
By Cerberus.Tidis 2015-01-03 17:10:37
Link | Quote | Reply
 
Sweet, that works! Been giving me a headache all day.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2015-01-03 20:05:30
Link | Quote | Reply
 
Phoenix.Segagamer said: »
This lua isn't equipping my FC set whenever I have an avatar out, but has no problem with midcast. Anyone know how to sort that?
Code
beforecall = 0
sumskill = 417 + 16 + 115

PetName = S{"Garuda", "Carbuncle", "Diabolos", "Fenrir", "Caith Sith", "Leviathan", "Ifrit", "Titan", "Shiva"}
SpiritName = S{'Fire Spirit', 'Earth Spirit', 'Water Spirit', 'Air Spirit', 'Ice Spirit', 'Thunder Spirit', 'Light Spirit', 'Dark Spirit'}
SpecialAvatar = S{"Alexander", "Odin", "Atomos"}
 
-- a finir
Storm = {['Firestorm']='Fire',['Windstorm']='Air', ['Sandstorm']='Earth', ['Voidstorm']='Dark', ['Aurorastorm']='Light', ['Hailstorm']='Ice',['Rainstorm']='Water',['Thunderstorm']='Thunder'}
StormList = {'Firestorm','Windstorm', 'Sandstorm', 'Voidstorm', 'Aurorastorm', 'Hailstorm','Rainstorm','Thunderstorm'}
 
AvatarElement = {["Garuda"] = "Wind", ["Carbuncle"]="Light", ["Diabolos"]="Dark", ["Fenrir"]="Dark", ["Caith Sith"]="Light", ["Leviathan"]="Water", ["Ifrit"]="Fire", ["Titan"]="Earth", ["Shiva"]="Ice", ["Ramuh"]="Thunder"}
 
spirit_element = {['Fire']='Fire Spirit', ['Earth']='Earth Spirit', ['Water']='Water Spirit', ['Wind']='Air Spirit', ['Ice']='Ice Spirit', ['Lightning']='Thunder Spirit', ['Light']='Light Spirit', ['Dark']='Dark Spirit'}
spirit_conflict = {['Fire']='Ice', ['Earth']='Lightning', ['Water']='Fire', ['Wind']='Earth', ['Ice']='Wind', ['Lightning']='Water', ['Light']='Dark', ['Dark']='Light'}
 
 
bp_physical = {['Regal Scratch']=true, ['Punch']=true, ['Rock Throw']=true, ['Barracuda Dive']=true, ['Claw']=true, ['Axe Kick']=true, ['Shock Strike']=true, ['Camisado']=true, ['Poison Nails']=true, ['Moonlit Charge']=true, ['Crescent Fang']=true, ['Rock Buster']=true, ['Tail Whip']=true, ['Double Punch']=true, ['Megalith Throw']=true, ['Double Slap']=true, ['Eclipse Bite']=true, ['Mountain Buster']=true, ['Spinning Dive']=true, ['Predator Claws']=true, ['Rush']=true, ['Chaotic Strike']=true, ['Volt Strike']=true, ['Crag Throw']=true}
bp_hybrid = {['Burning Strike']=true, ['Flaming Crush']=true}
bp_magic = {['Inferno']=true, ['Earthen Fury']=true, ['Tidal Wave']=true, ['Aerial Blast']=true, ['Diamond Dust']=true, ['Judgment Bolt']=true, ['Searing Light']=true, ['Howling Moon']=true, ['Ruinous Omen']=true, ['Zantetsuken']=true, ['Somnolence']=true, ['Nether Blast']=true}
bp_magic_tp = {['Meteor Strike']=true, ['Geocrush']=true, ['Grand Fall']=true, ['Wind Blade']=true, ['Heavenly Strike']=true, ['Thunderstorm']=true, ['Fire II']=true, ['Stone II']=true, ['Water II']=true, ['Aero II']=true, ['Blizzard II']=true, ['Thunder II']=true, ['Fire IV']=true, ['Stone IV']=true, ['Water IV']=true, ['Aero IV']=true, ['Blizzard IV']=true, ['Thunder IV']=true, ['Thunderspark']=true, ['Meteorite']=true, ['Holy Mist']=true, ['Lunar Bay']=true, ['Night Terror']=true, ['Level ? Holy']=true, ['Conflag Strike']=true}
bp_accuracy = {['Mewing Lullaby']=true, ['Eerie Eye']=true, ['Lunar Cry']=true, ['Nightmare']=true, ['Lunar Roar']=true, ['Slowga']=true, ['Ultimate Terror']=true, ['Sleepga']=true, ['Tidal Roar']=true, ['Diamond Storm']=true, ['Shock Squall']=true, ['Pavor Nocturnus']=true}
-- Double table, for duration calculation
bp_duration = {
        ['Glittering Ruby']=90,
        ['Shining Ruby']=180,
        ['Frost Armor']=90,
        ['Rolling Thunder']=60,
        ['Crimson Howl']=30,
        ['Lightning Armor']=90,
        ['Ecliptic Growl']=180,
        ['Hastega II']=385,
        ['Noctoshield']=180,
        ['Ecliptic Howl']=180,
        ['Dream Shroud']=180,
        ['Earthen Armor']=95,
        ['Fleet Wind']=120,
        ['Heavenward Howl']=60,
		['Crystal Blessing']= 385,
		['Soothing Current'] =385}
 
icons = {
            ['Earthen Armor']    = 'spells/00299.png', -- 00299 for Titan
            ['Shining Ruby']     = 'spells/00043.png', -- 00043 for Protect
            ['Dream Shroud']     = 'spells/00304.png', -- 00304 for Diabolos
            ['Noctoshield']      = 'spells/00106.png', -- 00106 for Phalanx
            ['Crimson Howl']     = 'spells/00298.png', -- 00298 for Ifrit
            ['Hastega II']       = 'spells/00358.png', -- 00358 for Hastega
            ['Rolling Thunder']  = 'spells/00104.png', -- 00358 for Enthunder
            ['Frost Armor']      = 'spells/00250.png', -- 00250 for Ice Spikes
            ['Lightning Armor']  = 'spells/00251.png', -- 00251 for Shock Spikes
            ['Reraise II']       = 'spells/00135.png', -- 00135 for Reraise
            ['Fleet Wind']       = 'abilities/00074.png', --
			['Crystal Blessing'] = 'spells/00250.png', -- 00250 for TP Bonus
			['Soothing Current'] = 'spells/00300.png', -- 00300 for Soothing Current
        }      
       
       
bp_boon = {['Earthen Ward']=true, ['Aerial Armor']=true, ['Raise II']=true, ['Reraise II']=true, ['Healing Ruby']=true, ['Whispering Wind']=true, ['Spring Water']=true, ['Healing Ruby II']=true}
bp_skill = {['Perfect Defense']=true, ['Inferno Howl']=true, ['Soothing Ruby']=true}
 
 
MAB = S{"Stone", "Stone II", "Water", "Water II", "Aero", "Aero II", "Fire", "Fire II", "Thunder", "Thunder II", "Blizzard", "Blizzard II", "Geohelix", "Hydrohelix", "Anemohelix", "Pyrohelix", "Cryohelix", "Ionohelix", "Luminohelix", "Noctohelix"}
ENF = S{"Sleepga", "Drain", "Aspir", "Dispel", "Sleep", "Sleep II", "Paralyze", "Slow", "Poison", "Poison II", "Gravity", "Dia II", "Bio II", "Silence"}
CUR = S{"Cure", "Cure II", "Cure III", "Cure IV", "Curaga", "Curaga II"}
 
 
--[[Hagondes Body differentiation
HBodPerp = {name="Hagondes Coat +1"}
 Keraunos differentiation
KerACC = {name="Keraunos", augments={'Pet:"Regen"+2', 'Pet:"Mag.Atk.Bns"+11'}}
KerMAB = {name="Keraunos", augments={'Mag.Acc.+11', '"Mag.Atk.Bns."+11', '"Fast Cast"+2'}}
]]

 
function get_sets()
       
        -- IDLE
        sets.idle = {
                main='Bolelabunga',
                sub="Genbu's shield",
                head="Con. Horn +1",
                rear='Psystorm Earring',
				lear="Sanare Earring",
                body=HBodPerp,
                legs='Assid. Pants +1',
                neck='Twilight Torque',
                hands='Serpentes cuffs',
				ring1="Paguroidea Ring",
				ring2="Sheltered Ring",
                feet='Serpentes Sabots',
                waist='Fucho-no-obi',
                ammo="Dosis Tathlum",
                back="Iximulew Cape"}
 
        --  Perp : -13/tick + refresh +5 from gears
    sets.perpetuation = {
    main="Gridarvor",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Glyphic Horn +1", augments={'Enhances "Astral Flow" effect',}},
    body= { name="Hagondes Coat +1", augments={'Phys. dmg. taken -2%','Pet: Mag. Acc.+14',}},
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Assid. Pants +1",
    feet="Con. Pigaches +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Andoaa Earring",
    right_ear="Summoning Earring",
    left_ring="Thurandaut Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
               
    sets.favor = {
    main="Gridarvor",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Glyphic Horn +1", augments={'Enhances "Astral Flow" effect',}},
    body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -2%','Pet: Mag. Acc.+14',}},
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Assid. Pants +1",
    feet="Con. Pigaches +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Thurandaut Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape"}

       
    sets.spirit = {
   main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands="Glyphic Bracers +1",
    legs="Mdk. Shalwar +1",
    feet="Caller's Pgch. +2",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Evoker's Ring",
    right_ring="Fervor Ring",
    back="Conveyance Cape",
                }
       
    sets.resting = {
                head="Con. Horn +1",
                rear='Moonshade Earring',
                body='Hagondes Coat +1',
                legs='Assid. Pants +1',
                neck='Twilight Torque',
                main='Bolelabunga',
                hands='Serpentes cuffs',
                feet='Serpentes Sabots',
                waist='Fucho-no-obi'}
   
    sets.speed = {legs='Tatsu. Sitagoromo'}
       
        sets.ssp = {
                main='Gridarvor',
                ammo='Seraphicaller',
                head="Con. Horn +1",
                neck="Caller's Pendant",
                lear='Andoaa Earring',
                rear='Moonshade Earring',
                body='Hagondes Coat +1',
                hands='Glyphic Bracers +1',
                rring="Evoker's Ring",
                lring='Fervor Ring',
                back='Conveyance Cape',
                waist='Isa Belt',
                legs='Assid. Pants +1',
                feet="Desert Boots",
                sub="Vox Grip"}
               
    sets.ssi = {
                head="Con. Horn +1",
                rear='Moonshade Earring',
                body='Hagondes Coat +1',
                legs='Assid. Pants +1',
                neck='Twilight Torque',
                main='Bolelabunga',
                hands='Serpentes cuffs',
                feet='Desert Boots',
                waist='Fucho-no-obi',
                sub="Genbu's shield",
                ammo="Dosis Tathlum",
                back="Cheviot Cape"}   
 
    sets.precast = {}
       
    sets.precast.delay = {
        main="Gridarvor",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Glyphic Horn +1", augments={'Enhances "Astral Flow" effect',}},
    body={ name="Glyphic Doublet", augments={'Reduces Sp. "Blood Pact" MP cost',}},
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs={ name="Glyphic Spats", augments={'Increases Sp. "Blood Pact" accuracy',}},
    feet="Con. Pigaches +1",
    neck="Caller's Pendant",
    waist="Mujin Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Perception Ring",
    right_ring="Acumen Ring",
    back="Samanisi Cape",}
               
    sets.precast.cede = {
	main="Bolelabunga",
    sub={ name="Genbu's Shield", augments={'"Cure" potency +1%','"Cure" spellcasting time -5%',}},
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body= { name="Hagondes Coat +1", augments={'Phys. dmg. taken -2%','Pet: Mag. Acc.+14',}},
    hands="Call. Bracers +2",
    legs="Assid. Pants +1",
    feet="Serpentes Sabots",
    neck="Twilight Torque",
    waist="Fucho-no-Obi",
    left_ear="Sanare Earring",
    right_ear="Psystorm Earring",
    left_ring="Paguroidea Ring",
    right_ring="Sheltered Ring",
    back="Iximulew Cape",
	}
       
    sets.precast.siphon = {
   main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands="Glyphic Bracers +1",
    legs="Mdk. Shalwar +1",
    feet="Caller's Pgch. +2",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Evoker's Ring",
    right_ring="Fervor Ring",
    back="Conveyance Cape",}
               
    sets.precast.FC = {
    main={ name="Keraunos", augments={'Mag. Acc.+11 "Mag.Atk.Bns."+11','"Fast Cast"+2',}},
    sub="Vivid Strap",
    ammo="Seraphicaller",
    head="Nahtirah Hat",
    body="Marduk's Jubbah +1",
    hands="Repartie Gloves",
    legs={ name="Artsieq Hose", augments={'MP+18','Mag. Acc.+14','MND+4',}},
    feet="Regal Pumps",
    neck="Eddy Necklace",
    waist="Witful Belt",
    left_ear="Loquac. Earring",
    right_ear="Novio Earring",
    left_ring="Strendu Ring",
    right_ring="Acumen Ring",
    back="Swith Cape",}
               
        sets.precast.cure = set_combine(sets.precast.FC, { legs="Nabu's Shalwar" })
   
        sets.midcast = {}
       
    sets.midcast.cure = {
                body="Heka's Kalasiris",
                head="Nahtirah Hat",
                hands="Bokwus Gloves",
                neck="Phalaina Locket",
                legs="Artsieq Hose",
                feet="Umbani Boots",
                back="Pahtli Cape",
                main="Tamaxchi",
                sub="Genbu's shield"}
               
    sets.midcast.stoneskin = {
                neck='Stone Gorget',
                lear='Magnetic Earring',
                rear='Loquacious Earring',
                back='Swith Cape',
                waist='Siegel Sash',
                legs='Artsieq Hose',
                head="Umuthi Hat",
                hands="Gende. Gloves +1",
                body="Anhur Robe"}
               
    sets.midcast.regen = {
                head="Umuthi Hat",
                main="Bolelabunga",
                body="Anhur Robe",
                waist="Siegel Sash",
                back="Swith cape"}
       
    sets.midcast.Enf = {
    main={ name="Keraunos", augments={'Mag. Acc.+11 "Mag.Atk.Bns."+11','"Fast Cast"+2',}},
    sub="Mephitis Grip",
    ammo="Seraphicaller",
    head={ name="Buremte Hat", augments={'Phys. dmg. taken -2%','Magic dmg. taken -2%','Magic Damage +4',}},
    body={ name="Artsieq Jubbah", augments={'MP+30','"Mag.Atk.Bns."+20','INT+7',}},
    hands="Lurid Mitts",
    legs="Mes'yohi Slacks",
    feet="Umbani Boots",
    neck="Eddy Necklace",
    waist="Fucho-no-Obi",
    left_ear="Lifestorm Earring",
    right_ear="Psystorm Earring",
    left_ring="Perception Ring",
    right_ring="Strendu Ring",
    back="Twilight Cape",}
               
    sets.midcast.Mab = {
       main={ name="Keraunos", augments={'Mag. Acc.+11 "Mag.Atk.Bns."+11','"Fast Cast"+2',}},
    sub="Vivid Strap",
    ammo="Seraphicaller",
    head="Buremte Hat",
    body={ name="Artsieq Jubbah", augments={'MP+30','"Mag.Atk.Bns."+20','INT+7',}},
    hands="Otomi Gloves",
    legs="Hagondes Pants +1",
    feet="Umbani Boots",
    neck="Eddy Necklace",
    waist="Sekhmet Corset",
    left_ear="Hecate's Earring",
    right_ear="Novio Earring",
    left_ring="Strendu Ring",
    right_ring="Acumen Ring",
    back="Searing Cape",
                }
				
	sets.midcast.MabSav = set_combine(sets.midcast.Mab, {
		back = "Savior Mantle"
	})
               
    sets.pet_midcast = {}
       
    sets.pet_midcast.physical = {
                main="Gridarvor",
                sub="Vox Grip",
                ammo="Seraphicaller",
                head="Hagondes Hat +1",
                ear1="Andoaa Earring",
                ear2="Smn. Earring",
        body="Convoker's Doublet +1",
                hands="Glyphic Bracers +1",
                ring1="Evoker's Ring",
                ring2="Thurandaut Ring",
        legs="Ngen Seraweels",
                feet="Convoker's Pigaches +1",
                neck="Caller's Pendant",
                back="Samanisi Cape",
                waist="Mujin Obi"}
               
    sets.pet_midcast.magic = {
                main='Frazil Staff',
                sub='Vox Grip',
                ammo='Seraphicaller',
                head='Glyphic Horn +1',
                neck='Eidolon Pendant +1',
                lear='Smn. Earring',
                rear='Andoaa Earring',
                body="Convoker's Doublet +1",
                hands='Hagondes Cuffs',
                lring='Fervor Ring',
                rring="Evoker's Ring",
                back='Samanisi Cape',
                waist="Caller's Sash",
                legs="Ngen Seraweels",
                feet='Hagondes Sabots +1'}
               
               
    sets.pet_midcast.magic.tp = set_combine(sets.pet_midcast.magic,
        {legs="Caller's Spats +2" })
               
    sets.pet_midcast.accuracy = {
    main={ name="Keraunos", augments={'Pet: Mag. Acc.+14','Pet: "Regen"+2',}},
    sub="Vox Grip",
	ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands="Regimen Mittens",
    legs={ name="Glyphic Spats", augments={'Increases Sp. "Blood Pact" accuracy',}},
    feet="Caller's Pgch. +2",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Fervor Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
               
    sets.pet_midcast.boon = {
                rear='Gifted Earring',
                waist="Jaq'ij Sash",
                legs="Caller's Spats +2"}
   
        sets.pet_midcast.skill = {     --105 total
    main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Mdk. Shalwar +1",
    feet="Mdk. Crackows +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Smn. Earring",
    right_ear="Andoaa Earring",
    left_ring="Fervor Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
   
        sets.pet_midcast.duration = {
    main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Mdk. Shalwar +1",
    feet="Mdk. Crackows +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Smn. Earring",
    right_ear="Andoaa Earring",
    left_ring="Fervor Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
               
        sets.pet_midcast.hybrid = {
                main='Frazil Staff',
                sub='Vox Grip',
                ammo='Seraphicaller',
                head="Glyphic Horn +1",
                neck='Eidolon Pendant +1',
                lear='Smn. Earring',
                rear='Andoaa Earring',
                body="Convoker's Doublet +1",
                hands='Hagondes Cuffs',
                lring='Fervor Ring',
                rring="Evoker's Ring",
                back='Samanisi Cape',
                waist="Mujin Obi",
                legs="Ngen Seraweels",
                feet="Convoker's Pigaches +1"}
 
   
 
        sets.perpetuation['Alexander'] = sets.pet_midcast.skill
        sets.perpetuation['Odin'] = sets.pet_midcast.magic
		sets.perpetuation['Atomos'] = sets.pet_midcast.accuracy
       
   
end
 
 
 
function buff_change(name, gain)
    if name == "Sandstorm" then
        if gain then
            equip({feet="Desert Boots"})
        else
            idle()
        end
    end
   
end
 
       
     
 
function pet_change(pets, gain)
        beforecall = 0
    if pet.isvalid then
                --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Called ] *-*-*-*-*-*-*-*-*')
                if pet.name then
                        if pet.name:find('Spirit') then
                                equip(sets.spirit)
                        elseif pet.name == "Alexander" then
                                equip(sets.pet_midcast.skill)
                        elseif pet.name == "Odin" then
                                equip(sets.pet_midcast.magic)
						elseif pet.name == "Atomos" then
                                equip(sets.pet_midcast.accuracy)						
                        else
                                equip(sets.perpetuation[pet.name] or sets.perpetuation)
                        end
        else
            equip(sets.perpetuation[pet.name] or sets.perpetuation)
        end
    else
        equip(sets.idle)
    end
       
         
end
 
 
function status_change(new, old)
    if pet.isvalid == false then
        elseif new == 'Idle' then
           idle()
        elseif new == 'Resting' then
              idle()
    end
end
 
 
function precast(spell)
    if pet.isvalid then
		if buffactive['Astral Conduit'] then
			if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
				if bp_physical[spell.name] then
					equip(sets.pet_midcast.physical)
				elseif bp_magic_tp[spell.name] then
					if pet.tp < 220 then
						equip(sets.pet_midcast.magic.tp)
					else
						equip(sets.pet_midcast.magic)
					end
				elseif bp_magic[spell.name] then
					equip(sets.pet_midcast.magic)
                elseif bp_hybrid[spell.name] then
                    equip(sets.pet_midcast.hybrid)
				elseif bp_accuracy[spell.name] then
					equip(sets.pet_midcast.accuracy)
				elseif bp_duration[spell.name] then
                        duration = bp_duration[spell.name] + sumskill - 300
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Duration of '..spell.name..' = '..duration..' seconds ] *-*-*-*-*-*-*-*-*')
					equip(sets.pet_midcast.skill)
                        duration_pact_timer(spell.name)
				elseif bp_boon[spell.name] then
					equip(sets.pet_midcast.skill)
				elseif bp_skill[spell.name] then
					equip(sets.pet_midcast.skill)
				end
			
		else
			if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
				equip(sets.precast.delay)
			elseif spell.name == 'Elemental Siphon' then
				equip(sets.precast.siphon)
			elseif spell.name == 'Mana Cede' then
				equip(sets.precast.cede)
			elseif CUR:contains(spell.name) then
                equip(sets.precast.cure)       
            elseif spell.action_type == 'Magic' then
				equip(sets.precast.FC)                  
			end
		end
	end	
    elseif spell.action_type == 'Magic' then
               equip(sets.precast.FC)
    end
    if spell.name:find('Spirit') and beforecall == 1 then
                beforecall = 0
                b = 0
                -- A FINIR
                -- First : check storm, then check weather, then check day
                for i=1, 8 do
                        elem = StormList[i]
                        if buffactive[elem] then
                                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..elem..' active - '..Storm[elem]..' ] *-*-*-*-*-*-*-*-*')
                                cancel_spell()
                                send_command('input /ma "'..Storm[elem]..' Spirit" <me>')
                                b=1
                        end
                        i=i+1
                end
                if b == 0 then
                        if world.weather_element ~= "None" then
                                cancel_spell()
                                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..world.weather_element..' weather ] *-*-*-*-*-*-*-*-*')
                                windower.send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
                        else
                                cancel_spell()
                                windower.send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
                                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..world.day_element..' day ] *-*-*-*-*-*-*-*-*')
                        end
                end
    elseif spell.name == 'Sneak' then
        windower.ffxi.cancel_buff(71)
    elseif spell.name == 'Stoneskin' then
        windower.ffxi.cancel_buff(37)
               
         
       
       
    end
end
 
function midcast(spell)
       
        if spell.type == 'BloodPactRage'  or spell.type == 'BloodPactWard' then
                equip(sets.precast.delay)
        elseif spell.action_type == 'Magic' then
       
               
                if ENF:contains(spell.name) then
                        equip(sets.midcast.Enf)
                elseif spell.name  =='Stoneskin' then
                        equip(sets.midcast.stoneskin)
                elseif CUR:contains(spell.name) then
                        equip(sets.midcast.cure)
                elseif MAB:contains(spell.name) then
					if player.mpp > 50 then
                        equip(sets.midcast.Mab)
					else
						equip(sets.midcast.MabSav)
					end
       
                end
       
       
    end
 
end
 
 
function pet_midcast(spell)
        if SpecialAvatar:contains(pet.name) then
                return
        else
    if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
        if bp_physical[spell.name] then
            equip(sets.pet_midcast.physical)
        elseif bp_magic_tp[spell.name] then
			if pet.name =="Garuda" and pet.tp <170 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Titan" and pet.tp <170 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Leviathan" and pet.tp <210 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Ifrit" and pet.tp <250 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Shiva" and pet.tp <170 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Ramuh" and pet.tp <210 then
			   equip (sets.pet_midcast.magic.tp)
			else   
                equip(sets.pet_midcast.magic)
            end
        elseif bp_magic[spell.name] then
            equip(sets.pet_midcast.magic)
                elseif bp_hybrid[spell.name] then
                    equip(sets.pet_midcast.hybrid)
        elseif bp_accuracy[spell.name] then
            equip(sets.pet_midcast.accuracy)
        elseif bp_duration[spell.name] then
                        duration = bp_duration[spell.name] + sumskill - 300
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Duration of '..spell.name..' = '..duration..' seconds ] *-*-*-*-*-*-*-*-*')
            equip(sets.pet_midcast.skill)
                        duration_pact_timer(spell.name)
        elseif bp_boon[spell.name] then
            equip(sets.pet_midcast.skill)
        elseif bp_skill[spell.name] then
            equip(sets.pet_midcast.skill)
        end
    end
        end
end
 
 
function aftercast(spell)
    idle()
end
 
function status_change(new,old)
        if new=="resting" then
        idle()
        elseif new=="engaged" then
        return
        else
        idle()
        end
end
 
 
       
function self_command(command)
    if command == 'Idle' then
        idle()
    end
end
 
 
function pet_aftercast(spell)
  idle()
end
 
 
 
function idle()
    if pet.isvalid then
        if string.find(pet.name,'Spirit') then
            equip(sets.spirit)
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - SpiritPerp Set ] *-*-*-*-*-*-*-*-*')
                       
        elseif buffactive["Avatar's Favor"] then
            equip(sets.favor)
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Avatar Favor Set ] *-*-*-*-*-*-*-*-*')
        else
          equip(sets.perpetuation[pet.name] or sets.perpetuation)
                  add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Perp Set ] *-*-*-*-*-*-*-*-*')
     
         
           
        end
                else
         equip(sets.idle)
        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ NO Pet - Idle Set ] *-*-*-*-*-*-*-*-*')
       
         end
end
 
-- FĂ©vrier et Mars DB
 
 
function duration_pact_timer(spell_name)
        -- Create custom timers for ward pacts.
    if bp_duration[spell_name] then
        local duration = bp_duration[spell_name]
        if duration < 181 then
            local skill = player.skills.summoning_magic
            if skill > 300 then
                skill = skill - 300
                if skill > 200 then skill = 200 end
                duration = duration + skill
            end
        end
       
                local timer_cmd = 'timers c "'..spell_name..'" '..tostring(duration)..' down'
               
                if icons[spell_name] then
                        timer_cmd = timer_cmd..' '..icons[spell_name]
                end
 
                send_command(timer_cmd)
    end
end

-- MAKE A MACRO : /tell <me> check
function open_coffer()
        CofferType = "Velkk Coffer"
        if player.inventory[CofferType] then
        NCoffer = player.inventory[CofferType].count
        bag = windower.ffxi.get_bag_info(0).count
        max = windower.ffxi.get_bag_info(0).max
        spots = max-bag
        if spots > 0 then
        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..NCoffer..'x '..CofferType..' to open - Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
        local nextcommand = ""
        for i=1, spots do
                nextcommand = nextcommand .. 'input /item "'..CofferType..'" <me>; wait 2;'
        end
        nextcommand = nextcommand .. 'input /tell '..player.name..' check'
        send_command(nextcommand)
        else
                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
        end
        else
                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ No '..CofferType..' in inventory ] *-*-*-*-*-*-*-*-*')
        end
end
 
 
windower.register_event('chat message', function(original, sender, mode, gm)
    local match
 
                                if sender == player.name then
                                        if original == "check" then
                                                open_coffer()
                                        end
                                end
 
    return sender, mode, gm
end)
-- Select default macro book on initial load or subjob change.
function select_default_macro_book(reset)
    if reset == 'reset' then
        -- lost pet, or tried to use pact when pet is gone
    end
    
    -- Default macro set/book
    set_macro_page(1, 3)
end


A week late, sorry.

Your precast function's first conditional check is if your pet is valid. I don't really understand why that would ever be necessary unless you use different gear for certain abilities/spells depending on whether you have a pet out or not, but it doesn't look like you do, so you should really remove that.

That said, that's not your issue, it just creates an unnecessary need for redundancy, or else creates holes in your logic (technically, you'll never equip your cure precast unless you have a pet out).

The real problem is that you're not ending the first "if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then", so everything after the else is still under the condition that Astral Conduit is on. Way easier to spot things like this if you keep your tabbing in line.
Offline
Posts: 346
By Sidiov 2015-01-05 00:30:32
Link | Quote | Reply
 
I recently started getting errors when ranged attacking using Mote's libraries.
Code
Mote-Include.lua:845: "has_value" is not defined for strings
Code
Mote-Include.lua:564: "has_value" is not defined for strings

which looks like:
Code
 if state.CombatWeapon.has_value and equipSet[state.CombatWeapon.value] then
       equipSet = equipSet[state.CombatWeapon.value]
       mote_vars.set_breadcrumbs:append(state.CombatWeapon.value)
   end


Does anyone have an idea about whats wrong there?
 Bismarck.Stanislav
Offline
Server: Bismarck
Game: FFXI
user: daNpwr
Posts: 120
By Bismarck.Stanislav 2015-01-05 02:27:18
Link | Quote | Reply
 
I was wondering how to add sets with certain buffs such as haste2/geo-haste. My current THF/NIN lua uses certain buff stages such as haste only, haste & march, etc. and I wanted to add in sets with Haste2 & Indi/Geo-Haste as well. Thanks in advanced!
Offline
Posts: 1431
By fractalvoid 2015-01-05 03:25:04
Link | Quote | Reply
 
Bismarck.Stanislav said: »
I was wondering how to add sets with certain buffs such as haste2/geo-haste. My current THF/NIN lua uses certain buff stages such as haste only, haste & march, etc. and I wanted to add in sets with Haste2 & Indi/Geo-Haste as well. Thanks in advanced!

It might be possible to do it for a geomancer's haste but I don't think there's a way to differentiate between haste1&2 as the buffs don't differ at all afaik unless they have a different ID. Was looking into doing this myself earlier but couldn't come up with anything
 Bismarck.Stanislav
Offline
Server: Bismarck
Game: FFXI
user: daNpwr
Posts: 120
By Bismarck.Stanislav 2015-01-05 14:00:15
Link | Quote | Reply
 
fractalvoid said: »
Bismarck.Stanislav said: »
I was wondering how to add sets with certain buffs such as haste2/geo-haste. My current THF/NIN lua uses certain buff stages such as haste only, haste & march, etc. and I wanted to add in sets with Haste2 & Indi/Geo-Haste as well. Thanks in advanced!

It might be possible to do it for a geomancer's haste but I don't think there's a way to differentiate between haste1&2 as the buffs don't differ at all afaik unless they have a different ID. Was looking into doing this myself earlier but couldn't come up with anything

Damn this really sucks. lol
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2015-01-05 14:11:06
Link | Quote | Reply
 
Bismarck.Stanislav said: »
fractalvoid said: »
Bismarck.Stanislav said: »
I was wondering how to add sets with certain buffs such as haste2/geo-haste. My current THF/NIN lua uses certain buff stages such as haste only, haste & march, etc. and I wanted to add in sets with Haste2 & Indi/Geo-Haste as well. Thanks in advanced!

It might be possible to do it for a geomancer's haste but I don't think there's a way to differentiate between haste1&2 as the buffs don't differ at all afaik unless they have a different ID. Was looking into doing this myself earlier but couldn't come up with anything

Damn this really sucks. lol

Actually I'm working on a method for this, it isn't 100% yet but when I manage it I will let you know! (Krispy I'll pm you it on GW later)
Offline
Posts: 1431
By fractalvoid 2015-01-05 14:15:29
Link | Quote | Reply
 
Send me a PM on here as well Conagh, if you don't post it here. Thanks!
Was just looking into making a toggle for it but I'm infinitely lazy
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2015-01-05 14:28:03
Link | Quote | Reply
 
A Rather crude method would be to add a gain/loss function to check when you lose haste it sets a toggle

Toggle 0 no haste
toggle 1 Haste 1
Toggle 2 Haste 2

Triggers for toggle 1 and 2 would be something like this ..this is not the right way to parse chat messages and is just an example for a work around, it may be easier to just use the Packet id's like Batlemod does and make the trigger work directly from Battlemod updating this data within an include for your gearswap file.

Packet manipulation is a little beyond my skill but if I nail the chat log function to check it (and that target is you) then this could work... subject to some issues obviously and this is just a preliminary idea.
Code
windower.register_event('Chat Message',function(chat)   
	if string S{'Haste II','Haste 2'} then
		HasteToggle == 2
	elseif string S{'Haste'} then
		HasteToggle == 1
	end
end


Packet id's etc would be better in ways but then it's subject to Battlemod being maintained etc or rather that people who use this aspect if it were included report it if it breaks. But Packet ID parsing is for more robust than checking chat log messages (especially if you block those form your chat log).

P.S I'm learning how packets work and how to write the code for it, so if Flippant or Bryth don't beat me to it! I'll post somewhere, might even ask for it to be put into a repository or something
 Asura.Limelol
Offline
Server: Asura
Game: FFXI
user: Limelol
By Asura.Limelol 2015-01-05 14:43:04
Link | Quote | Reply
 
So I'm sure this has been answered multiple times, but I'm not going to go through 46 pages of replies, so sorry in advance.

After reading the second post, I want to make sure I'm understanding this right because, quite frankly, it does seem a tad bit gamebreaking although it's essentially doing the same thing as macros. Not that I'm judging anyone who uses it.

The question:

Lets assume I have a ws set setup. Does this addon auto-detect me using the ws and changes my gear without the use of macros?

Is that it's advantage over macros, it just cuts out the time writing the macro?
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2015-01-05 14:49:49
Link | Quote | Reply
 
Asura.Limelol said: »
So I'm sure this has been answered multiple times, but I'm not going to go through 46 pages of replies, so sorry in advance.

After reading the second post, I want to make sure I'm understanding this right because, quite frankly, it does seem a tad bit gamebreaking although it's essentially doing the same thing as macros. Not that I'm judging anyone who uses it.

The question:

Lets assume I have a ws set setup. Does this addon auto-detect me using the ws and changes my gear without the use of macros?

Is that it's advantage over macros, it just cuts out the time writing the macro?

It does this, can also have various acc sets so if you say I want Low Acc, you can define a low acc ws set (can have infinite sets controlled by a toggle or by an acc parse rule to auto adjust sets etc....) you would have 1 WS macro but a toggle (so 2 macros to control what could be 10 sets)

You dont need a macro for TP gear it equis it after your WS is complete / spells / ja

Also accounts for instant cast etc.

and Makes gearing easier (you can swap from 80 slots on WAR to 80 slots of gear for WHM in about 2~3minutes)
 Asura.Limelol
Offline
Server: Asura
Game: FFXI
user: Limelol
By Asura.Limelol 2015-01-05 15:10:22
Link | Quote | Reply
 
Cerberus.Conagh said: »
It does this, can also have various acc sets so if you say I want Low Acc, you can define a low acc ws set (can have infinite sets controlled by a toggle or by an acc parse rule to auto adjust sets etc....) you would have 1 WS macro but a toggle (so 2 macros to control what could be 10 sets)

You dont need a macro for TP gear it equis it after your WS is complete / spells / ja

Also accounts for instant cast etc.

and Makes gearing easier (you can swap from 80 slots on WAR to 80 slots of gear for WHM in about 2~3minutes)

Oh, alright. I can definitely see why everyone suggests this addon then. Thanks for the information.

And I'll have to read up on the first part about having multiple sets because it sounds pretty cool.

Another question:

I plan on tinkering around with this while leveling DNC. Obviously, I won't have a bunch of different sets, maybe just a ws set and some sets for my JAs.

If I leave the level 99 gearsets / gear I don't have in the script, will anything go wrong? Obviously, I won't be able to use level 99 gear at level ~55.
 Quetzalcoatl.Mckenzee
Offline
Server: Quetzalcoatl
Game: FFXI
Posts: 83
By Quetzalcoatl.Mckenzee 2015-01-07 00:53:18
Link | Quote | Reply
 
a couple quick questions

will spell.skill return weaponskill for weaponskills?

i wanna make sure that this syntax will work as well

gorget.Distortion = (Snow Gorget)
sets.precast.weaponskill.[ws_name] = (
head = "helmet",
neck = gorget[spell.WSA],
ear1 = "earring")


also, i'm planning on using //gs export to populate individual gearset include files. 1 want to double check that after initializing the gearset, simply calling the include and defining the gearset inside the exported file will cover it.

edit: also, does export provide support for naming the files/sets or does that need to be editted by hand?
 Quetzalcoatl.Valli
Offline
Server: Quetzalcoatl
Game: FFXI
user: valli
Posts: 1420
By Quetzalcoatl.Valli 2015-01-07 05:17:42
Link | Quote | Reply
 
What does one have to do to ensure gearswap always works? Cause I hate to break this, but it does not always get the gear on fast enough for the ws to process.

It's very obvious when using magical ws when the program fails to act quickly enough.

Fail vs success


1000 tp in the proper set minimum is 4k. meaning that first one was fired off in my melee set. Granted this only happens maybe 1 every 50 pulls, but 0 times is too many.
First Page 2 3 ... 45 46 47 ... 182 183 184