SurrenderToEnemies()
Causes all creatures in a 10 meter (1 tile) radius to stop actions, improves the creature's reputation with nearby enemies for 3 minutes. Only works for NPCs.
void SurrenderToEnemies();
Description
Use this on an NPC to cause all creatures within a 10-metre radius to stop what they are doing and sets the NPC's enemies within this range to be neutral towards the NPC for roughly 3 minutes. If this command is run on a PCor an object that is not a creature, nothing will happen.
Remarks
Very useful function. Can for instance be used to make an enemy surrender just before dying, to try and cut a deal with his attackers...
Known Bugs
Previous bug about wounding fixed in 1.62, the function does remove wounding effects from creatures so you can talk to them.
Version
1.61
Example
//Cause an NPC to attack a player and then surrender so the player does not auto attack back at them. void main() { object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); DelayCommand(2.0, SurrenderToEnemies()); ActionAttack(oPC, TRUE); }
See Also
functions: | AdjustReputation | SurrenderAllToEnemies |
categories: | Combat Actions Functions | Reputation/Faction Functions |
author: John Shuell, editor: Jasperre