Author Topic: Increased DC on all spells  (Read 418 times)

Legacy_JP480

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Increased DC on all spells
« on: March 12, 2011, 02:07:46 am »


                Is there any way of increasing the spell DC of every spell by, let's say 6, without going through each individual spell script?

Thanks in advance,
~Tenshar
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Increased DC on all spells
« Reply #1 on: March 12, 2011, 04:39:21 am »


               THIS, or if you use my community patch its even more easier (but if you rewritten many spells and got them in override/module its a problematic since you would have to get them into new spell engine otherwise it wouldnt work for those)

for my patch, you need to open script 70_inc_spells line 31 change

sp.DC = GetSpellSaveDC();

to

sp.DC = GetSpellSaveDC()+6;

or anything else. Then you download "1.70 builders resources" and you need the "1.70 spell scripts" and you extract it somewhere. Then you save this include and copy it from modules/temp0 and put it into the include folder in the builders resources folder (and any other include you might have). Then you run compile_it.bat. Then you take the *.ncs files and you put them into hak or override on your server and you are done.

Its far more simple than original way in my first link.
               
               

               


                     Modifié par ShaDoOoW, 12 mars 2011 - 04:40 .
                     
                  


            

Legacy_JP480

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Increased DC on all spells
« Reply #2 on: March 12, 2011, 12:11:11 pm »


               Thanks, your "Ultimate and crossmodule changes in all spellscripts" worked great, only thing is, it made a lot of my other scripts imcompatible so I just commented out the functions I don't need a removed the CORE_ from the functions in nwscript.

Thanks for the help,
~Tenshar
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Increased DC on all spells
« Reply #3 on: March 12, 2011, 12:17:55 pm »


               yeah thats a good idea too, I did it another way adding core include into all my scripts in module too cos I need it (SetXP hook to make OnDelevel event etc.).
               
               

               
            

Legacy_JP480

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Increased DC on all spells
« Reply #4 on: March 19, 2011, 04:41:34 pm »


               I changed this in "_sh__inc_core"


// Get the DC to save against for a spell (10 + spell level + relevant ability
// bonus +6 if pure caster). This can be called by a creature or by an Area of Effect object.
int GetSpellSaveDC();
int GetSpellSaveDC()
{
int nDC = CORE_GetSpellSaveDC();
int nPure = CORE_GetSpellSaveDC()+6;
if (GetLevelByclass(class_TYPE_WIZARD)== GetHitDice(OBJECT_SELF)
|| GetLevelByclass(class_TYPE_SORCERER)== GetHitDice(OBJECT_SELF)
|| GetLevelByclass(class_TYPE_DRUID)== GetHitDice(OBJECT_SELF)
|| GetLevelByclass(class_TYPE_CLERIC)== GetHitDice(OBJECT_SELF)
|| GetLevelByclass(class_TYPE_BARD)== GetHitDice(OBJECT_SELF))
return nPure;
return nDC;
}

but it doesn't seem to be working, the DC for lvl 40 casters is still the same as before.
               
               

               


                     Modifié par JP480, 19 mars 2011 - 04:42 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Increased DC on all spells
« Reply #5 on: March 19, 2011, 05:02:28 pm »


               Ok and did you recompiled all default spellscripts with this include?
               
               

               


                     Modifié par ShaDoOoW, 19 mars 2011 - 05:15 .
                     
                  


            

Legacy_JP480

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Increased DC on all spells
« Reply #6 on: March 19, 2011, 05:09:25 pm »


               yeah I added the #include "sh_inc_core" above the void main() on every spell script
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Increased DC on all spells
« Reply #7 on: March 19, 2011, 05:15:53 pm »


               I have looked into my concept, cos its a while ago... so lets check the procedure:

you need to download spellscriptschanges.zip and

then you must alter "nwscript.nss" and "_sh_inc_core.nss" (seems you did it), then

copy the nwscript.nss into override folder in NWN and copy "_sh_inc_core.nss" into "1.69 spell scripts with
_sh_inc_core included" folder in the downloaded package

run "compile_it.bat", should throw no errors and compile all spellscripts

now copy the content of the "1.69 spell scripts with _sh_inc_core included"
into server's override and restart nwserver

then it will work on all default spells you havent altered in your module, to make it work also on those you need to add "#include "_sh_inc_core" line into all scripts in your module that uses the GetSpellSaveDC function and then
add the "_sh_inc_core.nss" into your module (eg. via modules/temp0), then recompile all scripts in module via Build feature.

Takes a while to set it up...
               
               

               


                     Modifié par ShaDoOoW, 19 mars 2011 - 05:16 .
                     
                  


            

Legacy_JP480

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Increased DC on all spells
« Reply #8 on: March 19, 2011, 06:28:33 pm »


               Yeah it works now, thanks, seems the problem was that I still had the unmodified "_sh_inc_core" in the override and I didn't know, lol
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Increased DC on all spells
« Reply #9 on: March 21, 2011, 06:48:50 am »


               It's a lot of work to add custom DCs to all spells, whoosh!

I know I've done it 3 times, man, simply too much work...