//:://///////////////////////////////////////////// //:: 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 //:: altered by mr_bumpkin Dec 4, 2003 for prc stuff #include "prc_inc_spells" #include "prc_add_spell_dc" void main() { DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); //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; } int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator()); object oTarget = GetFirstInPersistentObject(); while(GetIsObjectValid(oTarget)) { // SpawnScriptDebugger(); if(!GetHasFeat(FEAT_WOODLAND_STRIDE, oTarget) &&(GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) != TRUE) ) { 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(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr)) { int nDC = PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()); //Make reflex save int n = PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, (nDC),SAVING_THROW_TYPE_NONE,GetAreaOfEffectCreator() ); if(n == 0) { //Apply linked effects SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2),FALSE); } } } } } //Get next target in the AOE oTarget = GetNextInPersistentObject(); } DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); // Erasing the variable used to store the spell's spell school }