///:://///////////////////////////////////////////// //:: [Sound Burst] //:: [NW_S0_SndBurst.nss] //:: Copyright (c) 2000 Bioware Corp. //::////////////////////////////////////////////// //:: Does 1d8 damage to all creatures in a 10ft //:: radius. Will save or the creature is stunned //:: for 1 round. //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Jan 31, 2001 //::////////////////////////////////////////////// //:: Last Updated By: Georg Z, Oct. 2003 #include "X0_I0_SPELLS" #include "x2_inc_spellhook" 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()) { return; } // End of Spell Cast Hook //Declare major variables object oTarget; int nCasterLevel = GetCasterLevel(OBJECT_SELF); int nMetaMagic = GetMetaMagicFeat(); int nDamage; effect eStun = EffectStunned(); effect eVis = EffectVisualEffect(VFX_IMP_SONIC); effect eFNF = EffectVisualEffect(VFX_FNF_SOUND_BURST); effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); effect eLink = EffectLinkEffects(eStun, eMind); eLink = EffectLinkEffects(eLink, eDur); effect eDam; location lLoc = GetSpellTargetLocation(); int nDC = GetSpellSaveDC(); //Apply the FNF to the spell location ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eFNF, lLoc); //Get the first target in the spell area oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc); while (GetIsObjectValid(oTarget)) { if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) { //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SOUND_BURST)); //Make a SR check if(!MyResistSpell(OBJECT_SELF, oTarget)) { //Roll damage nDamage = d8(); //Make a Will roll to avoid being stunned if(!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SONIC)) { ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2)); } //Make meta magic checks if (nMetaMagic == METAMAGIC_MAXIMIZE) { nDamage = 8; } if (nMetaMagic == METAMAGIC_EMPOWER) { nDamage = nDamage + (nDamage/2); } //Set the damage effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_SONIC); //Apply the VFX impact and damage effect ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis,oTarget); ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam,oTarget); } } //Get the next target in the spell area oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc); } }