Author Topic: Hooking concentration checks?  (Read 1360 times)

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Hooking concentration checks?
« on: July 04, 2014, 04:12:34 am »


               

Greetings,


Our world has a bit of an issue for arcane casters. The damage at higher levels far exceeds what the cap of 127 concentration can overcome. As such arcane casters on our world are at a serious disadvantage at higher levels.


 


I thought I would reach out here, and on the NWNX website to see if someone might be willing to help us with this issue. We use multiple NWNX plugins to do things way beyond the scope of the original game, so I wonder if this might be possible too?


 


I would love to hear from anyone willing to offer ideas, and better yet help.


Kind regards,


Lazarus Magni



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Hooking concentration checks?
« Reply #1 on: July 05, 2014, 08:08:26 pm »


               If you can get hold of nwnx_cool for windows, this plugin is like a much more powerful version of the nwnx_events plugin.
It comes with a UseSkill hook, that should allow you to identify the Skill being used, and the target of the skill.

Not sure if it allows you to get DC or anything for checks, but it might be a step in the right direction?
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Hooking concentration checks?
« Reply #2 on: July 06, 2014, 07:03:11 am »


               

We do in fact already use nwnx_cool for windows. However I have no idea on how to code a script (or alter an existing one) to utilize it in this manner. Any chance someone might be willing to throw us some snippets of code that could, and a little guidance on where to insert it?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Hooking concentration checks?
« Reply #3 on: July 06, 2014, 12:02:27 pm »


               

Ive looked at this already and UseSkill wont help. The function checks this directly from skill rank. (GetSkillRank)


 


problem is that GetSkillRank is a char - Im not sure what would happened if you hooked GetSkillRank, added value from local variable and returned something that would exceeded 8bytes. I smell a crash...


 


Thus inline hook had to be done which is always pain in the ass.



               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Hooking concentration checks?
« Reply #4 on: July 06, 2014, 07:30:22 pm »


               

Hi Shadooow,


Thanks for the response.


 


You are talking a bit above my head here though. What exactly is a "char"?


 


And what do you mean "inline hook"?


 


For us we were thinking 1 of 2 things.


 


1) Completely disabling the concentration check. Definitely not ideal as it's a facet of the game we enjoy in principle (it makes it more challenging and multi dimensional.)


 


2) Adding concentration to the player based off their post 40 level (and perhaps fractionally dependent based off their 1-40 class structure. And by that I mean a pure wiz would get more "post 40" concentration than say a 20 wiz 20 ftr.) Something on the order of +1 (or 2) conc for every post 40 level.


 


Or some other solution we haven't considered yet.


Laz


 


 


 


 


 


 


 



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Hooking concentration checks?
« Reply #5 on: July 06, 2014, 07:39:16 pm »


               


Hi Shadooow,


Thanks for the response.


 


You are talking a bit above my head here though. What exactly is a "char"?


 


And what do you mean "inline hook"?


 


For us we were thinking 1 of 2 things.


 


1) Completely disabling the concentration check. Definitely not ideal as it's a facet of the game we enjoy in principle (it makes it more challenging and multi dimensional.)


 


2) Adding concentration to the player based off their post 40 level (and perhaps fractionally dependent based off their 1-40 class structure. And by that I mean a pure wiz would get more "post 40" concentration than say a 20 wiz 20 ftr.) Something on the order of +1 (or 2) conc for every post 40 level.


 


Or some other solution we haven't considered yet.


Laz




char is a variable type that has 8bites - that is either -127 - +127 or 0-255


inline hook is a method of engine patching that is bit tricky.


 


but to disable the concentration check wouldn't be that hard - and you could always rescript that in the OnDamage event (Baaleos can help you with this or you can use the OnCastSpell on armor method).


 


BUT - that is posible without engine hooking actuall.


 


Set UseConcentration for all spells to 0 (-1 might also work - that way you could easily distinguish which spell should and which shouldnt).


               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Hooking concentration checks?
« Reply #6 on: July 06, 2014, 07:46:31 pm »


               

Hmm... thanks for the info, sounds like there may be some possibilities here.


 


Doing a little exploring on my own here too, I am looking at nwnx_funcs (for windows) which we also already use, and I see that there are numerous functions for modifying skills. Would these modifications (or ones achieved by Leto) be subject to the 127 cap?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Hooking concentration checks?
« Reply #7 on: July 06, 2014, 07:48:32 pm »


               

yes they would



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Hooking concentration checks?
« Reply #8 on: July 06, 2014, 10:51:58 pm »


               

*Improved suggestion.


 


Just remove the collumn. That way you will be able to read the original value via Get2DAString but otherwise all spells will not require concentration.


 


And in the OnDamage, try one of these:


- apply 100% spell failure for 1second

- set variable on PC that will be read in spellhook where you cancel spell


 


since ClearAllActions is not applicable in this situation.



               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Hooking concentration checks?
« Reply #9 on: July 06, 2014, 11:00:23 pm »


               

As far as altering the 2da, is that something that could be server side only? We have done this in the past, but have strived to not require players use custom haks (other than CEP.)


 


But again, even if this might be a solution to disabling the concentration check entirely, this is far from ideal from my standpoint. Disabling conc, in my view would be a method of last resort to help ensure all classes are playable at higher levels (which mages are, but I guess I mean soloable.)



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Hooking concentration checks?
« Reply #10 on: July 06, 2014, 11:27:50 pm »


               


As far as altering the 2da, is that something that could be server side only? We have done this in the past, but have strived to not require players use custom haks (other than CEP.)




oh yes



 


But again, even if this might be a solution to disabling the concentration check entirely, this is far from ideal from my standpoint. Disabling conc, in my view would be a method of last resort to help ensure all classes are playable at higher levels (which mages are, but I guess I mean soloable.)



Did you read what I said? You can script and add custom concentrate check once you disable the default one. THATS what you want, dont you? I even said how to do that.


               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Hooking concentration checks?
« Reply #11 on: July 06, 2014, 11:55:37 pm »


               

Shado0ow please don't take offense. I sincerely appreciate you trying to help us resolve this. My limited understanding of what you are saying in no way confers some disrespect. I absolutely read what you said.


 


As far as how to do that, we could certainly use some help on that. I can easily make the 2da modification myself. But I am not a scripter. Never claimed to be, and never will be (I know my limitations.)