84 lines
2.8 KiB
Plaintext
84 lines
2.8 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Makanito (Deadly Air)
|
|
//:: makanito.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Kills all monsters with 7 or fewer hit point dice.
|
|
Level 5 Mage spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 5 Mage attack spell that targets
|
|
all monsters.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: WizardryEE Project
|
|
//:: Created On: April 26, 2025
|
|
//:://////////////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
// Spell implementation for WizardryEE
|
|
// Core functionality: Kill all weak monsters
|
|
|
|
// 1. Get caster information
|
|
object oCaster = OBJECT_SELF;
|
|
|
|
// 2. Create the deadly air visual effect
|
|
effect eDeadlyAir = EffectVisualEffect(47); // Death visual effect
|
|
location lCaster = GetLocation(oCaster);
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDeadlyAir, lCaster);
|
|
|
|
// 3. Get all creatures in the area
|
|
object oArea = GetArea(oCaster);
|
|
object oTarget = GetFirstObjectInArea(oArea);
|
|
int nKilled = 0;
|
|
|
|
while (GetIsObjectValid(oTarget))
|
|
{
|
|
// Check if target is a valid enemy
|
|
if (GetIsEnemy(oTarget, oCaster) &&
|
|
GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
|
|
{
|
|
// Get creature's hit dice
|
|
int nHitDice = GetHitDice(oTarget);
|
|
|
|
// Check if creature is weak enough to be affected
|
|
if (nHitDice <= 7)
|
|
{
|
|
// Signal spell cast at event
|
|
SignalEvent(oTarget, EventSpellCastAt(oCaster, 39)); // Death spell ID
|
|
|
|
// Create the death effect
|
|
effect eDeath = EffectDeath();
|
|
effect eVis = EffectVisualEffect(45); // Death visual effect
|
|
|
|
// Apply the visual and death effects
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
|
|
|
|
// Notify kill
|
|
FloatingTextStringOnCreature("MAKANITO: " + GetName(oTarget) + " is killed!", oCaster, TRUE);
|
|
nKilled++;
|
|
}
|
|
else
|
|
{
|
|
// Notify too strong
|
|
FloatingTextStringOnCreature(GetName(oTarget) + " is too powerful!", oCaster, TRUE);
|
|
}
|
|
}
|
|
|
|
// Get next target in area
|
|
oTarget = GetNextObjectInArea(oArea);
|
|
}
|
|
|
|
// Final notification
|
|
if (nKilled > 0)
|
|
{
|
|
FloatingTextStringOnCreature("MAKANITO: Killed " + IntToString(nKilled) + " weak enemies!", oCaster, TRUE);
|
|
}
|
|
else
|
|
{
|
|
FloatingTextStringOnCreature("MAKANITO: No enemies were weak enough to affect", oCaster, TRUE);
|
|
}
|
|
} |