228 lines
7.7 KiB
Plaintext
228 lines
7.7 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Madi (Healing)
|
|
//:: madi.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Restores all hit points and cures all conditions
|
|
except death for a party member.
|
|
Level 6 Priest spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 6 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: Full heal and cure conditions
|
|
|
|
// 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 and is a party member
|
|
if (GetIsObjectValid(oTarget) && spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))
|
|
{
|
|
// Check if target is dead
|
|
if (GetIsDead(oTarget))
|
|
{
|
|
FloatingTextStringOnCreature("MADI cannot cure death. Use DI or KADORTO instead.", oCaster, TRUE);
|
|
return;
|
|
}
|
|
|
|
// Signal spell cast at event
|
|
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
|
|
|
|
// Create the healing effects
|
|
effect eHeal = PRCEffectHeal(GetMaxHitPoints(oTarget), oTarget); // Full heal
|
|
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_G); // Major healing visual effect
|
|
|
|
// Create the condition removal effects
|
|
effect eRemove;
|
|
|
|
// Remove paralysis
|
|
if (GetHasEffect(EFFECT_TYPE_PARALYZE, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect eParalyze = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eParalyze))
|
|
{
|
|
if (GetEffectType(eParalyze) == EFFECT_TYPE_PARALYZE)
|
|
{
|
|
RemoveEffect(oTarget, eParalyze);
|
|
}
|
|
eParalyze = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_PARALYZED");
|
|
FloatingTextStringOnCreature("Paralysis cured!", oTarget, TRUE);
|
|
}
|
|
|
|
// Remove poison
|
|
if (GetHasEffect(EFFECT_TYPE_POISON, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect ePoison = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(ePoison))
|
|
{
|
|
if (GetEffectType(ePoison) == EFFECT_TYPE_POISON)
|
|
{
|
|
RemoveEffect(oTarget, ePoison);
|
|
}
|
|
ePoison = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_POISONED");
|
|
FloatingTextStringOnCreature("Poison cured!", oTarget, TRUE);
|
|
}
|
|
|
|
// Remove sleep
|
|
if (GetHasEffect(EFFECT_TYPE_SLEEP, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect eSleep = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eSleep))
|
|
{
|
|
if (GetEffectType(eSleep) == EFFECT_TYPE_SLEEP)
|
|
{
|
|
RemoveEffect(oTarget, eSleep);
|
|
}
|
|
eSleep = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_SLEEPING");
|
|
FloatingTextStringOnCreature("Sleep removed!", oTarget, TRUE);
|
|
}
|
|
|
|
// Remove disease
|
|
if (GetHasEffect(EFFECT_TYPE_DISEASE, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect eDisease = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eDisease))
|
|
{
|
|
if (GetEffectType(eDisease) == EFFECT_TYPE_DISEASE)
|
|
{
|
|
RemoveEffect(oTarget, eDisease);
|
|
}
|
|
eDisease = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_DISEASED");
|
|
FloatingTextStringOnCreature("Disease cured!", oTarget, TRUE);
|
|
}
|
|
|
|
// Remove blindness
|
|
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect eBlind = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eBlind))
|
|
{
|
|
if (GetEffectType(eBlind) == EFFECT_TYPE_BLINDNESS)
|
|
{
|
|
RemoveEffect(oTarget, eBlind);
|
|
}
|
|
eBlind = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_BLINDED");
|
|
FloatingTextStringOnCreature("Blindness cured!", oTarget, TRUE);
|
|
}
|
|
|
|
// Remove confusion
|
|
if (GetHasEffect(EFFECT_TYPE_CONFUSED, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect eConfused = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eConfused))
|
|
{
|
|
if (GetEffectType(eConfused) == EFFECT_TYPE_CONFUSED)
|
|
{
|
|
RemoveEffect(oTarget, eConfused);
|
|
}
|
|
eConfused = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_CONFUSED");
|
|
FloatingTextStringOnCreature("Confusion cured!", oTarget, TRUE);
|
|
}
|
|
|
|
// Remove silence
|
|
if (GetHasEffect(EFFECT_TYPE_SILENCE, oTarget))
|
|
{
|
|
eRemove = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRemove, oTarget);
|
|
|
|
// Remove the effect
|
|
effect eSilence = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eSilence))
|
|
{
|
|
if (GetEffectType(eSilence) == EFFECT_TYPE_SILENCE)
|
|
{
|
|
RemoveEffect(oTarget, eSilence);
|
|
}
|
|
eSilence = GetNextEffect(oTarget);
|
|
}
|
|
|
|
// Remove the flag
|
|
DeleteLocalInt(oTarget, "CONDITION_SILENCED");
|
|
FloatingTextStringOnCreature("Silence removed!", oTarget, TRUE);
|
|
}
|
|
|
|
// Apply the healing effects last
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
|
|
|
|
// Notify the caster
|
|
FloatingTextStringOnCreature("MADI: " + GetName(oTarget) + " fully healed and cured!", oCaster, TRUE);
|
|
}
|
|
else
|
|
{
|
|
// Notify if no valid target
|
|
FloatingTextStringOnCreature("MADI: No valid target found", oCaster, TRUE);
|
|
}
|
|
|
|
// Clean up spell school variable
|
|
PRCSetSchool();
|
|
} |