Author Topic: Problem with Great Wisdom\Intellegence and spellslots  (Read 907 times)

Legacy_xa0t3k

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« on: February 26, 2015, 02:42:48 pm »


               

Hello guys.


Anybode to know how to fix bug with Great Wisdom\Intellegence and dissapearing bonus spellslots?

Example:

Cleric 40 level.

Base Wisdom = 15

Wisdom from epic feats = 7

Final Wisdom == 22

After relog on server, character doesn't have memorized spells on 6-9 levels, they totally dissapear from spellbook. Same situation with bonus spellslots on lower spell levels.

I trying use funcs RestoreReadySpells/GetAllMemorizedSpells from nwnx_funcs in OnClientEnter/OnClientLeave but it doesn't fix problem.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #1 on: February 26, 2015, 06:52:05 pm »


               


After relog on server, character doesn't have memorized spells on 6-9 levels, they totally dissapear from spellbook.




 


That sounds like it's not a bonus spellslots problem but rather the game considers the character to only have 15 Wisdom and thus the character can't have any level 6+ spells memorized.  There might also be a bonus spell slots issue on top of that, though.



               
               

               
            

Legacy_xa0t3k

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #2 on: February 26, 2015, 07:13:16 pm »


               

Yes, you right. But when i fill 6+ level spellslots and rest, i can cast these memorized spells. Bug occurs only on login on server.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #3 on: February 26, 2015, 07:28:33 pm »


               

are we talking here about server running on windows or linux? because I havent seen this issue on windows...



               
               

               
            

Legacy_xa0t3k

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #4 on: February 26, 2015, 07:31:36 pm »


               

linux


Plugins:


NWNX2lib: org SetString() at 81f41b4, new SetString() at f77a9365

NWNX2lib: org GetObj() at 81f40bc, new GetObj() at f77a938c

* Parsing configuration...

NWN Extender v2.8-dev

© 2004 by the APS/NWNX Linux Conversion Group

© 2007-2010 by virusman and Acaos

Based on the Win32 version © 2003 by Ingmar Stieger (Papillon)

and Jeroen Broekhuizen

visit us at http://www.avlis.org


* Searching for signatures...

* Loading modules...

TMI plugin registered.

FUNCS plugin registered.

FIXES plugin registered.

RESETPLUGIN plugin registered.

OPTIMIZATIONS plugin registered.

WEAPONS plugin registered.

SPELLS plugin registered.

FUNCSEXT plugin registered.

SYSTEM plugin registered.

EXTEND plugin registered.

TWEAKS plugin registered.

STRUCTS plugin registered.

DEFENSES plugin registered.

FUNCTIONS plugin registered.

ODBC plugin registered.

 



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #5 on: February 26, 2015, 07:41:33 pm »


               

well this is known bug on linux server, afaik nobody fixed it yet


 


it might be possible to workaround it via the method youve tried though, maybe you did some mistake in the script?



               
               

               
            

Legacy_xa0t3k

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #6 on: February 26, 2015, 07:45:30 pm »


               

The script is simple.


ModEnter



string sSpells = GetLocalString(GetModule(), "spellbook_"+IntToString(GetPCPersistentID(oPC)));
RestoreReadySpells(oPC, sSpells);

ModExit



SetLocalString(GetModule(), "spellbook_"+IntToString(GetPCPersistentID(oPC)), GetAllMemorizedSpells(oPC));

               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #7 on: February 26, 2015, 07:46:32 pm »


               

I've seen this on both Windows and Linux Servers myself.


 


The bonuses granted by feats act a lot like the bonuses from equipped items. In both cases, as you log in, initially the bonuses aren't applied. Sometime during loading, your feat bonuses are restored, followed by bonuses for equipped items.


 


Unlike equipment bonuses however, if you log in and out and the server hasn't been reset, your feat bonuses should remain. Its only after a server reset they need reapplied.



               
               

               
            

Legacy_xa0t3k

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #8 on: February 26, 2015, 07:59:49 pm »


               

Also, my server settings



Enforce Legal Characters=1
ItemLevelRestrictions=1
Restore Spell Uses On Login=0

               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #9 on: February 26, 2015, 10:09:02 pm »


               

Saving it as a local variable to the module won't help in a server reset. You want to save it however you are saving persistent vars for the PC I'd think. Second, you might try delaying the RestoreReadySpells(oPC, sSpells); a couple of seconds to make sure the PC has completed entering the module since we seem not to know exactly when the engine is clearing the "invalid" spell slots.


 


I bet this is caused by enforce legal characters...



               
               

               
            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #10 on: March 02, 2015, 07:02:10 pm »


               I have heard this is an artifact of ELC as well. Has there been confirmation of that? It's a constant problem on a server I frequent (not running NWNX) where I play many casters and often forget which spells I intended a particular caster to have in those cleared slots.

