示例#1
0
 private void Give_OnCommand(CommandArgs args)
 {
     if (this.m_GiveEntries == null)
     {
         this.m_GiveEntries = new Hashtable((IEqualityComparer)StringComparer.OrdinalIgnoreCase);
         this.RegisterGive((GiveEntry) new GiveFixedEntry("Recalls", 2, new IItemValidator[3]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3974
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3962
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3963
             })
         }));
         this.RegisterGive((GiveEntry) new GiveFixedEntry("Gates", 2, new IItemValidator[3]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3974
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3962
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3980
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Regs", 25, new IItemValidator[8]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3962
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3963
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3972
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3973
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3974
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3976
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3980
             }),
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3981
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Drake", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3974
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Pearl", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3962
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Moss", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3963
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Garlic", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3972
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Shade", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3976
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Ginseng", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3973
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Silk", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3981
             })
         }));
         this.RegisterGive((GiveEntry) new GiveRatioEntry("Ash", 25, new IItemValidator[1]
         {
             (IItemValidator) new ItemIDValidator(new int[1] {
                 3980
             })
         }));
     }
     if (args.Length > 0)
     {
         GiveEntry entry = this.m_GiveEntries[(object)args.GetString(0)] as GiveEntry;
         if (entry != null)
         {
             int desiredAmount = -1;
             if (args.Length > 1)
             {
                 desiredAmount = args.GetInt32(1);
             }
             if (desiredAmount > 0 || desiredAmount == -1)
             {
                 TargetManager.Client = (ClientTargetHandler) new GiveTargetHandler(entry, desiredAmount);
                 Engine.AddTextMessage(string.Format("Who do you wish to give {0} to?", entry.Validators.Length == 1 ? (object)"this item" : (object)"these items"));
             }
             else
             {
                 Engine.AddTextMessage("You have specified an invalid amount.");
             }
         }
         else
         {
             Engine.AddTextMessage("You have specified an unknown item name.");
         }
     }
     else
     {
         Engine.AddTextMessage("You must specify an item name.");
     }
 }
示例#2
0
 private void RegisterGive(GiveEntry entry)
 {
     this.m_GiveEntries[(object)entry.Name] = (object)entry;
 }