SC Question

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » FFXI » Jobs » Warrior » SC question
SC question
 Valefor.Caelir
Offline
サーバ: Valefor
Game: FFXI
user: Caelir
Posts: 80
By Valefor.Caelir 2012-11-13 21:17:04  
Hey, not too great at this spellcast business but trying to set up SC to recognize area.

I want it to equip restraint up/down dependant on area. Only have legion in there right now, but want to put more in.

It says my <elseif> is defined without criteria.
Code
<if status="engaged">
		<if area="Maquette Abdhaljs - Legion">
			<if mode="or" spell="restraint" buffactive="restraint">
				<equip when="engaged|aftercast" set="LegionTP-Restraint"/>
			</if>
		<else>
			<equip when="precast|engaged|aftercast" set="LegionTP" />
		</else>
		</if>
		<elseif>
			<if mode="or" spell="restraint" buffactive="restraint">
				<equip when="engaged|aftercast" set="Restraint"/>
			</if>
		<else>
			<equip when="precast|engaged|aftercast" set="TP" />
		</else>
		</elseif>
	</if>
I want my <elseif> to be any area except 1's I will have specific gear sets for. Can some1 advise me on how to change this?

Also not too sure how to set up mob/zone specific ws set if some1 would like to shed some light on this.

A complete spellcast would be good, but if its too complex like some ive seen, it'll just blow my mind haha.
 Ragnarok.Sekundes
Offline
サーバ: Ragnarok
Game: FFXI
user: Sekundes
Posts: 4189
By Ragnarok.Sekundes 2012-11-13 22:10:00  
Try this.
Code
<if status="engaged">
	<if area="Maquette Abdhaljs - Legion">
		<if mode="or" spell="restraint" buffactive="restraint">
			<equip when="engaged|aftercast" set="LegionTP-restraint"/>
		</if>
		<else>
			<equip when="precast|engaged|aftercast" set="LegionTP" />
		</else>
	</if>
	<elseif mode="or" spell="restraint" buffactive="restraint">
			<equip when="engaged|aftercast" set="restraint"/>
	</elseif>
	<else>
		<equip when="precast|engaged|aftercast" set="TP" />
	</else>
</if>


If you need to test it without botching a legion run, you can use this and check to see if the add to chats work as expected:
Code
<if status="engaged">
<addtochat>Engaged</addtochat>
	<if area="Konschtat Highlands">
	<addtochat>In Konschtat!</addtochat>
		<if mode="or" spell="Aggressor" buffactive="Aggressor">
			<addtochat>Agressor is being used or is on!</addtochat>
			<equip when="engaged|aftercast" set="LegionTP-Aggressor"/>
		</if>
		<else>
			<addtochat>Agressor is off!</addtochat>
			<equip when="precast|engaged|aftercast" set="LegionTP" />
		</else>
	</if>
	<elseif mode="or" spell="Aggressor" buffactive="Aggressor">
			<equip when="engaged|aftercast" set="Aggressor"/>
			<addtochat>In Konschtat and Agressor is being used or is on!</addtochat>
	</elseif>
	<else>
	<addtochat>Not in zone, agressor is off.</addtochat>
		<equip when="precast|engaged|aftercast" set="TP" />
	</else>
</if>
 Valefor.Caelir
Offline
サーバ: Valefor
Game: FFXI
user: Caelir
Posts: 80
By Valefor.Caelir 2012-11-13 22:22:29  
Thanks dude, i'll give that a try tomorrow when im not trying to fix/write another spellcast for DRK.
 Ragnarok.Sekundes
Offline
サーバ: Ragnarok
Game: FFXI
user: Sekundes
Posts: 4189
By Ragnarok.Sekundes 2012-11-13 22:26:45  
I tried to stay as close to your original method as I could here as I don't know what the rest of your xml looks like and I don't want to deviate too much but there are several other ways to do it and some are probably more efficient.

Oh and btw, on the second one I put aggressor instead of restraint since I used that to test it myself and I only have war as a sub. So you can do a quick find and replace if you want to use restraint instead.
Log in to post.