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

62 lines
2.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Milwa (Light)
//:: milwa.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Summons a softly glowing light that increases vision
and reveals secret doors.
Level 1 Priest spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 1 Priest field/support spell that
targets the party.
*/
//:://////////////////////////////////////////////
//:: Created By: WizardryEE Project
//:: Created On: April 26, 2025
//:://////////////////////////////////////////////
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Create light and reveal secret doors
// 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 = HoursToSeconds(nCasterLevel); // Lasts for hours equal to caster level
// 3. Create the light effect
effect eLight = EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY);
// 4. Apply to the caster (light follows the party)
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLight, oCaster, fDuration);
// 5. Reveal secret doors in the area
// This would typically involve a search check or revealing
// hidden objects in the area around the party
object oArea = GetArea(oCaster);
object oDoor = GetFirstObjectInArea(oArea);
while (GetIsObjectValid(oDoor))
{
// If the object is a secret door
if (GetObjectType(oDoor) == OBJECT_TYPE_DOOR && GetLocalInt(oDoor, "SECRET_DOOR"))
{
// Make it visible/discoverable
SetLocalInt(oDoor, "REVEALED", TRUE);
// Visual effect at door location
location lDoor = GetLocation(oDoor);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL), lDoor);
}
oDoor = GetNextObjectInArea(oArea);
}
}