Author Topic: How to edit Spell Casts per Day  (Read 464 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
How to edit Spell Casts per Day
« on: April 03, 2014, 01:45:17 pm »


               

Is there a 2da to edit to alter the amount of spells available to sorc/wiz per day?


 


I am using nwnx_cool, and it has the ability to allow for level 41+ in your nwn server. (I've enabled levels 41-45 so far)


The problem I am seeing however is that when some of my spell casting players level up, they are immediately losing access to the spells they have in their spellbook - it seems that the system is reading a 0 for the amount spell casts per day for level 41+.


Im just wondering if this is an engine setting, or if I can edit a 2da  to add in rows for level 41 onwards.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
How to edit Spell Casts per Day
« Reply #1 on: April 03, 2014, 01:59:55 pm »


               

Found a 2da package on the vault, and it has cls_spgen_* 2da's which seem to describe the functionality I want.


 


The problem is that I dont know if these are custom ones, or the ones that describe the default values for nwn.


The ones in the package, describe levels 1-60 - so level 41 should be working by all accounts.


 


If they are already the values that my server is behaving by, then I dont understand why level 41 is getting 0 spells per day cast?


 


I've added them to the override directory, just incase they are updated values.


 



               
               

               
            

Legacy_gutwrench66kg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +0/-0
How to edit Spell Casts per Day
« Reply #2 on: April 03, 2014, 02:25:54 pm »


               

yep!


 


Cls_spgen_* 2da files dictate the spells per day.


 


the default ones don't give any increase in spells per day in a class past about 19th level.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
How to edit Spell Casts per Day
« Reply #3 on: April 03, 2014, 03:05:38 pm »


               

Not entirely sure whats going on then.


I have a subrace, called Fae, and when they cast a spell, the spellhook system restores the spells using nwnx_funcs.


It is designed to set their remaining spell casts back to their remaining.


Based on what I can see I think it might be part engine bug, and part of my system.


 


This code from nwnx_funcs grabs the 'max' casts per day from the bic file (character) for a specific spell level,


then it checks to see if the Slots parameter (provided by the user / script) is higher than the value for the max per day.


if it is larger than the max per day, then it changes slots to be that maximum value.


 


The question however, is this.


Where/Why is level 41 for this players character wiping out her max per day spell casts.


I don't think there is anywhere in my framework that modifies the max per day casts, all I do is change the remaining slots, which doesnt affect the max per day fields.


 


Odd


 


/* iterate their class list, matching the requested class, then set the slots */
for (i = 0; i < cre->cre_stats->cs_classes_len; i++) {
if (cre->cre_stats->cs_classes[i].cl_class != Class)
continue;

        if (Slots > cre->cre_stats->cs_classes[i].cl_spells_max[SpellLevel])
Slots = cre->cre_stats->cs_classes[i].cl_spells_max[SpellLevel];

cre->cre_stats->cs_classes[i].cl_spells_left[SpellLevel] = Slots;
break;
}