HoS_PRC8/_mod/_removed/x0_s0_elecjolt.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

67 lines
1.7 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Electric Jolt
//:: [x0_s0_ElecJolt.nss]
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
1d3 points of electrical damage to one target.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: July 17 2002
//:://////////////////////////////////////////////
#include "X0_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 = GetSpellTargetObject();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ELECTRIC_JOLT));
//Make SR Check
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
//Set damage effect
effect eBad = EffectDamage(MaximizeOrEmpower(3, 1, GetMetaMagicFeat()), DAMAGE_TYPE_ELECTRICAL);
//Apply the VFX impact and damage effect
if (GetTag(oTarget)=="cfleshgolem")
{ // heal
eBad=EffectHeal(MaximizeOrEmpower(3, 1, GetMetaMagicFeat()));
} // heal
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBad, oTarget);
}
}
}