78 lines
2.3 KiB
Plaintext
78 lines
2.3 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()
|
||
|
{
|
||
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||
|
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||
|
|
||
|
/*
|
||
|
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 oCaster = OBJECT_SELF;
|
||
|
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||
|
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, OBJECT_SELF))
|
||
|
{
|
||
|
//Fire cast spell at event for the specified target
|
||
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CURE_LIGHT_WOUNDS, FALSE));
|
||
|
|
||
|
//Roll healing
|
||
|
nHeal = d8(1);
|
||
|
|
||
|
//Resolve metamagic
|
||
|
if (nMetaMagic & METAMAGIC_MAXIMIZE)
|
||
|
{
|
||
|
nHeal = 8;
|
||
|
}
|
||
|
if (nMetaMagic & METAMAGIC_EMPOWER)
|
||
|
{
|
||
|
nHeal = nHeal + (nHeal / 2);
|
||
|
}
|
||
|
|
||
|
//Set the healing effect
|
||
|
eHeal = EffectHeal(nHeal);
|
||
|
|
||
|
//Apply the VFX impact and healing effect
|
||
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
|
||
|
}
|
||
|
|
||
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||
|
// Getting rid of the local integer storing the spellschool name
|
||
|
}
|