Spell & Ability Upgrade
Reorganized hak files & removed duplicates. Added @rafhot's PRC spell & ability level scaling expansion. Further script integration. Full compile.
This commit is contained in:
75
_haks/poa_exp_abilities/nw_s1_conesonic.nss
Normal file
75
_haks/poa_exp_abilities/nw_s1_conesonic.nss
Normal file
@@ -0,0 +1,75 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Cone: Sonic
|
||||
//:: NW_S1_ConeSonic
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
A cone of damage eminated from the monster. Does
|
||||
a set amount of damage based upon the creatures HD
|
||||
and can be halved with a Reflex Save.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 11, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
#include "NW_I0_SPELLS"
|
||||
//#include "wm_include"
|
||||
|
||||
void main()
|
||||
{
|
||||
//if (WildMagicOverride()) { return; }
|
||||
|
||||
//:: Declare major variables
|
||||
object oNPC = OBJECT_SELF;
|
||||
object oTarget;
|
||||
|
||||
int nHD = GetHitDice(oNPC);
|
||||
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
|
||||
int nDC = 10 +nCHAMod+ (nHD/2);
|
||||
int nDamage;
|
||||
int nLoop = nHD / 3;
|
||||
|
||||
float fDelay;
|
||||
|
||||
if(nLoop == 0)
|
||||
{
|
||||
nLoop = 1;
|
||||
}
|
||||
|
||||
//Calculate the damage
|
||||
for (nLoop; nLoop > 0; nLoop--)
|
||||
{
|
||||
nDamage = nDamage + d6(2);
|
||||
}
|
||||
location lTargetLocation = GetSpellTargetLocation();
|
||||
|
||||
effect eCone;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
|
||||
|
||||
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
|
||||
//Get first target in spell area
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_SONIC));
|
||||
//Determine effect delay
|
||||
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
|
||||
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,DAMAGE_TYPE_SONIC);
|
||||
//Set damage effect
|
||||
eCone = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
//Apply the VFX impact and effects
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
|
||||
}
|
||||
}
|
||||
//Get next target in spell area
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user