FANDOM


General IF Info Edit

IF is a QUEST command used to check if the player meets certain conditions. It has two arguments.

IF <conditions>, @<label>

Argument 1 - Conditions Edit

This is a list of conditions, such as having items, having tokens or being a certain level. The full list of things that IF can check is as follows:

ALIVE player is alive
Cn true if player is of character class 'n'
DEAD player is dead
Enn Player is EQUIPPED with item nn (not just in possession of one)
Fnn true if player is on a map with this 'map flag' set. (nn = 1, 2, 4, 8, 16, 32, etc.)
Gnn true if Player has at least nn gold pieces
GS true if Player is a Golden Soul
Hnn true if this CHARACTER is nn hours old (or older)
Inn player has item nn (from ITEMS table) Use Inn.mm to check if they have mm or more of that item
Jnn player has completed mission (JOB ID) nn
JQnn player has qualified to start mission (JOB ID) nn
JAnn player has accepted mission (JOB ID) nn (but not yet finished it)
LOSE player lost last fight in this scene (all members of party died)
KBn player has been killed at least once, by monster ID = n
KBn.x player has been killed at least x times by monster ID = n
KMn player has killed at least one monster 'n' (monster ID = n)
KMn.x player has killed at least 'x' monsters of type 'n'
M0 true if player is a CHEATER character (m-zero)
M2 true if player character has played in a modified world before.
M4 true if player has ever turned off the "avoid modified quest files" option.
NO player answered NO to last ASK scene command
P0 true if player is a PLAYER KILLER (p-zero)
Pnn true if player is a PLAYER KILLER *and* has killed other players at least nn times.
Qword player answered 'word' to last ASK scene command (use ^ if your word has spaces.. "Qbutter^fly" matches "butter fly")
Rnn Random Number (nn = 00-99, represents percent chance of TRUE)
Snn player has spell nn (from SPELLS table)
Tnn player has token nn (from TOKENS table)
Vnn true if player's level is greater than or equal to nn
WIN Player won last fight in this scene (after FIGHT scene command, at least one party member lived)
XP true if the COUNTDOWN TIMER has EXPIRED (use the COUNTDOWN opcode to start the timer)
YES player answered YES to last ASK scene command
Znn true if player has trophy nn. Use Znn.mm to see if they have mm or more of trophy nn
#nn true if player is currently on map nn (as defined in MAPS table)
>, <, =, !=, <=, >= (no space in this case, use IF= etc) checks the condition code, as set by the last COMPARE or mathematical command.

Multiple conditions can be strung together with + signs. If you want to check that a player DOESN'T meet the conditions, put - signs in. For example, if you wanted to check that a player had Token 45 and Item 66 but NOT Trophy 21, the command would be

IF T4+I66-Z21, @label

Argument 2 - @label Edit

If the IF command evaluates as true, i.e. the player meets the conditions set in argument 1, the game immediately jumps to the line of script that matches this @label.