Author Topic: Where is Spell Data stored?  (Read 1034 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Where is Spell Data stored?
« on: November 12, 2014, 05:11:47 pm »


               The title is somewhat vague - apologies for that.
I am using nwnx_cool - by Terra_777, to allow for level progression beyond level 40 up to level 50 and beyond.


However, what I am finding is that when a Sorcerer / Wizard level is taken for Level 41 or beyond, it wipes out / prevents access to the Characters spell book.

Eg: after a rest, the spells just vanish or get 0 casts per day.

Is there a 2da that needs to be altered in order to configure spell cast amounts for levels 41+
If so - where?

Has anyone else seen similar issues with increasing the level cap?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #1 on: November 13, 2014, 12:50:12 am »


               

Yes, the spells known and spells gained 2das only have entries up to level 40 edit 60.  In addition, the epic BAB and saving throw progressions will only take you up to character level 80.  There are probably a whole slew of other issues to be handled (including the XP table).



               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #2 on: November 13, 2014, 06:00:32 pm »


               

It's been a long time ago now, but I made a nwnx_levels plugin that raised the level cap on linux to 60.  I don't remember all the issues anymore but I did have to put in a couple hooks for spells: CNWClass__GetSpellsKnownPerLevel and CNWClass__GetSpellGain because the server/client hardcodes some things to 40th level for PCs.  Familiars/Animal Companions will also stop working.


 


This is extraneous to your question, but I had hope that the client would be able to handle the increase in level cap, but it just can't.  I'm not sure it will save you much woe or not, but I ultimately decided that I had to use a HGLL conversation and level up characters server side.


               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #3 on: November 14, 2014, 10:46:56 am »


               

I will try creating a similar hook in nwnx_cool.



Familiars/Animal Companions will also stop working



Yes - We had also noticed that they seemed to stop working - although Familiar seemed to work for some reason, just not animal companion.


Odd.


 


I will see if the server side fixes solve my problem - cheers.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #4 on: November 14, 2014, 11:31:19 am »


               


I will try creating a similar hook in nwnx_cool.


 


Yes - We had also noticed that they seemed to stop working - although Familiar seemed to work for some reason, just not animal companion.


Odd.


 


I will see if the server side fixes solve my problem - cheers.




my nwnx_patch plugin (shipped with CPP 1.72beta) will fix this as it allows to customize both familiar and animal comanion sumoning with ranger+druid and wizard+sorcerer level stacking + post lvl 40fix summoning lvl 40 animal by default.


               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #5 on: November 15, 2014, 03:21:31 pm »


               Hey all.
I have installed the nwnx_patch dll - is there any documentation with it for switches?

Also I added the following hooks to my version of nwnx_cool
This does seem to allow spellbooks to remain accessible, but during levelup, only cantrips remain editable.
Meaning levels 1-9 are offlimits - and the spells effectively get locked in.

Is this down to client side restrictions?



// 00504C30
int __fastcall CNWClass__GetSpellsKnownPerLevel(CNWClass *cls, void *, uint8_t level, int8_t sp_level, int8_t cls_type, uint16_t race, uint8_t cha){

if(level > 39){
level = 39;
}

return CNWClass__GetSpellsKnownPerLevelNext(cls,NULL, level,sp_level,cls_type,race,cha);
}


//00504BF0
int __fastcall CNWClass__GetSpellGain(CNWClass *cls, void *, uint8_t level, int8_t sp_level){

if(level > 39){
level = 39;
}

return CNWClass__GetSpellGainNext(cls,NULL, level,sp_level);
}
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #6 on: November 15, 2014, 05:34:08 pm »


               


Hey all.

I have installed the nwnx_patch dll - is there any documentation with it for switches?




im afraid that i havent write any documentation, i try to upload my source code, that will be better for you purposes, but basically there is a nwnx.ini switch for most of the changes + module switch controlling some others (module switches should be found in x2_inc_switches if you install cpp, I havent externalized this yet)



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #7 on: November 15, 2014, 06:00:35 pm »


               I tried summoning a familiar at level 42 and it didnt summon anything.
Is there any settings I need to set?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Where is Spell Data stored?
« Reply #8 on: November 15, 2014, 06:13:43 pm »


               


I tried summoning a familiar at level 42 and it didnt summon anything.

Is there any settings I need to set?




oh... i forgot...


 


Many of the functionalities depends on new NWScript scripts - ie. I externalized and softcoded these things so you need a script for that. So it wont work without CPP installed standalone unless you rip these scripts from CPP first and add into module/override.


 


these are:


70_s2_devattk


70_s2_dthattk


70_s3_healkit


nw_s2_familiar


nw_s2_animalcomp


 



 


//::///////////////////////////////////////////////

//:: Summon Familiar

//:: NW_S2_Familiar

//:: Copyright © 2001 Bioware Corp.

//:://////////////////////////////////////////////

/*

    This spell summons an Arcane casters familiar

*/

//:://////////////////////////////////////////////

//:: Created By: Preston Watamaniuk

//:: Created On: Sept 27, 2001

//:://////////////////////////////////////////////

/*

Patch 1.72


- softcoded,builder is now able to override the summoned creature resref within NWScript

- wizard and sorcerer levels stacks together for determining the animal companion level now

*/


void main()

{

    string sResRef = Get2DAString("hen_familiar","BASERESREF",GetFamiliarCreatureType(OBJECT_SELF));

    int nLevel = GetLevelByClass(CLASS_TYPE_SORCERER)+GetLevelByClass(CLASS_TYPE_WIZARD);

    if(nLevel <= 0) return;

    else if(nLevel < 10) sResRef+= "0";

    else if(nLevel > 40) nLevel = 40;

    sResRef+= IntToString(nLevel);

    //NWNX hook to override summoned creature resref

    SetLocalString(OBJECT_SELF, "NWNX!PATCH!SETSUMMONEDRESREF",sResRef);

    //Yep thats it

    SummonFamiliar();

}

 



 



 


//::///////////////////////////////////////////////

//:: Summon Animal Companion

//:: NW_S2_AnimalComp

//:: Copyright © 2001 Bioware Corp.

//:://////////////////////////////////////////////

/*

    This spell summons a Druid's animal companion

*/

//:://////////////////////////////////////////////

//:: Created By: Preston Watamaniuk

//:: Created On: Sept 27, 2001

//:://////////////////////////////////////////////

/*

Patch 1.72


- softcoded,builder is now able to override the summoned creature resref within NWScript

- druid and ranger levels stacks together for determining the animal companion level now

*/


void main()

{

    string sResRef = Get2DAString("hen_companion","BASERESREF",GetAnimalCompanionCreatureType(OBJECT_SELF));

    int nLevel = GetLevelByClass(CLASS_TYPE_DRUID)+GetLevelByClass(CLASS_TYPE_RANGER);

    if(nLevel <= 0) return;

    else if(nLevel < 10) sResRef+= "0";

    else if(nLevel > 40) nLevel = 40;

    sResRef+= IntToString(nLevel);

    //NWNX hook to override summoned creature resref

    SetLocalString(OBJECT_SELF, "NWNX!PATCH!SETSUMMONEDRESREF",sResRef);

    //Yep thats it

    SummonAnimalCompanion();

}