• 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 enchants

Well the first thing you should do is open up the editor and take a look at some of the entries under the "Item Powers" tab.

The ones that don't add a script to the weapons are easy. They are just text.

Hero Lab doesn't really allow for conditional modifiers for weapons so things that add extra damage for example just enter what needs to be added. Things that give a bonus to things like strength or base damage can be coded with varying degrees of difficulty.

I'm not really a coder but I can give you a start.

If you need to make sure an item grants its ability only when it is equiped use the gIsEquip if statement.

Timing Pre-Levels/5000
Code:
      ~ If the hero is Lawful, and we're equipped, add a negative level
      doneif (hero.tagis[Alignment.Lawful] = 0)
      if (container.parent.field[gIsEquip].value + container.parent.field[wIs2nd].value = 0) then
        done
        endif
      herofield[tNegLevel].value = herofield[tNegLevel].value + 1

Code:
doneif(hero.tagis[Alignment.Lawful] = 0)
Checks the alignment, if it IS lawful the script stops and does not continue.

Code:
if(container.parent.field[gIsEquip].value + container.parent.field[wIs2nd].value = 0)
Checks if it is equiped in either the main or off-hand.

Item powers are attached to armors and as such it requires "container.parent." If it was just armor or weapon alone you would say "field[gIsEquip].value"

Code:
      herofield[tNegLevel].value = herofield[tNegLevel].value + 1
is fairly straight forward, it adds 1 negative level to hero.


This script is for the Axiomatic (Lawful) weapon. As I said, I'm not the best with scripts but I hope this gives a bit of insight. I know the help is a bit incomplete in some areas. And the authoring kit makes my head spin if I try to read it.
 
Last edited:
Back
Top