61 lines
2.1 KiB
Plaintext
61 lines
2.1 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Halito (Little Fire)
|
|
//:: halito.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Causes 1d8 (1-8) points of fire damage to a monster.
|
|
Level 1 Mage spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 1 Mage attack spell that targets
|
|
one monster.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: WizardryEE Project
|
|
//:: Created On: April 26, 2025
|
|
//:://////////////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
// Spell implementation for WizardryEE
|
|
// Core functionality: Deal 1d8 fire damage
|
|
|
|
// 1. Get caster information
|
|
object oCaster = OBJECT_SELF;
|
|
|
|
// 2. Get the target
|
|
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))
|
|
{
|
|
// 4. Calculate damage
|
|
int nDamage = d8(1); // 1d8 fire damage
|
|
|
|
// 5. Create the damage effect
|
|
effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
|
effect eVis = EffectVisualEffect(44); // Fire visual effect
|
|
|
|
// 6. Apply the effects
|
|
// Signal spell cast at event
|
|
SignalEvent(oTarget, EventSpellCastAt(oCaster, 31)); // Burning Hands spell ID
|
|
|
|
// Apply the visual and damage effects
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
|
|
|
|
// 7. Notify the caster
|
|
FloatingTextStringOnCreature("HALITO: " + IntToString(nDamage) + " fire damage to " + GetName(oTarget), oCaster, TRUE);
|
|
}
|
|
else
|
|
{
|
|
// Notify if no valid target
|
|
FloatingTextStringOnCreature("HALITO: No valid target found", oCaster, TRUE);
|
|
}
|
|
} |