View Single Post
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old March 2nd, 2012, 09:39 PM
It is possible to do through the editor but I don't think this is something worthwhile enough to include in the core program, so I can guide you roughly how to do it yourself... You'd have to do a foreach to cycle through the weapons on the hero, negate the strength bonus for a weapon, and then add in your own values. Here is an example eval script I was doing to replace STR with CHA.

PostAttr 10000
~ DEFINE YOUR VALUES FOR DIFFERENT STR SCORES HERE
var my2H as number
var my1H as number
var myOff as number

if (hero.child[aSTR].field[aFinalVal].value >= 60) then
my2H = WHATEVER1
my1H = WHATEVER2
myOff = WHATEVER3
elseif (hero.child[aSTR].field[aFinalVal].value >= 58) then
BLAHBLAH SO ON AND SO FORTH
endif

~ REPLACE THE BELOW REFERENCES TO aCHA's ATTRIBUTE MODIFIER WITH YOUR OWN VALUES AS APPROPRIATE

~ Then 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 chamod 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]
elseif (#attrmod[aSTR] < 0) then
strmod = #attrmod[aSTR]
else
strmod = #attrmod[aSTR] * 1.5
endif

if (eachpick.tagis[wClass.Light] <> 0) then
chamod = #attrmod[aCHA]
elseif (#attrmod[aCHA] < 0) then
chamod = #attrmod[aCHA]
else
chamod = #attrmod[aCHA] * 1.5
endif

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

~ 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]
chamod = #attrmod[aCHA]
else
if (#attrmod[aSTR] < 0) then
strmod = #attrmod[aSTR]
else
strmod = #attrmod[aSTR] * .5
endif

if (#attrmod[aCHA] < 0) then
chamod = #attrmod[aCHA]
else
chamod = #attrmod[aCHA] * .5
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] < 0) then
strmod = #attrmod[aSTR]
else
strmod = #attrmod[aSTR] * 1.5
endif

if (#attrmod[aCHA] < 0) then
strmod = #attrmod[aCHA]
else
strmod = #attrmod[aCHA] * 1.5
endif
else
strmod = #attrmod[aSTR]
chamod = #attrmod[aCHA]
endif
endif

eachpick.field[wDamBonus].value -= strmod
eachpick.field[wDamBonus].value += chamod
nexteach
Aaron is offline   #2 Reply With Quote