Files
PRC8/nwn/nwnprc/trunk/users/Jaysyn/future spells/pg_s0_larldrain.nss
Jaysyn904 f7d00cf6f8 2025/12/04 Update
Added Intrinsic Armor builder's feat to prevent any Disarming.
Added Intrinsic Weapon builder's feat to prevent Ruin Armor.
GetEpicSorcerer() should allow racial hit dice casters.
Enlarge / Reduce Person now stores object's original scale.
Added prc_inc_size for the above changes.
Updated PRC8 version.
Reverted Vow of Poverty to use PRC event system.
Reverted Forsaker to use PRC event system.
Updated Spell Cancel NUI to not show "system" spells @Rakiov)
Added notes on instanced Maze system.
Organized notes.
2025-12-04 18:44:36 -05:00

65 lines
2.0 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Sihlbrane's Grove
//:: Larloch's Minor Drain
//:: 00_S0_LARLDRAIN
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Yaballa
//:: Created On: 7/9/2003
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "pg_spell_CONST"
#include "x2_inc_spellhook"
#include "prc_inc_spells"
void main()
{
/*
Spellcast Hook Code
Added 2003-07-07 by Georg Zoeller
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
object oTarget = PRCGetSpellTargetObject();
int nMetaMagic = PRCGetMetaMagicFeat();
int nDamage = d4();
if(nMetaMagic == METAMAGIC_MAXIMIZE) {
nDamage = 4; }
else if(nMetaMagic == METAMAGIC_EMPOWER) {
nDamage = nDamage + (nDamage/2); }
effect eHeal = EffectTemporaryHitpoints(nDamage);
effect eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
if(!GetIsReactionTypeFriendly(oTarget))
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_LARLOCHS_MINOR_DRAIN));
if(!PRCDoResistSpell(OBJECT_SELF, oTarget, 1))
{
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
DelayCommand(1.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(1.0f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHeal, OBJECT_SELF, HoursToSeconds(1)));
DelayCommand(1.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEAD_EVIL), oTarget));
DelayCommand(1.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEAD_HEAL), OBJECT_SELF));
}
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7f);
}