Alangara_PRC8/_removed/NW_S0_GRRESTORE.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

192 lines
8.4 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Greater Restoration
//:: NW_S0_GrRestore.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Removes all negative effects of a temporary nature
and all permanent effects of a supernatural nature
from the character. Does not remove the effects
relating to Mind-Affecting spells or movement alteration.
Heals target for 5d8 + 1 point per caster level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 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_GREATER);
int nCasterLvl = ( GetCasterLevel(OBJECT_SELF)*20)+100;
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_CURSE ||
GetEffectType(eBad) == EFFECT_TYPE_DISEASE ||
GetEffectType(eBad) == EFFECT_TYPE_POISON ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_CHARMED ||
GetEffectType(eBad) == EFFECT_TYPE_DOMINATED ||
GetEffectType(eBad) == EFFECT_TYPE_DAZED ||
GetEffectType(eBad) == EFFECT_TYPE_CONFUSED ||
GetEffectType(eBad) == EFFECT_TYPE_FRIGHTENED ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_SLOW ||
GetEffectType(eBad) == EFFECT_TYPE_STUNNED)
{
//Remove effect if it is negative.
if(!GetIsSupernaturalCurse(eBad))
RemoveEffect(oTarget, eBad);
}
eBad = GetNextEffect(oTarget);
}
if(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Apply the VFX impact and effects
// int nHeal = GetMaxHitPoints(oTarget) - GetCurrentHitPoints(oTarget);
// Activating Tarashon's unique healing system for "Alangara - New Dawn" !
int nHeal = nCasterLvl;
// *** Setting the various class modifications to all healing *** //
// * SINGLE CLASS Fighters gain + 30 % healing *
if ( GetLevelByClass(CLASS_TYPE_BARBARIAN, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_BARD, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_CLERIC, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_MONK, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_PALADIN, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_ROGUE, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_SORCERER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_WIZARD, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_ASSASSIN, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_BLACKGUARD, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DIVINE_CHAMPION, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DWARVEN_DEFENDER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_HARPER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_PALE_MASTER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_PURPLE_DRAGON_KNIGHT, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DRAGON_DISCIPLE, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_SHIFTER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_WEAPON_MASTER, oTarget) == 0 )
{
nHeal = (nHeal*1300)/1000;
}
// * SINGLE CLASS Barbarians gain + 50 % healing *
else if ( GetLevelByClass(CLASS_TYPE_FIGHTER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_BARD, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_CLERIC, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_MONK, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_PALADIN, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_ROGUE, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_SORCERER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_WIZARD, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_ASSASSIN, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_BLACKGUARD, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DIVINE_CHAMPION, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DWARVEN_DEFENDER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_HARPER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_PALE_MASTER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_PURPLE_DRAGON_KNIGHT, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_DRAGON_DISCIPLE, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_SHIFTER, oTarget) == 0 &&
GetLevelByClass(CLASS_TYPE_WEAPON_MASTER, oTarget) == 0 )
{
nHeal = (nHeal*1500)/1000;
}
// * Any character having Barbarian levels gain + 20 % healing *
else if ( GetLevelByClass(CLASS_TYPE_BARBARIAN, oTarget) > 0 )
{
nHeal = (nHeal*1200)/1000;
}
// * Any character having Fighter levels gain + 15 % healing *
else if ( GetLevelByClass(CLASS_TYPE_FIGHTER, oTarget) > 0 )
{
nHeal = (nHeal*1150)/1000;
}
// * Any character having Ranger or Paladin levels get + 10% healing. *
else if ( GetLevelByClass(CLASS_TYPE_RANGER, oTarget) > 0 ||
GetLevelByClass(CLASS_TYPE_PALADIN, oTarget) > 0 )
{
nHeal = (nHeal*1100)/1000;
}
// *** End of Tarashons healing system modifiers *** //
effect eHeal = EffectHeal(nHeal);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GREATER_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;
}