EffectDamageShield(int, int, int)

Creates a damage shield around the target that will damage sucessfull attackers.

effect EffectDamageShield(
    int nDamageAmount,
    int nRandomAmount,
    int nDamageType
);

Parameters

nDamageAmount

The amount of damage to apply to the targets attacker after a successful hit by the opponent.

nRandomAmount

The amount to add to the base damage caused by the shield as defined in the DAMAGE_BONUS_* constants group.

nDamageType

The type of damage that will be done to the attacker, as defined in the DAMAGE_TYPE_* constants group.


Description

Returns a Damage Shield effect which, when applied to a target, does (nDamageAmount + nRandomAmount) damage to any melee attacker on a successful attack of damage type nDamageType.

It is important to use DAMAGE_BONUS_* constants in the second paramter, not actual integer values, which may cause unpredicable results.



Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.


Known Bugs

It seems that the damage is only dealed back if the melee attacker does damage to the person with this effect - that is wrong, and any attacker who mearly hits the person should be affected with return damage.


Version

1.22

See Also

functions: EffectDamageResistance
categories: Combat Functions | Effects Functions
constants: DAMAGE_BONUS_* Constants | DAMAGE_TYPE_* Constants


 author: John Shuell, editor: Jasperre, additional contributor(s): Jasperre
 Send comments on this topic.