Initial commit
Initial commit
This commit is contained in:
89
_removed/nw_s0_restore.nss
Normal file
89
_removed/nw_s0_restore.nss
Normal file
@@ -0,0 +1,89 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Restoration
|
||||
//:: NW_S0_Restore.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Removes all negative effects unless they come
|
||||
from Poison, Disease or Curses.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 22, 2001
|
||||
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
// return TRUE if the effect created by a supernatural force and can't be dispelled by spells
|
||||
int GetIsSupernaturalCurse(effect eEff);
|
||||
|
||||
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
|
||||
object oTarget = GetSpellTargetObject();
|
||||
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
|
||||
int bValid;
|
||||
|
||||
effect eBad = GetFirstEffect(oTarget);
|
||||
//Search for negative effects
|
||||
while(GetIsEffectValid(eBad))
|
||||
{
|
||||
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
|
||||
{
|
||||
//Remove effect if it is negative.
|
||||
if(!GetIsSupernaturalCurse(eBad))
|
||||
{
|
||||
RemoveEffect(oTarget, eBad);
|
||||
}
|
||||
effect eLevelDrain = SupernaturalEffect(EffectNegativeLevel(1));
|
||||
if(GetLocalInt(oTarget,"LevelDrain")==1)
|
||||
{
|
||||
RemoveEffect(oTarget, eLevelDrain);
|
||||
SetLocalInt(oTarget,"LevelDrain", 0);
|
||||
}
|
||||
}
|
||||
eBad = GetNextEffect(oTarget);
|
||||
}
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
|
||||
}
|
||||
|
||||
int GetIsSupernaturalCurse(effect eEff)
|
||||
{
|
||||
object oCreator = GetEffectCreator(eEff);
|
||||
if(GetTag(oCreator) == "q6e_ShaorisFellTemple")
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
Reference in New Issue
Block a user