Welcome to the Builder Academy

Question Trigger of the Day - Guildguard Example

More
09 Nov 2012 23:49 #1016 by Rumble
Code:
Name: 'Warrior Guildguard - 127', VNum: [ 133], RNum: [ 133] Trigger Intended Assignment: Mobiles Trigger Type: Leave , Numeric Arg: 100, Arg list: None Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Replaces the guildguard special procedure. * Check the direction the player must go to enter the guild. if %direction% == up * Stop them if they are not the appropriate class. if %actor.class% != warrior return 0 %send% %actor% The guard humiliates you, and blocks your way. %echoaround% %actor% The guard humiliates %actor.name%, and blocks %actor.hisher% way. end end
If this was helpful please vote or leave a review for TBA.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
05 Jul 2025 22:16 #10781 by wlessard1
Is it possible for one guildguard to pass 2 different classes.

I have been trying to get the Magic User guildguard to allow Bards to pass.

if %actor.class% != Magic User || %actor.class% !Bard
OR
if %actor.class% != Magic User || !Bard

Any other suggestions on if it is possible or how to make it possible.

Please Log in or Create an account to join the conversation.

More
08 Jul 2025 23:57 - 08 Jul 2025 23:58 #10786 by Salty
Yes.

Tested live on my game.  Working as intended.
Code:
#1098 salty guild guard example~ 0 q 100 ~ if %direction% == east   if %actor.class% == Priest || %actor.class% == Wizard     %send% %actor% Welcome to the secret Magic User & Cleric hideout!     %echoaround% %actor% %actor.name% slips into a secret door and is gone.   else     %send% %actor% The guard humiliates you, and blocks your way.     %echoaround% %actor% The guard humiliates %actor.name%, and blocks %actor.hisher% way.     return 0   end end
Last edit: 08 Jul 2025 23:58 by Salty.
The following user(s) said Thank You: wlessard1

Please Log in or Create an account to join the conversation.

More
09 Jul 2025 10:20 #10787 by wlessard1
I see what is different but I ask...

Why is it the original trigger basically determines who is NOT != Magic User but yours asks if it is this or this.

I guess my question is why does the Equals to rather than not-class works at this point to understand.

Please Log in or Create an account to join the conversation.

More
10 Jul 2025 00:15 #10789 by Salty
The way || (or) works means if any of the statements in the if are true, then the if returns true. 

Let’s use some simplified code to explain the logic:
Code:
If (!bard || !cleric) we are not allowed in else we are allowed in done

Now, say we’re a bard.  That makes !bard false. But it makes !cleric true. Therefore the if statement returns true and we’re not allowed in.

Only one clause of the || needs to be true to make the if statement true.

By using the positive as I did in my example:
Code:
if bard || cleric we are allowed in else we are not allowed in done

We are a bard, so we’re allowed in.  A priest would be allowed in. No other classes would be allowed in.

Hope this helps. 
The following user(s) said Thank You: wlessard1

Please Log in or Create an account to join the conversation.

Time to create page: 0.306 seconds