Try this:
const float EFFECT_RADIUS = 10.0;
void main()
{
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
if (GetObjectType(oTarget) != OBJECT_TYPE_CREATURE)
{
SendMessageToPC(oPC, "Improper use of item!");
return;
}
effect eDamage = EffectDamage(100, DAMAGE_TYPE_DIVINE);
effect eVisual = EffectVisualEffect(VFX_IMP_HEALING_L);
effect eEffect = EffectLinkEffects(eVisual, eDamage);
location lTarget = GetLocation(oTarget);
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, EFFECT_RADIUS, lTarget);
while (GetIsObjectValid(oTarget))
{
if (GetIsEnemy(oTarget, oPC))
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
oTarget = GetNextObjectInShape(SHAPE_SPHERE, EFFECT_RADIUS, lTarget);
}
}
Change EFFECT_RADIUS to however far from the target you want the AoE to reach.
Modifié par Squatting Monk, 15 juillet 2013 - 06:11 .