SpellCast Variables

SpellCast variables can be used throughout SpellCast in a growing number of places. You can use them in AddToChat actions, command actions, advanced rules, and set definition to name a few. In fact you can even type SpellCast variables into normal FFXI chat input and they will output as parsed!

Using Variables as a Rule

There will be times you may want to accomplish some task but are unable to do so with the common rules that are available. Well you're options don't have to stop there. Thanks to spellcast's predefined variables you can grab some pretty astonishing information. So here are a few examples to help you get started. Get ready to become familiar with the advanced tag.

<!-- Checking if your action is a command prefix of range with no ammo equipped -->
	<if commandprefix="/range|/ra" advanced='"%EquipAmmo" = "empty"'>
		<addtochat> You are trying to preform a range with no ammo</addtochat>
		<cancelspell />
	</if>
 
<!-- Equip a basic gear set if your Body AND Head slots are empty, OR if your main slot is empty -->
	<if advanced='("%EquipBody"="empty" AND "%EquipHead"="empty") OR "%EquipMain"="empty"'>
		<if mainjob="WAR">
			<equip set="WARBasic" />
		</if>
		<elseif mainjob="BLM">
			<equip set="BLMBasic" />
		</elseif>
	</if>
 
<!-- Equip Twilight Cape for BLM when the casting spell element matches the Day OR Weather Element -->
	<if Advanced='"%SpellElement"="%DayElement" or "%SpellElement"="%WeatherElement"'>
		<equip when="precast|midcast">		
			<back>Twilight Cape</back>
		</equip>
	</if>

Those examples should get you started on making your own checks with spellcasts variables. Just remember that numbers are NOT suppose to be enclosed in double quotes. Double quotes are used for text strings.

Also if you need to use 's, or < less then, or > greater then in your advanced tags be sure to use the escaped forma, &apos; &lt; &gt;

And just in case you haven't caught on, = is equal and != is Not equals.

Helpful Tip

It is important to remember that spellcast will match variable with the first matched parse. What this means is if you are using similar names for you variables, you may experience unexpected problems.

Lets take this example. Lets say you have to define 11 variables with the same name. Lets say you are bard and you have 11 different instruments you want to use on different occasions. Now lets say you call the instrument independent of your gear sets and you name your 11 instruments something like this.

<variables>	
	<var name="instra1">A</var>
	<var name="instra2">B</var>
	<var name="instra10">J</var>
	<var name="instra11">K</var>
</variables>

Now lets say you want to pull instra K, you would think you would call this with $instra11 and it would work since you have it defined. But this is wrong, when calling $insta11 the result will be A1

This is because [$instra1] is defined and parsed first. So the result is A+1, A1. To fix this we need to use not so similar names.

<variables>	
	<var name="instra01">A</var>
	<var name="instra11">K</var>
</variables>

Now when you call instra11 it will be K since in order to call A you must type instra01.

This is handy when creating multi-layered variables Example:

<!-- $use$daytype%spellelement_set -->
<!-- on a cast of fire with a daytime of night-->
<!-- $useNightFire_set -->
<!-- which then I can have this variable defined as a Fire Type gear set -->
<var name="useNightFire">Night_Fire_gear</var> 
 
<set name = "Night_Fire_gear" >	
	<!-- Fire base gear -->
</set>
 
<equip when="precast" set="$use$daytype%spellelement_set" />

The equip line can then be reused to equip many different types of gear sets based off of the current conditions.

Variable List

