Hi everyone…again.
As you see lately I have been trying to make new spells. Here is another one. I got this one to compile. I based it on the Hold Person spell. Only one drawback:
I Changed the constant to undead and outsiders. I tried to just make it undead (Hold Undead - ideally I would just like this), but when I pulled the other creatures out of that Hold Person spell…it would not compile unless there were at least two creatures in the script. So technically the spell is “Hold Undead and Outsiders”…kind of like how some outsiders can be grouped in with undead…like higher level Clerics and Paladins can effect outsiders with turning at higher levels. One big problem. Undead cannot be paralyzed. Ugh…how do I script around this in this script?
Here is the script below (I attach it too):
//::///////////////////////////////////////////////
//:: Hold Undead & Outsiders
//:: sp_holdundead
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
//:: The target freezes in place, standing helpless.
*/
//:://////////////////////////////////////////////
//:: modified by me Dec/2022
#include “prc_alterations”
#include “NW_I0_SPELLS”
#include “x2_inc_spellhook”
void main()
{
DeleteLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”);
SetLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”, SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nCasterLvl = (GetCasterLevel(OBJECT_SELF) + GetChangesToCasterLevel(OBJECT_SELF));
int nMeta = GetMetaMagicFeat();
int nDuration = nCasterLvl;
nDuration = GetScaledDuration(nDuration, oTarget);
effect eParal = EffectParalyze();
effect eVis = EffectVisualEffect(82);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eDur3 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eLink = EffectLinkEffects(eDur2, eDur);
eLink = EffectLinkEffects(eLink, eParal);
eLink = EffectLinkEffects(eLink, eVis);
eLink = EffectLinkEffects(eLink, eDur3);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HOLD_PERSON));
//Make sure the target is undead or outsider
if (GetIsPlayableRacialType(oTarget) ||
GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD||
GetRacialType(oTarget) == RACIAL_TYPE_OUTSIDER)
{
//Make SR Check
if (!MyPRCResistSpell(OBJECT_SELF, oTarget))
{
//Make Fortitude save
if (!/*Fortitude Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, (GetSpellSaveDC()+ GetChangesToSaveDC(OBJECT_SELF))))
{
//Make metamagic extend check
if (nMeta == METAMAGIC_EXTEND)
{
nDuration = nDuration * 2;
}
//Apply paralyze effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
}
}
}
}
DeleteLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”);
// Getting rid of the local integer storing the spellschool name
}
sp_holdundead.zip (1.3 KB)