• 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 Magic Weapon Question

I'm trying to create a custom magic weapon that confers a skill bonus when wielded or carried. I am not having any problems creating the magic weapon. The trouble I am having is figuring out how to get it to apply the skill bonus.

Here is a description of the weapon:

"Rapier of Agility is a Rapier +1, and when held or carried, it grants a +3 luck bonus to the posessor's Acrobatics skill."

Can someone help me with making the rapier give it's bonus? I've been perusing the boards hoping to find the answer, but every possibility I have found hasn't been working. Any help is welcome :)
 
I copied the luck blade and changed the bonus to an acrobatics bonus, instead of a saves bonus, but I can't figure out how to adjust the code to make it always on, not just when equipped.

I clicked the "Powers Always Available" option, but that's apparently only for other powers.
 
Their is no code at the top of the Eval Script that says something like "doneif" or something not being on then get out now? Most likely the "doneif" is set to end the script if its not equipped.

Usually that is how its done. You may get allot better help with posting your Script so we can all "see" what you see. Then I can let you know what you would need to change. :)
 
~ If we're not equipped, get out
if (field[gIsEquip].value + field[wIs2nd].value = 0) then
done
endif
#applybonus[BonLuck, hero.child[svFort], 1]
#applybonus[BonLuck, hero.child[svRef], 1]
#applybonus[BonLuck, hero.child[svWill], 1]

This is what I copied off the luck blade.

~ If we're not equipped, get out
if (field[gIsEquip].value + field[wIs2nd].value = 0) then
done
endif
#applybonus[BonLuck, hero.child[skAcrobat], 3]

This is what I changed it to to get it to apply the +3 to Acrobatics, but it only works when it's equipped. I have tried a few things with it, and I cannot get it to apply the bonus whenever it's on the Hero... :-\
 
Code:
      ~ If we're not equipped, get out
      if (field[gIsEquip].value + field[wIs2nd].value = 0) then
        done
        endif
      #applybonus[BonLuck, hero.child[skAcrobat], 3]
This is what I changed it to to get it to apply the +3 to Acrobatics, but it only works when it's equipped. I have tried a few things with it, and I cannot get it to apply the bonus whenever it's on the Hero... :-\
So good on changing the bonus from saves to a skill.

So your looking for something that maybe talks about being "equipped" right? So the very first line which is a comment says:
Code:
      ~ If we're not equipped, get out
It mentions "equipped" so that means the lines that follow could be what we are looking for.
Code:
      if (field[gIsEquip].value + field[wIs2nd].value = 0) then
A "IF" statement is how a logic branch happens in a programming language. Basically an IF statement can be answered as TRUE or FALSE. This statement is saying if the value of the "gIsEquip" plus the value of "wIs2nd" is zero then do something.

Something you may not now is 0 in such a case usually means FALSE or OFF. So this is saying if myself (ie the weapon) is not equipped in the main hand or off-hand then do something.
Code:
        done
So this is saying "DONE" or finished. It tells the script to STOP running. So nothing more will happen. So your ApplyBonus statement can't get executed unless we are equipped in main or off hand.
Code:
        endif
So "ENDIF" is the end of a block of code specially the end of where ever the "IF" statement started.

So if you remove the IF statement logic that is looking for the weapon to be in main or off-hand then the script will ALWAYS run as nothing will stop it once it has been added to a character.


So the only line you need is the following:
Code:
#applybonus[BonLuck, hero.child[skAcrobat], 3]

Hope that helps. :)
 
Back
Top