EffectConfused()

Creates a confusion effect.

effect EffectConfused();

Description

This function returns a confusion effect. This effect can then be applied to a PC/NPC.

The confusion script, declared in "statescripts.2da" and by default is "nw_g0_confuse" does the actions each round (heartbeat) for a creature affected with confusion.

The target this effect is applied to must be a creature for it to work. This effect cannot be applied instantly, only temporarily or permanently.



Remarks

This is a mind-effect and will be blocked by mind immunities.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got seperately via. looping valid effects on the target (GetFirst/NextEffect()). See the Effect Tutorial for more details.


Version

1.29

Example

// Sample code for applying a confusion effect to a target

void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;

    // Create the effect to apply
    effect eDrain = EffectConfused();

    // Create the visual portion of the effect. This is instantly
    // applied and not persistant with wether or not we have the
    // above effect.
    effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);

    // Apply the visual effect to the target
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    // Apply the effect to the object   
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget);
}

See Also

categories: Effects Functions


 author: Michael Nork, editor: Jasperre