Welcome to the Builder Academy

Question Trigger of the Day - Magic Eight Ball

More
27 Aug 2013 12:31 #4176 by Rumble
Code:
Name: 'Obj Command Magic Eight Ball - O47', VNum: [ 6], RNum: [ 6] Trigger Intended Assignment: Objects Trigger Type: Command , Numeric Arg: 2, Arg list: shake Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Numeric Arg: 2 means in character's carried inventory. * Command trigs do not work for level 32 and above. * There are 20 possible answers that the Magic Eight Ball can give. * Of these, nine are full positive, two are full negative, one is * mostly positive, three are mostly negative, and five are abstentions. * * Check arguments if they match. /= checks abbreviations. if ball /= %arg% || eightball /= %arg% * Echo text to everyone else in the room and the actor. %echoaround% %actor% %actor.name% shakes %self.shortdesc% vigorously. %send% %actor% You shake %self.shortdesc% vigorously. * Use a switch to choose a random response (1-20). switch %random.20% * Send the answer! %self% is the 8ball, or whatever the trig is attached to. * Only the actor sees the answer. * Case is what we are trying to match. Does %random.20% == 1? case 1 %send% %actor% %self.shortdesc% reveals the answer: Outlook Good * We are done with this case so check the next one. break case 2 %send% %actor% %self.shortdesc% reveals the answer: Outlook Not So Good break case 3 %send% %actor% %self.shortdesc% reveals the answer: My Reply Is No break case 4 %send% %actor% %self.shortdesc% reveals the answer: Don't Count On It break case 5 %send% %actor% %self.shortdesc% reveals the answer: You May Rely On It break case 6 %send% %actor% %self.shortdesc% reveals the answer: Ask Again Later break case 7 %send% %actor% %self.shortdesc% reveals the answer: Most Likely break case 8 %send% %actor% %self.shortdesc% reveals the answer: Cannot Predict Now break case 9 %send% %actor% %self.shortdesc% reveals the answer: Yes break case 10 %send% %actor% %self.shortdesc% reveals the answer: Yes, definitely break case 11 %send% %actor% %self.shortdesc% reveals the answer: Better Not Tell You Now break case 12 %send% %actor% %self.shortdesc% reveals the answer: It Is Certain break case 13 %send% %actor% %self.shortdesc% reveals the answer: Very Doubtful break case 14 %send% %actor% %self.shortdesc% reveals the answer: It Is Decidedly So break case 15 %send% %actor% %self.shortdesc% reveals the answer: Concentrate And Ask Again break case 16 %send% %actor% %self.shortdesc% reveals the answer: Signs Point To Yes break case 17 %send% %actor% %self.shortdesc% reveals the answer: My Sources Say No break case 18 %send% %actor% %self.shortdesc% reveals the answer: Without A Doubt break case 19 %send% %actor% %self.shortdesc% reveals the answer: Reply Hazy, Try Again break case 20 %send% %actor% %self.shortdesc% reveals the answer: As I See It, Yes break * Every switch should have a default. A catch-all if the cases do not match. default %send% %actor% %self.shortdesc% explodes since your question is unanswerable. break * Every switch must have a done! Just like every if needs an end! done * The actor didn't use the command shake with arg ball or eightball. else * Return 0 allows the command to continue through to the MUD. The player will * get the Huh!?! response or the shake social if you have one. return 0 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
28 Aug 2013 13:06 #4183 by JTP
Command trigs dont work for level 32 and above.

So what if levels have been increases to 64, does it then still not work for level 32 and above, and where can that be changed ?

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

More
28 Aug 2013 17:01 #4184 by Rumble
I should change 32 to LVL_GOD. As long as you updated your LVL_X it will work fine.

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

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

Time to create page: 0.197 seconds