GearSwap Question About Weather & TP

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » FFXI » General » GearSwap Question about weather & TP
GearSwap Question about weather & TP
 
Offline
Posts:
By 2015-10-08 22:33:37
| Edit  | Link | Quote | Reply
 
Post deleted by User.
Offline
Server: Asura
Game: FFXI
Posts: 95
By Asura.Omnijuggernaut 2015-10-08 23:51:56
Link | Quote | Reply
 
Put this wherever your belt slot is that you want the Obi to be,
waist=gear.ElementalObi,

Where your function user set up is you should put in,
Code
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.cure_waist = "Belt that you want here without weather bonus"
	gear.default.obi_waist = "Belt that you want here without weather bonus"
	gear.default.obi_back = "Belt that you want here without weather bonus"
	
	select_default_macro_book()
end[code]



more specifically you will need to put in these lines into that section to create the rules.

gear.default.cure_waist = "Belt that you want here without weather bonus"
gear.default.obi_waist = "Belt that you want here without weather bonus"
gear.default.obi_back = "Belt that you want here without weather bonus"


As for your weapon/tp problem
Type this in chat and manually set the weapon/sub/ammo so you don't lose tp

//gs disable main
//gs disable sub
//gs disable range
 Bismarck.Snprphnx
Offline
Server: Bismarck
Game: FFXI
user: Snprphnx
Posts: 2689
By Bismarck.Snprphnx 2015-10-09 00:22:07
Link | Quote | Reply
 
If you have the newer, all-weather obi, sea gorget, or all element waist, you may need to go into the libs\Mote-Mappings.lua, and find the sections that defines element.obi, element.waist, and element.gorget, and change them from the older Korin, Rairin, etc, to Fotia Gorget, Hachirin-no-obi, and Fotia Belt
 Asura.Vafruvant
Offline
Server: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2015-10-09 00:33:53
Link | Quote | Reply
 
karusanyoshi said: »
Hi all,

I recently started playing again and am teaching myself Gearswap finally.

Since the change to sch's weather spell levels, and the relatively new all-weather Obi, I wanted to know how to add to my gearswap lua a function to change to a certain set of gear when I have the appropriate weather either cast, or naturally occuring, or change to another when I do not. I want this function to be for Curing spells, and one for Elemental spells. Most gearswaps I've seen include a complicated function to change to one of the 8 different Obi's, but I don't understand the coding well enough to edit it to do what I want yet.

My other question is how to add a function that does not change weapon (thereby draining all TP) when my TP is above a certain amount. Up until now, I just don't include weapons in any of my sets, because I like to build up tp for Myrkr.

Thanks in advance to anyone who can help me.
What Omni said is almost accurate, but gear.default.cure_waist won't work by itself, and the other two won't work unless you're using a file from the Kinematics repository. If you're using a basic GearSwap lua, one that includes all of it's own rules, you need to do something a little more involved.
-----------------------
First, we'll go through how to make it work with a Kinematics file:
  • Step one: If one isn't already present with the same name, put this function at the bottom of your file:

    Code
    function job_precast(spell, action, spellMap, eventArgs)
    	if spell.action_type == 'Magic' then
    		if spell.skill == 'Elemental Magic' then
    			gear.default.obi_waist = "NonBonusNukingBelt"
    			gear.default.obi_back = "NonBonusNukingBack"
    		elseif spellMap == 'Cure' or spellMap == 'Curaga' then
    			gear.default.obi_waist = "NonBonusCuringBelt"
    			gear.default.obi+back = "NonBonusCuringBack"
    		end
    	end
    end
    Obviously, change the names inside the quotes to the item you want to use.

  • Step two: In your Curing and Nuking sets, change the names of your back and waist slots to the following:

    Code
    back=gear.ElementalCape,waist=gear.ElementalObi

