EffectSwarm(int, string, string, string, string)

Returns a Swarm effect.

effect EffectSwarm(
    int nLooping,
    string sCreatureTemplate1,
    string sCreatureTemplate2 = "",
    string sCreatureTemplate3 = "",
    string sCreatureTemplate4 = ""
);

Parameters

nLooping

If this is TRUE, for the duration of the effect when one creature created by this effect dies, the next one in the list will be created. If the last creature in the list dies, we loop back to the beginning and sCreatureTemplate1 will be created, and so on...

sCreatureTemplate1

Blueprint of first creature to spawn

sCreatureTemplate2

Optional blueprint for second creature to spawn (Default: "")

sCreatureTemplate3

Optional blueprint for third creature to spawn (Default: "")

sCreatureTemplate4

Optional blueprint for fourth creature to spawn (Default: "")


Description

Returns a Swarm effect of, up to, four definable creatures.



Remarks

This effect does not work with ApplyEffectToLocation().

When applied to a PC, the spawned creature will become part of the target PC's group, replacing any summon creature the PC might already control.

Bioware’s description of what nLooping does is a little vague. The effect will actually proceed to the next creature when the one before dies even when nLooping is FALSE. Once the last creature in the list dies, though, if nLooping is FALSE, the effect ends even if its duration hasn’t expired yet. If nLooping is TRUE, however, the effect loops back and starts over with the first creature.


Known Bugs

Previously noted bug was fixed in a patch some time ago.


Version

1.30

Example

// Example 1 - The following script is an OnUsed event script.
// When triggered, it checks to make sure it was triggered by a
// PC, and if not exits the script.  If it was a PC that triggered the
// script, the Swarm effect is created and applied to the PC for
// duration of 3 minutes.

void main(){

  effect eSwarm;
  object oPC = GetLastUsedBy();
  if (!GetIsPC(oPC)) return;
  eSwarm = EffectSwarm(TRUE,"nw_skeleton", "nw_skelchief", "nw_skeleton", "nw_skeleton");
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eSwarm,oPC,180.0f);
}

See Also

functions: ApplyEffectToObject | SummonAnimalCompanion | SummonFamiliar
categories: Effects Functions | Henchmen/Familiars/Summoned Functions


 author: Brett Lathrope, editor: Lilac Soul, additional contributor(s): Lilac Soul
 Send comments on this topic.