74 lines
2.7 KiB
Plaintext
74 lines
2.7 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Maporfic (Big Shield)
|
|
//:: maporfic.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Reduces the armor class of all party members by 2
|
|
for the entire expedition.
|
|
Level 4 Priest spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 4 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 for the entire expedition
|
|
|
|
// 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 = 4; // Minimum level 4 for this spell
|
|
float fDuration = HoursToSeconds(24); // Lasts for 24 hours (entire expedition)
|
|
|
|
// 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. Remove any existing PORFIC effects
|
|
// This would typically involve removing any existing shield effects
|
|
// from the PORFIC spell
|
|
object oPartyMember = GetFirstPC();
|
|
while (GetIsObjectValid(oPartyMember))
|
|
{
|
|
if (GetLocalInt(oPartyMember, "PORFIC_ACTIVE") == 1)
|
|
{
|
|
DeleteLocalInt(oPartyMember, "PORFIC_ACTIVE");
|
|
// The game engine would handle removing the effect
|
|
}
|
|
|
|
oPartyMember = GetNextPC();
|
|
}
|
|
|
|
// 5. Apply to all party members
|
|
oPartyMember = GetFirstPC();
|
|
while (GetIsObjectValid(oPartyMember))
|
|
{
|
|
// Signal spell cast at event
|
|
SignalEvent(oPartyMember, EventSpellCastAt(oCaster, 58, FALSE)); // Mage Armor spell ID
|
|
|
|
// Apply the VFX impact and effects
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPartyMember);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPartyMember, fDuration);
|
|
|
|
// Set the MAPORFIC flag
|
|
SetLocalInt(oPartyMember, "MAPORFIC_ACTIVE", 1);
|
|
|
|
// Notify the target
|
|
FloatingTextStringOnCreature("MAPORFIC: AC reduced by 2 for 24 hours", oPartyMember, TRUE);
|
|
|
|
// Get next party member
|
|
oPartyMember = GetNextPC();
|
|
}
|
|
} |