Пример #1
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Item )
				{
					Item item = (Item)targeted;

					if ( item is IDyable && m_Tub.AllowDyables )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						else if ( item.Parent is Mobile )
							from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
						else if ( ((IDyable)item).Dye( from, m_Tub ) )
							from.PlaySound( 0x23E );
					}
					else if ( FurnitureAttribute.Check( item ) )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else
						{
							bool okay = ( item.IsChildOf( from.Backpack ) );

							if ( !okay )
							{
								if ( item.Parent == null )
								{
									BaseHouse house = BaseHouse.FindHouseAt( item );

									if ( house == null || ( !house.IsLockedDown( item ) && !house.IsSecure( item ) ) )
										from.SendLocalizedMessage( 501022 ); // Furniture must be locked down to paint it.
									else if ( !house.IsCoOwner( from ) )
										from.SendLocalizedMessage( 501023 ); // You must be the owner to use this item.
									else
										okay = true;
								}
								else
								{
									from.SendLocalizedMessage( 1048135 ); // The furniture must be in your backpack to be painted.
								}
							}

							if ( okay )
							{
								item.Hue = m_Tub.DyedHue;
								from.PlaySound( 0x23E );
							}
						}
					}
					else if ( (item is Runebook || item is RecallRune ) && m_Tub.AllowRunebooks )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1049776 ); // You cannot dye runes or runebooks that are locked down.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if (	item is ILevelable || 
								item is IGiftable || 
								item is BaseBoatDeed || 
								item is HouseDeed || 
								item is HousePlacementTool || 
								item is BaseDockedBoat || 
								item is MagicCloak || 
								item is MagicHat || 
								item is Pillows || 
								item is ColoredWallTorch || 
								item is BaseQuiver || 
								item is MagicBelt || 
								item is MagicSash || 
								item is MagicBoots || 
								item is MagicRobe || 
								item is HairDyeBottle || 
								item is HairDyePotion || 
								item is ThrowingGloves || 
								item is LevelPugilistGloves || 
								item is LevelThrowingGloves || 
								item is GiftPugilistGloves || 
								item is GiftThrowingGloves || 
								item is PugilistGlove || 
								item is PugilistGloves ) // WIZARD ADDED FOR SPECIAL CLOTHES
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}

						if ( ( item is BaseBoatDeed || item is BaseDockedBoat ) && item.Hue < 1 ){ item.Hue = 0x5BE; }
					}
					else if ( item is DDRelicRugAddonDeed ) // WIZARD ADDED TO DYE RELIC RUGS
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							DDRelicRugAddonDeed relic = (DDRelicRugAddonDeed)item;
							relic.RelicColor = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is HenchmanFamiliarItem || item is WaxPainting || item is WaxSculptors || item is WaxSculptorsD || item is WaxSculptorsE || item is ColorCandleShort || item is ColorCandleLong ) // WIZARD ADDED
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( ( item is MyTentEastAddonDeed ) || ( item is MyTentSouthAddonDeed ) ) // WIZARD ADDED TO DYE TENTS
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							if ( item is MyTentEastAddonDeed ) { MyTentEastAddonDeed tent = (MyTentEastAddonDeed)item; tent.TentColor = m_Tub.DyedHue; }
							else { MyTentSouthAddonDeed tent = (MyTentSouthAddonDeed)item; tent.TentColor = m_Tub.DyedHue; }
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is MonsterStatuette && m_Tub.AllowStatuettes )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1049779 ); // You cannot dye statuettes that are locked down.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is BaseArmor && ( Server.Misc.MaterialInfo.IsAnyKindOfClothItem( item ) || item is ElvenBoots ) && m_Tub.AllowLeather )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042419 ); // You may not dye leather items which are locked down.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is BaseArmor && ( Server.Misc.MaterialInfo.IsAnyKindOfMetalItem( item ) || Server.Misc.MaterialInfo.IsAnyKindOfWoodItem( item ) ) && m_Tub.AllowArmor )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendMessage( "Can't Dye armor that is equipped." );
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is BaseWeapon && m_Tub.AllowWeapons )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendMessage( "Can't Dye weapons that are equipped." );
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else
					{
						from.SendLocalizedMessage( m_Tub.FailMessage );
					}
				}
				else
				{
					from.SendLocalizedMessage( m_Tub.FailMessage );
				}
			}
