• 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

Direction needed

ErinRigh

Well-known member
I need to know if I am on the right track here

I am coding a custom ability that causes 1 handed weapons in your offhand to be treated as light weapons

My logic looks like this

Final/1000
Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

    ~If there is nothing in the offhand, get out now
        doneif (hero.tagis[Hero.EquipOff] <> 1)

      foreach pick in hero from BaseWep where "wClass.OneHanded | Hero.EquipOff"
            perform delete[wClass.OneHanded]
            perform assign[wClass.Light]
       nexteach

Am I even on the right track here?
 
I would modify this as follows:

Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

    ~If there is nothing in the offhand, get out now
        doneif (hero.tagis[Hero.EquipOff] = 0)

      foreach pick in hero from BaseWep where "wClass.OneHanded & Hero.EquipOff"
            perform eachpick.tagreplace[wClass.OneHanded,wClass.Light]
       nexteach

Reasons as follows:

tagis returns 0 or 1

In the loop, you want things that are one-handed weapons and equipped in the off hand. Thus changing the | to &.

You were missing the eachpick in your foreach loop. Otherwise you perform statements would run on whatever pick this script is on.

tagreplace is basically the same as the calling delete then assign, but it is easier to understand what you are doing in my opinion.

Note: I am not sure if this will do what you want so you will have to test it. If it doesn't work play with the timings. If you have debugging enabled, right-click on whatever weapon you are testing this with and look at the task list to see if there are scripts that do things with the wClass tags. You will want to have this script run before that.
 
Back
Top