Advertisement
Guest User

Untitled

a guest
Dec 24th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using fCraft;
  6.  
  7. namespace FortuneCookie
  8. {
  9.     public class Init : Plugin
  10.     {
  11.         public void Initialize()
  12.         {
  13.             Logger.Log(
  14.                     LogType.ConsoleOutput,
  15.                     Name + "(v " + Version + " Yay, registering /fortunecookie.");
  16.  
  17.             CommandManager.RegisterCustomCommand(new CommandDescriptor
  18.             {
  19.                 Name = "FortuneCookie",
  20.                 Aliases = new[] { "FC", "Fortune" },
  21.                 Category = CommandCategory.Chat,
  22.                 Permissions = new Permission[] { Permission.Chat },
  23.                 IsConsoleSafe = true,
  24.                 Usage = "/FortuneCookie",
  25.                 Help = "Reads you your fortune",
  26.                 NotRepeatable = true,
  27.                 Handler = FCHandler,
  28.             });
  29.         }
  30.         public string Name
  31.         {
  32.             get
  33.             {
  34.                 return "FortuneCookie";
  35.             }
  36.             set
  37.             {
  38.                 Name = value;
  39.             }
  40.         }
  41.  
  42.         public string Version
  43.         {
  44.             get
  45.             {
  46.                 return "2.0";
  47.             }
  48.             set
  49.             {
  50.                 Version = value;
  51.             }
  52.         }
  53.         static void FCHandler(Player player, Command cmd)
  54.         {
  55.             player.Message("You ate the fortune cookie, here is your fortune!");
  56.  
  57.             string[] msgStrings = { "&3You will die in your life time.",
  58.                                       "&3Early to bed, early to rise, makes a man healthy, wealthy, and tired.",
  59.                                       "&3About time someone got me out of that stale cookie.",
  60.                                       "&3Ignore previous fortune.",
  61.                                       "&3You are not illiterate.",
  62.                                       "&3Only listen to the fortune cookie. Disregard all other fortune telling units.",
  63.                                       "&3This is not the fortune cookie you are looking for.",
  64.                                       "&3That wasn't actually a cookie you just ate...",
  65.                                       "&3Warning, do not break open or eat your fortune cookie.",
  66.                                       "&3You may still be hungry. Order takeout now."};
  67.  
  68.             Random RandmsgString = new Random();
  69.             player.Message(msgStrings[RandmsgString.Next(0, msgStrings.Length)]);
  70.  
  71.             string[] numStrings = { " &cLucky Numbers:&e 1,2,3,4,5",
  72.                                       " &cLucky Numbers:&e 0,0,0,0,0",
  73.                                       " &cLucky Numbers:&e .5,0,-1,10035,poop",
  74.                                       " &cLucky Numbers:&e 1,2,1,2,1",
  75.                                       " &cLucky Numbers:&e p,o,o,p,y",
  76.                                       " &cLucky Numbers:&e 18,11,22,36,8",
  77.                                       " &cLucky Numbers:&e 11,7,68,0,0",
  78.                                       " &cLucky Numbers:&e 11,11,11,12,11",
  79.                                       " &cLucky Numbers:&e M,II,XL,IV,V",
  80.                                       " &cLucky Numbers:&e 3,2,1,2,1"};
  81.             Random RandnumString = new Random();
  82.             player.Message(numStrings[RandnumString.Next(0, numStrings.Length)]);
  83.  
  84.         }
  85.     }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement