A_RandomStateRange is an action that randomly chooses a state within a certain range to go to next. Var1 is the minimum state number to choose, Var2 is the maximum state number to choose.
Code – A_RandomStateRange
// Function: A_RandomStateRange
// Description: Chooses a random state within the range supplied.
// var1 = Minimum state number to choose.
// var2 = Maximum state number to use.
void A_RandomStateRange(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_RandomStateRange", actor))
P_SetMobjState(actor, P_RandomRange(locvar1, locvar2));