1
0
EQ2Emu/docs/lua_functions/GetInfoStructUInt.md

23 lines
769 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: GetInfoStructUInt(spawn, field)
**Description:**
Retrieves an unsigned integer field from a spawns info struct. This can include things like level, model type, gender, etc. 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:** Int32 The value of the field.
**Example:**
```lua
-- From Spells/Fighter/Crusader/PowerCleave.lua
function precast(Caster, Target)
local wield_type = GetInfoStructUInt(Caster, "wield_type")
if wield_type ~= 4 then
SendMessage(Caster, "Must have a two-handed weapon equipped", "yellow")
return false, 70
end
```