Пример #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                object obj = targeted;

                string sCownt = "Charges";

                if (obj is HueStone)
                {
                    Item iStone = targeted as Item;

                    from.RevealingAction();
                    from.PlaySound(0x1FA);


                    if (iStone.Hue == 0)
                    {
                        iStone.Hue = 0x483; iStone.Name = "Illusionist Stone ( dark green )";
                    }
                    else if (iStone.Hue == 0x483)
                    {
                        iStone.Hue = 0x484; iStone.Name = "Illusionist Stone ( dark blue )";
                    }
                    else if (iStone.Hue == 0x484)
                    {
                        iStone.Hue = 0x485; iStone.Name = "Illusionist Stone ( dark red )";
                    }
                    else if (iStone.Hue == 0x485)
                    {
                        iStone.Hue = 0x486; iStone.Name = "Illusionist Stone ( dark purple )";
                    }
                    else if (iStone.Hue == 0x486)
                    {
                        iStone.Hue = 0x487; iStone.Name = "Illusionist Stone ( dark yellow )";
                    }
                    else if (iStone.Hue == 0x487)
                    {
                        iStone.Hue = 0x488; iStone.Name = "Illusionist Stone ( dark bluegreen )";
                    }
                    else if (iStone.Hue == 0x488)
                    {
                        iStone.Hue = 0x48A; iStone.Name = "Illusionist Stone ( blue green )";
                    }
                    else if (iStone.Hue == 0x48A)
                    {
                        iStone.Hue = 0x48B; iStone.Name = "Illusionist Stone ( purple green )";
                    }
                    else if (iStone.Hue == 0x48B)
                    {
                        iStone.Hue = 0x48C; iStone.Name = "Illusionist Stone ( green blue )";
                    }
                    else if (iStone.Hue == 0x48C)
                    {
                        iStone.Hue = 0x493; iStone.Name = "Illusionist Stone ( green purple )";
                    }
                    else if (iStone.Hue == 0x493)
                    {
                        iStone.Hue = 0x494; iStone.Name = "Illusionist Stone ( blue red )";
                    }
                    else if (iStone.Hue == 0x494)
                    {
                        iStone.Hue = 0x495; iStone.Name = "Illusionist Stone ( bright blue )";
                    }
                    else if (iStone.Hue == 0x495)
                    {
                        iStone.Hue = 0x497; iStone.Name = "Illusionist Stone ( darkness )";
                    }
                    else if (iStone.Hue == 0x497)
                    {
                        iStone.Hue = 0x498; iStone.Name = "Illusionist Stone ( blue darkness )";
                    }
                    else if (iStone.Hue == 0x498)
                    {
                        iStone.Hue = 0;     iStone.Name = "Illusionist Stone ( colorless )";
                    }

                    else if (iStone.Hue == 0xB96)
                    {
                        iStone.Hue = 0x47E; iStone.Name = "Illusionist Stone ( winter snow )";
                    }
                    else if (iStone.Hue == 0x47E)
                    {
                        iStone.Hue = 0x47F; iStone.Name = "Illusionist Stone ( winter ice )";
                    }
                    else if (iStone.Hue == 0x47F)
                    {
                        iStone.Hue = 0x480; iStone.Name = "Illusionist Stone ( solid ice )";
                    }
                    else if (iStone.Hue == 0x480)
                    {
                        iStone.Hue = 0x481; iStone.Name = "Illusionist Stone ( snow white )";
                    }
                    else if (iStone.Hue == 0x481)
                    {
                        iStone.Hue = 0x482; iStone.Name = "Illusionist Stone ( dark snow )";
                    }
                    else if (iStone.Hue == 0x482)
                    {
                        iStone.Hue = 0x4AB; iStone.Name = "Illusionist Stone ( frost )";
                    }
                    else if (iStone.Hue == 0x4AB)
                    {
                        iStone.Hue = 0xB83; iStone.Name = "Illusionist Stone ( jade )";
                    }
                    else if (iStone.Hue == 0xB83)
                    {
                        iStone.Hue = 0xB93; iStone.Name = "Illusionist Stone ( darker jade )";
                    }
                    else if (iStone.Hue == 0xB93)
                    {
                        iStone.Hue = 0xB94; iStone.Name = "Illusionist Stone ( dark jade )";
                    }
                    else if (iStone.Hue == 0xB94)
                    {
                        iStone.Hue = 0xB95; iStone.Name = "Illusionist Stone ( medium jade )";
                    }
                    else if (iStone.Hue == 0xB95)
                    {
                        iStone.Hue = 0xB96; iStone.Name = "Illusionist Stone ( light jade )";
                    }

                    else if (iStone.Hue == 0x492)
                    {
                        iStone.Hue = 0x48F; iStone.Name = "Illusionist Stone ( green light )";
                    }
                    else if (iStone.Hue == 0x48F)
                    {
                        iStone.Hue = 0x490; iStone.Name = "Illusionist Stone ( purple light )";
                    }
                    else if (iStone.Hue == 0x490)
                    {
                        iStone.Hue = 0x491; iStone.Name = "Illusionist Stone ( brown light )";
                    }
                    else if (iStone.Hue == 0x491)
                    {
                        iStone.Hue = 0x48D; iStone.Name = "Illusionist Stone ( ice light )";
                    }
                    else if (iStone.Hue == 0x48D)
                    {
                        iStone.Hue = 0x48E; iStone.Name = "Illusionist Stone ( fire light )";
                    }
                    else if (iStone.Hue == 0x48E)
                    {
                        iStone.Hue = 0x499; iStone.Name = "Illusionist Stone ( gold )";
                    }
                    else if (iStone.Hue == 0x499)
                    {
                        iStone.Hue = 0x4AA; iStone.Name = "Illusionist Stone ( rose red )";
                    }
                    else if (iStone.Hue == 0x4AA)
                    {
                        iStone.Hue = 0x4AC; iStone.Name = "Illusionist Stone ( sun )";
                    }
                    else if (iStone.Hue == 0x4AC)
                    {
                        iStone.Hue = 0x489; iStone.Name = "Illusionist Stone ( fire )";
                    }
                    else if (iStone.Hue == 0x489)
                    {
                        iStone.Hue = 0x496; iStone.Name = "Illusionist Stone ( blaze )";
                    }
                    else if (iStone.Hue == 0x496)
                    {
                        iStone.Hue = 0x492; iStone.Name = "Illusionist Stone ( slickness )";
                    }

                    else if (iStone.Hue == 0x9C3)
                    {
                        iStone.Hue = 0x7E3; iStone.Name = "Illusionist Stone ( nightmare )";
                    }
                    else if (iStone.Hue == 0x7E3)
                    {
                        iStone.Hue = 0x1;   iStone.Name = "Illusionist Stone ( pitch black )";
                    }
                    else if (iStone.Hue == 0x1)
                    {
                        iStone.Hue = 0x81C; iStone.Name = "Illusionist Stone ( moonlight )";
                    }
                    else if (iStone.Hue == 0x81C)
                    {
                        iStone.Hue = 0x81B; iStone.Name = "Illusionist Stone ( dark nights )";
                    }
                    else if (iStone.Hue == 0x81B)
                    {
                        iStone.Hue = 0xB97; iStone.Name = "Illusionist Stone ( necrotic flesh )";
                    }
                    else if (iStone.Hue == 0xB97)
                    {
                        iStone.Hue = 0x6F3; iStone.Name = "Illusionist Stone ( bloody hell )";
                    }
                    else if (iStone.Hue == 0x6F3)
                    {
                        iStone.Hue = 0xB85; iStone.Name = "Illusionist Stone ( bloodstone )";
                    }
                    else if (iStone.Hue == 0xB85)
                    {
                        iStone.Hue = 0x5B5; iStone.Name = "Illusionist Stone ( dark blood )";
                    }
                    else if (iStone.Hue == 0x5B5)
                    {
                        iStone.Hue = 0x9C2; iStone.Name = "Illusionist Stone ( ghostly )";
                    }
                    else if (iStone.Hue == 0x9C2)
                    {
                        iStone.Hue = 0x9C3; iStone.Name = "Illusionist Stone ( ghostly bright )";
                    }

                    else
                    {
                        iStone.Hue = 0;     iStone.Name = "Illusionist Stone ( colorless )";
                    }

                    m_Dye.NType = iStone.Name;

                    from.SendMessage("The Illusionist Stone magically changed color.");
                }
                else if (obj is Item)
                {
                    Item iDye = targeted as Item;

                    if (!iDye.IsChildOf(from.Backpack))
                    {
                        from.SendMessage("You can only use this stone on things in your pack.");
                    }
                    else if ((iDye is Gold) && (iDye.Amount > 499))
                    {
                        m_Dye.NCharges = m_Dye.NCharges + 1;

                        if (iDye.Amount == 500)
                        {
                            iDye.Delete();
                        }
                        else
                        {
                            iDye.Amount = iDye.Amount - 500;
                        }

                        from.RevealingAction();
                        from.PlaySound(0x2E6);
                        string sCount = "charges";
                        if (m_Dye.NCharges == 1)
                        {
                            sCount = "charge"; sCownt = "Charge";
                        }
                        from.PrivateOverheadMessage(MessageType.Regular, 0x44, false, "This stone now has " + m_Dye.NCharges.ToString() + " " + sCount + ".", from.NetState);
                    }
                    else if ((iDye is Gold) && (iDye.Amount < 500))
                    {
                        from.PrivateOverheadMessage(MessageType.Regular, 0x44, false, "I do not have enough gold to charge this stone.", from.NetState);
                    }
                    else if ((iDye.IsChildOf(from.Backpack)) && (m_Dye.NCharges > 0))
                    {
                        if (iDye is DDRelicRugAddonDeed)                           // DJERYV ADDED TO DYE RELIC RUGS
                        {
                            DDRelicRugAddonDeed relic = (DDRelicRugAddonDeed)iDye;
                            relic.RelicColor = m_Dye.Hue;
                        }
                        else if ((iDye is MyTentEastAddonDeed) || (iDye is MyTentSouthAddonDeed))                               // DJERYV ADDED TO DYE TENTS
                        {
                            if (iDye is MyTentEastAddonDeed)
                            {
                                MyTentEastAddonDeed tent = (MyTentEastAddonDeed)iDye; tent.TentColor = m_Dye.Hue;
                            }
                            else
                            {
                                MyTentSouthAddonDeed tent = (MyTentSouthAddonDeed)iDye; tent.TentColor = m_Dye.Hue;
                            }
                        }
                        iDye.Hue = m_Dye.Hue;
                        from.RevealingAction();
                        from.PlaySound(0x1FA);
                        m_Dye.NCharges = m_Dye.NCharges - 1;
                    }
                    else if (m_Dye.NCharges < 1)
                    {
                        from.PrivateOverheadMessage(MessageType.Regular, 0x44, false, "This illusionist stone has no charges.", from.NetState);
                    }
                    else
                    {
                        from.SendMessage("You cannot use the stone on that.");
                    }
                }
                else
                {
                    from.SendMessage("You cannot use the stone on that.");
                }
            }