Author Topic: Custom Spell Control System, I need suggestions..  (Read 508 times)

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« on: September 02, 2010, 03:43:40 am »


               I'm making a custom spell control system, which will work off of the following include script below...

I need help to ensure it's quality & am asking for any tips you may have, I want this to be the best it can be, for it will be a community resource when I'm all done...

The idea behind this system is it will give builders excellent control over All Spells, so they can either turn things up or down as they see fit, for often balance can be maintained through spells..

It appears that this include may be causing some lag too, before the acutal casting..

Here is the include that I will be using, thus far..


// include script:    gen_spell_inc
/////////////////////////////////////////////////////////////
//created by Genisys (Guile)
//created on 8-28-10
////////////////////////////////////////////////////////////
/*
   The whole point of this include is to allow you to adjust
   ALL SPELLS with one simple script!  The switches below
   will control how spells will work in your module only!
   Make sure you BUILD THE MODULE (Scripts Only)
   after you are done editing this script!

   NOTE: DMs always cast at level 40 with this script
   & Monsters / NPCs controlled by a DM cast at 5 levels higher!
*/
/////////////////////////////////////////////////////////////
//IMPORTANT SETTINGS FOR ALL SPELLS!!! (That are effected)
/////////////////////////////////////////////////////////////

//Set the # below to the minimum caster level spells are cast at
//This switch has some uses, and that being Bards / Rangers / Paladins..
//USE WITH CAUTION as low level casters will automatically cast at this level!
const int MINIMUM_CASTER_LEVEL = 1; //Default = 1 (Minimum 1 Caster Level)

//Set the # below to the maximum level used for damage for
//all spells level 1 - 3
const int MAX_DMG_LVL_1_3 = 20; //Default = 20 (20 max Damage Dice Used)

//Set the # below to the maximum level used for damage for all spells
//level 4 - 6
const int MAX_DMG_LVL_4_5 = 25; //Default = 25 (25 max damage dice used)

//Set the # below to the maximum level used for damage for all spells
//level 4 - 6
const int MAX_DMG_LVL_6_7 = 30; //Default = 30 (30 max damage dice used)

//Set the # below to the maximum level used for damage for all spells
//level 4 - 6
const int MAX_DMG_LVL_8_9 = 35; //Default = 35 (Damage capped at level 35 max)

//Set this to FALSE if you don't want to allow Pale Master & RDD to be
//figured in as caster levels for ALL casters (bards included)
const int PRESTIGE_CASTER_LVL = TRUE; //Default = TRUE (Use Prestige Levels)

//Set this to FALSE if you don't want to use EPIC DC for Spells..
const int EPIC_DC_USAGE = TRUE; //Default = TRUE (Use Epic Levels for DC)

//Set this to the # of levels the DC is figured, e.g., if you set it to 3
//then every 3 levels a caster gains an epic DC bonus (after level 20),
//if 2, then every 2 levels beyond level 20 they will get a +1 DC bonus..
const int EPIC_DC_LEVEL_BONUS = 3; //Default = 3 (+1 DC every 3 Levels beyond 20!)

//Set this to the Global Bonus for ALL SPELLS reguardless of caster level!
//You can set this to 0 if you want (diabled) (BE CAREFUL HERE - This is UBER!)
const int BONUS_DC_ALL_SPELLS = 0; //Default = 0 (NO DC Bonus to all Spells)

//Set this to FALSE, if you do NOT wish to use Bonus Damages
const int USE_BONUS_DAMAGE = TRUE; //default = TRUE (Use Bonus Damage For ALL SPELLS)

//BE CAREFUL HERE, this is very powerful!! (TEST IT THOROUGHLY!)
//NOTE: This is NOT CAPPED By Spell Level!
//Set this to how much additional damage / level you wish to apply to ALL SPELLS!
//This only applies to spells which cause damage (Except Missle Spells)
const int SPELL_BONUS_DAMAGE = 0; //Default = 0 (No bonus damage added)

