SetMonsterAttackDamage

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

setMonsterAttackDamage

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Changes a resource-owned monster instance's authoritative base melee damage.

Syntax

bool setMonsterAttackDamage(string monsterId, number attackDamage)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.
attackDamage number yes A finite base melee damage value from 0 through 100000.

Returns

Returns true when the value and ownership are valid and the per-instance damage is changed; otherwise returns false.

Examples

Give one encounter monster stronger melee attacks:

if setMonsterAttackDamage(monsterId, 85) then
    outputDebugString("Monster damage updated")
end

Notes

  • Available only in server-side resource scripts.
  • Only the resource that created the monster may change this value. Other monsters of the same catalog type are unaffected.
  • The value is read when an attack reaches its impact frame, so changing it during wind-up affects that impact. Armor resistance and the configured server damage multiplier still apply.
  • A value of 0 keeps the attack event but makes the impact harmless: player health, hit reactions, and damage effects are unchanged.