45 lines
1.6 KiB
Plaintext
45 lines
1.6 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Porfic (Shield)
|
|
//:: porfic.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Reduces the armor class of the caster by 4
|
|
for the duration of the combat.
|
|
Level 1 Priest spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 1 Priest support spell that targets
|
|
the caster only.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: WizardryEE Project
|
|
//:: Created On: April 26, 2025
|
|
//:://////////////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
// Spell implementation for WizardryEE
|
|
// Core functionality: Reduce AC of caster 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 = 1;
|
|
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(VFX_IMP_AC_BONUS);
|
|
effect eShield = EffectVisualEffect(VFX_DUR_GLOBE_MINOR);
|
|
effect eLink = EffectLinkEffects(eAC, eShield);
|
|
|
|
// 4. Apply to the caster
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oCaster, fDuration);
|
|
|
|
// 5. Notify the caster
|
|
FloatingTextStringOnCreature("Shield spell active: AC reduced by 4", oCaster, TRUE);
|
|
} |