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

206 lines
8.7 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Mass Heal
//:: [NW_S0_MasHeal.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Heals all friendly targets within 10ft to full
//:: unless they are undead.
//:: If undead they reduced to 1d4 HP.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
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
effect eKill;
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eHeal;
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_G);
effect eStrike = EffectVisualEffect(VFX_FNF_LOS_HOLY_10);
int nTouch, nModify, nDamage, nHeal;
int nMetaMagic = GetMetaMagicFeat();
int nCasterLvl = ( GetCasterLevel(OBJECT_SELF)*20)+100; // by tarashon
float fDelay;
location lLoc = GetSpellTargetLocation();
//Apply VFX area impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, lLoc);
//Get first target in spell area
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc);
while(GetIsObjectValid(oTarget))
{
fDelay = GetRandomDelay();
//Check to see if the target is an undead
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD && !GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MASS_HEAL));
//Make a touch attack
nTouch = TouchAttackRanged(oTarget);
if (nTouch > 0)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Make an SR check
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Roll damage
nModify = d4();
//make metamagic check
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nModify = 1;
}
//Detemine the damage to inflict to the undead
nDamage = nCasterLvl/2;
// nDamage = GetCurrentHitPoints(oTarget) - nModify;
//Set the damage effect
eKill = EffectDamage(nDamage, DAMAGE_TYPE_POSITIVE);
//Apply the VFX impact and damage effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
}
else
{
//Make a faction check
if(GetIsFriend(oTarget) && GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MASS_HEAL, FALSE));
//Determine amount to heal
// Activating Tarashon's unique healing system for "Alangara - New Dawn" !
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 *** //
// nHeal = GetMaxHitPoints(oTarget);
//Set the damage effect
eHeal = EffectHeal(nHeal);
//Apply the VFX impact and heal effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
//Get next target in the spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc);
}
}