87 lines
2.9 KiB
Plaintext
87 lines
2.9 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Madalto (Frost)
|
|
//:: madalto.nss
|
|
//:: Copyright (c) 2025 WizardryEE Project
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Causes 8d8 (8-64) points of cold damage to a
|
|
monster group.
|
|
Level 5 Mage spell.
|
|
|
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
|
this is a Level 5 Mage attack spell that targets
|
|
a monster group.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: WizardryEE Project
|
|
//:: Created On: April 26, 2025
|
|
//:://////////////////////////////////////////////
|
|
|
|
#include "prc_inc_spells"
|
|
#include "prc_add_spell_dc"
|
|
|
|
void main()
|
|
{
|
|
// Spell implementation for WizardryEE
|
|
// Core functionality: Deal 8d8 acid damage to a monster group with lingering effect
|
|
|
|
// Spellcast Hook Code
|
|
if (!X2PreSpellCastCode()) return;
|
|
|
|
// Set spell school for proper record keeping
|
|
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
|
|
|
// Declare major variables
|
|
object oCaster = OBJECT_SELF;
|
|
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
|
int nMetaMagic = PRCGetMetaMagicFeat();
|
|
|
|
// Get the target location
|
|
location lTarget = PRCGetSpellTargetLocation();
|
|
|
|
// Calculate duration (based on caster level)
|
|
int nDuration = nCasterLevel / 2;
|
|
if (nDuration < 1) nDuration = 1;
|
|
|
|
// Check for Extend Spell metamagic
|
|
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
|
|
{
|
|
nDuration *= 2; // Duration is +100%
|
|
}
|
|
|
|
// Create the acid fog visual effect
|
|
effect eAOE = EffectAreaOfEffect(AOE_PER_FOGACID);
|
|
effect eImpact = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_ACID);
|
|
|
|
// Apply the visual effect at the location
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget);
|
|
|
|
// Create an instance of the AOE Object using the Apply Effect function
|
|
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
|
|
|
// Get the AOE object and set its properties
|
|
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_FOGACID");
|
|
|
|
// Set the damage type (default to acid)
|
|
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ACID);
|
|
|
|
// Set the AOE properties
|
|
SetAllAoEInts(SPELL_ACID_FOG, oAoE, PRCGetSaveDC(OBJECT_INVALID, oCaster), 0, nCasterLevel);
|
|
SetLocalInt(oAoE, "Acid_Fog_Damage", EleDmg);
|
|
|
|
// Set custom damage for MADALTO (8d8 instead of standard 2d6)
|
|
SetLocalInt(oAoE, "MADALTO_DAMAGE", 1);
|
|
|
|
// Store the metamagic information for the AOE script to use
|
|
SetLocalInt(oAoE, "METAMAGIC_MAXIMIZE", CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE));
|
|
SetLocalInt(oAoE, "METAMAGIC_EMPOWER", CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER));
|
|
|
|
// Store the caster for the AOE script to use
|
|
SetLocalObject(oAoE, "CASTER", oCaster);
|
|
|
|
// Notify the caster
|
|
FloatingTextStringOnCreature("MADALTO: Acid fog created for " + IntToString(nDuration) + " rounds!", oCaster, TRUE);
|
|
|
|
// Clean up spell school variable
|
|
PRCSetSchool();
|
|
} |