That will do it for a Kinematics file (or any file that uses Mote-Include.lua)
-----------------------
As for any other file, you'll need to do something similar, but a little more involved:
  • Step one: Make a new gear set that looks like this:

    Code
    ElementalGear = {}
    ElementalGear.Obi = "Hachirin-no-Obi"
    ElementalGear.Cape = "Twilight Cape"
    sets.midcast.CureWithLightWeather = {back=ElementalGear.Cape,waist=ElementalGear.Obi}
    sets.Midcast.NukeWithMatchingWeather = {back=ElementalGear.Cape,waist=ElementalGear.Obi}

  • Step Two: If not already present, add this function:

    Code
    function midcast(spell)
    	if spell.action_type == 'Magic' then
    		if spell.skill == 'Elemental Magic' then
    			equip(sets.midcast['Elemental Magic'])
    			if world.weather_element == spell.element or wprld.day_element == spell.element then
    				equip(sets.midcast.NukeWithMatchingWeather)
    			end
    		elseif spell.skill == 'Healing Magic' and spell.english:startswith('Cur') and spell.english ~= 'Cursna' then
    			equip(sets.midcast.Cure)
    			if world.weather_element == spell.element or wprld.day_element == spell.element then
    				equip(sets.midcast.CureWithMatchingWeather)
    			end
    		end
    	end
    end

That *should* do it for a non-Mote file, but I didn't debug it fully, as I use primarily Mote-based files.
-----------------------
I hope this all works and is simple enough to follow :)
[+]
 Asura.Vafruvant
Offline
Server: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2015-10-09 00:40:10
Link | Quote | Reply
 
karusanyoshi said: »
My other question is how to add a function that does not change weapon (thereby draining all TP) when my TP is above a certain amount. Up until now, I just don't include weapons in any of my sets, because I like to build up tp for Myrkr.
And since I forgot to answer this...

You can set up two checks, one at precast and one at aftercast, like this:

Mote-based:
Code
function job_precast(spell, action, spellMap, eventArgs)
	if player.tp >= #### then
		disable('main','sub','range')
	end
end
Code
function job_aftercast(spell, action, spellMap, eventArgs)
	if not player.tp >= #### then
		enable('main','sub','range')
	end
end

Non Mote-based:
Code
function precast(spell,act)
	if player.tp >= #### then
		disable('main','sub','range')
	end
end
Code
function aftercast(spell,act)
	if not player.tp >= #### then
		enable('main','sub','range')
	end
end

Hope it helps!
[+]
Offline
Server: Asura
Game: FFXI
Posts: 95
By Asura.Omnijuggernaut 2015-10-09 11:02:51
Link | Quote | Reply
 
I got lucky and Vafruvant already put those rules in mine.
Offline
Posts: 33
By vm0d 2015-10-09 13:34:49
Link | Quote | Reply
 
precast should have fast cast, the obi should only be in midcast.
 Asura.Vafruvant
Offline
Server: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2015-10-09 14:39:18
Link | Quote | Reply
 
vm0d said: »
precast should have fast cast, the obi should only be in midcast.
All it's doing is declaring the name of the equipment to be equipped in the midcast; it's not actually equipping anything.
 Shiva.Tilanna
Offline
Server: Shiva
Game: FFXI
user: Tilanna
Posts: 28
By Shiva.Tilanna 2015-10-09 15:00:44
Link | Quote | Reply
 
Regarding saving TP, if using Mote's libraries, you can cycle your OffenseMode (by default bound to F9, or you can create a macro with "/console gs c cycle OffenseMode") and it will disable your main, sub, and ranged slots for you when your OffenseMode is set to Normal.
Code
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


This might require some of Mote's libraries to even be called (I'm not too familiar with which functionality belongs to which library), but if you need to add it, this is how you'd do it.
 Asura.Vafruvant
Offline
Server: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2015-10-09 21:47:31
Link | Quote | Reply
 
Shiva.Tilanna said: »
This might require some of Mote's libraries to even be called (I'm not too familiar with which functionality belongs to which library), but if you need to add it, this is how you'd do it.
Unfortunately, his libraries can't really be called individually, as they are all written to work with each other. You can call specific functions by copying them, but as for calling a specific file, you cannot.

