///:://///////////////////////////////////////////// //:: Invisibility Sphere: On Exit //:: NW_S0_InvSphA.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* All allies within 15ft are rendered invisible. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Jan 7, 2002 //::////////////////////////////////////////////// #include "x2_inc_spellhook" void main() { /* Spellcast Hook Code Added 2003-06-23 by GeorgZ If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more */ if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell return; } // End of Spell Cast Hook //Declare major variables //Get the object that is exiting the AOE object oTarget = GetExitingObject(); int bValid = FALSE; effect eAOE; if(GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oTarget)) { //Search through the valid effects on the target. eAOE = GetFirstEffect(oTarget); while (GetIsEffectValid(eAOE) && bValid == FALSE) { if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator()) { if(GetEffectType(eAOE) == EFFECT_TYPE_INVISIBILITY) { //If the effect was created by the Invisibility Sphere then remove it if(GetEffectSpellId(eAOE) == SPELL_INVISIBILITY_SPHERE) { RemoveEffect(oTarget, eAOE); bValid = TRUE; } } } //Get next effect on the target eAOE = GetNextEffect(oTarget); } } }