SpellCast Related:
Variable Name Since Replaced With:
%Group 2.11 Replaced with the currently active SpellCast group name.
Spell Related:
Variable Name Since Replaced With:
%Spell 2.10 Replaced with the English name for the current spell.
%ESpell 2.11 Replaced with the English name for the current spell.
%FSpell 2.11 Replaced with the French name for the current spell.
%GSpell 2.11 Replaced with the German name for the current spell.
%JSpell 2.11 Replaced with the Japanese name for the current spell.
%SpellElement 2.11 Replaced with the element of the spell being cast.
Elements: Earth, Fire, Water, Wind, Ice, Thunder, Dark, Light
%Type 2.11 Replaced with the type of the spell being cast.
Types: WhiteMagic, BlackMagic, SummonerPact, BardSong, Ninjutsu, BlueMagic, JobAbility, PetCommand, WeaponSkill, BloodPactRage, CorsairRoll, CorsairShot, BloodPactWard
%Skill 2.11 Replaced with the skill the spell being cast relies upon.
Skills: BlueMagic, Singing, Ninjutsu, SummoningMagic, DarkMagic, ElementalMagic, EnfeeblingMagic, EnhancingMagic, HealingMagic, DivineMagic
%ValidTarget 2.11 Replaced with the valid targets of the current spell.
Valid Targets:Corpse”, “Enemy”, “Self”, “Party”, “Self, Party”,
Self, Party, Ally, NPC”, “Self, Party, Ally, NPC, Enemy
%MPCost 2.11 Replaced with the mp cost of the current spell.
%Recast 2.11 Replaced with the recast time of the current spell. This is the max recast time, not the current recast time.
%Castime 2.11 Replaced with the castime of the current spell.
%CommandPrefix 2.11 Replaced with the current spell's command prefix. You must specify full prefixes here, as SpellCast automatically converts short or alternate prefixes.
Available CommandPrefixes: /magic, /weaponskill, /jobability, /pet, /range, /song, /ninjutsu
Character Related:
Variable Name Since Replaced With:
%MPMax 2.11 Replaced with your character's max MP.
%HPMax 2.11 Replaced with your character's max HP.
%MP 2.11 Replaced with your character's current MP.
%HP 2.11 Replaced with your character's current HP.
%TP 2.11 Replaced with your character's current TP.
%MPP 2.11 Replaced with your character's current MP%.
%HPP 2.11 Replaced with your character's current HP%.
%Status 2.11 Replaced with your character's current status.
Statuses: Idle, Resting, Engaged, Dead, Zoning
%MPPAfterCast 2.11 Replaced with the MP% that will be available after the current spell finishes casting.
%MPAfterCast 2.11 Replaced with the MP that will be available after the current spell finishes casting.
%Job 2.11 Replaced with your character's current job combination(MAIN/SUB).
Jobs: examples: BLM/WHM, NIN/WAR, etc.
%MainJob 2.11 Replaced with your character's current MainJob.
MainJobs: BLM, BLU, BRD, BST, COR, DNC, DRG, DRK, MNK, NIN, PLD, PUP, RDM, RNG, SAM, SCH, SMN, THF, WAR, WHM
%SubJob 2.11 Replaced with your character's current SubJob.
Subjobs: BLM, BLU, BRD, BST, COR, DNC, DRG, DRK, MNK, NIN, PLD, PUP, RDM, RNG, SAM, SCH, SMN, THF, WAR, WHM
%MainJobLVL 2.11 Replaced with your character's current MainJob level.
%SubJobLVL 2.11 Replaced with your character's current SubJob level.
%PlayerName 2.16 Replaced with your character's name.
%IsInCombat 2.17 Replaced with your status of being in battle where the battle BGM Music is playing (even when not physically engaged) Returns 1 or 0. Does not work in Dynamis (always 0)
%IsInAlly 2.18 Replaced with 1 or 0 depending if you are in an alliance or not,
%PartyCount 2.18 Replaced with the number of people in your alliance.
Vana'diel Related:
Variable Name Since Replaced With:
%Area 2.11 Replaced with the current area you are in.
%Time 2.11 Replaced with the current FFXI * time.
%Moon 2.11 Replaced with the current FFXI moon phase.
%MoonPCT 2.16 Replaced with the current FFXI moon%.
%Day 2.11 Replaced with the current day of the Vana'diel week.
%DayElement 2.11 Replaced with the element of the current Vana'diel day.
Day Elements: Earth, Fire, Water, Wind, Ice, Thunder, Dark, Light
%Weather 2.11 Replaced with the weather currently affecting your character. *This takes into account Scholar Storms.
Weathers: Clear, Sunshine, Clouds, Fog, Fire, Fire x2, Water, Water x2, Earth, Earth x2, Wind, Wind x2, Ice, Ice x2, Thunder, Thunder x2, Light, Light x2, Dark, Dark x2
%WeatherElement 2.11 Replaced with the element of the current weather regardless of double weather. *This takes into account Scholar Storms.
Weather Elements: Earth, Fire, Water, Wind, Ice, Thunder, Dark, Light, None
Spell Target Related:
%SpellTarget 2.10 Since 2.20, this is synonymous with %SpellTargetName. Previously it was synonymous with %SpellTargetRaw.
%SpellTargetName 2.20 Replaced with the current target of the spell. This will tell you the name of who you have targeted in game even if <t>, <st>, etc. was used.
%SpellTargetRaw 2.20 Replaced with the current target of the spell as received from FFXI. This will not tell you the name of who you have targeted in game unless their name was typed out in the FFXI command.
Targets: examples: <me>, <lastst>, <t>, CharacterName, etc
%SpellTargetHPP 2.20 Replaced with the current HP percentage of your spell's target
%SpellTargetType 2.20 Replaced with the type of your spell's target
Types: NONE, SELF, PLAYER, NPC, MONSTER
%SpellTargetIsAllyMember 2.20 Replaced with 1 or 0 depending if your spell's target is in your alliance or not.
%SpellTargetDistance 2.20 Replaced with the distance between you and your spell's target.
Target Related:
%Target 2.17 Replaced with your current targets name
%TargetHPP 2.20 Replaced with your targets current HP %
%TargetType 2.17 Replaced with your targets type. (Note: this was misspelled as %TargeType in 2.17
Types: NONE, SELF, PLAYER, NPC, MONSTER
%TargetIsAllyMember 2.20 Replaced with 1 or 0 depending if your target is in your alliance or not.
%TargetDistance 2.20 Replaced with the distance between you and your target.
Equipment Related:
%EquipMain 2.20 Replaced with the name of the item equipped in your Main slot.
%EquipSub 2.20 Replaced with the name of the item equipped in your Sub slot.
%EquipAmmo 2.20 Replaced with the name of the item equipped in your Ammo slot.
%EquipRange 2.20 Replaced with the name of the item equipped in your Range slot.
%EquipHead 2.20 Replaced with the name of the item equipped in your Head slot.
%EquipNeck 2.20 Replaced with the name of the item equipped in your Neck slot.
%EquipLEar 2.20 Replaced with the name of the item equipped in your LEar slot.
%EquipREar 2.20 Replaced with the name of the item equipped in your REar slot.
%EquipBody 2.20 Replaced with the name of the item equipped in your Body slot.
%EquipHands 2.20 Replaced with the name of the item equipped in your Hands slot.
%EquipLRing 2.20 Replaced with the name of the item equipped in your LRing slot.
%EquipRRing 2.20 Replaced with the name of the item equipped in your RRing slot.
%EquipBack 2.20 Replaced with the name of the item equipped in your Back slot.
%EquipWaist 2.20 Replaced with the name of the item equipped in your Waist slot.
%EquipLegs 2.20 Replaced with the name of the item equipped in your Legs slot.
%EquipFeet 2.20 Replaced with the name of the item equipped in your Feet slot.
If the slot being checked is empty, the returned value will be [empty]
Fellow Related: <NEW>
%FellowIsValid <NEW> 2.34 Displays a number representing if a Fellow NPC is active.
%FellowID <NEW> 2.34 Displays the ID of your Fellow NPC
%FellowName <NEW> 2.34 Displays the Name of your Fellow NPC
%FellowHPP <NEW> 2.34 Displays the HP% of your Fellow NPC
Pet Related: <NEW>
%PetIsValid <NEW> 2.34 Displays a number representing if you have a pet active.
%PetName <NEW> 2.34 Displays your pet's Name.
%PetElement <NEW> 2.34 Displays your pet's aligned element.
%PetTP <NEW> 2.34 Displays your pet's TP amount.
%PetTPReal <NEW> 2.34 Displays your pet's TP real amount.
%PetHPP <NEW> 2.34 Displays your pet's HP% amount.
Other Related: <NEW>
%TPCost <NEW> 2.34 Displays the TP for the current action
%TPAfterCast <NEW> 2.34 Displays the TP remaining after the TP ability
%IsInCombat <NEW> 2.34 Displays a number representing if your target is in combat.
  • Time - As of SpellCast 2.15, time related rules are calculated based off the server time and should be within a second of Vana'diel time.
  • Scholar Storms override any actual weather affecting your character.
plugins/spellcast/variables.txt · Last modified: 2011/06/11 02:05 by genesisx
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0