WizardryEE/Content/spells/tiltowait.nss
2025-04-26 15:20:45 -04:00

87 lines
2.7 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Tiltowait (Explosion)
//:: tiltowait.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Causes 10d15 (10-150) points of damage to all
monsters.
Level 7 Mage spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 7 Mage attack spell that targets
all monsters.
*/
//:://////////////////////////////////////////////
//:: Created By: WizardryEE Project
//:: Created On: April 26, 2025
//:://////////////////////////////////////////////
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Deal massive damage to all monsters
// 1. Get caster information
object oCaster = OBJECT_SELF;
object oArea;
object oTarget;
effect eDamage;
effect eVis;
int nDamage;
int nAffected;
// 2. Create explosion visual effect
effect eExplosion = EffectVisualEffect(43); // Explosion visual effect
location lCaster = GetLocation(oCaster);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplosion, lCaster);
// 3. Get all creatures in the area
oArea = GetArea(oCaster);
oTarget = GetFirstObjectInArea(oArea);
nAffected = 0;
while (GetIsObjectValid(oTarget))
{
// Check if target is a valid enemy
if (GetIsEnemy(oTarget, oCaster) &&
GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
// Calculate damage (10d15)
nDamage = 0;
int i;
for (i = 0; i < 10; i++)
{
nDamage += Random(15) + 1; // 1-15 per die
}
// Create the damage effect
eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
eVis = EffectVisualEffect(43); // Explosion visual effect
// Signal spell cast at event
SignalEvent(oTarget, EventSpellCastAt(oCaster, 55)); // Meteor Swarm spell ID
// Apply the visual and damage effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
// Notify damage
FloatingTextStringOnCreature("TILTOWAIT: " + IntToString(nDamage) + " damage to " + GetName(oTarget), oCaster, TRUE);
nAffected++;
}
// Get next target in area
oTarget = GetNextObjectInArea(oArea);
}
// Final notification
if (nAffected > 0)
{
FloatingTextStringOnCreature("TILTOWAIT: Hit " + IntToString(nAffected) + " enemies!", oCaster, TRUE);
}
else
{
FloatingTextStringOnCreature("TILTOWAIT: No enemies affected", oCaster, TRUE);
}
}