• 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

Custom ability limit based on level

TobyFox2002

Well-known member
I have run into a custom ability that adds to ability score and can be taken once plus one time for every six levels a character possesses. The way the MAX LIMIT works, it doesn't seem like it can be dynamically altered based on scripts. I dont see any tags or fields that manipulate that.

I'm fairly certain I've seen customs that function similarly to this but I cant recall. Would anyone have any thoughts on how I could proceed.

Ability Increase (Ex):
The engineer’s constructs all have their Strength or Dexterity ability scores increased by +2. This modification can be selected more than once. It can only be applied once to an individual ability score, plus one additional time for every six levels the engineer possesses.

The next issue is, and I haven't quite gotten to this point yet is that the fact that this doesn't apply to this to the player (most of the time) it applies it to their pet construct. How do I transition this choice to to a minion or companion?
 
No, max limit is a fixed value. In cases like this, you should use a prereq to enforce the limits you want, instead of using max limit.

An example of something that alters ability scores on a minion is the Human ART Eye for Talent.
 
I would recommend looking at the summoner. The Eidolon has several abilities that have similar logic of can be take X number of levels.
 
I have tried to copy an ability from the Eidolon which does exactly what I want, Unfortunately when I bring it from a racial custom to a Class Custom. However, when I do this nothing happens. No how many levels i add to the hero the script says the allowed copies is zero.

I want to keep the code mostly like this so the same script can be used directly on the hero or function on the minion.

Pre-reqs
Code:
var classlev as number
var minionlev as number

~classlev = round(parent.field[xAllLev].value/6,0,-1)
~minionlev = round(herofield[tCompLevel].value/6,0,-1)

~debug "[cENgAbilSt] Class Levels : " & classlev
~debug "[cENgAbilSt] Minion Levels : " & minionlev

var allowed as number
      if (ishero = 0) then
        allowed = round(parent.field[xAllLev].value/6,0,-1) + 1
      elseif (isminion <> 0) then
        allowed = round(herofield[tCompLevel].value/6,0,-1) + 1
        endif
  debug "[cENgAbilSt] Allowed Copies : " & allowed
      ~if we're a pick, then must be complevel/6 or fewer copies of
      ~ this ability
      if (@ispick <> 0) then
        validif (tagcount[HasAbility.cENgAbilST] <= allowed)

      ~otherwise, look for fewer, since we're adding this
      else
        validif (tagcount[HasAbility.cENgAbilST] < allowed)
        endif

      @message = "You may not have more than " & allowed & " copies of this ability."
 
Sorry for the thread necro, but I'm having the same issue with a mythic ability I'm working on. Did you get this resolved?
 
I ended up attaching them to racial specials instead of class specials which, proved actually to be the better choice since the ability eventually had to be moved to a race anyway...

I copied the code from summoner:

Pre-requisit:
Code:
var allowed as number
      if (ishero = 0) then
        allowed = round(parent.field[xAllLev].value/6,0,-1) + 1
      elseif (isminion <> 0) then
        allowed = round(herofield[tCompLevel].value/6,0,-1) + 1
        endif

      ~if we're a pick, then there must be complevel/6 or fewer copies of
      ~ this ability
      if (@ispick <> 0) then
        validif (tagcount[HasAbility.rcEiAbSTR] <= allowed)

      ~otherwise, look for fewer, since we're adding this
      else
        validif (tagcount[HasAbility.rcEiAbSTR] < allowed)
        endif

      @message = "You may not have more than " & allowed & " copies of this ability."

Although, minion/parent transitions are still giving me a hard time.

There is also a procedural version of this, designed to work with class specials for the summoner class, however, I never got it to work:

Pre-requisit:

Code:
        var allowed as number
        var rate as number
        rate = 6

        call CalcEvAllw
        allowed += 1

        ~if we're a pick, then there must be complevel/6 or fewer copies of
        ~ this ability
        if (@ispick <> 0) then
          validif (hero.tagcount[HasAbility.cSumAbSTR] <= allowed)

        ~otherwise, look for fewer, since we're adding this
        else
          validif (hero.tagcount[HasAbility.cSumAbSTR] < allowed)
          endif

        @message = "You may not have more than " & allowed & " copies of this ability."

With a validation type procedure:

~ IN: level, rate
~ OUT: allowed

var allowed as number
var rate as number
var level as number

~ If this custom special ability is being added to an animal companion,
~ then we are being added to the primal transformation configurable, so
~ base our level calculation on that.
if (hero.tagis[CompPower.arHunPriCo] <> 0) then
level = hero.childfound[cfgPriTran].field[cfgLevel].value
else
level = #custspeciallevelcount[Summoner]
endif

allowed = round(level/rate,0,-1) + 1

I know that this is an all over the place answer, but its the best I think I can give. Especially at 3 in the morning. Anyways, I hope it helps or at least gives you ideas.
 
Back
Top