//:://///////////////////////////////////////////// //:: Howl: Daze //:: NW_S1_HowlDaze //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* A howl emanates from the creature which affects all within 10ft unless they make a save. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: May 14, 2000 //::////////////////////////////////////////////// #include "NW_I0_SPELLS" #include "jw_inc_spells" #include "prc_inc_spells" void bombard(object oTarget) { object oRock; int nIdx; int nDamage; location lLoc=GetLocation(oTarget); for (nIdx=1;nIdx<=3;nIdx++) { oRock=CreateObject(OBJECT_TYPE_PLACEABLE,"jw_smash_boulder",lLoc,TRUE); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(TRUE,FALSE),oRock); if (!ScrollResist(OBJECT_SELF, oTarget)) { nDamage=d8(4); if (ReflexSave(oTarget,22,SAVING_THROW_TYPE_SPELL)!=0) { nDamage=nDamage/2; } ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(nDamage,DAMAGE_TYPE_BLUDGEONING,DAMAGE_POWER_PLUS_FOUR),oTarget); AssignCommand(oTarget,PlayVoiceChat(VOICE_CHAT_PAIN2)); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_HEAD_NATURE),oTarget); } } } void earthhowl() { //Declare major variables effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND); float fDelay; ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); //Get first target in spell area object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); while(GetIsObjectValid(oTarget)) { if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != OBJECT_SELF) { SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_HOWL_DEATH)); fDelay = GetDistanceToObject(oTarget)/10; //Make a saving throw check //Apply the VFX impact and effects DelayCommand(fDelay, bombard(oTarget)); } //Get next target in spell area oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); } } void revenhowl() { effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_ODD); //DEBUG PlayVoiceChat(VOICE_CHAT_THREATEN); float fDelay; ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); //Get first target in spell area object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 30.0, GetLocation(OBJECT_SELF),FALSE,OBJECT_TYPE_PLACEABLE); while(GetIsObjectValid(oTarget)) { if(GetTag(oTarget)=="jw_und_spear") { fDelay = GetDistanceToObject(oTarget)/10; //Make a saving throw check DelayCommand(fDelay, SignalEvent(oTarget,EventUserDefined(50))); //DelayCommand(fDelay, CreateObject(OBJECT_TYPE_CREATURE,"jw_und_spear_sk",lLoc)); } //Get next target in spell area oTarget = GetNextObjectInShape(SHAPE_SPHERE, 30.0, GetLocation(OBJECT_SELF),FALSE,OBJECT_TYPE_PLACEABLE); } } void main() { if (GetTag(OBJECT_SELF)=="jw_revenancer") { revenhowl(); return; } if (GetTag(OBJECT_SELF)=="jw_earth_nasty") { earthhowl(); return; } //Declare major variables effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S); effect eHowl = EffectDazed(); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND); effect eLink = EffectLinkEffects(eHowl, eDur); eLink = EffectLinkEffects(eLink, eDur2); float fDelay; int nHD = GetHitDice(OBJECT_SELF); int nDC = 10 + (nHD/4); int nDuration = 1 + (nHD/4); ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); //Get first target in spell area object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); while(GetIsObjectValid(oTarget)) { if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != OBJECT_SELF) { nDuration = GetScaledDuration(nDuration , oTarget); //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_HOWL_DAZE)); fDelay = GetDistanceToObject(oTarget)/10; //Make a saving throw check if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay)) { //Apply the VFX impact and effects DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration))); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } //Get next target in spell area oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); } }