COR Lua Assistance

Eorzea Time
 
 
 
言語: JP EN FR DE
日本語版のFFXIVPRO利用したい場合は、上記の"JP"を設定して、又はjp.ffxivpro.comを直接に利用してもいいです
users online
フォーラム » FFXI » Jobs » Corsair » COR Lua Assistance
COR Lua Assistance
 Quetzalcoatl.Balthor
Offline
サーバ: Quetzalcoatl
Game: FFXI
Posts: 20
By Quetzalcoatl.Balthor 2023-09-20 18:10:58  
Anyone know how I can make my COR GS equip the Hachirin-no-obi only when I have Day/Weather bonus, and/or when in Dynamis where it's always double-dark weather? I'm still sort of new to GS, but understand most of what is in my GS.
 Bahamut.Celebrindal
Offline
サーバ: Bahamut
Game: FFXI
Posts: 1820
By Bahamut.Celebrindal 2023-09-20 19:30:00  
most will look something like this, and occur in the "function precast (spell, action)" section of your lua:

if spell.english == "Leaden Salute" and spell.target.distance < 7 then equipSet = set_combine(equipSet, {waist = "Orpheus's Sash"})

elseif spell.english == "Leaden Salute" and (world.weather_element == "Dark" or world.day_element == "Dark") then add_to_chat(125, "weather mode") equipSet = set_combine(equipSet, {waist = "Hachirin-no-Obi"})
end


can completely leave out the Orpheus's Sash section if you don't want to mess with it or don't have one- just change the "elseif" to an "if" in the Leaden section and eliminate the prior portion.

Would highly suggest also making a rule like this for your Wildfire as well regarding Fire weather/day.
 Quetzalcoatl.Balthor
Offline
サーバ: Quetzalcoatl
Game: FFXI
Posts: 20
By Quetzalcoatl.Balthor 2023-09-20 21:52:56  
Thank you very much.
Offline
Posts: 464
By drakefs 2023-09-21 11:25:22  
define an array with the Shots and their element (motes based):
Code
function job_setup()
    -- Elements of Quickdraw
    QuickdrawElement = {['Fire Shot']='Fire',['Ice Shot']='Ice',['Wind Shot']='Wind',['Earth Shot']="Earth",['Thunder Shot']='Lightning',['Water Shot']='Water',['Light Shot']='Light',['Dark Shot']='Dark'}
end


if not motes use
Code
function get sets()



If you are using a motes based lua:
Code
function job_midcast(spell)
    if QuickdrawElement[spell.english] and (world.weather_element == QuickdrawElement[spell.english] or world.day_element == QuickdrawElement[spell.english]) then
        equip(sets.weatherbelt)
    end
end


If not:
Code
function midcast(spell)
    if QuickdrawElement[spell.english] and (world.weather_element == QuickdrawElement[spell.english] or world.day_element == QuickdrawElement[spell.english]) then
        equip(sets.weatherbelt)
    end
end
Offline
Posts: 82
By Seraphpdh 2023-09-21 23:17:24  
Might be a little late with my reply, but I have always found common solutions for this belt problem lacking. This solution is a little more extreme for all COR elemental situations. It checks for weather, double weather, SCH storm spells, and day of the week to determine optimal belt.

It also assumes you have an "Orpheus's Sash" as well, so if you do not, just remove those cases.
Code
-- Example:
-- equip(set_combine(sets.precast.LeadenSalute, {waist=optimal_belt(spell)}))

function optimal_belt(spell)
    
    -------------------------------------- 
    -- Basic element relations
    -------------------------------------- 
    --  10% bonus for magic of the day
    --  10% bonus for magic matching single weather
    --  20% bonus for magic matching single weather and day
    --  25% bonus for magic matching double weather
    --  35% bonus for magic matching double weather and day
    elements            = {}
    elements.weak_to    = {['Light']='Dark', ['Dark']='Light', ['Fire']='Ice', ['Ice']='Wind', ['Wind']='Earth', ['Earth']='Lightning', ['Lightning']='Water', ['Water']='Fire'}
    elements.strong_to  = {['Light']='Dark', ['Dark']='Light', ['Fire']='Water', ['Ice']='Fire', ['Wind']='Ice', ['Earth']='Wind', ['Lightning']='Earth', ['Water']='Lightning'}
    
    single_storm_element = 0
    for i,v in pairs({Fire=178,Ice=179,Wind=180,Earth=181,Lightning=182,Water=183,Light=184,Dark=185,}) do  -- NOTE: SCH 'Single Storm' Buffs Only!
        if buffactive[v] then
            single_storm_element = i
        end
    end
    
    double_storm_element = 0
    for i,v in pairs({Fire=589,Ice=590,Wind=591,Earth=592,Lightning=593,Water=594,Light=595,Dark=596,}) do  -- NOTE: SCH 'Double Storm' Buffs Only!
        if buffactive[v] then
            double_storm_element = i
        end
    end

    if (double_storm_element == spell.element) and (spell.element ~= elements.weak_to[world.day_element]) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for double storm (w/o day conflict). (25-35%)')
        return "Hachirin-no-Obi"  
    elseif (spell.element == world.weather_element and S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)) and (spell.element ~= elements.weak_to[world.day_element]) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" double weather (w/o day conflict). (25-35%)')
        return "Hachirin-no-Obi"
    elseif (spell.element == world.day_element and single_storm_element == spell.element) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for storm and day. (20%)')
        return "Hachirin-no-Obi"
    elseif (spell.element == world.day_element and spell.element == world.weather_element) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for weather and day. (20%)')
        return "Hachirin-no-Obi" 
    elseif (double_storm_element == spell.element) and (spell.element == elements.weak_to[world.day_element]) then  
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for double storm (with day conflict). (15%)')
        return "Hachirin-no-Obi"
    elseif (spell.element == world.weather_element and S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)) and (spell.element == elements.weak_to[world.day_element]) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for double weather (with day conflict). (15%)')
        return "Hachirin-no-Obi"
    -- Optimal Distance [Varies between 13 and 1.93 yalms].  (11-15%)     [Approximately 1.27% per yalm: 13y=1.0, 12y=2.3, 11y=3.5, 10y=4.8, 9y=6.1, 8y=7.4, 7y=8.6, 6y=9.9, 5y=11.2, 4y=12.4, 3y=13.7, 2y=14.9]
    elseif spell.target.distance < 5.0 then   -- [Ideally < 1.93 yalms]
        send_command('@input /echo >>> GEAR MOD: "Orpheus`s Sash" for Optimal Distance [13 to 1.93 yalms].  (11-15%)')
        return "Orpheus's Sash"
    elseif (single_storm_element == spell.element) and (spell.element ~= elements.weak_to[world.day_element]) then     
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for single storm (w/o day conflict). (10%)')
        return "Hachirin-no-Obi" 
    elseif (spell.element == world.weather_element) and (spell.element ~= elements.weak_to[world.day_element]) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for single weather (w/o day conflict). (10%)')
        return "Hachirin-no-Obi"
    elseif (spell.element == world.day_element) and (spell.element ~= elements.weak_to[world.weather_element]) then
        send_command('@input /echo >>> GEAR MOD: "Hachirin-no-Obi" for Matching day (w/o weather conflict). (10%)')
        return "Hachirin-no-Obi"
    else
        return "Orpheus's Sash"
    end
end