SpellCast Rules

Rule List

All rules are optional, however you must specify at least one.

Rule Related:
Attribute Name Example Since Description
Mode OR Tells SpellCast if all or only some of the rule criteria must be true in order for the rule to be true. SpellCast defaults to “AND” mode when processing rules if mode is not specified.
Available Modes: AND, OR
Advanced See Description 2.11 Allows you to setup more advanced rules in a format similar to many programming languages. Makes use of special variable comparisons.
Click here for more information on this rule.
Click here for a list of the variables you can check against.
SpellCast Related:
Attribute Name Example Since Description
Group <WC> group name 2.11 Matches for your current group name.
Spell Related:
Attribute Name Example Since Description
Spell <WC> spell name 2.10 Matches by a spells English name. Note: put “autoset” for the spell name to make a rule process on autoset event trigger. (Even if you use F/G/J client, you type the English spell name here)
FSpell <WC> spell name 2.11 Matches by a spells French name. Note: put “autoset” for the spell name to make a rule process on autoset event trigger.
GSpell <WC> spell name 2.11 Matches by a spells German name. Note: put “autoset” for the spell name to make a rule process on autoset event trigger.
JSpell <WC> spell name 2.11 Matches by a spells Japanese name. Note: put “autoset” for the spell name to make a rule process on autoset event trigger.
CommandPrefix <WC> /magic /weaponskill 2.11 Allows one to set a rule based on the specified 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
Element <WC> Ice 2.11 Allows one to set rules based on a spells given element type.
Available Elements: Earth, Fire, Water, Wind, Ice, Thunder, Dark, Light
Skill <WC> Ninjutsu 2.11 Alows one to set rules based on a spells skill.
Available Skills: BlueMagic, Singing, Ninjutsu, SummoningMagic, DarkMagic, ElementalMagic, EnfeeblingMagic, EnhancingMagic, HealingMagic, DivineMagic
Type <WC> BlackMagic 2.11 Allows one to set rules based on a spells type.
Available Types: WhiteMagic, BlackMagic, SummonerPact, BardSong, Ninjutsu, BlueMagic, JobAbility, PetCommand, WeaponSkill BloodPactRage, CorsairRoll, CorsairShot, BloodPactWard
ValidTarget <WC> Corpse 2.11 Allows one to set rules based on valid targets for the spell being casted, i.e: Self Target only spells.
ValidTarget Values: Bolded in quotations for 'groups'
Corpse”, “Enemy”, “Self”, “Party”, “Self, Party”,
Self, Party, Ally, NPC”, “Self, Party, Ally, NPC, Enemy
MPCost <WC> 135 2.11 Allows one to set rules based on current MP.
MPCostGT 51 2.11 Allows one to set rules based on the MP cost of the spell. Must be greater then specified amount to proc. Supports “calculations” as the comparison value.
MPCostLT 10 2.11 Allows one to set rules based on the MP cost of the spell. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
Recast <WC> 1.5 2.11 Allows one to set rules based on spells Recast timer. Values in seconds.
RecastGT 60 2.11 Allows one to set rules based on Recast timers. Values in seconds. Must be greater then specified amount to proc. This checks against the max recast time in the dats, not the current recast time. Does not account for haste or other modifiers. Supports “calculations” as the comparison value.
RecastLT 60 2.11 Allows one to set rules based on Recast timers. Values in seconds. Must be less then specified amount to proc. This checks against the max recast time in the dats, not the current recast time. Does not account for haste or other modifiers. Supports “calculations” as the comparison value.
CastTime <WC> 6.5 2.11 Allows one to set rules based on Cast timers. Values in seconds.
CastTimeGT 2 2.11 Allows one to set rules based on Cast timers. Values in seconds. Must be greater then specified amount to proc. Supports “calculations” as the comparison value.
CastTimeLT 2 2.11 Allows one to set rules based on Cast timers. Values in seconds. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
Spell/Character Related:
Attribute Name Example Since Description
MPAftercast <WC> 800 2.11 Allows one to set rules based on current MP after casting a spell.
MPAftercastLT 800 2.11 Allows one to set rules based on current MP after casting a spell. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
MPAftercastGT 800 2.11 Allows one to set rules based on current MP after casting a spell. Must be greater then specified amount to proc. Supports “calculations” as the comparison value.
MPPAftercast <WC> 50 2.11 Allows one to set rules based on current MP percentage after casting a spell.
MPPAftercastLT 50 2.11 Allows one to set rules based on current MP percentage after casting a spell. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
MPPAftercastGT 50 2.11 Allows one to set rules based on current MP percentage after casting a spell. Must be greater then specified amount to proc. Supports “calculations” as the comparison value.
Character Related:
Attribute Name Example Since Description
Job <WC> BLM/WHM 2.11 Allows one to set a rule based on your full job(includes subjob). See MainJob and SubJob for rules based on these separately.
MainJob <WC> BLM 2.11 Allows one to set rules based specifically on your current Main Job.
SubJob <WC> NIN 2.11 Allows one to set rules based specifically on your current Sub Job.
Lvl <WC> 75/37 2.11 Allows you to set a rule based on levels only.
MainJobLvl <WC> 75 2.11 Allows one to set rules based specifically on your current Main Job Level
MLvlGT 55 2.11 Allows one to set rules based specifically on if your current Main Job Level is greater than the specified level. Supports “calculations” as the comparison value.
MLvlLT 55 2.11 Allows one to set rules based specifically on if your current Main Job Level is less than the specified level. Supports “calculations” as the comparison value.
SubJobLvl <WC> 37 2.11 Allows one to set rules based specifically on your current Sub Job Level
SLvlGT 30 2.11 Allows one to set rules based specifically on if your current Sub Job Level is greater than the specified level. Supports “calculations” as the comparison value.
SLvlLT 37 2.11 Allows one to set rules based specifically on if your current Sub Job Level is less than the specified level. Supports “calculations” as the comparison value.
MP <WC> 1000 2.11 Allows one to set rules based on current MP.
MPLT 900 2.11 Allows one to set rules based on current MP. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
MPGT 1100 2.11 Allows one to set rules based on current MP. Must be greater than specified amount to proc. Supports “calculations” as the comparison value.
MPP <WC> 50 2.11 Allows one to set rules based on current MP percentage.
MPPLT 50 2.11 Allows one to set rules based on current MP percentage. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
MPPGT 50 2.11 Allows one to set rules based on current MP percentage. Must be greater than specified amount to proc. Supports “calculations” as the comparison value.
MaxMP <WC> 1000 2.11 Allows one to set rules based on Max MP.
MaxMPLT 1000 2.11 Allows one to set rules based on Max MP. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
MaxMPGT 1000 2.11 Allows one to set rules based on Max MP. Must be greater than specified amount to proc. Supports “calculations” as the comparison value.
HP <WC> 1500 2.11 Allows one to set rules based on current HP.
HPLT 1500 2.11 Allows one to set rules based on current HP. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
HPGT 1500 2.11 Allows one to set rules based on current HP. Must be greater than specified amount to proc. Supports “calculations” as the comparison value.
HPP <WC> 75 2.11 Allows one to set rules based on current HP percentage.
HPPLT 75 2.11 Allows one to set rules based on current HP percentage. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
HPPGT 75 2.11 Allows one to set rules based on current HP percentage. Must be greater than specified amount to proc. Supports “calculations” as the comparison value.
MaxHP <WC> 1500 2.11 Allows one to set rules based on Max HP.
MaxHPLT 1300 2.11 Allows one to set rules based on Max HP. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
MaxHPGT 1200 2.11 Allows one to set rules based on Max HP. Must be greater than specified amount to proc. Supports “calculations” as the comparison value.
TP <WC> 100 2.11 Allows one to set rules based on current TP.
TPLT 10 2.11 Allows one to set rules based on current TP. Must be less then specified amount to proc. Supports “calculations” as the comparison value.
TPGT 10 2.11 Allows one to set rules based on current TP. Must be greater then specified amount to proc. Supports “calculations” as the comparison value.
Status <WC> Engaged 2.11 Allows one to set rules based on current player status.
Available Statuses: Idle, Resting, Engaged, Dead, Zoning
BuffActive <WC> Signet 2.11 Allows one to set rules based on current active buffs.
Buff List: View Buff List
Vana'diel Related:
Attribute Name Example Since Description
Area <WC> Dragon's Aery 2.11 Allows one to set rules based on current area/zone.
Time <WC> 12.* 2.11 Allows one to set rules based on current game *time. Note: Use a PERIOD to separate minutes from seconds, NOT :
TimeLT 18.00 2.11 Allows one to set rules based on current game *time Must be less then specified amount to proc. Supports “calculations” as the comparison value. Note: Use a PERIOD to separate minutes from seconds, NOT :
TimeGT 04.00 2.11 Allows one to set rules based on current game *time. Must be greater then specified amount to proc. Supports “calculations” as the comparison value. Note: Use a PERIOD to separate minutes from seconds, NOT :
Moon <WC> New Moon 2.11 Allows one to set rules based on current moon phase.
Weather <WC> Dark 2.11 Allows one to set rules based on current weather type.
Weather Names: 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 <WC> Earth 2.11 Allows one to set rules based on 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
Day <WC> Darksday 2.11 Allows one to set rules based on current Day type.
Day Names: Firesday, Earthsday, Watersday, Windsday, Iceday, Lightningday, Lightsday, Darksday
PartyCount <WC> 3 2.20 Allows one to set rules based on how many players are in your alliance.
PartyCountLT 3 2.20 Allows one to set rules based on how many players are in your alliance. Must be less than the specified amount to be true.
PartyCountGT 3 2.20 Allows one to set rules based on how many players are in your alliance. Must be greater than the specified amount to be true.
Spell Target Related:
Attribute Name Example Since Description
SpellTarget <WC> Tiamat 2.10 As of 2.20 synonymous with SpellTargetName. Before 2.20 it was synonymous with SpellTargetRaw.
SpellTargetName <WC> Tiamat 2.20 Allows one to set rules based on the name of the spell's target
SpellTargetRaw <WC> <stpc> 2.20 Allows you to set rules based on the target as typed, or or as in the macro.
SpellTargetHPP <WC> 73 2.20 Allows you to check the spelltarget's HP %
SpellTargetHPPLT 33 2.20 Allows you to check the spelltarget's HP %. Must be less then specified amount to proc
SpellTargetHPPGT 33 2.20 Allows you to check the spelltarget's HP %. Must be greater then specified amount to proc
SpellTargetType <WC> PLAYER|SELF 2.20 Allows you to set rules based on your spelltarget's type. Possible values: PLAYER SELF MONSTER NPC NONE
SpellTargetDistanceLT 15.5 2.20 Allows you to set rules based on the distance from you and your spell's target. Must be less than the specified amount to be true.
SpellTargetDistanceGT 15.5 2.20 Allows you to set rules based on the distance from you and your spell's target. Must be greater than the specified amount to be true.
Target Related:
Attribute Name Example Since Description
Target <WC> Tiamat 2.17 Allows you to check the currently selected target.
TargetHPP <WC> 73 2.20 Allows you to check the current targets HP %
TargetHPPLT 33 2.20 Allows you to check the current targets HP %. Must be less then specified amount to proc
TargetHPPGT 33 2.20 Allows you to check the current targets HP %. Must be greater then specified amount to proc
TargetType <WC> PLAYER|SELF 2.17 Allows you to set rules based on your target's type. Possible values: PLAYER SELF MONSTER NPC NONE
TargetDistanceLT 15.5 2.20 Allows you to set rules based on the distance from you and your current target. Must be less than the specified amount to be true.
TargetDistanceGT 15.5 2.20 Allows you to set rules based on the distance from you and your current target. Must be greater than the specified amount to be true.
Equipment Related:
Attribute Name Example Since Description
EquipMain <WC> Hagun 2.20 Allows one to set rules based on what is equipped in the Main slot.
EquipSub <WC> Perdu Blade 2.20 Allows one to set rules based on what is equipped in the Sub slot.
EquipRange <WC> Lightning Bow +1 2.20 Allows one to set rules based on what is equipped in the Range slot.
EquipAmmo <WC> Phantom Tathlum 2.20 Allows one to set rules based on what is equipped in the Ammo slot.
EquipHead <WC> Sorcerer's Petas. 2.20 Allows one to set rules based on what is equipped in the Head slot.
EquipNeck <WC> Dark Torque 2.20 Allows one to set rules based on what is equipped in the Neck slot.
EquipLEar <WC> Brutal Earring 2.20 Allows one to set rules based on what is equipped in the LEar slot.
EquipREar <WC> Bushinomimi 2.20 Allows one to set rules based on what is equipped in the REar slot.
EquipBody <WC> Haubergeon +1 2.20 Allows one to set rules based on what is equipped in the Body slot.
EquipHands <WC> Dusk Gloves 2.20 Allows one to set rules based on what is equipped in the Hands slot.
EquipLRing <WC> Rajas Ring 2.20 Allows one to set rules based on what is equipped in the LRing slot.
EquipRRing <WC> Snow Ring 2.20 Allows one to set rules based on what is equipped in the RRing slot.
EquipBack <WC> Forager's Mantle 2.20 Allows one to set rules based on what is equipped in the Back slot.
EquipWaist <WC> Speed Belt 2.20 Allows one to set rules based on what is equipped in the Waist slot.
EquipLegs <WC> Shura Haidate 2.20 Allows one to set rules based on what is equipped in the Legs slot.
EquipFeet <WC> Goliard Clogs 2.20 Allows one to set rules based on what is equipped in the Feet slot.
All Equip* rules will use the short name of an item. Sorcerer's Petas. instead of Sorcerer's Petasos, Ryl.Kgt. Chainmail instead of Royal Knight's Chainmail, etc.
  • <WC> = Means the item supports Windower wildcard and regex notation. For more information click here.
  • 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.

