SetMonsterAggressive
setMonsterAggressive
Enables or disables autonomous targeting for a server-owned monster.
Syntax
bool setMonsterAggressive(string monsterId, bool aggressive)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
aggressive |
bool |
yes | True to enable autonomous hostility or false to make the monster passive. |
Returns
Returns true when the state is accepted; otherwise returns false.
Examples
Make a quest creature passive:
setMonsterAggressive(monsterId, false)
setMonsterTarget(monsterId, 0)
Notes
- Available only in server-side resource scripts.
- Disabling aggression prevents autonomous target acquisition; clear an existing target separately when required.