#include "NW_I0_SPELLS"

void main()
{
object oDamager = GetLastDamager();
if ((GetDamageDealtByType(DAMAGE_TYPE_FIRE) >= 1)||(GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL) >= 1))
 {
 object oCaster = GetNearestObjectByTag("InvisMine");
 AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_FIREBALL, OBJECT_SELF, METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
 effect eEffect = EffectDamage(500, DAMAGE_TYPE_FIRE, DAMAGE_POWER_NORMAL);
 ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, OBJECT_SELF);
 object oMine = GetNearestObjectByTag("MineBarrel");
 DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oMine));
 }
else return;
}
