73 lines
2.4 KiB
Plaintext
73 lines
2.4 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Dirge: Heartbeat
|
||
|
//:: jw_dirge_aoe
|
||
|
//::
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Creates an AOE that removes the strength of the enemnies
|
||
|
of the caster over a 30ft radius around the caster
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Preston Watamaniuk
|
||
|
//:: Created On: Nov 8, 2001
|
||
|
//:://////////////////////////////////////////////
|
||
|
|
||
|
#include "NW_I0_SPELLS"
|
||
|
#include "jw_inc_spells"
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
//Declare major variables
|
||
|
effect eStr=EffectAbilityDecrease(ABILITY_STRENGTH,2);
|
||
|
effect eDex=EffectAbilityDecrease(ABILITY_DEXTERITY,2);
|
||
|
effect eVis=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
|
||
|
effect eLink = EffectLinkEffects(eStr, eDex);
|
||
|
eLink = EffectLinkEffects(eVis, eLink);
|
||
|
effect eHit=EffectVisualEffect(VFX_IMP_HEAD_ODD);
|
||
|
object oCaster=GetObjectByTag("PR_Zacharias");
|
||
|
|
||
|
//debug
|
||
|
object oCreator=GetAreaOfEffectCreator();
|
||
|
//AssignCommand(oCreator,SpeakString("I am the creator"));
|
||
|
|
||
|
|
||
|
float fDelay;
|
||
|
//Get first target in spell area
|
||
|
object oTarget = GetFirstInPersistentObject();
|
||
|
while(GetIsObjectValid(oTarget))
|
||
|
{
|
||
|
|
||
|
if((!GetIsFriend(oTarget, oCreator))&&(oTarget!=oCreator))
|
||
|
{
|
||
|
//Fire cast spell at event for the specified target
|
||
|
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_STORM_OF_VENGEANCE));
|
||
|
//Make an SR Check
|
||
|
fDelay = GetRandomDelay(0.5, 2.0);
|
||
|
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHit, oTarget));
|
||
|
if(!ScrollResist(GetAreaOfEffectCreator(), oTarget, fDelay))
|
||
|
{
|
||
|
|
||
|
//AssignCommand(oTarget,SpeakString("Resist failed"));
|
||
|
//Make a saving throw check
|
||
|
if(WillSave(oTarget, 22, SAVING_THROW_TYPE_CHAOS, oCaster) == 0)
|
||
|
{
|
||
|
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(5)));
|
||
|
//signCommand(oTarget,SpeakString("Save failed"));
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
//signCommand(oTarget,SpeakString("Save passed"));
|
||
|
}
|
||
|
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
|
||
|
//signCommand(oTarget,SpeakString("resist passed"));
|
||
|
}
|
||
|
}
|
||
|
//Get next target in spell area
|
||
|
oTarget = GetNextInPersistentObject();
|
||
|
}
|
||
|
}
|