Separate Weapon Rules

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » Windower » Spellcast Scripting » Corsair » Separate weapon rules
Separate weapon rules
 Asura.Lokimaru
Offline
Server: Asura
Game: FFXI
user: Rocketpop
Posts: 2006
By Asura.Lokimaru 2013-03-06 23:50:13
Link | Quote | Reply
 
So I'm a weirdo that wants to have separate sets on COR for just tping at range and for meleeing.

My current spellcast works to a point, but since I was getting "can't find set engaged" errors, I changed my ranged/staff set to Engaged.

So now even if I'm meleeing, it changes back to the ranged set after an action like a weaponskill.

Assistance would be great and please ignore all the gimpy gear, my COR is a work in progress. <_<
Code
    <spellcast xmlns:xi="http://www.w3.org/2001/XInclude">
            <config
                    Debug="false"
                    ShowGearSwaps="False"
                    />
           
        <sets>
            <group default="yes" name="Cor">
                <set name="Engaged">
				    <head>Commodore tricorne</head>
                    <neck>Rancor Collar</neck>
                    <lear>Volley Earring</lear>
                    <rear>Navarch's Earring</rear>
                    <body>Nvrch. Frac +2</body>
                    <hands>Nvrch. Gants +1</hands>
                    <lring>Arewe Ring</lring>
                    <rring>Arewe Ring</rring>
                    <back>Terebellum Mantle</back>
                    <waist>Commodore Belt</waist>
                    <legs>Mirador trousers</legs>
                    <feet>War boots</feet>
                </set>
				<set name="Ranged">
				    <head>Commodore tricorne</head>
                    <neck>Rancor Collar</neck>
                    <lear>Volley Earring</lear>
                    <rear>Navarch's Earring</rear>
                    <body>Nvrch. Frac +2</body>
                    <hands>Nvrch. Gants +1</hands>
                    <lring>Arewe Ring</lring>
                    <rring>Arewe Ring</rring>
                    <back>Terebellum Mantle</back>
                    <waist>Commodore Belt</waist>
                    <legs>Mirador trousers</legs>
                    <feet>War boots</feet>
                </set>
				<set name="Snapshot" baseset="Ranged">
				    <head>Aurore Beret</head>
					<body>Skopos Jerkin</body>
					<legs>Nvrch. Culottes +1</legs>
				    <waist>Impulse Belt</waist>
					<back>Navarch's Mantle</back>
				</set>	
                <set name="Idle" BaseSet="Ranged">
                    <lear>Merman's earring</lear>
					<lring>Dark Ring</lring>
					<head>Ocelomeh headpiece +1</head>
					<neck>Twilight Torque</neck>
					<body>Mirke wardecors</body>
					<hands>Melaco mittens</hands>
					<back></back>
					<waist></waist>
					<legs>Desultor Tassets</legs>
					<feet>Hermes' Sandals</feet>
					<rear>Merman's earring</rear>
					<rring>Dark Ring</rring>
                </set>
				<set name="IdleRegen" BaseSet="Ranged">
                    <head>Oce. Headpiece +1</head> 
				    <hands>Navarch's Gants +2</hands>
    			    <neck>Wiglen Gorget</neck>
				    <lring>Paguroidea Ring</lring>
                    <rring>Sheltered Ring</rring>
					<back>Shadow Mantle</back>
				    <legs>Thaumas Kecks</legs>
				    <feet>Hermes' Sandals</feet>
                </set>
                <set name="PDT" BaseSet="Idle">
					<head>Fugacity Beret</head>
					<neck>Twilight Torque</neck>
					<lear>Volley Earring</lear>
					<rear>Black Earring</rear>
					<body>Dst. Harness +1</body>
					<hands>Melaco mittens</hands>
					<lring>Dark Ring</lring>
					<rring>Dark Ring</rring>
					<back>Mollusca Mantle</back>
					<waist>Lieutenant's Sash</waist>
					<legs>Desultor Tassets</legs>
					<feet>Dst. Leggings +1</feet>
				</set>	
                <set name="Detonator" BaseSet="Ranged" />
                <set name="Slugshot" BaseSet="Detonator" />
                <set name="Wildfire">
					<lring>Stormsoul Ring</lring>
				    <head>Thaumas Hat</head>
                    <neck>Stoicheion Medal</neck>
                    <lear>Hecate's Earring</lear>
                    <rear>Strophadic Earring</rear>
                    <body>Athos's Tabard</body>
                    <hands>Athos's Gloves</hands>
                    <back>Forban Cape</back>
                    <waist>Aquiline Belt</waist>
                    <legs>Thaumas Kecks</legs>
                    <feet>Nvrch. Bottes +2</feet>
					<rring>Stormsoul Ring</rring>
                </set>
                <set name="Salute" BaseSet="Wildfire">
					<lring>Stormsoul Ring</lring>
				    <head>Pandinus beret</head>
                    <neck>Stoicheion Medal</neck>
                    <lear>Hecate's Earring</lear>
                    <rear>Sortiarius Earring</rear>
                    <body>Loki's kaftan</body>
                    <hands>Athos's Gloves</hands>
                    <back>Forban Cape</back>
                    <waist>Aquiline Belt</waist>
                    <legs>Nvrch. Culottes +1</legs>
                    <feet>Nvrch. Bottes +1</feet>
					<rring>Stormsoul Ring</rring>
                </set>
				<set name="Laststand">
					<lring>Stormsoul Ring</lring>
				    <head>Ocelomeh headpiece +1</head>
                    <neck>Light gorget</neck>
                    <lear>Drone earring</lear>
                    <rear>Moonshade earring</rear>
                    <body>Kudzu aketon</body>
                    <hands>Athos's Gloves</hands>
					<back>Terebellum mantle</back>
                    <waist>Light Belt</waist>
                    <legs>Mirador trousers</legs>
                    <feet>Nvrch. Bottes +1</feet>
					<rring>Stormsoul Ring</rring>
                </set>
                <set name="WFObi" BaseSet="Wildfire">
                    <waist>Karin Obi</waist>
                </set>
                <set name="QuickDraw" BaseSet="Ranged">
					<lring>Stormsoul Ring</lring>
				    <ammo>Orichalcum Bullet</ammo>
					<head>Pandinus beret</head>
                    <neck>Stoicheion Medal</neck>
                    <lear>Hecate's Earring</lear>
                    <rear>Sortiarius Earring</rear>
                    <body>Loki's kaftan</body>
                    <hands>Schutzen mittens</hands>
                    <back>Forban Cape</back>
                    <waist>Aquiline Belt</waist>
                    <legs>Mirador trousers</legs>
                    <feet>Nvrch. Bottes +1</feet>
					<rring>Stormsoul Ring</rring>
                </set>
                <set name="QDMacc" BaseSet="QuickDraw">
                    <head>Nvrch. Tricorne +2</head>
                    <back>Navarch's Mantle</back>
                </set>
                <set name="QDObi" BaseSet="QuickDraw">
                    <waist>Karin Obi</waist>
                </set>
                <set name="EngagedMelee">
				    <head>Ocelomeh headpiece +1</head>
                    <neck>Rancor Collar</neck>
                    <lear>Brutal earring</lear>
                    <rear>Suppanomimi</rear>
                    <body>Toci's harness</body>
                    <hands>Dusk gloves +1</hands>
                    <lring>Epona's ring</lring>
                    <rring>Rajas Ring</rring>
                    <back>Atheling mantle</back>
                    <waist>Twilight belt</waist>
                    <legs>Ocelot trousers</legs>
                    <feet>Athos's boots</feet>
                </set>
            </group>
        </sets>
           
        <rules>
            <if status="engaged">
                        <if EquipMain="Chatoyant staff">
                                <action type="equip" when="engaged|aftercast" set="Engaged" />
                        </if>

                        <elseif EquipMain="Lux pugio">
		                <action type="equip" when="engaged|aftercast" set="EngagedMelee" />
                        </elseif>
       		</if>
            <if status="idle">
                <equip when="idle" set="Idle" />
            </if>
			<if spell="ranged">
			    <castdelay delay=".2" />
				<midcastdelay delay="2.4" />
			    <aftercastdelay delay="5" />
			    <equip when="precast" set="Snapshot">
			        <ammo>Bullet</ammo>
			    </equip>	
			    <equip when="midcast" set="Ranged">
			        <ammo>Bullet</ammo>
			    </equip>
			    <equip when="aftercast" set="%status" />
		    </if>

                  
            <if spell="Ice Shot|Wind Shot|Earth Shot|Thunder Shot|Water Shot">
                <castdelay delay="0.5" />
                <equip when="precast" set="Quickdraw">
				    <ammo>Bullet</ammo>
                </equip>
                <equip when="aftercast" set="%status">
                    <ammo>remove</ammo>
                </equip>
            </if>
            <if spell="Fire Shot">
                <castdelay delay="0.5" />
                <if Mode="OR" Day="Firesday" WeatherElement="Fire">
                    <equip when="precast" set="QDObi">
					    <ammo>Bullet</ammo>
                    </equip>
                    <equip when="aftercast" set="%status">
                         <ammo>remove</ammo>
                    </equip>
                </if>
                <else>
                    <equip when="precast" set="Quickdraw" />
                    <equip when="aftercast" set="%status">
                        <ammo>remove</ammo>
                    </equip>
                </else>
            </if>
            <if spell="Light Shot|Dark Shot">
                <equip when="precast" set="QDMacc" />
                <equip when="aftercast" set="%status">
                    <ammo>remove</ammo>
                </equip>
            </if>
                   
            <if commandprefix="/range|/weaponskill" EquipAmmo="Omphalos Bullet">
                <cancelspell />
                    <equip>
                        <ammo>remove</ammo>
                    </equip>
                <action type="command">input /echo Don't shoot that ***!</action>
                <return />
            </if>
                   
            <if spell="Random Deal">
                <equip when="precast">
                    <body>Commodore Frac</body>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Tactician's Roll" baseset="PDT">
                <equip when="precast">
                    <body>Nvrch. Frac +2</body>
                    <hands>Nvrch. Gants +2</hands>
                    <lring>Luzaf's Ring</lring>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Blitzer's Roll" baseset="PDT">
                <equip when="precast">
                    <head>Nvrch. Tricorne +2</head>
                    <hands>Nvrch. Gants +2</hands>
                    <lring>Luzaf's Ring</lring>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Caster's Roll" baseset="PDT">
                <equip when="precast">
                    <legs>Nvrch. Tricorne +2</legs>
                    <hands>Nvrch. Gants +2</hands>
                    <lring>Luzaf's Ring</lring>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Courser's Roll" baseset="PDT">
                <equip when="precast">
                    <feet>Nvrch. Bottes +2</feet>
                    <hands>Nvrch. Gants +2</hands>
                    <lring>Luzaf's Ring</lring>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Miser's Roll|Companion's Roll" baseset="PDT">
    			<equip when="precast">
                    <hands>Nvrch. Gants +2</hands>
                    <lring>Luzaf's Ring</lring>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Corsair's Roll|Ninja Roll|Hunter's Roll|Chaos Roll|Magus's Roll|Healer's Roll|Puppet Roll|Choral Roll|Monk's Roll|Beast Roll|Samurai Roll|Evoker's Roll|Rogue's Roll|Warlock's Roll|Fighter's Roll|Drachen Roll|Gallant's Roll|Wizard's Roll|Dancer's Roll|Scholar's Roll">
                <equip when="precast" baseset="PDT">
                    <head>Comm. Tricorne</head>
                    <hands>Nvrch. Gants +2</hands>
                    <lring>Luzaf's Ring</lring>
				</equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Double-Up">
                <equip when="precast" baseset="PDT">
    				<lring>Luzaf's Ring</lring>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Utsusemi*">
                <equip when="precast" set="Melee" />
            </if>
            <if spell="Triple Shot">
                <equip when="precast">
                    <body>Nvrch. Frac +2</body>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Slug Shot">
                <equip when="precast" set="Slugshot">
				    <ammo>Bullet</ammo>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Detonator">
                <equip when="precast" set="Detonator">
				    <ammo>Bullet</ammo>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
			<if spell="Last Stand">
                <equip when="precast" set="Laststand">
				    <ammo>Bullet</ammo>
                </equip>
				<equip when="aftercast" set="%status" />
            </if>
            <if spell="Wildfire">
                <if Mode="OR" Day="Firesday" WeatherElement="Fire">
                    <equip when="precast" set="WFObi">
					    <ammo>Orichalcum Bullet</ammo>
                    </equip>
                </if>
                    <else>
                        <equip when="precast" set="Wildfire">
						    <ammo>Orichalcum Bullet</ammo>
                        </equip>
                    </else>
                <equip when="aftercast" set="%status">
                    <ammo>remove</ammo>
                </equip>
            </if>
            <if spell="Leaden Salute">
                <equip when="precast" set="Salute">
				    <ammo>Orichalcum Bullet</ammo>
                </equip>
				<equip when="aftercast" set="%status">
                    <ammo>remove</ammo>
			    </equip>
            </if>
            
        </rules>
    </spellcast>
 Bahamut.Raenryong
