GS And Flurry.

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » FFXI » Jobs » Ranger » GS and Flurry.
GS and Flurry.
 Asura.Hrohj
Offline
サーバ: Asura
Game: FFXI
Posts: 129
By Asura.Hrohj 2019-11-06 21:25:12  
Tyring to write my own Ranger GS (as in completely; not using different parts from a dozen other peoples' .lua files) and I'm having a bit of trouble. I have this part:

function precast(spell,action)

if spell.english == 'Ranged' then
equip(sets.precastrangedattackTF0)
end

if buffactive['Flurry'] then
equip(sets.precastrangedattackTF1)
end

if buffactive['Flurry II'] then
equip(sets.precastrangedattackTF2)
end

end

F0 works fine. However, even when buffed with Flurry II from a RDM, it still uses the F1 set. I can see that when you manually inspect your buffs, it still says "Flurry" and not "Flurry II", which is what I'm assuming is causing the issue. Is there some work-around for this? I'm stumped.
 Leviathan.Comeatmebro
Offline
サーバ: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2019-11-06 22:17:25  
Flurry and Flurry 2 are the same buff(which is called Flurry), you need a bit more advanced code to check which spell was last cast on you to be able to differentiate them. The buff icon won't do it, and that's what gearswap is checking.
[+]
 Shiva.Arislan
Offline
サーバ: Shiva
Game: FFXI
user: Arislan
Posts: 990
By Shiva.Arislan 2019-11-06 22:18:47  
Quote:
I can see that when you manually inspect your buffs, it still says "Flurry" and not "Flurry II", which is what I'm assuming is causing the issue.

Bingo.

The only way to automatically differentiate between states of Flurry (and Haste) is to packet sniff for the spell's unique param.

Otherwise, you gotta set up a manual toggle.
[+]
 Asura.Hrohj
Offline
サーバ: Asura
Game: FFXI
Posts: 129
By Asura.Hrohj 2019-11-06 22:57:49  
One of my friends searched around for me and found that the ID for Flurry is 265 and the ID for Flurry II is 581. When I substituted this into my existing code, it sort of worked, but not really:

if buffactive[265] then
equip(sets.precastrangedattackTF1)
end

if buffactive[581] then
equip(sets.precastrangedattackTF2)
end

Now it's just using my F2 set for both. If I snip out the part concerning buff 265 and my F1 set, it just seems to default to using the F2 set even if I'm being buffed with Flurry and not Flurry II. Is there some way to be more specific to fix this?
 Bahamut.Ivebian
Offline
サーバ: Bahamut
Game: FFXI
user: Smg1388
Posts: 39
By Bahamut.Ivebian 2019-11-06 23:46:11  
The first flurry effect is a beneficial pathos, has nothing to do with the RDM spells.
 Asura.Hrohj
Offline
サーバ: Asura
Game: FFXI
Posts: 129
By Asura.Hrohj 2019-11-06 23:56:58  
Can someone smarter than me tell me how to go about finding out the ID for Flurry then? Or just tell me? :(
Offline
Posts: 152
By Unzero 2019-11-07 00:19:24  
Windower\plugins\resources\spells.xml
Offline
Posts: 152
By Unzero 2019-11-07 00:19:56  
<s id="80" index="845" prefix="/magic" english="Flurry" japanese="スナップ" type="WhiteMagic" element="Wind" targets="Self, Party, Ally, NPC" skill="EnhancingMagic" mpcost="40" casttime="3" recast="20" duration="180" alias="" />

<s id="81" index="846" prefix="/magic" english="Flurry II" japanese="スナップII" type="WhiteMagic" element="Wind" targets="Self, Party, Ally, NPC" skill="EnhancingMagic" mpcost="80" casttime="3" recast="20" duration="180" alias="" />
Offline
Posts: 152
By Unzero 2019-11-07 00:20:46  
845 and 846 for Flurry 1 and 2 respectively
 Leviathan.Comeatmebro
Offline
サーバ: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2019-11-07 00:21:26  
There is no ID that will differentiate Flurry and Flurry 2 using that function.

You need to track the incoming action packet, record which was last cast on you, and use that to be able to tell the difference.

There may be someone with that code already written, there may not, but that is the only way to do it besides having a manual toggle.
[+]
 Shiva.Arislan
Offline
サーバ: Shiva
Game: FFXI
user: Arislan
Posts: 990
By Shiva.Arislan 2019-11-07 00:36:13  
Code
function precast(spell,action)
    if spell.action_type == 'Ranged Attack' then
        if flurry == 2 then
            equip(sets.precastrangedattackTF2)
        elseif flurry == 1 then
            equip(sets.precastrangedattackTF1)
        end
    end
end

Code
function buff_change(name,gain)
    if S{'flurry'}:contains(buff:lower()) then
        if not gain then
            flurry = nil
            add_to_chat(122, "Flurry status cleared.")
        end
    end
end

Code
windower.register_event('action',
    function(act)
        --check if you are a target of spell
        local actionTargets = act.targets
        playerId = windower.ffxi.get_player().id
        isTarget = false
        for _, target in ipairs(actionTargets) do
            if playerId == target.id then
                isTarget = true
            end
        end
        if isTarget == true then
            if act.category == 4 then
                local param = act.param
                if param == 845 and flurry ~= 2 then
                    add_to_chat(122, 'Flurry Status: Flurry I')
                    flurry = 1
                elseif param == 846 then
                    add_to_chat(122, 'Flurry Status: Flurry II')
                    flurry = 2
              end
            end
        end
    end)
[+]
Offline
Posts: 62
By Demhar 2019-11-08 11:58:51  
What about when you have Barrage active? How are you gonna not make it swap to to midshot?
 Shiva.Spynx
Offline
サーバ: Shiva
Game: FFXI
user: auron86
Posts: 369
By Shiva.Spynx 2019-11-08 14:18:34  
Flurry kicks in precast while barrage gear will affect midcast so no issue there.
Offline
Posts: 62
By Demhar 2019-11-13 11:18:06  
.lua:80: attempt to call global 'ChangeGear' (a nil value)


any ideas?



----------------------------------------------------

function get_sets()

-- Preshot --
sets.Preshot1 = {
head="Taeon Chapeau",
neck="Scout's Gorget +2",
body="Amini caban +1",
hands="Carmine Fin. Ga. +1",
back={ name="Belenus's Cape", augments={'"Snapshot"+10',}},
waist="Impulse Belt",
legs="Orion Braccae +3",
feet="Meg. Jam. +2",
}

-- Preshot --
sets.Preshot2 = {
head="Orion beret +3",
neck="Scout's Gorget +2",
body="Amini caban +1",
hands="Carmine Fin. Ga. +1",
back={ name="Belenus's Cape", augments={'"Snapshot"+10',}},
waist="Yemaya Belt",
legs="Adhemar Kecks +1",
feet="Arcadian Socks +3",
}


-- Midshot --
sets.Midshot = {
head="Arcadian Beret +3",
neck="Scout's Gorget +2",
ear1="Dedition Earring",
ear2="Telos Earring",
body="Orion Jerkin +3",
hands="Adhemar Wrist. +1",
ring1="Rajas ring",
ring2="Ilabrat Ring",
back={ name="Belenus's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10',}},
waist="Yemaya belt",
legs="Adhemar Kecks +1",
feet="Adhe. Gamashes +1",
}
-- Barrage --
sets.Barrage = {
head="Orion Beret +3",
neck="Scout's Gorget +2",
ear1="Enervating Earring",
ear2="Telos Earring",
body="Orion Jerkin +3",
hands="Orion Bracers +3",
ring1="Regal Ring",
ring2="Cacoethic Ring +1",
back={ name="Belenus's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10',}},
waist="Kwahu Kachina Belt",
legs="Adhemar Kecks +1",
feet="Orion Socks +3",
}
-- Double Shot --
sets.DoubleShot = {
head="Arcadian Beret +3",
body="Arc. Jerkin +3",
back={ name="Belenus's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10',}},
feet="Osh. Leggings +1",
}



end


function autoRA()
send_command('@wait 2.5; input /ra <t>')
end

function precast(spell,action)
if spell.english == 'Ranged' then
if buffactive['Flurry II'] then
ChangeGear(sets.Preshot2)
else
ChangeGear(sets.Preshot1)
end
end

function midcast(spell,action)
if spell.english == 'Ranged' then
if state.Buff['Barrage'] then
ChangeGear(sets.Barrage)
elseif state.Buff['Double Shot'] then
ChangeGear(sets.DoubleShot)
else
ChangeGear(sets.Midshot)
end
end

end


function ChangeGear(GearSet)
equipSet = GearSet
equip(GearSet)
end
end
Offline
Posts: 152
By Unzero 2019-11-13 12:28:12  
How are we supposed to know what line 81 is
 Shiva.Spynx
Offline
サーバ: Shiva
Game: FFXI
user: auron86
Posts: 369
By Shiva.Spynx 2019-11-13 12:47:57  
What's even the point of the changeGear function, just use the 'equip' one directly.
Offline
Posts: 62
By Demhar 2019-11-13 13:24:18  
Unzero said: »
How are we supposed to know what line 81 is

 Asura.Nebohh
Offline
サーバ: Asura
Game: FFXI
user: Kealohaa
Posts: 94
By Asura.Nebohh 2019-11-13 14:38:50  
Next time just use the syntax:
[ code ] paste your code inside here [ /code ]
Just remove the extra spacing above.
 Asura.Hrohj
Offline
サーバ: Asura
Game: FFXI
Posts: 129
By Asura.Hrohj 2019-11-13 16:02:38  
Demhar,

Have you verified with //gs showswaps on that the correct gear is swapping for Flurry or Flurry II? From the responses to this thread so far, it seems like if buffactive['Flurry II'] won't work... it's never worked for me so far, anyway.

Also, just try removing this bit and see if it will load:

function autoRA()
send_command('@wait 2.5; input /ra <t>')
end


Also, I thought the consensus was that automated ranged attacks were sort of dumb since they don't ever really account for Rapid Shot activation..?
[+]
Offline
Posts: 62
By Demhar 2019-11-13 17:17:04  
Asura.Nebohh said: »
Next time just use the syntax:
[ code ] paste your code inside here [ /code ]
Just remove the extra spacing above.

Thank you!
Offline
Posts: 62
By Demhar 2019-11-13 17:17:34  
Have you verified with //gs showswaps on that the correct gear is swapping for Flurry or Flurry II? From the responses to this thread so far, it seems like if buffactive['Flurry II'] won't work... it's never worked for me so far, anyway.

Also, just try removing this bit and see if it will load:

function autoRA()
send_command('@wait 2.5; input /ra <t>')
end




Thank you! Will test that tonight.
 Shiva.Arislan
Offline
サーバ: Shiva
Game: FFXI
user: Arislan
Posts: 990
By Shiva.Arislan 2019-11-13 17:44:15  
If you're not sure what you're doing, it would save you (and others) a lot of trouble if you didn't try to write something from scratch.

There's ready-made RNG luas out there. Tinker with those.
[+]
 Asura.Hrohj
Offline
サーバ: Asura
Game: FFXI
Posts: 129
By Asura.Hrohj 2019-11-13 17:56:11  
No way to really learn about the way any of this works if people keep pushing pre-fabricated .lua onto us. Some of us don't want all of the bells and whistles.
[+]
necroskull Necro Bump Detected! [50 days between previous and next post]
 Bahamut.Celebrindal
Offline
サーバ: Bahamut
Game: FFXI
Posts: 726
By Bahamut.Celebrindal 2020-01-02 10:05:37  
The only way I've ever dealt with varying levels of "No Flurry","Flurry", and "Flurry II" preshot sets is with a toggle. Here's the function part of my lua:

---------------
Code
       function precast(spell,action)
                if spell.english == 'Ranged' then
					equipSet = sets.Preshot
					add_to_chat(57,"Flurry Level "..PreshotArray[PreshotIndex])
				if buffactive['Flurry'] then
					add_to_chat(122,"Flurry found")
				if PreshotArray[PreshotIndex] == 'RDM' then
				if  equipSet[player.equipment.range].RDM then 
					equipSet =  equipSet[player.equipment.range].RDM
				end
		else
				if  equipSet[player.equipment.range].Any then 
					equipSet =  equipSet[player.equipment.range].Any
		end
		end
		else
				if  equipSet[player.equipment.range] then 
					equipSet =  equipSet[player.equipment.range]
		end
					add_to_chat(122,"No flurry")
		end
   
					equip(equipSet 



I have 3 preshot sets for every weapon due to needing different sets for Gastraphetes vs other weapons (with Snapshot +10 on Gastra). They're all named in this convention:

sets.Preshot.<weapon name> = no flurry
sets.Preshot.<weapon name>.Any = Flurry
sets.Preshot.<weapon name>.RDM = Flurry II

my naming convention makes sense in my head....."Any" mage can give me Flurry, but only a "RDM" can give me Flurry II. If I see a RDM, I just hit my toggle (bound to CTRL-(tilde)...the key to the left of the 1 on your keyboard).

If I am not receiving flurry, it defaults to my base preshot set no matter what the toggle is set to.
[+]
necroskull Necro Bump Detected! [258 days between previous and next post]
Offline
Posts: 2
By Caliper 2020-09-16 00:43:07  
This is all assuming you're using a Mote-Include lua.

for tracking purposes you will need to declare a global variable called flurry in job_setup()
Code
flurry=nil

There are two functions which require modification or creation...
Code
function job_buff_change(buff,gain)
	if S{'flurry'}:contains(buff:lower()) then
        if not gain then
            flurry = nil
            add_to_chat(122, "Flurry status cleared.")
        end
        if not midaction() then
            handle_equipping_gear(player.status)
        end
    end
end

And the main course...
Code
windower.register_event('action',
    function(act)
        --check if you are a target of spell
        local actionTargets = act.targets
        playerId = windower.ffxi.get_player().id
        isTarget = false
        for _, target in ipairs(actionTargets) do
            if playerId == target.id then
                isTarget = true
            end
        end
        if isTarget == true then
            if act.category == 4 then
                local param = act.param
                if param == 845 and flurry ~= 2 then
                    add_to_chat(122, 'Flurry Status: Flurry I')
                    flurry = 1
                elseif param == 846 then
                    add_to_chat(122, 'Flurry Status: Flurry II')
                    flurry = 2
              end
            end
        end
    end)

Now that those are in place, we append the custom range group under the function job_post_precast() as follows...
Code
if spell.action_type == 'Ranged Attack' then
		if flurry == 2 then
			classes.CustomRangedGroups:append('Flurry2')
		elseif flurry == 1 then
			classes.CustomRangedGroups:append('Flurry1')
		end
end

Now we can create the following sets...
Code
sets.precast.RA.Flurry1 = {)
sets.precast.RA.Flurry2 = {)


This logic is also "CombatWeapon" compatible out of the box if you are using them, as follows...
Code
sets.precast.RA.Gastraphetes = {}
sets.precast.RA.Gastraphetes.Flurry1 = {}
sets.precast.RA.Gastraphetes.Flurry2 = {}

I hope you find this information useful, please let me know if i can help further.
Log in to post.