56 lines
2.0 KiB
Plaintext
56 lines
2.0 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Bamatu (Prayer)
|
||
|
//:: bamatu.nss
|
||
|
//:: Copyright (c) 2025 WizardryEE Project
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Reduces the armor class of all party members by 4
|
||
|
for the duration of the combat.
|
||
|
Level 3 Priest spell.
|
||
|
|
||
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
||
|
this is a Level 3 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 4
|
||
|
|
||
|
// 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 = 3; // Minimum level 3 for this spell
|
||
|
float fDuration = RoundsToSeconds(nCasterLevel); // Lasts for rounds equal to caster level
|
||
|
|
||
|
// 3. Create the AC reduction effect
|
||
|
effect eAC = EffectACDecrease(4); // Reduce AC by 4 (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, 69, FALSE)); // Prayer 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("Prayer: AC reduced by 4", oTarget, TRUE);
|
||
|
|
||
|
// Get next party member
|
||
|
oTarget = GetNextPC();
|
||
|
}
|
||
|
}
|