56 lines
2.0 KiB
Plaintext
Raw Normal View History

//::///////////////////////////////////////////////
//:: Matu (Blessing)
//:: matu.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Reduces the armor class of all party members by 2
for the duration of the combat.
Level 2 Priest spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 2 Priest support spell that targets
the entire party.
*/
//:://////////////////////////////////////////////
//:: Created By: WizardryEE Project
//:: Created On: April 26, 2025
//:://////////////////////////////////////////////
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Reduce AC of all party members by 2
// 1. Get caster information
object oCaster = OBJECT_SELF;
// 2. Calculate duration (based on caster level)
int nCasterLevel = GetLevelByClass(CLASS_TYPE_CLERIC, oCaster);
if (nCasterLevel < 1) nCasterLevel = 2; // Minimum level 2 for this spell
float fDuration = RoundsToSeconds(nCasterLevel); // Lasts for rounds equal to caster level
// 3. Create the AC reduction effect
effect eAC = EffectACDecrease(2); // Reduce AC by 2 (lower AC is better)
effect eVis = EffectVisualEffect(21); // Generic blessing visual effect
effect eDur = EffectVisualEffect(14); // Duration visual effect
effect eLink = EffectLinkEffects(eAC, eDur);
// 4. Apply to all party members
object oTarget = GetFirstPC();
while (GetIsObjectValid(oTarget))
{
// Signal spell cast at event
SignalEvent(oTarget, EventSpellCastAt(oCaster, 7, FALSE)); // Bless spell ID
// Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration);
// Notify the target
FloatingTextStringOnCreature("Blessed: AC reduced by 2", oTarget, TRUE);
// Get next party member
oTarget = GetNextPC();
}
}