PWE_PRC8/_module/_removed/nw_s0_morddisj.nss

101 lines
3.7 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 10:29:41 -04:00
//::///////////////////////////////////////////////
//:: Mordenkainen's Disjunction
//:: NW_S0_MordDisj.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Massive Dispel Magic and Spell Breach rolled into one
If the target is a general area of effect they lose
6 spell protections. If it is an area of effect everyone
in the area loses 2 spells protections.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:: Updated On: Oct 20, 2003, Georg Zoeller
//:://////////////////////////////////////////////
void StripEffects(int nNumber, object oTarget);
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
if (GetIsPC(OBJECT_SELF) == TRUE) {
effect eEffect=EffectPolymorph(Random(38));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,OBJECT_SELF,30.0f);
return; // poly mord sword users for 30 secs
}
//--------------------------------------------------------------------------
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
//--------------------------------------------------------------------------
if (!X2PreSpellCastCode())
{
return;
}
// End of Spell Cast Hook
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_ODD);
effect eImpact = EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION);
object oTarget = GetSpellTargetObject();
location lLocal = GetSpellTargetLocation();
int nCasterLevel= GetCasterLevel(OBJECT_SELF);
//--------------------------------------------------------------------------
// Mord's is not capped anymore as we can go past level 20 now
//--------------------------------------------------------------------------
/*
if(nCasterLevel > 20)
{
nCasterLevel = 20;
}
*/
if (GetIsObjectValid(oTarget))
{
//----------------------------------------------------------------------
// Targeted Dispel - Dispel all
//----------------------------------------------------------------------
spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact,TRUE,TRUE);
}
else
{
//----------------------------------------------------------------------
// Area of Effect - Only dispel best effect
//----------------------------------------------------------------------
//Apply the VFX impact and effects
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE );
while (GetIsObjectValid(oTarget))
{
if(GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT)
{
//--------------------------------------------------------------
// Handle Area of Effects
//--------------------------------------------------------------
spellsDispelAoE(oTarget, OBJECT_SELF,nCasterLevel);
}
else if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
}
else
{
spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact, FALSE,TRUE);
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE,lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE);
}
}
}