eq2emu/docs/lua_functions/SetInfoStructFloat.md

24 lines
606 B
Markdown
Raw Permalink Normal View History

2025-05-25 21:42:32 -04:00
### Function: SetInfoStructFloat(spawn, field, value)
2025-05-04 14:34:15 -04:00
**Description:**
2025-05-25 21:42:32 -04:00
Sets the float field to the value provided. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for field types.
2025-05-04 14:34:15 -04:00
**Parameters:**
2025-05-25 21:42:32 -04:00
- `spawn` (Spawn) - Spawn object representing `spawn`.
- `field` (string) - String `field`.
- `value` (float) - Float value `value`.
2025-05-04 14:34:15 -04:00
**Returns:** None.
**Example:**
```lua
2025-05-25 21:42:32 -04:00
-- From SpawnScripts/Generic/CombatModule.lua
function attributes(NPC, Spawn)
-- Calculate attributes
if level <= 4 then
baseStat = 19 else
baseStat = level + 15
end
2025-05-04 14:34:15 -04:00
```