Exemplo n.º 1
0
        public void SingleParts_OnTarget(Mobile from, object o)
        {
            if (from == null || from.Backpack == null || o == null || !(o is Item))
            {
                return;
            }

            if (!IsChildOf(from.Backpack) || !(((Item)o).IsChildOf(from.Backpack)))
            {
                from.SendMessage("Both items must be in your backpack.");
                return;
            }
            else if (this.Level == 1 && o is MysticKeySinglePart)
            {
                MysticKeySinglePart s_part = (MysticKeySinglePart)o;
                if (s_part.Level == 2)
                {
                    if (Utility.Random(10) < 3)
                    {
                        from.SendMessage("You fail to fuse the two parts together and one explodes.");
                        from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                        from.PlaySound(0x307);
                        Spells.SpellHelper.Damage(TimeSpan.FromTicks(0), from, 20);
                        switch (Utility.Random(2))
                        {
                        case 0: this.Delete(); break;

                        case 1: s_part.Delete(); break;
                        }
                    }
                    else
                    {
                        from.SendMessage("You carefully fuse both parts together and form a bigger part.");
                        from.PlaySound(550);
                        from.AddToBackpack(new MysticKeyCombinedPart(1));

                        this.Delete();
                        s_part.Delete();
                    }
                }
                else
                {
                    from.SendMessage("They do not seem to fit well together.");
                }
            }
            else if (o is MysticKeyCombinedPart)
            {
                MysticKeyCombinedPart c_part = (MysticKeyCombinedPart)o;
                if (this.Level >= 3 && this.Level - 2 == c_part.Level)
                {
                    if (Utility.Random(10) < this.Level + 2)
                    {
                        from.SendMessage("You fail to fuse the two parts together and the smaller one explodes");
                        from.FixedParticles(0x36B0, 20, 10, 5044, EffectLayer.Head);
                        from.PlaySound(0x307);
                        Spells.SpellHelper.Damage(TimeSpan.FromTicks(0), from, 40);
                        this.Delete();
                    }
                    else
                    {
                        from.SendMessage("You carefully fuse both parts together and form a bigger part");
                        from.PlaySound(550);
                        c_part.RaiseLevel(from);
                        this.Delete();
                    }
                }
                else
                {
                    from.SendMessage("They do not seem to fit well together.");
                }
            }
            else
            {
                from.SendMessage("You can not use this with that.");
            }
        }
Exemplo n.º 2
0
		public override void OnDeath(Container c)
		{
			if ( Utility.Random( 10 ) == 0 )
				c.DropItem( new LayerSashDeed() );

			if ( Utility.Random( 250 ) == 0 )
				c.DropItem(new SpecialEtherealMountDeed());

			if (Utility.Random(20) < 1) c.DropItem( new ChampionHat() ) ;
			if (Utility.Random(500) < 1) c.DropItem( new ChampionShroud() );

			MysticKeySinglePart fp = new MysticKeySinglePart( 6 );
			fp.Movable = true;
			c.DropItem( fp );

			switch ( Utility.Random( 100 ) )
			{
				case 0: c.DropItem(new ChampionCloak()); break;
				case 1: c.DropItem(new ChampionDoublet()); break;
				case 2: c.DropItem(new ChampionKilt()); break;
				case 3: c.DropItem(new ChampionNecklace()); break;
				case 4: c.DropItem(new ChampionPants()); break;
				case 5: c.DropItem(new ChampionRing()); break;
				case 6: c.DropItem(new ChampionSandals()); break;
				case 7: c.DropItem(new ChampionShirt()); break;
			}

			int bonus = 0;

			for (int cnt = 3;cnt < 0; cnt--)
			{
				if ( bonus < 3 && Utility.Random(4) == 0 )
				{
					bonus++;
					cnt++;
				}

				switch (Utility.Random(4))
				{
					case 0: c.DropItem(new SpecialHairDye()); break;
					case 1: c.DropItem(new SpecialBeardDye()); break;
					case 2: c.DropItem(new ClothingBlessDeed()); break;
					case 3: c.DropItem(new NameChangeDeed()); break;
				}
			}

			ms_Active = false;
			base.OnDeath(c);
		}