//:://///////////////////////////////////////////// //:: Dragon Breath Cold //:: NW_S1_DragCold //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Calculates the proper damage and DC Save for the breath weapon based on the HD of the dragon. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: May 9, 2001 //::////////////////////////////////////////////// const string DRAGBREATHLOCK = "DragonBreathLock"; //modified to use the breath include - Fox #include "prc_inc_spells" #include "prc_inc_breath" #include "jw_inc_spells" void main() { // Check the dragon breath delay lock if(GetLocalInt(OBJECT_SELF, DRAGBREATHLOCK)) { SendMessageToPC(OBJECT_SELF, "You cannot use your breath weapon again so soon"); return; } //Declare major variables int nAge = GetHitDice(OBJECT_SELF); int nDCBoost = nAge / 2; int nDamageDice; struct breath ColdBreath; int nDamage, nDC, nDamStrike; float fDelay; object oTarget; effect eVis, eBreath; //custom Xyrothon script begins here effect eVis2; effect eVis3; effect eVis4; if (GetTag(OBJECT_SELF) == "frost_xyrothon") //Xyrothon { nDamage = d6(14); nDC = 36; PRCPlayDragonBattleCry(); //Get first target in spell area oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 14.0, GetSpellTargetLocation(), TRUE); while(GetIsObjectValid(oTarget)) { if(oTarget != OBJECT_SELF && !GetIsReactionTypeFriendly(oTarget)) { fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; //Reset the damage to full nDamStrike = nDamage; //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_DRAGON_BREATH_COLD)); //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_COLD, OBJECT_SELF, fDelay)) { nDamStrike = nDamStrike/2; if(GetHasFeat(FEAT_EVASION, oTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTarget)) { nDamStrike = 0; } } else if(GetHasFeat(FEAT_IMPROVED_EVASION, oTarget)) { nDamStrike = nDamStrike/2; } if (nDamStrike > 0) { //Set Damage and VFX eBreath = EffectDamage(nDamStrike, DAMAGE_TYPE_COLD); eVis = EffectVisualEffect(VFX_IMP_FROST_S); eVis2 = EffectVisualEffect(VFX_DUR_ICESKIN); eVis3 = EffectCutsceneParalyze(); eVis4 = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION); //Determine effect delay //Apply the VFX impact and effects DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); //custom part DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis2, oTarget)); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis3, oTarget)); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis4, oTarget)); } } //Get next target in spell area oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 14.0, GetSpellTargetLocation(), TRUE); } } //custom Xyrothon script ends here //Use the HD of the creature to determine damage and save DC if (nAge <= 6) //Wyrmling { nDamageDice = 1; } else if (nAge >= 7 && nAge <= 9) //Very Young { nDamageDice = 2; } else if (nAge >= 10 && nAge <= 12) //Young { nDamageDice = 3; } else if (nAge >= 13 && nAge <= 15) //Juvenile { nDamageDice = 4; } else if (nAge >= 16 && nAge <= 18) //Young Adult { nDamageDice = 5; } else if (nAge >= 19 && nAge <= 21) //Adult { nDamageDice = 6; } else if (nAge >= 22 && nAge <= 24) //Mature Adult { nDamageDice = 7; } else if (nAge >= 25 && nAge <= 27) //Old { nDamageDice = 8; } else if (nAge >= 28 && nAge <= 30) //Very Old { nDamageDice = 9; } else if (nAge >= 31 && nAge <= 33) //Ancient { nDamageDice = 10; } else if (nAge >= 34 && nAge <= 37) //Wyrm { nDamageDice = 11; } else if (nAge > 37) //Great Wyrm { nDamageDice = 12; } //create the breath - 40' ~ 14m? - should set it based on size later ColdBreath = CreateBreath(OBJECT_SELF, FALSE, 40.0, DAMAGE_TYPE_COLD, 6, nDamageDice, ABILITY_CONSTITUTION, nDCBoost); //Apply the breath PRCPlayDragonBattleCry(); ApplyBreath(ColdBreath, PRCGetSpellTargetLocation()); //Apply the recharge lock SetLocalInt(OBJECT_SELF, DRAGBREATHLOCK, TRUE); // Schedule opening the delay lock fDelay = RoundsToSeconds(ColdBreath.nRoundsUntilRecharge); SendMessageToPC(OBJECT_SELF, "Your breath weapon will be ready again in " + IntToString(ColdBreath.nRoundsUntilRecharge) + " rounds."); DelayCommand(fDelay, DeleteLocalInt(OBJECT_SELF, DRAGBREATHLOCK)); DelayCommand(fDelay, SendMessageToPC(OBJECT_SELF, "Your breath weapon is ready now")); }