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

152 lines
6.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Regenerate
//:: NW_S0_Regen
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Grants the selected target 6 HP of regeneration
every round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 22, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
#include "x0_i0_spells"
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();
// Activating Tarashon's unique regenerate spell system for "Alangara - New Dawn" !
int nHP;
nHP = 3;
// *** Setting the various class modifications to all healing *** //
// * SINGLE CLASS Fighters gain +6 *
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 )
{
nHP = 6;
}
// * SINGLE CLASS Barbarians gain +5 *
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 )
{
nHP = 8;
}
// * Any character having Barbarian levels gain +3 *
else if ( GetLevelByClass(CLASS_TYPE_BARBARIAN, oTarget) > 0 )
{
nHP = 5;
}
// * Any character having Fighter levels gain +3 *
else if ( GetLevelByClass(CLASS_TYPE_FIGHTER, oTarget) > 0 )
{
nHP = 5;
}
// * Any character having Ranger or Paladin levels get +2. *
else if ( GetLevelByClass(CLASS_TYPE_RANGER, oTarget) > 0 ||
GetLevelByClass(CLASS_TYPE_PALADIN, oTarget) > 0 )
{
nHP = 4;
}
// *** End of Tarashon's regenerate system modifiers *** //
effect eRegen = EffectRegenerate(nHP,6.0);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_NATURE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eRegen, eDur);
int nMeta = GetMetaMagicFeat();
int nLevel = GetCasterLevel(OBJECT_SELF);
//Meta-Magic Checks
if (nMeta == METAMAGIC_EXTEND)
{
nLevel *= 2;
}
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_REGENERATE, FALSE));
// Prevent stacking - seeker 17/6/05
RemoveEffectsFromSpell(oTarget, GetSpellId());
//Apply effects and VFX
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nLevel));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}