Battledale_PRC8/_removed/nw_s0_silenceb.nss
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
1.9 KiB
Plaintext

///::///////////////////////////////////////////////
//:: Silence: On Exit
//:: NW_S0_SilenceB.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The target is surrounded by a zone of silence
that allows them to move without sound. Spell
casters caught in this area will be unable to cast
spells.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
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_SILENCE, 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_SILENCE)
{
//If the effect was created by the Silence then remove it
if(GetEffectSpellId(eAOE) == SPELL_SILENCE)
{
//AssignAOEDebugString("Removing Effects");
RemoveEffect(oTarget, eAOE);
bValid = TRUE;
}
}
}
//Get next effect on the target
eAOE = GetNextEffect(oTarget);
}
}
}