Offline
Server: Bahamut
Game: FFXI
user: RaenRyong
Posts: 4554
By Bahamut.Raenryong 2013-03-07 00:03:56
Link | Quote | Reply
 
I haven't coded in spellcast in months; what I am about to say may be way off the mark.

Quote:
<equip when="aftercast" set="%status">

This seems very strange.

That is referencing the global variable of "status", which should return Engaged or Idle every time - it will never return EngagedMelee - meaning it's going to return you to the Engaged set every time in combat (which is what you are seeing).

One way I can see of fixing this is to define a variable

Quote:
<var name="IdleType">Melee</var>

at the beginning (nb: doesn't matter what you first define it as. Could read Allhailmithrabutt if you wanted. Vars are defined after Config and before Sets by the way, as such:
Code
<variables>
	<var name="EquipTime">Midcast</var>
</variables>

(tiny excerpt from my rdm spellcast)

And then add <var cmd="set IdleType Ranged" /> and <var cmd="set IdleType Melee" /> respectively in these two brackets.
Code
        <if status="engaged">
                    <if EquipMain="Chatoyant staff">
                            <action type="equip" when="engaged|aftercast" set="Engaged" />

                    </if>
 
                    <elseif EquipMain="Lux pugio">
                    <action type="equip" when="engaged|aftercast" set="EngagedMelee" />
                    </elseif>
        </if>


Then after that insert
Code
<else>
       <var cmd="set IdleType Idle" />
</else>


And then just change your aftercast sets to $IdleType instead of %status.

The reason your <action types> are not working above to give you the desired results is that you have other commands specifically telling the spellcast to equip you with %status taking priority.

Hopefully this helps (and/or makes sense and/or is good)!

EDIT: I fixed a lot of my syntax and stuff. I am very rusty! Also added a bit of extra help. Make sure you reread the post if you read it before this message was here.

EDIT2: Going to bed, so hopefully if this was insufficient/inaccurate someone else can help if you have any further problems!
 Asura.Lokimaru
Offline
Server: Asura
Game: FFXI
user: Rocketpop
Posts: 2006
By Asura.Lokimaru 2013-03-07 00:44:28
Link | Quote | Reply
 
Thanks. I actually jacked the whole ifequip rules from a friend, I should have figured it wouldn't be so easy as copy/paste.

Pardon my derpness here.

Do I need to have a var name for each of the engaged sets and the idle set?
 Bahamut.Raenryong
Offline
Server: Bahamut
Game: FFXI
user: RaenRyong
Posts: 4554
By Bahamut.Raenryong 2013-03-07 10:23:22
Link | Quote | Reply
 
One single var should suffice for what you need if you set it up as above!

If you have the var values as Ranged/Melee/Idle you will have to name the gearsets as such (ie Ranged/Melee/Idle) and then asking it to equip $variablename (IdleType in my example) will equip the set which has the name of the value of that one variable, which gets changed depending on what you have equipped in your mainhand (or if you are idle).
 Asura.Lokimaru
Offline
Server: Asura
Game: FFXI
user: Rocketpop
Posts: 2006
By Asura.Lokimaru 2013-03-07 11:08:39
Link | Quote | Reply
 
Hmm, I must be doing it wrong... My sets don't swap upon engaging and idle with either weapon on.

I set this up above sets but after config.
Code
<variables>
				<var name="Fightin">Ranged</var>
		</variables>


And I changed the brackets for my weapons and idle to this
Code
<if status="Engaged">
                        <if EquipMain="Chatoyant staff">
                                <var cmd="set Fightin Ranged" />
                        </if>
						<elseif EquipMain="Lux pugio">
								<var cmd="set Fightin Melee" />
                        </elseif>
       		</if>
            <else status="Idle">
						<var cmd="set Fightin Idle" />
			</else>


Along with changing all of the aftercasts to $Fightin.

Did I do it wrong?
 Bahamut.Raenryong
Offline
Server: Bahamut
Game: FFXI
user: RaenRyong
Posts: 4554
By Bahamut.Raenryong 2013-03-07 12:06:12
Link | Quote | Reply
 
That should work as long as your gear sets are called Ranged, Melee and Idle. Are they still called Engaged, EngagedMelee? Idle should work regardless.
 Asura.Lokimaru
Offline
Server: Asura
Game: FFXI
user: Rocketpop
Posts: 2006
By Asura.Lokimaru 2013-03-07 13:33:02
Link | Quote | Reply
 
I changed the set names appropriately. Just trying to figure out why it won't swap when I engage and disengage.
 Siren.Thoraeon
Offline
Server: Siren
Game: FFXI
user: Thoraeon
Posts: 2215
By Siren.Thoraeon 2013-03-07 13:34:58
Link | Quote | Reply
 
slap this at the end of your spellcast:
Code
		<if spell="autoset">
			<action type="equip" when="idle" set="Idle" />
			<action type="equip" when="engaged" set="Melee" />
		</if>
 Valefor.Sehachan
Guide Maker
Offline
Server: Valefor
Game: FFXI
user: Seha
Posts: 24219
By Valefor.Sehachan 2013-03-07 13:35:43
Link | Quote | Reply
 
"Fightin" maybe spellcast doesn't like gangsta talk.
 Asura.Lokimaru
Offline
Server: Asura
Game: FFXI
user: Rocketpop
Posts: 2006
By Asura.Lokimaru 2013-03-07 13:37:40
Link | Quote | Reply
 
Valefor.Sehachan said: »
"Fightin" maybe spellcast doesn't like gangsta talk.
Them's fightin' words, Seha!

I just stuck something in there to make sure I knew what I was changing lol
 Asura.Lokimaru
Offline
Server: Asura
Game: FFXI
user: Rocketpop
Posts: 2006
By Asura.Lokimaru 2013-03-07 13:40:53
Link | Quote | Reply
 
Siren.Thoraeon said: »
slap this at the end of your spellcast:
Code
		<if spell="autoset">
			<action type="equip" when="idle" set="Idle" />
			<action type="equip" when="engaged" set="Melee" />
		</if>
This worked!

I had to change "Melee" to "$Fightin" though. Now it swaps to the appropriate sets when I engage with a specific weapon.

Thanks for your help, Raen, Thoraeon, and I guess Seha too. XD
[+]
 Siren.Thoraeon
Offline
Server: Siren
Game: FFXI
user: Thoraeon
Posts: 2215
By Siren.Thoraeon 2013-03-07 13:42:43
Link | Quote | Reply
 
Asura.Lokimaru said: »
Siren.Thoraeon said: »
slap this at the end of your spellcast:
Code
		<if spell="autoset">
			<action type="equip" when="idle" set="Idle" />
			<action type="equip" when="engaged" set="Melee" />
		</if>
This worked!

I had to change "Melee" to "$Fightin" though. Now it swaps to the appropriate sets when I engage with a specific weapon.
Glad to help.