SetMonsterMaxHealth: Difference between revisions
Jump to navigation
Jump to search
Document Lua functions planned for G1R:MP update 0.1.2 |
Clarify the maximum-health behavior planned for G1R:MP update 0.1.2 |
||
| Line 34: | Line 34: | ||
== Notes == | == Notes == | ||
* Available only in server-side resource scripts. | * Available only in server-side resource scripts. | ||
* Raising the maximum does not | * Raising the maximum does not heal the monster by itself. Lowering it atomically clamps current health to the new maximum. | ||
* Use <code>setMonsterHealth</code> after this call when an elite or boss should start at full health. | * Use <code>setMonsterHealth</code> after this call when an elite or boss should start at full health. | ||
Revision as of 17:34, 2 September 2026
setMonsterMaxHealth
COMING IN UPDATE 0.1.2
This function is documented in advance and is not yet available in the current public release.
Changes a monster's authoritative maximum health for elite and boss variants.
Syntax
bool setMonsterMaxHealth(string monsterId, number maxHealth)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
maxHealth |
number |
yes | A finite maximum-health value greater than 0 and no greater than 1000000. |
Returns
Returns true when the new maximum is accepted and replicated; otherwise returns false.
Examples
Create a tougher encounter and then fill its health:
if setMonsterMaxHealth(monsterId, 2500) then
setMonsterHealth(monsterId, 2500)
end
Notes
- Available only in server-side resource scripts.
- Raising the maximum does not heal the monster by itself. Lowering it atomically clamps current health to the new maximum.
- Use
setMonsterHealthafter this call when an elite or boss should start at full health.