• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Domain pre-requisite

bodrin

Well-known member
I have a class special that requires a specific Diety and certain Domains as a pre-req. The #hasdeity[XXXXX]<>0 macro works spiffingly well however It would appear that Domain pre-requisites are an anomaly.

I tried #hasdomain[cdEvil] <> 0 but received a right side expression parsing error, presumably there isn't a has domain macro?

and then this script

Code:
~ Start out invalid
    @valid = 0

    ~ Check for Evil or Law Domain

    if (hero.childfound[HasDomain.cdEvil] <> 0) then

      ~ If so, we're valid.
      @valid = 1
      else
     
    if (hero.childfound[HasDomain.cdLaw] <> 0) then

      ~ If so, we're valid.
      @valid = 1
      endif
     endif
Error message below

HTML:
Syntax error in 'pre-requisite rule' script for Thing 'arWoWUnBar' on line 6
  -> Non-existent thing 'HasDomain' used by script
I referred to the hero fields and noticed that adding and removing domains altered the fields to HasAbility.cdEvil cdLaw respectively so I tried

if (hero.childfound[HasAbility.cdEvil] <> 0) which also didn't compile.

Exactly how can this be done??

Looking through the existing data I'm seeing a text placeholder stating script required (Ultimate Magic - Warrior Priest) or a huge search expression chooser that cycles through anything that grants a Domain ability (Domain Strike - Ultimate Combat) and allows the user to select a domain ability to apply effects to.

Edit: #hasability[cdLaw] <> 0 does work.
 
Last edited:
Checking for a Specific Domain

Nevermind this worked.

Code:
~ Check for Evil or Law domain
 @valid = 0

  if (#hasability[cdLaw] <> 0) then
   @valid = 1
    else

  if (#hasability[cdEvil] <> 0) then
   @valid = 1
    endif
   endif
 
Nevermind this worked.

Code:
~ Check for Evil or Law domain
 @valid = 0

  if (#hasability[cdLaw] <> 0) then
   @valid = 1
    else

  if (#hasability[cdEvil] <> 0) then
   @valid = 1
    endif
   endif
Just an FYI you could make this all one line of code:
Code:
~ We are valid if we have the Law or Evil Domain
validif (#hasability[cdLaw] + #hasability[cdEvil] <> 0)

Also you could then put this on the Pre-Req section:
Code:
#hasability[cdLaw] + #hasability[cdEvil] <> 0
 
Just an FYI you could make this all one line of code:
Code:
~ We are valid if we have the Law or Evil Domain
validif (#hasability[cdLaw] + #hasability[cdEvil] <> 0)

Also you could then put this on the Pre-Req section:
Code:
#hasability[cdLaw] + #hasability[cdEvil] <> 0

It was a very quick eureka moment when I spotted a domain ability could be tested with the #hasability macro a quick copy / paste duplicate was all I could spare before heading off to RL work.

Code tidying usually falls by the wayside once something is working as it should, but thanks for the pointer. :cool:
 
It was a very quick eureka moment when I spotted a domain ability could be tested with the #hasability macro a quick copy / paste duplicate was all I could spare before heading off to RL work.

Code tidying usually falls by the wayside once something is working as it should, but thanks for the pointer. :cool:
Yea no problem. I also wanted it for future readers. What you find is that about 90% of stuff can be tested with #hasability[] macro. Class Abilities, Racial Abilities, and I am pretty sure Custom Abilities also. Actually really nice as its a one stop macro instead of needing a specific one for each class or race.
 
Back
Top