WizardryEE/Content/spells/latumofis.nss
2025-04-30 12:23:15 -04:00

91 lines
2.8 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Latumofis (Cure Poison)
//:: latumofis.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Cures poison for a party member.
Level 4 Priest spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 4 Priest healing spell that targets
one character.
*/
//:://////////////////////////////////////////////
//:: 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: Cure poison
// Spellcast Hook Code
if (!X2PreSpellCastCode()) return;
// Set spell school for proper record keeping
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
// Declare major variables
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nCasterLevel = PRCGetCasterLevel(oCaster);
// Check if target is valid
if (!GetIsObjectValid(oTarget))
{
// If no specific target, target self
oTarget = oCaster;
}
// Check if target is valid and is a party member
if (GetIsObjectValid(oTarget) && spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))
{
// Signal spell cast at event
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
// Create the visual effects
effect eVis = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
// Check if target is poisoned
if (GetHasEffect(EFFECT_TYPE_POISON, oTarget) || GetLocalInt(oTarget, "CONDITION_POISONED") == 1)
{
// Remove poison effects
effect ePoison = GetFirstEffect(oTarget);
while (GetIsEffectValid(ePoison))
{
if (GetEffectType(ePoison) == EFFECT_TYPE_POISON)
{
RemoveEffect(oTarget, ePoison);
}
ePoison = GetNextEffect(oTarget);
}
// Remove the poison condition flag
DeleteLocalInt(oTarget, "CONDITION_POISONED");
// Apply the visual effect
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
// Notify the caster
FloatingTextStringOnCreature("LATUMOFIS: Cured poison for " + GetName(oTarget), oCaster, TRUE);
}
else
{
// Notify if target is not poisoned
FloatingTextStringOnCreature(GetName(oTarget) + " is not poisoned.", oCaster, TRUE);
}
}
else
{
// Notify if no valid target
FloatingTextStringOnCreature("LATUMOFIS: No valid target found", oCaster, TRUE);
}
// Clean up spell school variable
PRCSetSchool();
}