2025-04-26 15:20:45 -04:00

61 lines
2.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Sopic (Glass)
//:: sopic.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Reduces the armor class of the caster by 4
for the duration of the combat.
Level 2 Mage spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 2 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 4
// 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 = 2; // Minimum level 2 for this spell
float fDuration = RoundsToSeconds(nCasterLevel); // Lasts for rounds equal to caster level
// 3. Remove any existing MOGREF effects
// This would typically involve removing any existing shield effects
// from the MOGREF spell
if (GetLocalInt(oCaster, "MOGREF_ACTIVE") == 1)
{
DeleteLocalInt(oCaster, "MOGREF_ACTIVE");
// The game engine would handle removing the effect
}
// 4. Create the AC reduction effect
effect eAC = EffectACDecrease(4); // Reduce AC by 4 (lower AC is better)
effect eVis = EffectVisualEffect(21); // Shield visual effect
effect eDur = EffectVisualEffect(14); // Duration visual effect
effect eLink = EffectLinkEffects(eAC, eDur);
// 5. 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);
// Set the SOPIC flag
SetLocalInt(oCaster, "SOPIC_ACTIVE", 1);
// 6. Notify the caster
FloatingTextStringOnCreature("SOPIC: AC reduced by 4", oCaster, TRUE);
}