Jaysyn904 22947ad4b6 Initial Upload
Initial Upload
2023-08-08 16:22:17 -04:00

54 lines
2.7 KiB
Plaintext

#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
object oTarget;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH);
effect eWeird = EffectVisualEffect(VFX_FNF_WEIRD);
effect eAbyss = EffectVisualEffect(VFX_DUR_ANTI_LIGHT_10);
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
float fDelay = 0.0; // weird is instant
//Apply the FNF VFX impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eWeird, GetSpellTargetLocation());
//Get the first target in the spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetSpellTargetLocation(), TRUE);
while (GetIsObjectValid(oTarget)) {
// make a faction check
if (!GetIsFriend(oTarget)) {
// cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WEIRD));
// make an SR Check
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay)) {
if ((GetHitDice(oTarget) >= 4)
&& MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay)) {
// okay, we're not dead - now apply damage unless we fortsaved too
if (!MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay)) {
int nDamage = d6(3);
// no need for metamagic checks since you can't meta a c9 spell
eDam = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
//Apply VFX Impact and damage effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
} else {
// apply VFX impact and death effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget));
}
}
}
// get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetSpellTargetLocation(), TRUE);
}
}