2025-04-30 12:23:15 -04:00

83 lines
2.5 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Dios (Heal)
//:: dios.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Restores 1d8 (1-8) hit points to a party member.
Level 1 Priest spell.
*/
//:://////////////////////////////////////////////
//:: Created By: WizardryEE Project
//:: Created On: April 26, 2025
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Heal 1d8 hit points
// Spellcast Hook Code
if (!X2PreSpellCastCode()) return;
// Set spell school for proper record keeping
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
// Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLevel = PRCGetCasterLevel(oCaster);
int nMetaMagic = PRCGetMetaMagicFeat();
int nHeal;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_S);
effect eHeal;
// Get the spell target
object oTarget = PRCGetSpellTargetObject();
// Verify the target is a friendly creature
if (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))
{
// Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
// Roll healing
nHeal = d8(1);
// Resolve metamagic
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nHeal = 8; // Maximum healing
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nHeal = nHeal + (nHeal / 2); // +50% healing
}
// Apply bonus healing if the caster has Augment Healing feat
if (GetHasFeat(FEAT_AUGMENT_HEALING, oCaster))
{
nHeal += 2; // +2 per spell level (level 1)
}
// Set the healing effect
eHeal = PRCEffectHeal(nHeal, oTarget);
// Apply the VFX impact and healing effect
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
// Notify the caster
FloatingTextStringOnCreature("DIOS: " + IntToString(nHeal) + " hit points restored to " + GetName(oTarget), oCaster, TRUE);
}
else
{
// Notify if no valid target
FloatingTextStringOnCreature("DIOS: No valid target found", oCaster, TRUE);
}
// Clean up spell school variable
PRCSetSchool();
}