1
0
EQ2Emu/docs/lua_functions/GetInfoStructSInt.md

22 lines
697 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Function: GetInfoStructSInt(spawn, field)
**Description:**
Gets a signed integer field from the spawns info struct. Similar to GetInfoStructUInt but for fields that can be negative. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for a full list of options.
**Parameters:**
- `spawn` (Spawn) - Spawn object representing `spawn`.
- `field` (string) - String `field`.
**Returns:** SInt32 The value of that field.
**Example:**
```lua
-- From Spells/BattleRest.lua
function cast(Caster, Target)
CurrentRegen = GetInfoStructSInt(Caster, "hp_regen")
AddSpellBonus(Caster, 600, math.ceil(CurrentRegen * 0.05))
AddSpellBonus(Caster, 0, 2)
end
```