Author Topic: Retrieving the current AB of a creature  (Read 378 times)

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving the current AB of a creature
« on: January 23, 2012, 06:53:10 am »


               Hi,

Does anyone know of a function doing this? GetBaseAttackBonus returns the BAB, but what about the AB(shown on the character sheet)? Sorry if it's been asked before, I've searched in the lexicon, the Omnibus and these forums, but no luck yet. Maybe a nwnx plugin...

Thanks in advance


Kato
               
               

               


                     Modifié par Kato_Yang, 23 janvier 2012 - 06:54 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Retrieving the current AB of a creature
« Reply #1 on: January 23, 2012, 07:16:48 am »


               Im calculating this on paper, BAB+mod str/dex/wis+weapon+feats '<img'>
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Retrieving the current AB of a creature
« Reply #2 on: January 23, 2012, 10:20:01 am »


               The AB depends largely on the weapon that you are looking at.  For example, the character sheet does not consider creature weapon slots and thus ignores AB bonuses that creatures have on their creature weapon.  There are many other bugs with the character sheet report (including the epic prowess bug)  where DebugMode will show different results than the character sheet.

EnableCombatDebugging reports the real attack rolls.  If you want to parallel this you may find yourself going through a whole mess of feats including bane of enemies and nature sense, as well as checking to see which slots override other slots.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving the current AB of a creature
« Reply #3 on: January 23, 2012, 05:41:08 pm »


               Okay, thank you both. I guess I'll have to retrieve this manually in code, even though it indeed makes a lot of potential feats to check. I'm surprised that not even a nwnx plugin does this. I'm using nwnx_cool to override some special attacks(knockdown, smite etc...), thus the AB of the attacker must be retrieved quite often in order to apply the corresponding bonuses/penalties to it. The plugin hooks GetAttackModifierVersus(), GetRangedAttackBonus() and GetMeleeAttackBonus() but these functions are not exposed to nwscript... Would there be a way to at least simulate such a special attack at full/modified AB?


Kato
               
               

               


                     Modifié par Kato_Yang, 23 janvier 2012 - 06:55 .
                     
                  


            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Retrieving the current AB of a creature
« Reply #4 on: January 23, 2012, 10:36:52 pm »


               Funky had a custom function that found it, I use it in my HR base and added in size mod. to it. I will look for it. Do a search for it. Maybe Funky will post it again.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving the current AB of a creature
« Reply #5 on: January 23, 2012, 11:16:44 pm »


               Indeed, I have found it searching by author, in the Omnibus, topics "Emulated Attack Roll" and "How to get real AB?", for anyone interested. Thank you very much for the info ShadowM!

@Funky: Very nice system, thanks a lot for sharing it!!
               
               

               


                     Modifié par Kato_Yang, 23 janvier 2012 - 11:44 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving the current AB of a creature
« Reply #6 on: January 26, 2012, 07:43:41 pm »


               Very good news: Tera_777 has updated nwnx_cool(0.8), so we can now retrieve the AB vs(same with AC vs) with a single, fast function! A thousand thanks Tera_777!


Kato 
               
               

               


                     Modifié par Kato_Yang, 26 janvier 2012 - 07:52 .