Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - 4th Edition
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
DMayhew469
Member
 
Join Date: Aug 2011
Posts: 73

Old March 12th, 2013, 05:58 AM
Using the code below does anyone know how to access the enhancement bonus of each weapon? For example, if the pick is a +3 longsword I want to pull the "+3" from the data.


var EnhBonus as number
foreach pick in hero from WeapMelee
EnhBonus = eachpick.field[??????].value
nexteach
DMayhew469 is offline   #1 Reply With Quote
MagicSN
Senior Member
 
Join Date: Nov 2012
Posts: 208

Old March 16th, 2013, 06:49 AM
Quote:
Originally Posted by DMayhew469 View Post
Using the code below does anyone know how to access the enhancement bonus of each weapon? For example, if the pick is a +3 longsword I want to pull the "+3" from the data.


var EnhBonus as number
foreach pick in hero from WeapMelee
EnhBonus = eachpick.field[??????].value
nexteach
For a non-weapon Magic Item (Implement) you would use mgBonus. Sadly this does not work for Weapons. It seems to me that wpDamage should work for Weapons, but I am not 100% sure if nothing asides from the Enhancement Bonus modifies this field.

Alternatively (if you know what type of weapon this is) you might check for relevant thingid's (admitted, this would be an extremely clunky and badly maintenancable way of handling this)

Best regards,
MagicSN
MagicSN is offline   #2 Reply With Quote
DMayhew469
Member
 
Join Date: Aug 2011
Posts: 73

Old January 20th, 2015, 06:28 AM
I know it's been a while but I'm back to working on the inherent attack bonus script. Here is what I have:

~Inherent Attack Bonus

var AttBonus as number
var BonusDif as number

if (#level[] < 2) then
AttBonus = 0
elseif (#level[] < 7) then
AttBonus = 1
elseif (#level[] < 12) then
AttBonus = 2
elseif (#level[] < 17) then
AttBonus = 3
elseif (#level[] < 22) then
AttBonus = 4
elseif (#level[] < 27) then
AttBonus = 5
else
AttBonus = 6
endif

~doneif (tagis[Equipped.Equipped] = 0)
foreach pick in hero from WeapMelee
perform eachpick.field[wpDamage].modify[+,AttBonus,""]
perform eachpick.field[wpBonus].modify[+,AttBonus,""]
nexteach

foreach pick in hero from WeapRange
perform eachpick.field[wpDamage].modify[+,AttBonus,""]
perform eachpick.field[wpBonus].modify[+,AttBonus,""]
nexteach

This works fine as long as you don't add an actual magic weapon. I need a way to get the wpBonus of the current pick and then compare it to the AttBonus do determine wich bonus to use in the modify section. I have tried the following:

CurrentValue = eachpick.field(wpBonus)
CurrentValue = eachpick.field(wpBonus).value

Neither worked. Does anyone know how to get or reference that value inside the foreach loop?

Thanks
DMayhew469 is offline   #3 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:37 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.