• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Creating a new racial trait with ability modifer

Hello I have created a new racial trait. However, the benefit of the trait is determined by the constitution score.
Code:
~ If we're disabled, just get out now
      doneif (tagis[Helper.SpcDisable] <> 0)

      #situational[hero.child[svAll],"+X vs. spell & spell-like abilites",field[thingname].text]

Where X should equate to something like: hero.childfound[isCheckCon] += (4 is +1, 7 is +2, 11 is +3, 14 is +4, 18 is +5)

I simply do not know how to insert X into the statement. However, I can follow example code.

Well, I scripted a solution. If anyone would like to show me some cleaner code, especially on daisy-chaining "if's" instead of something like "&&", I would appreciate it. I also, couldn't get a "string &= "blah blah"" to compile inside of a #situational
Code:
~ If we're disabled, just get out now
      doneif (tagis[Helper.SpcDisable] <> 0)

      var str as string

      if (#attrvalue[aCON] < 4) then
        str = "+0"
      endif
      if (#attrvalue[aCON] > 3) then 
       if (#attrvalue[aCON] < 7) then 
         str = "+1"
       endif
      endif
      if (#attrvalue[aCON] > 6) then 
       if (#attrvalue[aCON] < 11) then 
         str = "+2"
       endif
      endif
      if (#attrvalue[aCON] > 10) then 
       if (#attrvalue[aCON] < 14) then 
         str = "+3"
       endif
      endif
      if (#attrvalue[aCON] > 13) then 
       if (#attrvalue[aCON] < 18) then 
         str = "+4"
       endif
      endif
      if (#attrvalue[aCON] >= 18) then
         str = "+5"
      endif 
   str &= " vs. spell & spell-like abilites"   
#situational[hero.child[svAll],str,field[thingname].text]
 
Last edited:
Back
Top