eq2emu/docs/lua_functions/SetInfoStructSInt.md

31 lines
1 KiB
Markdown
Raw Permalink Normal View History

2025-05-25 21:42:32 -04:00
### Function: SetInfoStructSInt(spawn, field, value)
2025-05-04 14:34:15 -04:00
**Description:**
2025-05-25 21:42:32 -04:00
Sets the signed integer 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` (int64) - Integer value `value`.
2025-05-04 14:34:15 -04:00
**Returns:** None.
**Example:**
```lua
2025-05-25 21:42:32 -04:00
-- From SpawnScripts/Antonica/Anguis.lua
function spawn(NPC)
dmgMod = math.floor(GetStr(NPC)/10)
HPRegenMod = math.floor(GetSta(NPC)/10)
PwRegenMod = math.floor(GetStr(NPC)/10)
SetInfoStructUInt(NPC, "override_primary_weapon", 1)
SetInfoStructUInt(NPC, "primary_weapon_damage_low", math.floor(205 + dmgMod))
SetInfoStructUInt(NPC, "primary_weapon_damage_high", math.floor(355 + dmgMod))
SetInfoStructUInt(NPC, "hp_regen_override", 1)
SetInfoStructSInt(NPC, "hp_regen", 125 + HPRegenMod)
SetInfoStructUInt(NPC, "pw_regen_override", 1)
SetInfoStructSInt(NPC, "pw_regen", 75 + PwRegenMod)
end
2025-05-04 14:34:15 -04:00
```