Basic Gearswap Utsusemi Cancel

Eorzea Time
 
 
 
言語: JP EN FR DE
日本語版のFFXIVPRO利用したい場合は、上記の"JP"を設定して、又はjp.ffxivpro.comを直接に利用してもいいです
users online
フォーラム » Windower » Support » basic gearswap utsusemi cancel
basic gearswap utsusemi cancel
 Odin.Madone
Offline
サーバ: Odin
Game: FFXI
user: Blackrock
Posts: 13
By Odin.Madone 2014-10-05 19:52:41  
hello.
im very new to gearswap and in order for me to use it i need to understand it better, i am having trouble with utsusemi cancel copy image when i try to cast utsusemi: ichi over utsusemi: ni with less than 3 images, i am wonder if someone could write the lua file i need, absolutly basic as if that was the only thing i use gear swap for, 1 simple file with a simple command for cancel. i have cancel addon and the other cancel addon loaded that doesn't need id's, much apreciated!
 Sylph.Jeanpaul
MSPaint Champion
Offline
サーバ: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-10-06 01:12:12  
Code
function get_sets()
		ShadowType = 'None'
end
               
function precast(spell,abil)
		if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
			cancel_spell()
		end
end            
 
function midcast(spell,act,arg) 
		if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
				send_command('cancel Copy Image')
				send_command('cancel Copy Image (2)')
		end
end
 
function aftercast(spell,arg)
		if spell.name == 'Utsusemi: Ni' and spell.interrupted == false then
			ShadowType = 'Ni'
		elseif spell.name == 'Utsusemi: Ichi' and spell.interrupted == false then
			ShadowType = 'Ichi'
		end
end

Putting this in a lua will do several things with Utsusemi. First, it will let it recognize the difference between when you've got Ni shadows or Ichi shadows (assuming you successfully cast the spell). Second, it makes it so you won't be allowed to cast Ichi if you already have 3 or more shadows. Third, it will cancel out Ni only if you have 1 or 2 shadows left when casting Ichi.
 Leviathan.Arcon
VIP
Offline
サーバ: Leviathan
Game: FFXI
user: Zaphor
Posts: 660
By Leviathan.Arcon 2014-10-06 01:48:27  
I would highly recommend against @Jeanpaul's precast rule, as it won't allow preemptive shadow casting. If you don't care about distinguishing between Utsusemi: Ichi and Utsusemi: Ni, the following will do:
Code
function midcast(spell)
    if spell.name == 'Utsusemi: Ichi' then
        send_command('cancel Copy Image|Copy Image (2)')
    end
end


Otherwise you will need a variable like he has, although personally I'd use a bool for it and call it something else:
Code
function midcast(spell)
    if spell.name == 'Utsusemi: Ichi' and overwrite then
        send_command('cancel Copy Image|Copy Image (2)')
    end
end

function aftercast(spell)
    if not spell.interrupted then
        if spell.name == 'Utsusemi: Ichi' then
            overwrite = false
        elseif spell.name == 'Utsusemi: Ni' then
            overwrite = true
        end
    end
end


However, this is not perfect either. If, for some reason, Utsusemi: Ichi has no effect, spell.interrupted will still be false, and overwrite will be set to true. In that case it will not cancel the shadows on the next cast, despite Utsusemi: Ni being up. (The same is true with @Jeanpaul's version, we only use slightly different semantics.)

Those are basically the two minimalistic versions, each one with their own drawback. Up to you to decide which one is more worth it to you. It would probably be possible to implement a perfect version, but it may require more effort (analyzing action message packets), unless GS exposes some other features I'm unaware of.

Two further general notes:
1. You don't need to check for buffactive before canceling, the cancel addon does that itself, so you can just send the cancel command and the addon won't send the packet if the buff isn't active.
2. Do not use the cancel plugin and addon both, choose one. I recommend the addon. In general, don't use the plugin and addon version of the same script, it rarely leads to good results and more often than not brings issues with it. When you have a choice between the two, the addon is almost always the way to go. The only addon with less functionality than its plugin counterpart is TParty, although that may change soon as well.
 Odin.Madone
Offline
サーバ: Odin
Game: FFXI
user: Blackrock
Posts: 13
By Odin.Madone 2014-10-06 16:36:40  
thanks for the replys, now how do these two lua's differ from the mote-include one? problem is when i use mote-include and the ninja lua form kitamatics(spelling) i find my character doing all sorts of stuff when i only really want to use if for utsuemi.
 Sylph.Jeanpaul
MSPaint Champion
Offline
サーバ: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-10-07 00:19:57  
Leviathan.Arcon said: »
I would highly recommend against @Jeanpaul's precast rule, as it won't allow preemptive shadow casting. If you don't care about distinguishing between Utsusemi: Ichi and Utsusemi: Ni, the following will do:
My bad, I should have specified; I set mine up that way because I regularly play RUN/NIN on high level fights, where casting Utsusemi preemptively is actually unnecessary due to capping fast cast. More often than not for me, wasting an Ichi cuz I hit the wrong macro would be worse than not casting it at all.