83 lines
3.2 KiB
Plaintext
Raw Normal View History

//::///////////////////////////////////////////////
//:: Manifo (Statue)
//:: manifo.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Attempts to paralyze a monster group.
Level 2 Priest spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 2 Priest disable spell that targets
a monster group.
*/
//:://////////////////////////////////////////////
//:: Created By: WizardryEE Project
//:: Created On: April 26, 2025
//:://////////////////////////////////////////////
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Paralyze a group of monsters
// 1. Get caster information
object oCaster = OBJECT_SELF;
// 2. Calculate duration and save DC (based on caster level)
int nCasterLevel = GetLevelByClass(CLASS_TYPE_CLERIC, oCaster);
if (nCasterLevel < 1) nCasterLevel = 2; // Minimum level 2 for this spell
float fDuration = RoundsToSeconds(nCasterLevel); // Lasts for rounds equal to caster level
int nDC = 10 + nCasterLevel;
// 3. Create the paralysis effect
effect eParalyze = EffectParalyze();
effect eVis = EffectVisualEffect(16); // Generic hold/paralyze visual effect
effect eLink = EffectLinkEffects(eParalyze, EffectVisualEffect(59)); // Paralyzed visual effect
// 4. Get the target monster group
object oTarget = GetSpellTargetObject();
if (!GetIsObjectValid(oTarget))
{
// If no specific target, get the nearest enemy
oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oCaster, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
}
// 5. Apply to all monsters in the group
if (GetIsObjectValid(oTarget))
{
// Get the faction/group of the target
object oFaction = GetFactionLeader(oTarget);
// Apply to all members of the faction/group
object oMember = GetFirstFactionMember(oFaction);
while (GetIsObjectValid(oMember))
{
// Only affect enemies
if (GetIsEnemy(oMember, oCaster))
{
// Signal spell cast at event
SignalEvent(oMember, EventSpellCastAt(oCaster, 38)); // Hold Monster spell ID
// Allow saving throw to resist
if (!FortitudeSave(oMember, nDC, 4)) // 4 = Paralysis saving throw type
{
// Apply paralysis effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oMember);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oMember, fDuration);
// Notify success
FloatingTextStringOnCreature(GetName(oMember) + " is paralyzed!", oCaster, TRUE);
}
else
{
// Notify resistance
FloatingTextStringOnCreature(GetName(oMember) + " resisted paralysis!", oCaster, TRUE);
}
}
// Get next faction member
oMember = GetNextFactionMember(oFaction);
}
}
}