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
for TBA.