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)
-   -   Check for a Special (http://forums.wolflair.com/showthread.php?t=56636)

Illyahr September 24th, 2016 12:33 PM

Check for a Special
 
An issue I've been running into a couple times is having a class ability check to see if a special is present.

This, for example, is from the Fury of Vengeance ability:

if (hero.child[xRage] <> 0) then
perform assign[Helper.SpecUp]
hero.child[xRage].field[hTotal].value = maximum(hero.child[xRage].field[hTotal].value, field[hTotal].value)
endif

It's supposed to check if Hero has Rage. If it does, hides the class ability from the Specials tab. The ability functions like rage but doesn't stack so it says the hTotal of Rage would be whichever has a higher value.

In the case Rage is found, Fury of Vengeance adds +2 to Str, +2 to Con, and +1 to Will when raging and fighting Shadowlands creatures so I think it'd look something like this:

if (hero.child[xRage] <> 0) then
if (field[hIsOn1].value <> 0) then
~ +2 Str
~ +2 Con
~ +1 Will
else
~ Barbarian Rage stat boosts
endif
endif

It's that first line that's giving me trouble, and I think the hTotal value check is going to give me trouble. Any suggestions?

Sendric September 24th, 2016 03:28 PM

Quote:

Originally Posted by Illyahr (Post 234977)
An issue I've been running into a couple times is having a class ability check to see if a special is present.

This, for example, is from the Fury of Vengeance ability:

if (hero.child[xRage] <> 0) then
perform assign[Helper.SpecUp]
hero.child[xRage].field[hTotal].value = maximum(hero.child[xRage].field[hTotal].value, field[hTotal].value)
endif

It's supposed to check if Hero has Rage. If it does, hides the class ability from the Specials tab. The ability functions like rage but doesn't stack so it says the hTotal of Rage would be whichever has a higher value.

In the case Rage is found, Fury of Vengeance adds +2 to Str, +2 to Con, and +1 to Will when raging and fighting Shadowlands creatures so I think it'd look something like this:

if (hero.child[xRage] <> 0) then
if (field[hIsOn1].value <> 0) then
~ +2 Str
~ +2 Con
~ +1 Will
else
~ Barbarian Rage stat boosts
endif
endif

It's that first line that's giving me trouble, and I think the hTotal value check is going to give me trouble. Any suggestions?

You need to look for something particular about the special. The code you presented here won't do anything. For the first line, I would recommend this:

Code:

if (hero.childfound[xRage].tagis[Helper.ShowSpec] <> 0) then
You should use "childfound" instead of "child" any time you aren't positive if the thing in question is on the character. Otherwise, you will likely get an error. This script searches to see if xRage exists, and if it does whether or not the tag "Helper.ShowSpec" is active on it, which generally means its an ability the character can use.

Illyahr September 24th, 2016 10:12 PM

Ah, ok. I knew I was missing something. Since I'm not doing spells for now, I'm very nearly done with OA and this is among the last few things I'm trying to tinker with.


All times are GMT -8. The time now is 09:19 AM.

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