Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System


Thread Tools Display Modes
Join Date: Sep 2008
Posts: 48

Old July 3rd, 2009, 04:48 PM
I am trying to implement a class that grants a special ability that adds 2 to a particular type of weapon's critical threat range and simply can't figure out how to do it.

Let's assume a scimitar (wScimitar) for the sake of this discussion (I actually have a pick list for the type of weapon, and I know how to get the id from the pick list) How would you go about increasing the critical threat range of this weapon by two?
Dastir is offline   #1 Reply With Quote
Join Date: Sep 2008
Posts: 48

Old July 5th, 2009, 08:58 PM
Nobody, huh? Bummer...
Dastir is offline   #2 Reply With Quote
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 12,873

Old July 6th, 2009, 10:21 AM
Critical range is stored as tags in the d20 files.

Since the improved critical feat's script happens at PreLevel, 5000, that ought to be a good timing for this script, too. The way things work behind the scenes, what's being added in this script will still take place before Improved Critical/Keen - the tags we're fooling with and those tags are all processed in the same script to calculate the final display value.

First, we'll look up the critical tags that already exist on the weapon, and get the minimum tag that exists. Also, it is technically possible for a weapon to be created with no wCritMin tags - in that case, the weapon has some special reason for it (since the editor requires one to be added), so we'll exit the script.

var crit as number
if (tagcount[wCritMin.?] > 0) then
  crit = field[chosen].chosen.tagmin[wCritMin.?]
~now, we'll subtract two from the value we looked up:
crit -= 2
~and create a tag for that new value:
var newcrittag as string
newcrittag = "wCritMin." & crit
~Weapons are assumed to have exactly one wCritMin tag,
~so we'll delete anything that already exists,
~and then assign the new tag:
perform field[chosen].chosen.delete[wCritMin.?]
perform field[chosen].chosen.assignstr[newcrittag]

Last edited by Mathias; July 7th, 2009 at 10:13 AM.
Mathias is offline   #3 Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 02:22 AM.

Powered by vBulletin® - Copyright ©2000 - 2021, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.