Differences

This shows you the differences between two versions of the page.

Link to this comparison view

conditions:variableequals [2019/07/01 01:56] (current)
Line 1: Line 1:
 +<WRAP infobox right>
 +<WRAP infoboxheader>​VariableEquals</​WRAP>​
 +<WRAP infoboxtable>​
 +^Type| Meta|
 +^Aliases| variableeq, varequals, vareq|
 +^Added In| 4.6|
 +^Author| Ashijin|
 +</​WRAP>​
 +</​WRAP>​
 +====== Condition: VariableEquals ======
  
 +A condition that checks the value of a [[:​skills:​variables|variable]].
 +
 +===== Attributes =====
 +
 +^Attribute ^Aliases ^Description ^Default Value ^
 +| variable | var | The name of the variable. Can optionally be prefixed with **scope.** |  |
 +| value | val | The value that the variable must equal to return true. Must be applicable for **type** or the mechanic will fail. Should be surrounded in double-quotes if using spaces. Value can also include placeholders,​ even from PlaceholderAPI. |  |
 +| scope | s | The [[:​skills:​variables#​variable_scopes|scope]] of the variable, e.g. where the variable will be located. | SKILL |
 +\\
 +===== Examples =====
 +
 +In this example, the target players would only hear growling from any number of nearby bears once every 10 minutes.
 +  BearMob:
 +    Skills:
 +    - skill:​BearGrowl @PlayersInRadius{r=40} ~onTimer:60
 +
 +  BearGrowl:
 +    TargetConditions:​
 +    - variableEquals{var=target.heardbear;​value="​yes"​} cancel
 +    Skills:
 +    - message{m="&​7You hear a growling noise..."​}
 +    - setvariable{var=target.heardbear;​value="​yes";​duration=6000}
 +
 +In this example, the skill would only fire if the global variable "​poison_storm"​ is set to true.
 +  PoisonStormDamage:​
 +    Conditions:
 +    - varEquals{var=global.poison_storm;​value="​yes"​}
 +    Skills:
 +    - potion{type=POISON;​duration=100}
 +    - damage{amount=1;​ignorearmor=true}

conditions/variableequals.txt · Last modified: 2019/07/01 01:56 (external edit)