Just a little addition to conditions you just forgot: You can negate them with '!'
And for BEHAVIOURs: The Priority can be changed with
SetPriority(STRING BehaviourName, INT value). If you want a behaviour to occur only once you set the priority to 0 in the script and you do this: When the behaviour should occur you use
SetPriority(STRING BehaviourName, INT value) in the ACTIONs part to set it higher and the last statement in the behaviour section should be to set the priority back to 0. Example:
EVENT ShouldDrinkPotion
ON
OnDamage(_,_,_,_)
ACTIONS
IF "c1"
ItemGetFromInventory(_, __Me, Minor_Healing_Potion)
THEN
SetPriority(DrinkPotion, 100)
ENDIF
REACTION DrinkPotion, 0
USAGE COMBAT
CHECK "c1"
CharacterCanDrinkPotion(__Me, Minor_Healing_Potion, 0)
ACTIONS
CharacterDrinkPotion(Minor_Healing_Potion)
SetPriority(DrinkPotion, 0)
Furthermore in my experience some script commands can only be used in the BEHAVIOUR section (the one I know is
CharacterDrinkPotion(Potion)).