49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Mogref (Body Iron)
|
|
//:: mogref.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Reduces the armor class of the caster by 2
|
|
for the duration of the combat.
|
|
Level 1 Mage spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 1 Mage support spell that targets
|
|
the caster.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: WizardryEE Project
|
|
//:: Created On: April 26, 2025
|
|
//:://////////////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
// Spell implementation for WizardryEE
|
|
// Core functionality: Reduce caster's AC by 2
|
|
|
|
// 1. Get caster information
|
|
object oCaster = OBJECT_SELF;
|
|
|
|
// 2. Calculate duration (based on caster level)
|
|
int nCasterLevel = GetLevelByClass(CLASS_TYPE_WIZARD, 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(2); // Reduce AC by 2 (lower AC is better)
|
|
effect eVis = EffectVisualEffect(21); // Shield visual effect
|
|
effect eDur = EffectVisualEffect(14); // Duration visual effect
|
|
effect eLink = EffectLinkEffects(eAC, eDur);
|
|
|
|
// 4. Apply to the caster
|
|
// Signal spell cast at event
|
|
SignalEvent(oCaster, EventSpellCastAt(oCaster, 58, FALSE)); // Mage Armor spell ID
|
|
|
|
// Apply the visual and AC effects
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oCaster, fDuration);
|
|
|
|
// 5. Notify the caster
|
|
FloatingTextStringOnCreature("MOGREF: AC reduced by 2", oCaster, TRUE);
|
|
} |