///////////////////////////////////////////////////////////////////
///WARNING DON'T TOUCH ANYTHING BELOW THIS LINE!!!
///////////////////////////////////////////////////////////////////

//Declare all Prototypes
int CasterLvl(object oPC);
int GetEpicLvlDC(object oPC);
int GetDamageBonus(object oPC);

///////////////////////////////////////////////////////////////////
//Define all Prototypes

//Define Prototype
int CasterLvl(object oPC)
{
 int i = 0;
 int n1, n2, n3, nCL;

 if(PRESTIGE_CASTER_LVL)
 {
   n1 = GetLevelByclass(class_TYPE_PALE_MASTER, oPC);
   n2 = GetLevelByclass(class_TYPE_DRAGON_DISCIPLE, oPC);
   n3 = GetCasterLevel(oPC);
   nCL = n1 + n2 + n3; //Combine all 3..
   i = nCL;
 }
 else
 {
  nCL = GetCasterLevel(oPC);
  i = nCL;
  return i;
 }

 //Hook for DMs, they automatically cast at level 40 EVERYTIME...
 if(GetIsDM(oPC))
 {
  i = 40;
  return i;
 }
 //Hook for DM controlled Monsters / NPCs..
 if(GetIsDMPossessed(oPC))
 {
  n1 = GetCasterLevel(oPC);
  n2 = 5;
  i = n1 + n2; //DM possessed Monsters/NPCs get a + 5 Caster Level Bonus...
  return i;
 }

 //Prevent a return of 0 as Caster Level.. NO MATTER WHAT!!! (Sanity Check)
 if(i <=0)
 {
  i = MINIMUM_CASTER_LEVEL;
  return i;
 }

  return i; //Just in case...
}

/////////////////////////////////////////////////////////////////////////////
//Define Prototype
int GetEpicLvlDC(object oPC)
{
 int i = BONUS_DC_ALL_SPELLS;
 int nCL = CasterLvl(oPC);
 int nDC1, nDC2, nDC3;
 int nODC = GetSpellSaveDC();
 string sBonus;

 //If we are using Epic DCs, then figure them up...
 if(EPIC_DC_USAGE == TRUE)
 {
   //Only check epic DC
   if(nCL >20)
   {
      nDC2 = nCL - 20;

     //If there is in fact a bonus possible..
     if(nDC2 > EPIC_DC_LEVEL_BONUS)
     {
       nDC3 = nDC2/EPIC_DC_LEVEL_BONUS;
       if(nDC3>=1)
       {
        sBonus = IntToString(nDC3);
        SendMessageToPC(oPC, "Your Epic DC Bonus = " + sBonus);
        nDC1 = nODC + nDC3;
        i = nDC1 + BONUS_DC_ALL_SPELLS;
       }
       else
       {
        i = nODC + BONUS_DC_ALL_SPELLS;
       }
     }
    //Otherwise just use the base bonus...
    else
    {
     nDC1 = GetSpellSaveDC();
     nDC2 = BONUS_DC_ALL_SPELLS;
     i = nDC1 + nDC2;  //Add the all spells DC bonus in...
    }

   }
   //Otherwise just use the base bonus...
   else
   {
    nDC1 = GetSpellSaveDC();
    nDC2 = BONUS_DC_ALL_SPELLS;
    i = nDC1 + nDC2;  //Add the all spells DC bonus in...
   }

 }
 //Otherwise just use the base bonus...
 else
 {
   nDC1 = GetSpellSaveDC();
   nDC2 = BONUS_DC_ALL_SPELLS;
   i = nDC1 + nDC2;  //Add the all spells DC bonus in...
 }

  return i; //Always return +1 unless told differently..
}

