697 B
697 B
Function: GetInfoStructSInt(spawn, field)
Description: Gets a signed integer field from the spawn’s 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 representingspawn
.field
(string) - Stringfield
.
Returns: SInt32 – The value of that field.
Example:
-- 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