BTW, I think it's also an issue when simply re-logging a character. Even when there has not been a server reset, my toons will have cleared slots if they log and come back.

(These days, I rely on a python-calling-letoscript script that prints out the current spell slot assignments of a local vault character. When I make any significant changes to a character's spell book, I save the toon, run my script, and then paste the results in his journal so that I have it handy in-game to repopulate the slots.)

Anyway, is there any possibility of a fix to this that doesn't involve NWNX? Maybe a scripted ELC would get around the issue?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #11 on: March 02, 2015, 07:20:50 pm »


               


I have heard this is an artifact of ELC as well. Has there been confirmation of that? It's a constant problem on a server I frequent (not running NWNX) where I play many casters and often forget which spells I intended a particular caster to have in those cleared slots.




I dont think so but I cant proof otherwise



 


BTW, I think it's also an issue when simply re-logging a character. Even when there has not been a server reset, my toons will have cleared slots if they log and come back.



yes it does bugs even with just relog



 


Anyway, is there any possibility of a fix to this that doesn't involve NWNX? Maybe a scripted ELC would get around the issue?



If ELC is issue then custom ELC could be a fix, but I dont think so...



               
               

               
            

Legacy_xa0t3k

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #12 on: March 02, 2015, 07:59:33 pm »


               

With ELC off, bug doesn't appear.


BTW i solved this problem by using nwnx_funcs(GetMaxSpellSlots(), SetMemorizedSpell(), GetMemorizedSpell()) and nwnx_odbc.


Also, i found another bug, in GetMemorizedSpell(), it doesn't save cleric domain flag. If anyone need fix for that i can share.



               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #13 on: March 08, 2015, 03:19:55 pm »


               You could try applying a stat bonus (temporarily) on client enter (do it at the very first as they enter the module), this may do the trick.. (I dunno though)


I've seen quite a few bugs that present this problem, especially where shifters are concerned, spell slots disappear when gear is removed when they shift, so again, the only real solution is a temporary stat bump, like +12 to all stats and remove after a delay (via nwnx_funcs.dll plugin using nwnx2)....
               
               

               
            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Problem with Great Wisdom\Intellegence and spellslots
« Reply #14 on: March 09, 2015, 10:33:58 am »


               First, I want to confirm that it appears that ELC is involved in this. With ELC enabled, my test wizard with Great Intelligence feats has spells from the slots due to the greater INT cleared. With ELC disabled, the slots are not cleared.

The stat bump approach doesn't work easily for shifters who lose spell slots due to unequiped/re-equiped WIS bonus items (or other spellcasting stat bonus items if the shifter is also an arcane caster). It's an incomplete solution even for that issue, since the PC will have those slots cleared when he unshifts as well, which is pretty much just as bad, since he wasn't doing much casting while shifted anyway. A stat bump that lasts for the whole shift might work. But, without a lot of care, it would end up capping the wisdom of toons who don't wouldn't have otherwise had it capped (potentially a big deal for toons with monk levels or shape abilities whose DC benefits from wisdom). Sadly, Bioware didn't provide an OnUnshift event, so we can't also add the stat bump when the toon is unshifting. And, stat bumps don't address the issue of bonus spell slot items.

Regardless of it's impact on shifting, a stat bump doesn't help much with slots cleared on PC entry for many toons because the temporary stat bump is still subject to the +12 cap. So, PCs with +12 worth of gear (which will be many epic toons, even on mid-magic modules) are already capped (and will see no added bump from the temp stat boost) and will still have the slots from the Great * feats cleared (since those aren't part of the cap).

Part of the problem here is that Bioware didn't give us a bonus spell slot effect. That way, we could give bonus slots as a temp effect while running ELC (or during OnClientLeave or whatever) and the extra slots would hold the spells until the Great * feats were re-applied.

A bonus spell slot effect would also help deal with the shifter issue, since a bonus spell slot effect could start with the polymorph effect and would keep the slots from clearing until the toon unshifted. Unfortunately, that might require a heartbeat script to check when the toon is no longer shifted so that the bonus slots effect could be removed. (Just linking the effects may not work, since bonus slot effect would likely go away before the just-unshifted toon got his gear bonuses re-applied.)

However, as best I can tell, ELC either runs before OnClientEnter or ELC unequips gear. I am guessing the former. I think that foils many approaches.

For instance, I wrote some code for the OnClientEnter script to temporarily add the bonus spell slot item properties to something the toon is wearing (the chest item was default). To be honest, this is the approach I thought would be the easiest to get working (or at least to try). But, no dice. The script runs, but the toon still has spell slots cleared. I don't know much about how the mechanics of ELC work, but it seems to have run before OnClientEnter. If there is a way to apply an item property to a just-logged PC's gear before ELC runs, then I think that would do the trick. I just don't know how, since it seems the OnClientEnter is too late.