Additionally, you may prefix all of these rules with 'Not' as in 'NotSpell', 'NotGroup', 'NotDay' to reverse the check and make sure that rule is NOT true.

  • Example of 'AND' mode rule.
<!--This rule will change equipment on ws, while additionally not change equipment-->
<!--if we dont actually have enough tp-->
<if mode="AND" CommandPrefix="/ws|/weaponskill" NotTPLT="100">
	<action type="castdelay" delay=".2" />
	<action type="Equip" when="Precast" set="Weapon Skill" />
	<action type="Equip" when="Aftercast" set="Standard" />
</if>
  • Example of 'OR' mode rule.
<!--This will equip evasion gear if you cast Utsusemi OR, if your hp is less than 30% when the rule is parsed -->
<!--Unlikely anyone would actually use this, but was an easy example-->
<if mode="OR" spell="Utsusemi*" HPPLT="30">
	<action type="Equip" when="precast" set="Evasion_Gear" />
	<action type="command" when="midcast">input /echo Evasion Gear ON</action>
 
</if>

Advanced Rules

Used for setting up advanced rules. These rules allow comparisons against variables, and have a special syntax. Please note the additional tick(') that is placed around the whole advanced rule.

The advanced rule allows for specifying an advanced boolean expression. This is very close to C, C++, JAVA, etc format. I will try my best to make this easily accessible to non-programmers.

Syntax

Here are a few rules describing the syntax of the Advanced rule

  • A boolean expression consists of a condition check OR a condition check joined to another boolean expression.
    • boolean expression example: '”%MainJob”=“WHM”'
    • joined expression example: '”%MainJob”=“WHM” AND ”%SubJob”=“BLM”'
  • A condition check consists of a value and a second value separated by a comparison operator.
    • Values can be literals or variables, or equations
    • Valid variables can be found here.
    • Valid comparison operators include:
      • &lt; - less than
      • &gt; - greater than
      • &lt;= - less than or equal
      • &gt;= - greater than or equal
      • == - exactly equal
      • = - exactly equal
      • != - not equal
    • If any math is used that might result in a decimal, you must typecast to (float).
    • Strings should be placed within double quotes. ie. “this”
      • If a variable stores a string value, it too should be placed within quotes. ie. ”%Job”
  • Boolean expressions can be joined through the use of boolean operators.
    • AND - The boolean expressions on both sides of this operator must be true in order for the whole expression to be true.
    • &amp;&amp; - This is the same as the AND boolean operator. This is really just putting &&, but since & is an escape character…
    • OR - At least one boolean expressions on either side of this operator must be true in order for the whole expression to be true.
    • || - This is the same as the OR boolean operator.
  • Boolean expressions can be grouped together through the use of parenthesis.
    • ie. Expression1 AND (Expression2 OR Expression3) - This will only be true if expression1 and either expression2 and/or expression3 are also true.
  • An additional single tick(') must be placed on both sides of the whole boolean expression.
  • Advanced rules support regular expressions and wildcards. However, expressions with regex take a slightly different form. For example: (regex)%Weather=^.* x2$(/regex)
  • You can perform simple math in advanced rules using the common operators.
    • If your math might result in a decimal, you must typecast to float.
  • You can not pipe in the same way as you can in normal rules. Instead you must use regular expressions to pipe inside advanced rules.

Type Casting

When comparing values of different types, you need to typecast one of the values to the other. This is done by placing the desired type in parenthesis immediately prior to the value you want to type cast. For example, to type cast the time to a float so you can compare it you would use (float)%Time.

Type Cast: Converts To:
(float) floating point notation(decimals)
(int) integer values
(string) a character string

Note: Putting double quotes (”) around things automatically turns them into strings. Even if you typecast within the quotes, the quotes will make the end result a string. So for instance, you would have to do advanced='%tp < 100'. If you did advanced='”%tp” < “100”', you would get true for almost any value. Since alphabetically speaking, 11 is higher than 100.

Variables

For a list of the variables available to advanced rules, click here.

Advanced Rule Example

<if Advanced='"%MainJob"="WHM" and ("%SubJob"="SMN" or "%SubJob"="BLM")'>
	<action type="addtochat">Mainjob is WHM and subjob is SMN or BLM!</action>
</if>

Common Rule Examples

Below you can find example rule sections for common things used.

HQ Staff rule (Place the sections into the corresponding sections in your XML – Not a direct copy and paste!) 1)

<!--Have $SetStaff inside of a set-->
<set name="standard">
	<main>$SetStaff</main>
</set>
<!--Create Variables for all your staves, and one to be changed-->
<variables>
	<var name="SetStaff">Apollo's Staff</var>
	<var name="Light">"Apollo's Staff"</var>
	<var name="Dark">"Pluto's Staff"</var>
	<var name="Earth">"Terra's Staff"</var>
	<var name="Water">"Neptune's Staff"</var>
	<var name="Wind">"Auster's Staff"</var>
	<var name="Fire">"Vulcan's Staff"</var>
	<var name="Ice">"Aquillo's Staff"</var>
	<var name="Thunder">"Jupiter's Staff"</var>
</variables>
<!--Insert action inside of your rule-->
<rules>
	<if skill="ElementalMagic"> 
		<!--%SpellElement will process first. If ThunderIV is cast then $SetStaff will be set to $Thunder -->
		<action type="Var" cmd="set SetStaff $%SpellElement" /> 
	</if>
<rules>

Obi Rules (Place the sections into the corresponding sections in your XML – Not a direct copy and paste!)

<variables>
  <!--Corresponding Obi per element-->
  <var Name="EarthObi">Dorin Obi</var>
  <var Name="ThunderObi">Rairin Obi</var>
  <var Name="WaterObi">Suirin Obi</var>
  <var Name="FireObi">Karin Obi</var>	
  <var Name="IceObi">Suirin Obi</var>
  <var Name="WindObi">Furin Obi</var>
  <var Name="LightObi">Korin Obi</var>
  <var Name="DarkObi">Anrin Obi</var>
</variables>
 
<rules>
  <!--  Equip The right obi based on weather(and scholar storm) or day-->
  <if Advanced='"%SpellElement" = "%WeatherElement" OR "%SpellElement" = "%DayElement"'> 
    <!--Equip your weather/day related gear here.-->
    <action Type="Equip" When="MidCast"> 
      <waist Lock="Yes">$%SpellElementObi</waist> 
      <!--An alternative would have been to define sets by these names and only parse once-->
    </action> 
  </if>
</rules>

Basic Utsu: Ichi rule to cancel shadows (Place sections into corresponding sections within your XML)

<!-- Rule for auto-canceling of shadows during Utsusemi: Ichi cast-->
<if spell="Utsusemi: Ichi">
	<action type="Equip" when="precast" set="Evasion" />
	<!--Utsusemi:Ichi cast time is 4 sec-->
	<!--This may be conservative and it may not always be enough. I have seen delay 3 work-->
	<!--Find a delay value that YOU are comfortable relying upon-->
	<action type="midcastdelay" delay="2.5" />
	<!--Cancel currently active shadows(Buff_Id 66). Technically only need for Ni to Ichi, but no way to tell-->
	<action type="Command" when="midcast">cancel 66</action> 
</if>
1) If you do not have the HQ Staves simply replace the names with the NQ staves. If you do not have a staff replace it with another piece of equipment to put into the Main slot, or just leave it as is.
plugins/spellcast/rules.txt · Last modified: 2008/12/13 18:08 by alananir
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