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

70 lines
2.4 KiB
Plaintext

////::///////////////////////////////////////////////
//:: Vine Mine, Entangle C
//:: X2_S0_VineMEntC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the AOE the target must make
a reflex save or be entangled by vegitation
*/
//:://////////////////////////////////////////////
//:: Created By: Andrew Nobbs
//:: Created On: Nov 25, 2002
//::///////////////////////////////////////////////
//:: Last Updated By: Georg Zoeller, 14/08/2003
#include "NW_I0_SPELLS"
#include "x0_i0_spells"
void main()
{
//Declare major variables
effect eHold = EffectEntangle();
effect eEntangle = EffectVisualEffect(VFX_DUR_ENTANGLE);
//Link Entangle and Hold effects
effect eLink = EffectLinkEffects(eHold, eEntangle);
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
object oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget))
{ // SpawnScriptDebugger();
if(!GetHasFeat(FEAT_WOODLAND_STRIDE, oTarget) )
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), 529));
//Make SR check
if(!GetHasSpellEffect(SPELL_ENTANGLE, oTarget))
{
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget))
{
//Make reflex save
int n = MySavingThrow(SAVING_THROW_REFLEX, oTarget, GetSpellSaveDC(),SAVING_THROW_TYPE_NONE,GetAreaOfEffectCreator() );
if(n == 0)
{
//Apply linked effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2));
}
}
}
}
}
//Get next target in the AOE
oTarget = GetNextInPersistentObject();
}
}