• 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

Restrict Domains available from Deity

athelu

Well-known member
I have created two new classes that are dedicated to a specific deity. The classes are like Ying/Yang of each other and received different "blessings" from the god.

I want to restrict the choice of domains available to be selected based upon what class the user is. I was trying to do this via an EVAL script on the Deity.

I removed all domains and want to have the AllowDom tags pushed based on the results of the Eval Script

I was trying:

~ if Custom class, give these domains
If (hero.pickexists[cHelpnas] <> 1) then
perform pushtags[AllowDom.cdMagic]

endif

This compiles without issue, but when i add the class and look at the domains it shows all domains.
 
So I have it working - but it is not horribly elegant.
setup as a Eval Script on the Deity

Phase: Post-Levels
Priority: 10000

Code:
~ if Custom class, give these domains
If (#levelcount[cHelpNas]>= 1) then
perform hero.assign[AllowDom.cdLaw]
perform hero.assign[AllowDom.cdNobility]
perform hero.assign[AllowDom.cdProtect]
perform hero.assign[AllowDom.cdStrength]
perform hero.assign[AllowDom.cdSun]

elseIf (#levelcount[cHelpYas]>= 1) then
perform hero.assign[AllowDom.cdFire]
perform hero.assign[AllowDom.cdLaw]
perform hero.assign[AllowDom.cdNobility]
perform hero.assign[AllowDom.cdStrength]
perform hero.assign[AllowDom.cdWar]
endif

I am using the #levelcount macro because i could not get the hero.pickexists to validate.

I need to now tell it to assign a different set of domains if any other class beside these two chooses this deity. I was thinking of doing something like:
Code:
If (!firstclass | !secondclass)
but I am using the levelcount to find the class currently and I assume there has got to be a better way.
 
It won't work to just have an "else" in the if...elseif you've already got - so if it's got the one class it has the first set, elseif it has the second class, it has the second set, and if neither of those apply, it has the third set.

Alternatively, since #levelcount[] returns a number (the count of levels), the double not is just #levelcount[cHelpNas] + #levelcount[cHelpYas] = 0


Since it looks like there's a large percentage of overlap between the domain lists, you can put the parts that overlap outside of the if...elseif, so that you only need to assign those once. Or you can just define those as the standard domains on the deity, and only handle the parts that change here.
 
Since it looks like there's a large percentage of overlap between the domain lists, you can put the parts that overlap outside of the if...elseif, so that you only need to assign those once. Or you can just define those as the standard domains on the deity, and only handle the parts that change here.

Yes - thanks for that. I went ahead and assigned all of the overlap to the deity.

This is what i have now (and it works):
Code:
~ if Alkira is not chosen as the deity, get out now
	doneIf (hero.pickexists[deiLAAlkira] <> 1) 

~ if we are not a follower of Ja'Alkira receive all domain options
    if (#levelcount[cHelpNas] + #levelcount[cHelpYas] = 0) then
        perform hero.assign[AllowDom.cdFire]
        perform hero.assign[AllowDom.cdWar]
        perform hero.assign[AllowDom.cdProtect]
        perform hero.assign[AllowDom.cdSun]
    endif

~ if class is Nashan get these domain options
    If (#levelcount[cHelpNas]>= 1) then
        perform hero.assign[AllowDom.cdProtect]
        perform hero.assign[AllowDom.cdSun]

~ if class is Yashan get these domain options
    elseIf (#levelcount[cHelpYas]>= 1) then
        perform hero.assign[AllowDom.cdFire]
        perform hero.assign[AllowDom.cdWar]
    endif

I noticed that inquisitions are showing up in the domains. They are ones that are available to any God. Is their a way to hide or suppress these?
 
Back
Top