As for why I didn't specify the offense mode toggle is that if it's a Mote-based file that deviates from his Kinematics repository and doesn't use offense mode (as might be with mages who don't often melee), the two functions I wrote above will cover the request without adding in a toggle and requiring a key press. The nice thing about the toggle, though, is that you can turn it on and off, if you are ever in an event and don't need Myrkr, to swap in fast cast items.
 
Offline
Posts:
By 2015-10-09 22:36:52
 Undelete | Edit  | Link | Quote | Reply
 
Post deleted by User.
necroskull Necro Bump Detected! [118 days between previous and next post]
 Bismarck.Singular
Offline
Server: Bismarck
Game: FFXI
user: Singular
Posts: 10
By Bismarck.Singular 2016-02-04 12:15:30
Link | Quote | Reply
 
Hello. I apologize to bump an old topic, but I cannot get elemental obis to work in Kinematic's BLM file, I think it has something to do with mote-include but I'm not sure.

I downloaded an untouched version of Kinematic's BLM lua, then pasted my dark obi into the mote-include
Code
gear.ElementalGorget = {name=""}
    gear.ElementalBelt = {name=""}
    gear.ElementalObi = {name="Anrin Obi"}
    gear.ElementalCape = {name=""}
    gear.ElementalRing = {name=""}
    gear.FastcastStaff = {name=""}
    gear.RecastStaff = {name=""}


And tested it to see if it works at all and it does not. Putting anything in that field does absolutely nothing.

I then have tried about 4 different codes I found on the net to make Elemental Obies work, and none of them will. It's as if mote-include or something else I'm missing won't allow elemental obi support no matter what I change.

