Author Topic: Gelatinous Cube Paralysis DC  (Read 853 times)

Legacy_Wensleydale

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« on: November 20, 2011, 09:11:59 pm »


               Apparently I can set a variable to raise or lower the DC for the gelatinous cube's paralyze attack, like so: X2_L_PARALYZE_MONSTER_SAVE_DC.

My question is -- where do I set it? On the cube or on the module? I've tried setting it to 10 on the cube, but according to in-game feedback I'm still up against a DC of 16.

Any and all help appreciated.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #1 on: November 21, 2011, 02:03:08 am »


               It looks like it's handled by x2_s3_paralyze, this script here:

#include "x2_i0_spells"
#include "x2_inc_switches"
#include "x0_i0_spells"
void main()
{
   object oItem;        // The item casting triggering this spellscript
   object oSpellTarget; // On a weapon: The one being hit. On an armor: The one hitting the armor
   object oSpellOrigin; // On a weapon: The one wielding the weapon. On an armor: The one wearing an armor
   // fill the variables
   oSpellOrigin = OBJECT_SELF;
   oSpellTarget = GetSpellTargetObject();
   oItem        =  GetSpellCastItem();
   if (GetIsObjectValid(oItem))
   {
      // you can not be deafened if you already can not hear.
      if (!GetHasSpellEffect(GetSpellId(),oSpellTarget)  )
      {
             int nDC = GetCasterLevel(oSpellOrigin)+10;  ;
             if (DoCubeParalyze(oSpellTarget, oSpellOrigin,nDC))
             {
                         FloatingTextStrRefOnCreature(84609,oSpellTarget);
             }
             else
             {
                effect eSave = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
                ApplyEffectToObject(DURATION_TYPE_INSTANT,eSave,oSpellTarget);
              }
             return;
         }
    }
}

  The gelatinous cube slam attack is set at level 6, so that gives the DC 16 you're seeing.  Unless it's buried in an include, there's no variable checked for the attack.

You can either alter this script to allow customizing, or make a few different gelatinous cube slam weapons with different caster levels to get a DC range.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #2 on: November 21, 2011, 02:59:05 am »


               There is no way to adjust DC of gelationous cube paralyse in vanilla NWN. Also note that her attack is blocked even via mind spells immunity.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #3 on: November 21, 2011, 06:06:37 am »


               

ShaDoOoW wrote...

There is no way to adjust DC of gelationous cube paralyse in vanilla NWN. Also note that her attack is blocked even via mind spells immunity.


  Whar an utterly pointless thing to say.  There's no way to adjust anything in vanilla NWN, since it ceases to be vanilla the moment you change anything.

  The DC of the attack can be adjusted quite successfully through either means I mentioned, I've tested and confirmed this.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #4 on: November 21, 2011, 06:44:43 am »


               omg... What I meant is that there is not such variable "X2_L_PARALYZE_MONSTER_SAVE_DC" in vanilla nwn.

There are however ways how to adjust AI behavior or to set creature as incorporeal, all via variable and already in vanilla nwn.
               
               

               


                     Modifié par ShaDoOoW, 21 novembre 2011 - 06:48 .
                     
                  


            

Legacy_Wensleydale

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #5 on: November 21, 2011, 09:32:38 am »


               Thanks for the insight guys.

I've been experimenting with the gelatinous cube and what I've found is... odd. If you remove the creature's standard slam attack (which includes the caster level 6 paralyze spell), and replace it with something a lot tamer, (a basic 1D4 for example), the cube is still able to paralyze you in combat. And you're still up against a DC of 16. It's like the engulf and paralyze ability is hard-coded or something.

As complicated scripting is beyond my abilities, the simplest way to overcome this is to give my character some kind of item that cranks up his fortitude save. By a significant margin. Seems a bit like cheating really though, doesn't it?

Thoughts?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #6 on: November 21, 2011, 09:56:23 am »


               gelatinous cube has also special heartbeat script which does this:

each round there is special saving throw to all hostile creatures around with a dc of 13+hitdice-4 and if you fail this saving throw, then cube does paralyse effect with direct DC of 16.

to change it you have to look into cube's OnHeartbeat script or if you want to disable it, just change it to the standard AI script
               
               

               
            

Legacy_Wensleydale

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #7 on: November 21, 2011, 10:16:14 am »


               As it happens, I've just this minute figured that out. I changed the heartbeat script to the default, and now my cube no longer attempts to paralyze me every three seconds.

Thanks for the help, ShaDoOow and Failed.Bard.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #8 on: November 21, 2011, 10:22:00 am »


               FYI - the variable you reference is a place marker for a function modification that was never released to the public. If I remember correctly if you look at the modules for HotU - and at the cube - you will find it implemented there.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #9 on: November 21, 2011, 10:23:49 am »


               Change x2_s3_paralyze to (changed code in bold):

