//:://///////////////////////////////////////////// //:: Dismissal //:: NW_S0_Dismissal.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* All summoned creatures within 30ft of caster make a save and SR check or be banished */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Oct 22, 2001 //::////////////////////////////////////////////// //:: VFX Pass By: Preston W, On: June 20, 2001 #include "X0_I0_SPELLS" #include "x2_inc_spellhook" #include "hench_i0_generic" void main() { /* Spellcast Hook Code Added 2003-06-20 by Georg If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more */ if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell return; } // End of Spell Cast Hook //Declare major variables object oMaster; effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON); effect eImpact = EffectVisualEffect(VFX_FNF_LOS_EVIL_30); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation()); int nSpellDC; //Get the first object in the are of effect object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); while(GetIsObjectValid(oTarget)) { //does the creature have a master. oMaster = GetMaster(oTarget); //Is that master valid and is he an enemy if(GetIsObjectValid(oMaster) && spellsIsTarget(oMaster,SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF )) { //Is the creature a summoned associate if(GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster) == oTarget || GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oMaster) == oTarget || GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oMaster) == oTarget || GetLocalInt(oTarget, sHenchPseudoSummon)) { SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DISMISSAL)); //Determine correct save nSpellDC = GetSpellSaveDC() + 6; //Make SR and will save checks if (!MyResistSpell(OBJECT_SELF, oTarget) && !MySavingThrow(SAVING_THROW_WILL, oTarget, nSpellDC)) { //OnDeath script... so lets kill it. effect eKill = EffectDamage(GetCurrentHitPoints(oTarget)); //just to be extra-sure... :) effect eDeath = EffectDeath(FALSE, FALSE); DelayCommand(0.25, ApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget)); DelayCommand(0.25, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget)); DestroyObject(oTarget, 0.3); } } } //Get next creature in the shape. oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); } }