RemoveSummonedAssociate(object, object)
Removes an associate NPC from the service of a PC.
void RemoveSummonedAssociate(
object oMaster,
object oAssociate = OBJECT_SELF
);
Parameters
- oMaster
- Master PC to remove the associate of.
- oAssociate
- Associate to remove from the service of oMaster. (Default: OBJECT_SELF)
Description
This function removes the summon from the masters associate list and resets their faction back to "Commoner" with all the issues that might entail (they'll attack Hostile faction members for instance still).
The master is no longer able to command them and GetMaster on the associate will return OBJECT_INVALID.
Remarks
Summoned Associate will at times still follow PC, and at others go stationary and just turn to keep PC in sight.
Due to how EffectSummonCreature operates, when that effect is removed from the master (eg by resting/dispel magic/RemoveEffect) the creature also disappears due to how the effect is coded. You can work around this by using SetIsDestroyable and removing the parent effect, if it is important to keep the summon around.
The Balor from the spell Gate uses this function, and uses SetIsTemporaryEnemy to make them hostile to the master. It being in the Commoner faction isn't great however sometimes for faction diplomacy. It'd be recommended instead to change the summons faction to, say Hostile then use SetIsTemporaryEnemy.
See Also
| functions: |
author: Charles Feduke, editor: Jody Fletcher