• 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

Problems with 3 eval-scripts

FaeruN

Active member
Hello hero lab world, I have some problems while trying to create the eval-scripts for 3 magic weapons.

I've created 6 weapons that everyone can held, but in the hands of the right character the weapon if more powerful (like the holy avenger, that in normal hands is a +2 cold iron longsword, but on a paladin's hands it is the powerful holy avenger)

I have problems with 3 of them.

One of the weapon supposes to be used by any arcane spellcaster, and when that happens the weapon turns from a masterwork +0 weapon, to a +4, and I've tried to use this eval script:

~ If we're an arcane spellcaster, add our bonuses
if (hero.tagis[Hero.Arcane] <> 0) then
if (field[gIsEquip].value <> 0) then
field[BonEnhance].value = 4
endif
endif

but I dont know how to make it work correctly.

The other weapon instead of be used by a good-alignment fighter, ranger or paladin, and tried this eval script:

~If we're non-good, get out now
doneif (hero.tagis[Alignment.Good] = 0)

~ If we're not a paladin, fighter or ranger, get out now
doneif (hero.tagis[Classes.Paladin] = 0 or hero.tagis[Classes.Ranger] = 0 or hero.tagis[Classes.Fighter] = 0)
field[BonEnhance].value = 4

I know that should works but I don't know how to use the "OR" properly on hero lab yet.

And finally I have a weapon that if used by anyone with 5 ranks or more on Diplomacy gets the bonus, and I don't know how to check on the ranks a character haves on a selected skill.



Thank you :)
 
As Mathias said you need the right phase and priority, the cheeseweasel vids on youtube can help with that. Compare this to the code you did for the weapon

Code:
~ If we're an arcane spellcaster, add our bonuses
if (hero.tagis[Hero.Arcane] <> 0) then
  if (field[gIsEquip].value <> 0) then
    hero.child[XXXXXXXX].field[BonEnhance].value = 4
  endif
endif

XXXXXXXX would be the field reference for your weapon...
 
As Mathias said you need the right phase and priority, the cheeseweasel vids on youtube can help with that. Compare this to the code you did for the weapon

Code:
~ If we're an arcane spellcaster, add our bonuses
if (hero.tagis[Hero.Arcane] <> 0) then
  if (field[gIsEquip].value <> 0) then
    hero.child[XXXXXXXX].field[BonEnhance].value = 4
  endif
endif

XXXXXXXX would be the field reference for your weapon...

thank you that really helped me a lot :) I've tried using the Final Phase and a 100000 priority and did worked, maybe is not the perfect way but at least it worked for me.

I still need help with the 2nd and the 3rd weapons, that means, a way the weapon can accept 3 different classes (Fighter, Paladin or Ranger)

and a way to ask the weapon about if a character does haves 5 ranks or more at Diplomacy
 
This will check for levels in any of those three classes. It needs to run in the Post-Levels phase.

if (#levelcount[Fighter] + #levelcount[Paladin] + #levelcount[Ranger] <> 0) then
Do whatever
endif

You could also make that a doneif and it'd still work.

For the Diplomacy skill

if (#skillranks[skDiplo] >= 5) then
Do whatever.
endif

Again, also would work as a doneif
 
Back
Top