• 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

Damage Reduction and Acid Resistance abilities

mbran01

Well-known member
I am trying to create two custom abilities. The first one adds damage reduction the second adds acid resistance. I don't get any errors but neither adds the DR or acid resistance to the character. Any suggestions would be hot. Thanks in advance.

final phase/10500
Code:
      ~These calculations should only happen for the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

      field[abValue].value += field[xCount].value

      #applydr[xDamRd, field[abValue].value]

post-attributes/10000
Code:
 #applydr[xDamRsAcid, hero.child[aCON].field[aModBonus].value]
 
I am trying to create two custom abilities. The first one adds damage reduction the second adds acid resistance. I don't get any errors but neither adds the DR or acid resistance to the character. Any suggestions would be hot. Thanks in advance.
You say its for a Custom Ability and if so they don't get Helper.FirstCopy tags nor does it have "xCount" fields.

Is the concept for the DR one suppose to be the number of times you take this custom ability increases the amount by one? If so As DR only applies the highest one you can just use the following script:
Code:
#applydr[xDamRd,field[xIndex].value]

If you have this ability selected three times it will run three times but only the highest value of "3" will get applied at the end.

Actually just looked at the DR ability and they do all their calculations at Final/10000 so if your running Final/10500 your after the the value is calculated. Move it back to Final/1000 in that case.
 
What I ended up doing is set up three different abilities that could be chosen at different levels. The field[xIndex].value actual sets the value to whatever level the ability was added. So that if you add the ability at 5th level it gives you (dr 5/-). Since the ability could only be chosen three times (adding 1 to the dr each time) it was just easier to create three separate abilities, especially since the dr is equal to the highest dr.
 
The field[xIndex].value actual sets the value to whatever level the ability was added.
Actually no it does not. If it did it would open up allot of functionality actually as the ability to know when something was added would be nice.

xIndex controls the value of which Pick we are on the hero. So if you add the same Custom Ability three times xIndex will be 1,2,3 based on which Pick your looking at. Nothing in HL controls or stores the level when it was added to the hero as that info is lost the second you change anything and every script fires over again.
 
Well for whatever reason when I added it at fifth level it gave me dr 5, when i added at third level it gave me dr 3. So I assumed it was counting the level that it was added. This was with the ability being added to the hero once.
 
So this is resolved now?
I am curious if you know how/why xIndex would suddenly hold the level when it became a "Pick"? I tried everything I could think of and xIndex for me always held the "Instance" number it was added to the hero.

So I added it once it was 1, second time it was 2, third time it was 3.......

Any thoughts?
 
You've got it correct as far as I understand it, Shadow. Perhaps he bootstrapped 1 copy of this class ability at each level? Without looking at his file, I'm only guessing.
 
I will look at what I did. I don't think I bootstrapped anything to it, maybe something else was going on. To be honest it was quite late (or early) and I was tired and frustrated.
 
I figured out what was going on. It is counting the number of abilities added whether they are that custom ability or other custom abilities. If I only choose that particular ability it works fine. The problem is that I have multiple abilities to choose from, and when I add different ones it causes the index to increase by one. How do I get it to count only instances of that particular custom ability?

Or rather it indexes the number that that particular ability is when added (1st, 2nd, or 3rd, and so on). So if it was the first added it works fine until you try to add it again as the third ability.
 
Last edited:
What I ended up doing is creating a class special ability and bootstrapping it to the custom ability. That way when I add the custom ability it will add the class ability and the count is correct.
 
Back
Top