#include "prc_inc_spells" void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 35, float fRadius = 8.) { ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DUST_EXPLOSION), lTarget); ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_ELECTRIC_EXPLOSION), lTarget); object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget); do { int nDamageAfterSave = PRCGetReflexAdjustedDamage(nDamage/2, oObject, nSaveDC)+nDamage/2; ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_BLUDGEONING), oObject); ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_ELECTRICAL), oObject); } while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID); } void main() { ExecuteScript("mn_lootandxp",OBJECT_SELF); location lSource = GetLocation(OBJECT_SELF); DelayCommand(4., ExplodeAtLocation(lSource, d10(6))); }