Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   Critical Threat Range (http://forums.wolflair.com/showthread.php?t=8765)

Dastir July 3rd, 2009 03:48 PM

Critical Threat Range
 
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 July 5th, 2009 07:58 PM

Nobody, huh? Bummer...

Mathias July 6th, 2009 09: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.

Code:

var crit as number
 
if (tagcount[wCritMin.?] > 0) then
  crit = field[chosen].chosen.tagmin[wCritMin.?]
else
  done
  endif
 
~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]



All times are GMT -8. The time now is 08:32 PM.

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