So I just copy/pasted the script with the above fixes into HL on a new feat. I then created a new monk who had a Unarmed Strike that did 1d6. I added the feat and it changed it correctly to 1d8.
I then created a new Cleric and added the feat. It changed the damage to 1d4 and then when I added 4 more levels it was changed to 1d6 damage.
Maybe I am not getting it but what is not working?
Here is the script. Its Phase
First Priority
500. Now this is in Pathfinder as I don't have d20 but they should be pretty similar.
Code:
~First 500
var level as number
level = herofield[tLevel].value
var result as number
var dice as string
if (hero.tagis[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value += 4
else
result = hero.child[wUnarmed].delete[wMain.?]
if (level < 4) then
result = hero.child[wUnarmed].assign[wMain.1d4_4]
dice = "1d4"
elseif (level < 8) then
result = hero.child[wUnarmed].assign[wMain.1d6_5]
dice = "1d6"
elseif (level < 12) then
result = hero.child[wUnarmed].assign[wMain.1d8_6]
dice = "1d8"
elseif (level < 16) then
result = hero.child[wUnarmed].assign[wMain.1d10_304]
dice = "1d10"
else
result = hero.child[wUnarmed].assign[wMain.2d6_104]
dice = "2d6"
endif
field[livename].text = field[name].text & " (" & dice & ")"
endif