2025-04-26 15:20:45 -04:00

94 lines
3.2 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
//:://////////////////////////////////////////////
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Full heal and cure conditions
// 1. Get caster information
object oCaster = OBJECT_SELF;
// 2. Get the target
object oTarget = GetSpellTargetObject();
if (!GetIsObjectValid(oTarget))
{
// If no specific target, target self
oTarget = oCaster;
}
// 3. Check if target is valid and is a party member
if (GetIsObjectValid(oTarget) && !GetIsEnemy(oTarget, oCaster))
{
// Check if target is dead
if (GetLocalInt(oTarget, "CONDITION_DEAD") == 1)
{
FloatingTextStringOnCreature("MADI cannot cure death. Use DI or KADORTO instead.", oCaster, TRUE);
return;
}
// 4. Create the healing effects
effect eHeal = EffectHeal(GetMaxHitPoints(oTarget)); // Full heal
effect eVis = EffectVisualEffect(14); // Healing visual effect
// 5. Apply healing
// Signal spell cast at event
SignalEvent(oTarget, EventSpellCastAt(oCaster, 17, FALSE)); // Heal spell ID
// Apply the visual and healing effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
// 6. Cure conditions
// Remove paralysis
if (GetLocalInt(oTarget, "CONDITION_PARALYZED") == 1)
{
DeleteLocalInt(oTarget, "CONDITION_PARALYZED");
FloatingTextStringOnCreature("Paralysis cured!", oTarget, TRUE);
}
// Remove poison
if (GetLocalInt(oTarget, "CONDITION_POISONED") == 1)
{
DeleteLocalInt(oTarget, "CONDITION_POISONED");
FloatingTextStringOnCreature("Poison cured!", oTarget, TRUE);
}
// Remove sleep
if (GetLocalInt(oTarget, "CONDITION_SLEEPING") == 1)
{
DeleteLocalInt(oTarget, "CONDITION_SLEEPING");
FloatingTextStringOnCreature("Sleep removed!", oTarget, TRUE);
}
// Remove any other negative conditions
DeleteLocalInt(oTarget, "CONDITION_SILENCED");
DeleteLocalInt(oTarget, "CONDITION_BLINDED");
DeleteLocalInt(oTarget, "CONDITION_CONFUSED");
DeleteLocalInt(oTarget, "CONDITION_DISEASED");
// 7. 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);
}
}