Hold Undead Spell (RESOLVED)

Hi Mannast…you get a chance to look at this?

Sigh…I tried that AI chatbot to see if it could do the script. The following is what it gave me. It did not work. Is there something else missing in this?:

void main()
{
// Get the target creature
object oTarget = GetObjectByTag(“paralyze_target”);

// Check if the target is undead
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
    // Create a custom effect to simulate paralysis
    effect eParalyze = EffectParalyze();

    // Apply the paralysis effect to the target
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oTarget, 10.0);
}

}

hi bud,

Do you think you cracked this script yet? I have been trying like crazy with no luck :frowning:

So…trying to help here again, although I’m the wrong person to help since I don’t have NWN:EE. Tried figuring out what you want by reading here and reading what others said…I put in Mannast suggestions to the script and made a new one. Can’t compile it in NWN1 (original version) (and I hate that toolset since I haven’t worked with it at all) since I don’t have the include file “prc_alterations”, so I have no idea if this compiles or not, but…well, here you go, I guess:

//::///////////////////////////////////////////////
//:: 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 = EffectCutsceneParalyze();
effect eImmobilize = EffectCutsceneImmobilize();
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, eImmobilize);
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 (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
}

Hey thanks andgalf

It almost compiled. I took out the last part that is the issue but still did not compile…but getting closer. See the before and after below:

and without the last part…

It worked. I compiled it and tested it. Woohoo!! Thanks bud. See below. I just added a last bracket so it compiled:

Great to hear! I think I know the problem with DeleteLocalInt. The " signs are not the correct " signs I think (the symbols I mean).

EDIT:
Try to change it to

DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");

from

DeleteLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”);

Can you see the difference?

See. I just have to change the DC to 20 from 15 as it is too low. Going to release the spell today to the vault. It only affects one creature though. Too bad it can’t affect more. - but I’m happy with it.:slight_smile:

Ok I will add that back in and test it

Edited my last post.

yup…added it back in and it compiled. Got to test it. I don’t see how I can change the DC from 15 to 20 in the script. how do I do that? Also possible to effect 1d4 undead rather than just one?

You might be able to change that, or it’s hardcoded. I think I’ve done something like this but…well, I’m a bit busy at the moment. Another guy on Discord is trying to teach me animations and stuff for NWN2.

1 Like

Thanks bud!!

This is above my knowledge but to guess a bit here (really difficult when I can’t try to compile it myself):

if (MySavingThrow(SAVING_THROW_FORT, oTarget, (GetSpellSaveDC()+ 5 + GetChangesToSaveDC(OBJECT_SELF))))

Don’t know if that’s the way you do it…

where in the script does it go?

One second…

Using my orginal script here. You might need to do the modifications you did yourself before again…

//::///////////////////////////////////////////////
//:: 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));
int nMeta = GetMetaMagicFeat();
int nDuration = nCasterLvl;
nDuration = GetScaledDuration(nDuration, oTarget);
effect eParal = EffectCutsceneParalyze();
effect eImmobilize = EffectCutsceneImmobilize();
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, eImmobilize);
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 (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD ||
  		GetRacialType(oTarget) == RACIAL_TYPE_OUTSIDER)
       	{
  		      //Make SR Check
  		      if (!MyResistSpell(OBJECT_SELF, oTarget))
  		      {
   		         //Make Fortitude save
      		      if (MySavingThrow(SAVING_THROW_FORT, oTarget, (GetSpellSaveDC() + 5 + 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
}

Darn…sorry. Wait

Now, there.

Do you see the change I did in the script? I have no idea if that would work or if it compiles.
It’s right under “Make a fortitude save”. I added a + 5.

I hope you didn’t copy the script when I said “wait”. I did a mistake in the script not including the +5 at first.

1 Like

It compiled…will test it

hmm…I don’t think so.

the DC 20 showed up but when I cast it twice they failed their save vs fortitude as per below:

9+3 = 12 vs DC 20
failure

16+3 = 19 vs DC 20
failure

yet the spell did not hold them

So I think I will stick with the original one you made

Odd. It sounds, from your description, the script does what you wanted it to do…Or maybe I’m misunderstanding this totally.

The DC was what you wanted, and they failed their throw, but the spell did not do what it was supposed to do?

Should it not be the +5 instead of the +3?

I’m having a brain fart…does the failure mean they failed or the spell failed?

Serious brain fart. Should the roll be over 21 for it to work then?

Or below 20 to hold them?