//:://///////////////////////////////////////////// //:: Great Thunderclap //:: X2_S0_GrtThdclp //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* // You create a loud noise equivalent to a peal of // thunder and its acommpanying shock wave. The // spell has three effects. First, all creatures // in the area must make Will saves to avoid being // stunned for 1 round. Second, the creatures must // make Fortitude saves or be deafened for 1 minute. // Third, they must make Reflex saves or fall prone. */ //::////////////////////////////////////////////// //:: Created By: Andrew Nobbs //:: Created On: Nov 20, 2002 //:: Updated On: Oct 20, 2003 - some nice Vfx:) //::////////////////////////////////////////////// //:: altered by mr_bumpkin Dec 4, 2003 for prc stuff #include "prc_inc_spells" #include "prc_add_spell_dc" void main() { DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); /* Spellcast Hook Code Added 2003-07-07 by Georg Zoeller 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 int nDamage = 0; float fDelay; effect eExplode = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION); effect eVis = EffectVisualEffect(VFX_IMP_SONIC); effect eVis2 = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M); effect eVis3 = EffectVisualEffect(VFX_IMP_STUN); effect eDeaf = EffectDeaf(); effect eKnock = EffectKnockdown(); effect eStun = EffectStunned(); effect eShake = EffectVisualEffect(356); location lTarget = PRCGetSpellTargetLocation(); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eShake, OBJECT_SELF, 2.0f); object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); while (GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF) { SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //Get the distance between the explosion and the target to calculate delay fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); //should not work on creatures already deafened if(!PRCGetHasEffect(EFFECT_TYPE_DEAF, oTarget) && !PRCGetHasEffect(EFFECT_TYPE_SILENCE, oTarget)) { if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SONIC)) { DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDeaf, oTarget, RoundsToSeconds(10))); DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); } if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SONIC)) { DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStun, oTarget, RoundsToSeconds(1))); DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_SONIC)) { DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnock, oTarget, 6.0f)); DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis3, oTarget,4.0f)); } } oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); } DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); // Erasing the variable used to store the spell's spell school }