# The Dromesday Book

### Site Tools

public_scripts:trapmissionqvar

# TrapMissionQVar

Trap for setting a quest variable for a single mission. The Trap→Quest Var property describes the name and how to change the variable value. The first character is an operator. Immediately following the operator is a numerical argument, which may be negative. After the number is a colon (”`:`”) then the name of the quest variable. There should not be any spaces between the parts of the property. When turned on, the trap will modify the quest variable using the operator and argument. A complementary operation is done when the trap is turned off.

Op On Result Off Result
`=` Set the variable to the number. Set the variable to 0.
`+` Add the number to the variable. Subtract the number from the variable.
`*` Multiply the variable by the number. Divide the variable by the number.
`/` Divide the variable by the number, rounding towards 0. Multiply the variable by the number.
`%` Set the variable to the remainder of the variable divided by the number. Multiply the variable by the number.
`!` or `|` Set the bits in the variable thar are set in the number. Clear the bits in the variable that are set in the number.
`{` Shift the bits in the variable left by the number of bits. Shift the bits in the variable to the right.
`}` Shift the bits in the variable right by the number of bits. Shift the bits in the variable to the left.
`"` Multiply the variable by 10, then add the “ones” digit of the number. Divide the variable by 10.
`#` Like `"`, but the variable will never be more than 4 digits long. Same as above.
`?` Add a random value between 0 and the number, inclusive. Subtract a random number.
`d` Add a random value between 1 and the number. Subtract a random number.
Inherits Properties BaseTrap, BaseQuestVariable Trap\Quest Var, Script\QB Name initqv (integer) Set the quest variable to this value when the mission starts.
public_scripts/trapmissionqvar.txt · Last modified: 2010/11/23 00:06 (external edit)