104 lines
3.1 KiB
Plaintext
104 lines
3.1 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Dialko (Softness)
|
|
//:: dialko.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Cures paralysis and sleep for a party member.
|
|
Level 3 Priest spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 3 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 paralysis and sleep
|
|
|
|
// 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();
|
|
|
|
// Create the visual effect
|
|
effect eVis = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
|
|
// Check if target is valid
|
|
if (GetIsObjectValid(oTarget))
|
|
{
|
|
// Signal spell cast at event
|
|
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
|
|
|
|
// Check for sleep and paralysis effects
|
|
int bCured = FALSE;
|
|
|
|
// Remove sleep effects
|
|
if (GetHasEffect(EFFECT_TYPE_SLEEP, oTarget))
|
|
{
|
|
// Remove sleep effect
|
|
effect eSleep = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eSleep))
|
|
{
|
|
if (GetEffectType(eSleep) == EFFECT_TYPE_SLEEP)
|
|
{
|
|
RemoveEffect(oTarget, eSleep);
|
|
bCured = TRUE;
|
|
}
|
|
eSleep = GetNextEffect(oTarget);
|
|
}
|
|
}
|
|
|
|
// Remove paralysis effects
|
|
if (GetHasEffect(EFFECT_TYPE_PARALYZE, oTarget))
|
|
{
|
|
// Remove paralysis effect
|
|
effect eParalyze = GetFirstEffect(oTarget);
|
|
while (GetIsEffectValid(eParalyze))
|
|
{
|
|
if (GetEffectType(eParalyze) == EFFECT_TYPE_PARALYZE)
|
|
{
|
|
RemoveEffect(oTarget, eParalyze);
|
|
bCured = TRUE;
|
|
}
|
|
eParalyze = GetNextEffect(oTarget);
|
|
}
|
|
}
|
|
|
|
// Apply visual effect if any conditions were cured
|
|
if (bCured)
|
|
{
|
|
// Apply the visual healing effect
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
|
|
// Notify success
|
|
FloatingTextStringOnCreature("DIALKO: " + GetName(oTarget) + " is cured of paralysis and sleep!", oCaster, TRUE);
|
|
}
|
|
else
|
|
{
|
|
// Notify that target is not affected
|
|
FloatingTextStringOnCreature("DIALKO: " + GetName(oTarget) + " is not affected by paralysis or sleep.", oCaster, TRUE);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// Notify if no valid target
|
|
FloatingTextStringOnCreature("DIALKO: No valid target found", oCaster, TRUE);
|
|
}
|
|
|
|
// Clean up spell school variable
|
|
PRCSetSchool();
|
|
} |