Package net.storm.sdk.game
Class Vars
java.lang.Object
net.storm.sdk.game.Vars
Provides static utility methods for accessing game variables (varps, varbits, and varcs).
Game variables store various state information about the player, quests, settings, and game mechanics.
Variable types:
- Varps (Variable Parameters) - Server-side variables that persist across sessions
- Varbits - Bit-packed values within varps, allowing multiple values in a single varp
- VarcInt - Client-side integer variables
- VarcStr - Client-side string variables
Example usage:
// Read a varbit value (e.g., quest state)
int questState = Vars.getBit(QUEST_VARBIT_ID);
// Read a varp value directly
int varpValue = Vars.getVarp(VARP_ID);
// Read client variables
int clientInt = Vars.getVarcInt(VARC_INT_ID);
String clientStr = Vars.getVarcStr(VARC_STR_ID);
// Set a varbit value (use with caution)
Vars.setBit(VARBIT_ID, newValue);
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetBit(int id) Gets the value of a varbit.static intgetVarcInt(int varClientInt) Gets the value of a client integer variable.static StringgetVarcStr(int varClientStr) Gets the value of a client string variable.static intgetVarp(int id) Gets the value of a varp (variable parameter).static voidsetBit(int id, int value) Sets the value of a varbit.
-
Constructor Details
-
Vars
public Vars()
-
-
Method Details
-
getBit
public static int getBit(int id) Gets the value of a varbit. Varbits are bit-packed values within varps that store specific game state information.- Parameters:
id- the varbit ID- Returns:
- the varbit value
-
setBit
public static void setBit(int id, int value) Sets the value of a varbit. Use with caution as modifying varbits can affect game state.- Parameters:
id- the varbit IDvalue- the value to set
-
getVarp
public static int getVarp(int id) Gets the value of a varp (variable parameter). Varps are server-side variables that store game state.- Parameters:
id- the varp ID- Returns:
- the varp value
-
getVarcInt
public static int getVarcInt(int varClientInt) Gets the value of a client integer variable. VarcInts are client-side variables that do not persist on the server.- Parameters:
varClientInt- the variable ID- Returns:
- the integer value
-
getVarcStr
Gets the value of a client string variable. VarcStrs are client-side string variables.- Parameters:
varClientStr- the variable ID- Returns:
- the string value, or
nullif not set
-