//////////////////////////////////////////////////////////////////////////////
//Define PROTOTYPE
int GetDamageBonus(object oPC)
{
 int i = 0;
 int nCLvl =  CasterLvl(oPC);
 int nDmgBon;
 if(USE_BONUS_DAMAGE == TRUE)
 {
   nDmgBon = SPELL_BONUS_DAMAGE * nCLvl;
   if(nDmgBon==0)
   {
    i = 1;
   }
   else
   {
    i = nDmgBon;
   }
 }
 else
 {
  i = 1; //1 bonus damage is a nominal bonus (for sanity)
 }

 return i;
}
               
               

               


                     Modifié par Genisys, 06 septembre 2010 - 06:19 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #1 on: September 02, 2010, 04:55:48 am »


               I'm definitely going to revise the Bonus Damage to be Epic Bonus Damage based upon a constant which controls the # of Levels per Bonus Damage Dice..

e.g.

a 30th level caster would get 3d6 bonus damage added to the damage delt by the spell, based upon a setting of d6 / 3 levels (epic damage bonus)

the control will allow the Module Designer to adjust how many levels required / damage dice
and which damage dice to use..

therefore

1d12 / 4 levels after level 20 could be possible or..
1d4 / 2 Levels after level 20 could be possible

Hence this gives better control over epic casting for epic modules..

For I've always felt the 20 levels added by HOU really were not that benifitial to casters, for many spells were capped at 20 or less damage dice, and a level 40 caster casting a level 9 spell should do more than 20d6 damage, surely... I know 120 damage may seem like a lot, and it is, but that's if they rolled all 6's, but they would roll more like an average of 2's / 3' / 4' averaging out to be a 3 usually..

Therefore a Meteor Storm would deal around 50-70 damage not 120..  Because the base ice storm spell can do more than that because it's uncapped & doesn't allow a save, it's rather unfair to epic casters to cast these ridiculously underpowered level 9 spells..

But then again, if the module designer wants to tame magic down, they can do this as well with this system.. The system has a flaw by design, it makes all spells of the same level cap at X damage dice, though each spell is different, I will be making Custom Tokens in journals to show the PC your current settings...
               
               

               


                     Modifié par Genisys, 02 septembre 2010 - 03:58 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #2 on: September 06, 2010, 07:18:40 am »


               *bump*  Any help here?
               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #3 on: September 07, 2010, 09:30:00 pm »


               Looks neat, but I don't see how you can apply blanket coverage to all the spells like this without creating loads of new imbalances.



Ice storm has a very different damage setup than wall of fire, and sunburst is very different from horrid wilting.  Both pairs I think are the same level spells.  



So how would this system work for these spells? or how would isaac's lesser and greater missile storms change with this setup?
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #4 on: September 07, 2010, 09:36:17 pm »


               New imbalances, hmmm...  I didn't plan on actually changing spells that have a custom Dmg / X Levels, like icestorm, but I'm not in control of how the builders use this system, because in honesty, this system can work in many different ways...

Facts:

1) A builder can make spells more or less power, how they see fit..
2) You can choose to use most of the systems within the include / or simply not use them..
3) Missle Spells like IMGS, will not be effected by this system, unfortunately...
(For there is no way to hook into the spell effects without editing nw_i0_Spells (not an option))

Therefore if someone wanted to use this custom control to cap damage at level 18 for all spells, for like say a Dragon Lance Campaign, then it would be possible..  Balance is only brought on by the builders ability to see the systems / mechanics at work and adjust them to even the game-play out prospectively. 

I haven't actually started implimenting the include 100% yet, but you have given me reason to change the script some more, I'll probably apply a control to allow the builder to NOT use the level caps for all spells, this way they can make other adjustments as they see fit..  One problem I have ran into is a lag spike at casting, any help there?

No builder will achieve balance with the base system, because the base system introduced level 40, which in itself is pretty unbalanced, a level 40 casting a capped level 20 spells isn't really a level 40 caster, therefore the level 40 fighter who is definitely dishing out considerably more damage would be at an advantage over the level 40 caster..

Just food for though I guess..
               
               

               


                     Modifié par Genisys, 07 septembre 2010 - 08:39 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #5 on: September 07, 2010, 09:50:12 pm »


               

