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

80 lines
3.0 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Lorto (Blades)
//:: lorto.nss
//:: Copyright (c) 2025 WizardryEE Project
//:://////////////////////////////////////////////
/*
Causes 6d6 (6-36) points of damage to a monster group.
Level 6 Priest spell.
In Wizardry: Proving Grounds of the Mad Overlord,
this is a Level 6 Priest attack spell that targets
a monster group.
*/
//:://////////////////////////////////////////////
//:: Created By: WizardryEE Project
//:: Created On: April 26, 2025
//:://////////////////////////////////////////////
void main()
{
// Spell implementation for WizardryEE
// Core functionality: Deal 6d6 damage to a monster group
// 1. Get caster information
object oCaster = OBJECT_SELF;
// 2. 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);
}
// 3. Check if target is valid and is an enemy
if (GetIsObjectValid(oTarget) && GetIsEnemy(oTarget, oCaster))
{
// Get the faction/group of the target
object oFaction = GetFactionLeader(oTarget);
// Create the blade storm visual effect at the target location
location lTarget = GetLocation(oTarget);
effect eStorm = EffectVisualEffect(41); // Blade storm visual effect
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStorm, lTarget);
// Apply to all members of the faction/group
object oMember = GetFirstFactionMember(oFaction);
while (GetIsObjectValid(oMember))
{
// Only affect enemies
if (GetIsEnemy(oMember, oCaster))
{
// Calculate damage
int nDamage = d6(6); // 6d6 damage
// Create the damage effect
effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING);
effect eVis = EffectVisualEffect(42); // Blade impact visual effect
// Signal spell cast at event
SignalEvent(oMember, EventSpellCastAt(oCaster, 35)); // Blade Barrier spell ID
// Apply the visual and damage effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oMember);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oMember);
// Notify damage
FloatingTextStringOnCreature("LORTO: " + IntToString(nDamage) + " blade damage to " + GetName(oMember), oCaster, TRUE);
}
// Get next faction member
oMember = GetNextFactionMember(oFaction);
}
}
else
{
// Notify if no valid target
FloatingTextStringOnCreature("LORTO: No valid target found", oCaster, TRUE);
}
}