#include "x2_i0_spells"
#include "x2_inc_switches"
#include "x0_i0_spells"
void main()
{
   object oItem;        // The item casting triggering this spellscript
   object oSpellTarget; // On a weapon: The one being hit. On an armor: The one hitting the armor
   object oSpellOrigin; // On a weapon: The one wielding the weapon. On an armor: The one wearing an armor
   // fill the variables
   oSpellOrigin = OBJECT_SELF;
   oSpellTarget = GetSpellTargetObject();
   oItem        =  GetSpellCastItem();
   if (GetIsObjectValid(oItem))
   {
      // you can not be deafened if you already can not hear.
      if (!GetHasSpellEffect(GetSpellId(),oSpellTarget)  )
      {
             int nDC = GetLocalInt(oSpellOrigin, X2_L_PARALYZE_MONSTER_SAVE_DC); 
             if (nDC == 0)
                 nDC = GetCasterLevel(oSpellOrigin)+10;  ;
             if (DoCubeParalyze(oSpellTarget, oSpellOrigin,nDC))
             {
                         FloatingTextStrRefOnCreature(84609,oSpellTarget);
             }
             else
             {
                effect eSave = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
                ApplyEffectToObject(DURATION_TYPE_INSTANT,eSave,oSpellTarget);
              }
             return;
         }
    }
}

This will enable the variable for all creatures that use a paralyze attack that references this script. Because the DC is carried into the function DoCubeParalysis - found in x2_i0_spells - from both the spellability script and the cube's HB script, it would be more prudent to perform the variable check within that function instead.

// * Gelatinous Cube Paralyze attack
int  DoCubeParalyze(object oTarget, object oSource, int nSaveDC = 16)
{
    if (GetIsImmune(oTarget,IMMUNITY_TYPE_PARALYSIS) )
    {
        return FALSE;
    }

    int nSaveDCOverride = GetLocalInt(oSource, X2_L_PARALYZE_MONSTER_SAVE_DC);
    if (nSaveDCOverride > 0)
        nSaveDC = nSaveDCOverride;


    if (FortitudeSave(oTarget, nSaveDC, SAVING_THROW_TYPE_POISON,oSource) == 0)
    {
      effect ePara =  EffectParalyze();
      effect eDur = EffectVisualEffect(VFX_DUR_PARALYZED);
      ePara = EffectLinkEffects(eDur,ePara);
      ePara = EffectLinkEffects(EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),ePara);
      ApplyEffectToObject(DURATION_TYPE_TEMPORARY,ePara,oTarget,RoundsToSeconds(3+d3())); // not 3 d6, thats not fun
      return TRUE;
    }
    else
    {
     effect eSave = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
      ApplyEffectToObject(DURATION_TYPE_INSTANT,eSave,oTarget);
    }
    return FALSE;
}

If you choose this option, you don't need to modify the other script, but you will need to compile both it and the HB script.

               
               

               


                     Modifié par Pstemarie, 21 novembre 2011 - 10:39 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #10 on: November 21, 2011, 12:53:56 pm »


               Note that in order to make the DC change for onhit work, the variable must be on the creature weapon. Since you can adjust caster level there as well which will also result into DC change, its not very usefull (unless user would want a DC lesser than 11).

EDIT: wrong point, my apology it works correctly
               
               

               


                     Modifié par ShaDoOoW, 23 novembre 2011 - 04:54 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #11 on: November 21, 2011, 09:03:46 pm »


               Good point ShaDoOoW
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #12 on: November 22, 2011, 08:28:42 am »


               

Wensleydale wrote...

As it happens, I've just this minute figured that out. I changed the heartbeat script to the default, and now my cube no longer attempts to paralyze me every three seconds.

Thanks for the help, ShaDoOow and Failed.Bard.

Also note that if you remove the default cube heatbeat script, she will no longer be able to move through creatures (aka becomes solid). So if you want this functionality, you need to retain default heatbeat script but remove the part with saving throw (lines 32below).
               
               

               


                     Modifié par ShaDoOoW, 22 novembre 2011 - 08:29 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Gelatinous Cube Paralysis DC
« Reply #13 on: November 23, 2011, 02:52:42 pm »


                 I finally had a bit of time and tried a variant of the script Pstemarie posted  It worked fine reading the variable off the creature.  Aside from the lack of quotes around the variable name in that script I expect it would have worked as well.  Even the OnHeartbeat paralysis save was reduced to the variable set value on the cube.

  This is the one I used to test, in the x2_s3_paralyze script:

#include "x2_i0_spells"
#include "x2_inc_switches"
#include "x0_i0_spells"
void main()
{
 object oItem   = GetSpellCastItem();
 object oTarget = GetSpellTargetObject();
 if (GetIsObjectValid(oItem) && !GetHasSpellEffect(GetSpellId(), oTarget)  )
    {
     int nDC = GetLocalInt(OBJECT_SELF, "X2_L_PARALYZE_MONSTER_SAVE_DC");
     if (!nDC) nDC = GetCasterLevel (OBJECT_SELF) + 10;
     if (DoCubeParalyze (oTarget, OBJECT_SELF, nDC))
        {
         FloatingTextStrRefOnCreature (84609, oTarget);
        }
     else
        {
         effect eSave = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
         ApplyEffectToObject (DURATION_TYPE_INSTANT, eSave, oTarget);
        }
    }
}