View Single Post
2goth4U
Junior Member
 
Join Date: Mar 2012
Location: Vancouver BC
Posts: 6

Old March 7th, 2012, 08:15 AM
I believe this will do what I want.



~ search through all the weapons, adjust our damage from STR to mySTR
foreach pick in hero from BaseWep

~ Now we have to modify the damage
var strmod as number
var myDmgAdj as number

~ First negate the Str. If it is wielded 2 handed, if gets 1.5x Str,
~ unless it is light, or the Str mod is negative.
if (eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 2) then
if (eachpick.tagis[wClass.Light] <> 0) then
strmod = #attrmod[aSTR]
myDmgAdj= #attrmod[aSTR]
elseif (#attrmod[aSTR] < 1) then
strmod = #attrmod[aSTR]
myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/-2,0,0))
else
strmod = round(#attrmod[aSTR] * 1.5,0,-1)
myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/2,0,-1))
endif



~ If is is in the main hand, we get just the Str mod
elseif (eachpick.tagis[Hero.MainHand] = 1) then
strmod = #attrmod[aSTR]
myDmgAdj = #attrmod[aSTR]

~ If it is in the off hand, we get .5 Str unless the hero has the
~ Double Slice tag or the weapon has the Helper.NoHalfStr tag
elseif (eachpick.tagis[Hero.OffHand] = 1) then
if (hero.tagis[Hero.DblSlice] + eachpick.tagis[Helper.NoHalfStr] <> 0) then
strmod = #attrmod[aSTR]
myDmgAdj = #attrmod[aSTR]
else
if (#attrmod[aSTR] < 1) then
strmod = #attrmod[aSTR]
myDmgAdj= #attrmod[aSTR] - maximum(1, round(#attrmod[aSTR]/-2,0,-1))
else
strmod = round(#attrmod[aSTR] * .5,0,-1)
myDmgAdj= #attrmod[aSTR] - maximum(1, round(#attrmod[aSTR]/2,0,0))
endif


endif
~ If it is not equipped at all, check if it is a 2 handed weapon, if
~ so treat is as being wielded 2 handed. Otherwise treat it as in 1
~ hand.
else
if (eachpick.tagis[wClass.TwoHanded] <> 0) then
if (#attrmod[aSTR] < 1) then
strmod = #attrmod[aSTR]
myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/-2,0,0))
else
strmod = round(#attrmod[aSTR] * 1.5,0,-1)
myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/2,0,-1))
endif

else
strmod = #attrmod[aSTR]
myDmgAdj = #attrmod[aSTR]
endif
endif

eachpick.field[wDamBonus].value -= strmod
eachpick.field[wDamBonus].value += myDmgAdj
nexteach

Last edited by 2goth4U; March 8th, 2012 at 02:34 PM.
2goth4U is offline   #9 Reply With Quote