I'm pretty desperate here, I've been working on this for two days now, and I have help threads on Windower.net, on BG, and here, and unfortunately they've gone mostly ignored and I'm to the point where I want to smash my pc and quit FFXI for another couple years.
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()

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.CastingMode:options('Normal', 'Resistant', 'Proc')
    state.IdleMode:options('Normal', 'PDT')
    

    lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
        'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
        'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
        'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
        'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}

    gear.macc_hagondes = {name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','Mag. Acc.+29'}}
    
    -- Additional local binds
    send_command('bind ^` input /ma Stun <t>')
    send_command('bind @` gs c activate MagicBurst')

    select_default_macro_book()
end

-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^`')
    send_command('unbind @`')
end


-- Define sets and vars used by this job file.
function init_gear_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------
    
    ---- PRECAST ----
    
    ---- Precast sets to enhance JAs ----
	
    sets.precast.JA['Mana Wall'] = {feet="Goetia Sabots +1"}

    sets.precast.JA.Manafont = {}
    
    ---- equip to maximize HP (for Tarus) and minimize MP loss before using convert ----
	
    sets.precast.JA.Convert = {}

    ---- Fast cast sets for spells ----

    sets.precast.FC = {neck="Jeweled Collar",
        head="Wayfarer Circlet",ear2="Loquacious Earring",legs="Wayfarer Slops",body="Wicce Coat",waist="Swift Belt",feet="Rostrum Pumps"}

    sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})

    sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal"})

    sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris", back="Pahtli Cape"})

    sets.precast.FC.Curaga = sets.precast.FC.Cure
	
	sets.precast.Stoneskin = {hands="Carpacho Cuffs"}

    ---- MIDCAST ----
		
	---- HEALING MAGIC ----

    sets.midcast.Cure = {main="Eminent Staff",
        head="Wayfarer Circlet",neck="Morgana's Choker",ear2="Loquacious Earring", ear1="Geist Earring",
        body="Wicce Coat",hands="Wayfarer Cuffs",ring1="Tamas Ring",ring2="Solemn Ring",
        back="Kaikias' Cape",waist="Witch Sash",legs="Wayfarer Slops",feet="Wayfarer Clogs"}

    sets.midcast.Curaga = sets.midcast.Cure

    ---- ENHANCING MAGIC ----	
	
    sets.midcast['Enhancing Magic'] = {ear1="Geist Earring", back="Kaikias' Cape",
        waist="Siegel Sash", neck="Enhancing Torque", feet="Igqira Huaraches",
        body="Wicce Coat",hands="Wayfarer Cuffs", ring1="Tamas Ring", ring2="Solemn Ring",
        legs="Wayfarer Slops", ear2="Geist Earring", head="Wayfarer Circlet"}
		
    ---- STONESKIN ----
	
    sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash", main="Eminent Staff",
	neck="Morgana's Choker", feet="Wayfarer Clogs", legs="Haven Hoes", hands="Carapacho Cuffs"})
	
	---- ENFEEBLING MAGIC ----

    sets.midcast['Enfeebling Magic'] = {main="Eminent Staff", sub="Buggard Strap +1", ammo="Sturm's Report",
        head="Wayfarer Circlet",neck="Morgana's Choker",ear1="Geist Earring",ear2="Geist Earring",
        body="Wicce Coat",hands="Wayfarer Cuffs",ring1="Solemn Ring",ring2="Tamas Ring",
        back="Kaikias' Cape",legs="Wayfarer Slops",feet="Wayfarer Clogs", waist="Witch Sash"}
	
	sets.midcast['Enfeebling Magic'].Resistant = set_combine(sets.midcast['Enfeebling Magic'], {head="Wayfarer Circlet",neck="Enfeebling Torque",
        body="Wicce Coat",ring1="Omega Ring",ring2="Tamas Ring",feet="Wayfarer Clogs"})
        
    sets.midcast.ElementalEnfeeble = sets.midcast['Enfeebling Magic']
	
	---- ENFEEBLING MAGIC BLACK ----

    sets.midcast['Dark Magic'] = {main="Eminent Staff",sub="Bugard Strap +1",ammo="Phantom Tathlum",
        head="Wayfarer Circlet",neck="Stoicheion Medal",ear1="Hecate's Earring",ear2="Phantom Earring",
        body="Wicce Coat",hands="Wayfarer Cuffs",ring1="Tamas Ring",ring2="Icesoul Ring",
        back="Kaikias' Cape",waist="Witch Sash",legs="Wizard's Tonban",feet="Goetia Sabots +1"}

    ---- ELEMENTAL MAGIC ----
	    
    sets.midcast['Elemental Magic'] = {main="Eminent Staff",sub="Bugard Strap +1",ammo="Witchstone",
        head="Wayfarer Circlet",neck="Stoicheion Medal",ear1="Hecate's Earring",ear2="Friomisi Earring",
        body="Wicce Coat",hands="Goetia Gloves +1",ring1="Icesoul Ring",ring2="Acumen Ring",
        back="Kaikias' Cape",waist="Witch Sash",legs="Wayfarer Slops",feet="Wayfarer Clogs"}
		
	sets.midcast['Elemental Magic'].Resistant = set_combine(sets.midcast['Elemental Magic'], {ammo="Witchstone",
        head="Goetia Petasos +1",hands="Wayfarer Cuffs",ring2="Omega Ring",waist="Witch Sash",})
    
	
    ---- RESTING ----
	
    sets.resting = {main="Chatoyant Staff",sub="Ariesian Grip",
        neck="Beak Necklace +1",body="Errant Hpl.",waist="Hierarch Belt",feet="Avocat Pigaches"}
  
    ---- IDLE ----
	
    sets.idle = {main="Terra's Staff", sub="Bugard Strap +1",ammo="Hedgehog Bomb",
        head="Goetia Petasos +1",neck="Morgana's Choker",ear1="Bloodgem Earring",ear2="Loquacious Earring",
        body="Wicce Coat",hands="Goetia Gloves +1",ring1="Bifrost Ring",ring2="Tamas Ring",
        back="Kakias' Cape",waist="Witch Sash",legs="Goetia Chausses +2",feet="Goetia Sabots +1"}
		
	---- Functionality for Bard Sub ----	
		
    --sets.midcast.BardSong = {main="Lehbrailg +2",sub="Mephitis Grip",ammo="Sturm's Report",
    --    head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    --    body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Sangoma Ring",
    --    back="Refraction Cape",legs="Bokwus Slops",feet="Bokwus Boots"}

    -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
    
    sets.buff['Mana Wall'] = {feet="Goetia Sabots +2"}

    -- 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 = {
        head="Zelus Tiara",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
        body="Hagondes Coat",hands="Bokwus Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
        back="Umbra Cape",waist="Goading Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
		
	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.obi = {
		Fire = {waist="Karin Obi"},
		Earth = {waist="Dorin Obi"},
		Water = {waist="Suirin Obi"},
		Wind = {waist="Furin Obi"},
		Ice = {waist="Hyorin Obi"},
		Lightning = {waist="Rairin Obi"},
		Light = {waist="Korin Obi"},
		Dark = {waist="Anrin Obi"},
		}
	
end




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

-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.


function job_midcast(spell,action)
    if spell.action_type == 'Magic' then
        if sets.midcast[spell.english] then
            equip(sets.midcast[spell.english])
        elseif spell.english:startswith('Protect') or spell.english:startswith('Shell') then
            equip(sets.midcast.ProtectShell)
        elseif spell.skill == 'Elemental Magic' then
            if spell.english:startswith('Stone') then
                 equip(sets.midcast.Stone)	
            elseif spell.english == 'Impact' then
                 equip(sets.midcast['Elemental Magic'],{body="Twilight Cloak"})
            else equip(sets.midcast['Elemental Magic'])
            end
            if spell.element == world.weather_element or spell.element == world.day_element then
                 equip(sets.obi[spell.element])
            end
        elseif sets.midcast[spell.skill] then
            equip(sets.midcast[spell.skill])
        else equip(sets.precast.Fastcast)
        end
    end
end



function job_aftercast(spell, action, spellMap, eventArgs)
    -- Lock feet after using Mana Wall.
    if not spell.interrupted then
        if spell.english == 'Mana Wall' then
            enable('feet')
            equip(sets.buff['Mana Wall'])
            disable('feet')
        end
    end
end

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

-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
    -- Unlock feet when Mana Wall buff is lost.
    if buff == "Mana Wall" and not gain then
        enable('feet')
        handle_equipping_gear(player.status)
    end
end

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


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

-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
    if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
        --[[ No real need to differentiate with current gear.
        if lowTierNukes:contains(spell.english) then
            return 'LowTierNuke'
        else
            return 'HighTierNuke'
        end
        --]]
    end
end

-- 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


-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    set_macro_page(1, 2)
end
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-02-04 13:01:55
Link | Quote | Reply
 
You should not edit the Mote-Include.lua at all

Also do you have all the Obi? If so combine them and save the headache of spell type. Here is what I did with my GS. I am no expert but I have not had any problems with it.
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')
    -- Load organizer add on to grab all gear associated with lua.
    include('organizer-lib')
end
 
 
-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
 
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.CastingMode:options('Normal', 'Resistant', 'TP')
    state.IdleMode:options('Normal', 'PDT')
    state.MagicBurst = M(false, 'Magic Burst')
     
    lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
                    'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
                    'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
                    'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
                    'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}
     
    -- Additional local binds
    send_command('bind ^` input /ma Stun <t>;input /echo Target <t> Stunned')
    send_command('bind @` gs c toggle MagicBurst')
 
    select_default_macro_book()
end
 
-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^`')
    send_command('unbind @`')
end
 
 
-- Define sets and vars used by this job file.
function init_gear_sets()
-------------------------------------------------------------------------------------------------------------------
-- Start defining the sets
-------------------------------------------------------------------------------------------------------------------
                                                                         
-- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS =                                                       {}
                                                                             
-- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    -- Rock Crusher Modifiers: STR:20% INT:20% --       
    sets.precast.WS['Rock Crusher'] =                                       set_combine(sets.precast.WS,{})
                                                                             
    -- Spirit Taker Modifiers: INT:50% MND:50% --
    sets.precast.WS['Spirit Taker'] =                                       set_combine(sets.precast.WS,{})
                                                                             
    -- Cataclysm Modifiers: STR:30% INT:30% --
    sets.precast.WS['Cataclysm'] =                                          set_combine(sets.precast.WS,{})
                                                                             
    -- Retribution Modifiers: STR:30%; MND:50% --
    sets.precast.WS['Retribution'] =                                        set_combine(sets.precast.WS,{})
                                                                             
    -- Gate of Tartarus Modifiers: INT:80% --
    sets.precast.WS['Gate of Tartarus'] =                                   set_combine(sets.precast.WS,{
                                                                            })
                                                                             
    -- Myrkr Modifiers: None --
    sets.precast.WS['Myrkr'] =                                              set_combine(sets.precast.WS,{})
                                                                             
    -- Shattersoul Modifiers: INT:20~100%, depending on merit points upgrades. --
    sets.precast.WS['Shattersoul'] =                                        set_combine(sets.precast.WS,{})
                                                                             
-- Precast sets
    -- Precast sets to enhance JAs
    sets.precast.JA['Mana Wall'] =                                          {}
     
    sets.precast.JA['Manafont'] =                                           {}
     
 
    -- Fast cast sets for spells
    sets.precast.FC =                                                       {}
                                                                             
    -- Stoneskin
    sets.precast.Stoneskin =                                                set_combine(sets.precast.FC,{})
     
    -- Cure Magic
    sets.precast.Cure =                                                     set_combine(sets.precast.FC,{})
     
    -- Elemental Magic
    sets.precast.FCElementalMagic =                                         set_combine(sets.precast.FC,{})
     
    -- Ancient Magic
    sets.precast.AncientMagic =                                             set_combine(sets.precast.FCElementalMagic,{})
                                                     
-- Midcast Sets
    -- Day Weather Bonus
    sets.midcast.Bonus =                                                    {}
                                                         
    -- Fastrecast
    sets.midcast.FastRecast =                                               {}
     
    -- Cure
    sets.midcast.Cure =                                                     {}
 
    sets.midcast.Curaga =                                                   sets.midcast.Cure
                                                                             
    sets.midcast['Enhancing Magic'] =                                       {}
 
    sets.midcast['Enhancing Magic'].Stoneskin =                             set_combine(sets.midcast['Enhancing Magic'],{})
                                                                             
    sets.midcast['Enhancing Magic'].Aquaveil =                              set_combine(sets.midcast['Enhancing Magic'],{})                                                                         
 
 
    sets.midcast['Enfeebling Magic'] =                                      {}
                                                                             
    sets.midcast['Enfeebling Magic'].Mnd =                                  set_combine(sets.midcast['Enfeebling Magic'],{})
       
    sets.midcast.ElementalEnfeeble =                                        sets.midcast['Enfeebling Magic']
 
    sets.midcast['Dark Magic'] =                                            {}
                                                                             
    sets.midcast['Dark Magic'].Drain =                                      set_combine(sets.midcast['Dark Magic'],{})
                                                                             
    sets.midcast['Dark Magic'].Aspir =                                      sets.midcast['Dark Magic'].Drain                                        
                                                                             
 
    sets.midcast['Dark Magic'].Stun =                                       set_combine(sets.midcast['Dark Magic'],{})
 
    -- Elemental Magic sets
    sets.midcast.LowTierNuke =                                              {}
 
    sets.midcast.LowTierNuke.Resistant =                                    {}
 
    sets.midcast.TP =                                                       {}                                                                          
                                                                             
    sets.midcast.HighTierNuke =                                             set_combine(sets.midcast.LowTierNuke,{})
                                                                             
    sets.midcast.HighTierNuke.Resistant =                                   set_combine(sets.midcast.LowTierNuke.Resistant,{})
     
-- Sets to return to when not performing an action.
    -- Resting sets
    sets.resting =                                                          {}
     
    -- Idle sets
     
    -- Normal refresh idle set
    sets.idle =                                                             sets.resting
 
    -- Idle mode that keeps PDT gear on, but doesn't prevent normal gear swaps for precast/etc.
    sets.idle.PDT =                                                         set_combine(sets.resting,{})
 
    -- Idle mode when weak.
    sets.idle.Weak =                                                        sets.idle.PDT
     
    -- Town gear.
    sets.idle.Town =                                                        set_combine(sets.resting,{})
         
    -- Defense sets
 
    sets.defense.PDT =                                                      set_combine(sets.resting,{})
 
    sets.defense.MDT =                                                      set_combine(sets.resting,{})
 
    sets.Kiting =                                                           {}
 
    sets.latent_refresh =                                                   {}
 
    -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
     
    sets.buff['Mana Wall'] =                                                {}
 
    sets.magic_burst =                                                      {}
 
    -- 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 =                                                          {}
end
 
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
 
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
    if player.tp > 1000 then
        disable('main','sub')
    elseif (spellMap == 'Cure' or spellMap == 'Curaga') then
        equip(sets.precast.Cure)
        if (world.weather_element == 'Light' or world.day_element == 'Light') then
            equip({waist="Hachirin-no-Obi"})
        end
    elseif spellMap == 'Freeze II' or spellMap == 'Tornado II' or spellMap == 'Quake II' or spellMap == 'Burst II' or spellMap == 'Flood II' or spellMap == 'Flare II' then
        equip(sets.precast.AncientMagic)
    elseif spellMap == 'Stoneskin' then
        equip(sets.precast.Stoneskin)
    elseif spell.skill == 'Elemental Magic' then
        equip(sets.precast.FCElementalMagic)
    end
end
 
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Elemental Magic' and (spell.element == world.weather_element or spell.element == world.day_element) then
        equip(sets.midcast.Bonus)
    elseif spellMap == 'Slow' or spellMap == 'Silence' or spellMap == 'Paralyze' then
        equip(sets.midcast['Enfeebling Magic'].Mnd)
    end
end
 
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
        equip(sets.magic_burst)
    end
end
 
function job_aftercast(spell, action, spellMap, eventArgs)
    if player.tp < 1000 then
        enable('main','sub')
    elseif not spell.interrupted then
        if spell.english == 'Mana Wall' then
            enable('feet')
            equip(sets.buff['Mana Wall'])
            disable('feet')
        elseif spell.skill == 'Elemental Magic' and state.MagicBurst.value then
            state.MagicBurst:reset()
        elseif spell.english == 'Sleep' or spell.english == 'Sleepga' then
            send_command('@wait 55;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
        elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
            send_command('@wait 85;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
        elseif spell.english == 'Break' or spell.english == 'Breakga' then
            send_command('@wait 25;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
        end
    end
end
 
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
 
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
    -- Unlock feet when Mana Wall buff is lost.
    if buff == "Mana Wall" and not gain then
        enable('feet')
        handle_equipping_gear(player.status)
    end
end
 
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
    if stateField == 'Offense Mode' then
        if newValue == 'Normal' then
            disable('main','sub','range')
        else
            enable('main','sub','range')
        end
    end
end
 
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
 
-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
    if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
        if lowTierNukes:contains(spell.english) then
            return 'LowTierNuke'
        else
            return 'HighTierNuke'
        end
    end
end
 
-- 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
 
-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end
 
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
 
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    set_macro_page(1, 15)
end


It may help you or give you some ideas.
Code
if spell.skill == 'Elemental Magic' and (spell.element == world.weather_element or spell.element == world.day_element) then
        equip(sets.midcast.Bonus)


and then I have a specific gearset to go with that function.
Code
 -- Day Weather Bonus
    sets.midcast.Bonus =                                                    {}
 Bismarck.Singular
Offline
Server: Bismarck
Game: FFXI
user: Singular
Posts: 10
By Bismarck.Singular 2016-02-04 13:44:37
Link | Quote | Reply
 
Thanks for your response Keido!

I'm a pretty quiet solo player, I don't really know anyone who can craft the obi for me.

I actually semi-resolved the issue, though I had to edit the mote-utility and mote-mappings files.

For anyone else that has the same issue, I posted the details on how to "fix" it here.

http://forums.windower.net/index.php?/topic/1034-gearswap-help-elemental-obi-kinematics-blm-file/
[+]
Log in to post.