Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

66 lines
2.3 KiB
Plaintext

///::///////////////////////////////////////////////
//:: Battletide
//:: X2_S0_BattTideA
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
You create an aura that steals energy from your
enemies. Your enemies suffer a -2 circumstance
penalty on saves, attack rolls, and damage rolls,
once entering the aura. On casting, you gain a
+2 circumstance bonus to your saves, attack rolls,
and damage rolls.
*/
//:://////////////////////////////////////////////
//:: Created By: Andrew Nobbs
//:: Created On: Dec 04, 2002
//:://////////////////////////////////////////////
//:: Last Updated By: Andrew Nobbs 06/06/03
#include "NW_I0_SPELLS"
#include "x0_i0_spells"
#include "x2_i0_spells"
#include "x2_inc_spellhook"
void main()
{
//Declare major variables
effect eLink = CreateBadTideEffectsLink();
effect eLink2 = CreateGoodTideEffectsLink();
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID);
effect eFind;
object oTarget = GetEnteringObject();
object oCreator = GetAreaOfEffectCreator();
float fDelay;
//Check faction of spell targets.
if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCreator))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
//Make a SR check
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget))
{
//Make a Fort Save
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
{
fDelay = GetRandomDelay(0.75, 1.75);
//Apply the VFX impact and linked effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget));
}
}
}
else if(oTarget == oCreator)
{
//Apply the VFX impact and linked effects
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink2, oTarget);
}
}