View Single Post
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 23rd, 2017, 12:31 PM
I assume when you say secondary attacks you mean "Secondary Natural Attacks". That is what the below script assumes. I have combined your multiple scripts into one foreach loop because foreach loops are very CPU intensive to run.

This a full replacement for both scripts running at Post-attributes 10000
Code:
var bonus as number

~ Calculate the extra .5 of the strength modifier. 
bonus += round(#attrmod[aSTR]/2,0,1)

~ Loop through all weapons on the character
foreach pick in hero from BaseWep 

  ~ We are a two-handed melee weapon
  if (eachpick.tagexpr[wClass.TwoHanded & wCategory.Melee] <> 0) then
    ~ Add to the normal 1.5 bonus will give us 2x Str bonus
    eachpick.field[dmmBonus].value += bonus

  ~..We are a one handed melee weapon equipped in two hands
  elseif (eachpick.tagexpr[wCategory.Melee & wClass.OneHanded & fieldval:gIsEquip = 1 & fieldval:wIs2nd = 1] <> 0) Then
    ~ Add to the 1.5 bonus to give us a 2x Str bonus
    eachpick.field[wDamBonus].value += bonus

  ~..We are a secondary natural attack
  elseif (eachpick.tagexpr[wFtrGroup.Natural & Helper.NatOverSec] <> 0) Then
    ~ Tell the weapon to not be half str damage
    perform eachpick.assign[Helper.NoHalfStr]
  endif
    
nexteach
I can't find in my notes a Helper.? tag that forces a Natural Attack to do full damage. Maybe Aaron/Mathis knows one because I "thought" such a tag existed.

The above script just adds back the .5 to the secondary natural attacks.

NOTE: I wrote this without access to HL so tweaking maybe needed.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.

Last edited by ShadowChemosh; May 27th, 2017 at 02:30 PM.
ShadowChemosh is offline   #2 Reply With Quote