Author Topic: get value of concealment  (Read 353 times)

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
get value of concealment
« on: May 01, 2012, 02:09:25 am »


                so, checking if a target is concealed is simple:

    if(GetHasEffect(EFFECT_TYPE_CONCEALMENT, oTarget)){        SpeakString("concealed!");    }

but how do i check to see what the % of concealment is?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
get value of concealment
« Reply #1 on: May 01, 2012, 03:48:36 am »


               Hopefully someone will correct me,  

I do not think it can be done within vanilla NWN.   There may be a way to do it with NWNx, Hopefully if I am not corrected, Someone will be able to tell you about a NWNx way.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
get value of concealment
« Reply #2 on: May 02, 2012, 11:01:53 pm »


               Nwnx_funcs can do it, indeed, but it IIRC it works on effects created with the include functions. A text search for "effect" will quickly point to the functions dealing with effects in the main include file(nwnx_funcs).


Kato
               
               

               


                     Modifié par Kato_Yang, 02 mai 2012 - 10:06 .
                     
                  


            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
get value of concealment
« Reply #3 on: May 03, 2012, 08:59:48 am »


               If you're using linux server you can use this function in Acaos' nwnx_structs plugin:

/* Returns the internal effect integer at the index specified. The index
* is limited to being between 0 and 15, and which index contains what
 * value depends entirely on the type of effect. */
int GetEffectInteger (effect eEffect, int nIndex);

An EffectConcealment stores the % value at index 0 and the MISS_CHANCE_TYPE_* in index 4

If it's had VersusRacialTypeEffect applied to it then the race is stored in index 1, if not it will be RACIAL_TYPE_INVALID.

If it's had VersusAlignmentEffect applied to it then alignment versus law/chaos is stored in index 2, and versus alignment good/evil in index 3; if not these will be 0.

(EffectMissChance functions identically)
               
               

               


                     Modifié par pope_leo, 03 mai 2012 - 08:16 .