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

218 lines
9.4 KiB
Plaintext

// ALANGARA CHANGE - max level is now 40
// - Range is colossal
// - Heal per level is *6 ( ie max 240 + 8 )
// - Ja Seeker det er mig Tarashon der har fedtet med spellen, haha :)
//::///////////////////////////////////////////////
//:: Healing Circle
//:: NW_S0_HealCirc
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// Positive energy spreads out in all directions
// from the point of origin, curing 1d8 points of
// damage plus 1 point per caster level (maximum +20)
// to nearby living allies.
//
// Like cure spells, healing circle damages undead in
// its area rather than curing them.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18,2000
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: Aug 1, 2001
#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
object oTarget;
int nCasterLvl = (GetCasterLevel(OBJECT_SELF)*6)+50;
int nDamagen, nModify, nHP;
int nMetaMagic = GetMetaMagicFeat();
effect eKill;
effect eHeal;
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_20);
float fDelay;
//Limit caster level
if (nCasterLvl > 240)
{
nCasterLvl = 240;
}
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
//Get first target in shape
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetSpellTargetLocation());
while (GetIsObjectValid(oTarget))
{
fDelay = GetRandomDelay();
//Check if racial type is undead
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD )
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE));
//Make SR check
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
nModify = d8() + nCasterLvl;
//Make metamagic check
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nModify = 8 + nCasterLvl;
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nModify = nModify + (nModify/2); //Damage/Healing is +50%
}
//Make Fort save
if (MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
nModify /= 2;
}
//Set damage effect
eKill = EffectDamage(nModify, DAMAGE_TYPE_POSITIVE);
//Apply damage effect and VFX impact
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
else
{
// * May 2003: Heal Neutrals as well
if(!GetIsReactionTypeHostile(oTarget) || GetFactionEqual(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE, FALSE));
nHP = d8() + nCasterLvl;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nHP = nCasterLvl;//Damage is the same
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nHP = nCasterLvl; //Damage/Healing is the same
}
//Set healing effect
// Activating Tarashon uniqe healing system for Alangara - New Dawn !
// *** 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 )
{
nHP = (nHP*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 )
{
nHP = (nHP*1500)/1000;
}
// * Any character having Barbarian levels gain + 20 % healing *
else if ( GetLevelByClass(CLASS_TYPE_BARBARIAN, oTarget) > 0 )
{
nHP = (nHP*1200)/1000;
}
// * Any character having Fighter levels gain + 15 % healing *
else if ( GetLevelByClass(CLASS_TYPE_FIGHTER, oTarget) > 0 )
{
nHP = (nHP*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 )
{
nHP = (nHP*1100)/1000;
}
// *** End of Tarashons healing system modifiers *** //
eHeal = EffectHeal(nHP);
//Apply heal effect and VFX impact
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
//Get next target in the shape
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetSpellTargetLocation());
}
}