Esempio n. 1
0
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is Item)
     {
         Item item = (Item)targ;
         if (from.InRange(item.GetWorldLocation(), 1))
         {
             if (targ is BaseWand)
             {
                 BaseWand bw     = (BaseWand)targ;
                 int      addnum = Utility.RandomMinMax(10, 30);
                 if ((bw.Charges + addnum) > 30)
                 {
                     bw.Charges = 0;
                     Effects.PlaySound(bw.Location, bw.Map, 0x1E4);
                 }
                 else
                 {
                     bw.Charges += addnum;
                     Effects.PlaySound(bw.Location, bw.Map, 0x1EB);
                 }
                 Effects.SendLocationParticles(EffectItem.Create(bw.Location, bw.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5022);
                 rs.Delete();
             }
             else if (targ is IdentifyCrystalBall)
             {
                 IdentifyCrystalBall icb = (IdentifyCrystalBall)targ;
                 int addnum = Utility.RandomMinMax(10, 30);
                 if ((icb.Charges + addnum) > 30)
                 {
                     icb.Charges = 0;
                     Effects.PlaySound(icb.Location, icb.Map, 0x1E4);
                 }
                 else
                 {
                     icb.Charges += addnum;
                     Effects.PlaySound(icb.Location, icb.Map, 0x1EB);
                 }
                 Effects.SendLocationParticles(EffectItem.Create(icb.Location, icb.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5022);
                 rs.Delete();
             }
             else
             {
                 from.SendMessage("That can't be recharged");
             }
         }
         else
         {
             from.SendMessage("That's too far away");
         }
     }
 }
 public IdentifyTarget(IdentifyCrystalBall b) : base(10, false, TargetFlags.None)
 {
     ball = b;
 }