Genisys wrote...

*bump*  Any help here?

I said it already. My spell concept will enable this too, and I was first '<img'>. So rather help me than doing the same thing again. My spell concept is now still in library development state. I need to consider how much wrappers will be there, what will be their name, their parameters. Also I want to add new biware-system switches which most peoples would consider to use like your constant-switches in the include here.

Also if you help me, you will have this done (at least) two times earlier than you did it by yourself. Then if you will want to make some adjustments you will have my whole library for use and you will need to make just changes in it instead of all spells. ':whistle:'
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #6 on: September 07, 2010, 11:09:40 pm »


               Sshhh don't use the word switches, it may start another flame war here.. lol

Well ShaDoOow, I suppose you could look at the above script for some ideas maybe?

I'll be patient with your system, because honestly a spell system is A LOT of freaking work.. wooosh!
               
               

               


                     Modifié par Genisys, 07 septembre 2010 - 10:11 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #7 on: September 08, 2010, 03:23:11 am »


               

Genisys wrote...

Well ShaDoOow, I suppose you could look at the above script for some ideas maybe?

If you mean, I could use some of them; then no none of this suits me. I will provide just bioware module switch (':devil:') to allow add PM levels to caster level, and maybe one another for disabling damage/bonus caps.

I just want to allow any experienced scripter to make global changes in all spells easily (exactly like your project).

If you mean, if I help you with it; then...
- split PM and RDD into new constants, not everyone would want to enable them both
- you should check for spell type (divine, arcane) before applying RDD/PM level to caster level
rest makes balances and I can't predict them so can't help you either
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #8 on: September 08, 2010, 04:41:31 am »


               I still prefer using constants in one include / configuration script to control all scripts, but that's just me.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #9 on: September 08, 2010, 02:26:35 pm »


               

Genisys wrote...

I still prefer using constants in one include / configuration script to control all scripts, but that's just me.

Well advantage of module switches is that you don't need to recompile all spell scripts in order to make the changes. With include you have to.
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #10 on: September 08, 2010, 05:24:06 pm »


               

ShaDoOoW wrote...

Genisys wrote...

I still prefer using constants in one include / configuration script to control all scripts, but that's just me.

Well advantage of module switches is that you don't need to recompile all spell scripts in order to make the changes. With include you have to.


So your system will allow modifications in game to switches more or less?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #11 on: September 08, 2010, 07:18:31 pm »


               My system will allow just few little global changes through editing OnModuleLoad script or putting variable on module manually. I want only provide the most approved changes like PM levels adds to arcane spells caster level. Except the PM, I had idea to allow remove caster level caps from damage, but not sure, and yet nothing more, but feel free to suggest anything. (epic DC not, as there must be some calculation and you cant please everyone)
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #12 on: September 08, 2010, 09:21:23 pm »


               While I agree that spells should progress in power past 20th (some are capped at much lower by default) not all should. So a system like this simply has no appeal to me I'm afraid. I have made many custom changes to the spells in my own PW, but they are scaled to the balance of the module overall and not all surpass the normal defaults. Since spells are so easilly uncapped individually (or their caps raised), I prefer my own pick and choose method rather than what you've suggested. I suspect the lack of response here by others is due to most thinking along parallel lines to my own thoughts.



Don't let this hinder you though. If you like the idea then there's undoubtabley a few others that will too. Even if no one else does, its still worth pursueing for your own uses. I personally build/script for my own reasons and do it based on my own personal preferences. I never worry if others don't think the same or worry that a NWN Vault submission gets 2 or 2000 downloads and what if any comments are left there. Build and script because you enjoy it, share what you will and have no further expectations and life will be good.
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Custom Spell Control System, I need suggestions..
« Reply #13 on: September 08, 2010, 11:50:10 pm »


               I'll take all the suggestions I can get, thanks kalbaern.  '<img'>



I'm definitely adding a constant that will allow the user to NOT use custom level caps, thereby allowing them to leave spells at default settings, as I stated above.