Quote:
Originally Posted by Illyahr
The coding for the Hida Defender's Critical Focus ability (Oriental Adventures) doesn't function quite right. Please adjust to the following:
Code:
if (field[usrChosen1].chosen.tagis[thingid.wBattleaxe] <> 0) then
foreach pick in hero from BaseWep where "WepFocus.? & IsWeapon.wBattleaxe"
perform each.delete[wCritMult.?]
perform each.assign[wCritMult.4]
nexteach
elseif (field[usrChosen1].chosen.tagis[thingid.wWarhammer] <> 0) then
foreach pick in hero from BaseWep where "WepFocus.? & IsWeapon.wWarhammer"
perform each.delete[wCritMult.?]
perform each.assign[wCritMult.4]
nexteach
elseif (field[usrChosen1].chosen.tagis[thingid.wGreatclub] <> 0) then
foreach pick in hero from BaseWep where "WepFocus.? & IsWeapon.wGreatclub"
perform each.delete[wCritMult.?]
perform each.assign[wCritMult.3]
nexteach
endif
|
foreach loops are powerful, but also notoriously slow. As a modification, please try this:
Code:
~ Assign the appropriate tag to all weapons that meet the criteria
foreach pick in hero where "WepFocus.? & (thingid.wBattleaxe | thingid.wWarhammer | thingid.wGreatclub)"
perform each.delete[wCritMult.?]
if (eachpick.tagis[thingid.wGreatclub] <> 0) then
perform eachpick.assign[wCritMult.3]
else
perform eachpick.assign[wCritMult.4]
endif
nexteach