Member
Join Date: Aug 2008
Posts: 74
|
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. |
#1 |
Member
Join Date: Aug 2008
Posts: 74
|
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 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) |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#3 |
Member
Join Date: Aug 2008
Posts: 74
|
Quote:
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 |
|
#4 |
|
|