public override void Drink(Mobile from)
        {
            if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
            {
                from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
                return;
            }

            int delay = GetDelay(from);

            if (delay > 0)
            {
                from.SendLocalizedMessage(1072529, String.Format("{0}\t{1}", delay, delay > 1 ? "seconds." : "second.")); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
                return;
            }

            ThrowTarget targ = from.Target as ThrowTarget;

            if (targ != null && targ.Potion == this)
                return;

            from.RevealingAction();

            if (!this.m_Users.Contains(from))
                this.m_Users.Add(from);

            from.Target = new ThrowTarget(this);
        }
		public override bool OnMoveOver( Mobile m )
		{
			if ( m.AccessLevel > AccessLevel.Player )
				return true;

			bool sendMessage = m.Player;

			if ( m is BaseCreature )
				m = ((BaseCreature)m).ControlMaster;

			PlayerMobile pm = m as PlayerMobile;

			if ( pm != null )
			{
				QuestSystem qs = pm.Quest;

				if ( qs is DarkTidesQuest )
				{
					QuestObjective obj = qs.FindObjective( typeof( SpeakCavePasswordObjective ) );

					if ( obj != null && obj.Completed )
					{
						if ( sendMessage )
							m.SendLocalizedMessage( 1060648 ); // With Horus' permission, you are able to pass through the barrier.

						return true;
					}
				}
			}

			if ( sendMessage )
				m.SendLocalizedMessage( 1060649, "", 0x66D ); // Without the permission of the guardian Horus, the magic of the barrier prevents your passage.

			return false;
		}
示例#3
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				return;
			}

			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				//to prevent exploiting for pvp
				from.SendLocalizedMessage( 1075857 ); // You can not use that while paralyzed.
				return;
			} 

			if ( m_Timer == null )
			{
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), new TimerCallback( OnFirebombTimerTick ) );
				m_LitBy = from;
				from.SendLocalizedMessage( 1060581 ); //You light the firebomb! Throw it now!
			}
			else
				from.SendLocalizedMessage( 1060582 ); //You've already lit it! Better throw it now!

			from.BeginTarget( 12, true, TargetFlags.None, new TargetCallback( OnFirebombTarget ) );
		}
示例#4
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                from.RevealingAction();

                if ( targeted is BaseCreature && from.CanBeHarmful( (Mobile)targeted, true ) )
                {
                    BaseCreature creature = (BaseCreature)targeted;

                    if ( creature.Controled )
                    {
                        from.SendLocalizedMessage( 501590 ); // They are too loyal to their master to be provoked.
                    }
                    else if ( creature.IsParagon )
                    {
                        from.SendLocalizedMessage( 1049446 ); // You have no chance of provoking those creatures.
                    }
                    else
                    {
                        from.RevealingAction();
                        m_Instrument.PlayInstrumentWell( from );
                        from.SendLocalizedMessage( 1008085 ); // You play your music and your target becomes angered.  Whom do you wish them to attack?
                        from.Target = new InternalSecondTarget( from, m_Instrument, creature );
                    }
                }
            }
示例#5
0
        public override void OnComponentUsed(AddonComponent c, Mobile from)
        {
            if (from.InRange(c.Location, 2))
            {
                if (this.m_Fruits > 0)
                {
                    Item fruit = this.Fruit;

                    if (fruit == null)
                        return;

                    if (!from.PlaceInBackpack(fruit))
                    {
                        fruit.Delete();
                        from.SendLocalizedMessage(501015); // There is no room in your backpack for the fruit.					
                    }
                    else
                    {
                        if (--this.m_Fruits == 0)
                            Timer.DelayCall(TimeSpan.FromMinutes(30), new TimerCallback(Respawn));

                        from.SendLocalizedMessage(501016); // You pick some fruit and put it in your backpack.
                    }
                }
                else
                    from.SendLocalizedMessage(501017); // There is no more fruit on this tree
            }
            else
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
        }
示例#6
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if( !Validate(attacker) || !CheckStam(attacker, true) )
                return;

            ClearCurrentAbility(attacker);

            if( (defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
            {
                attacker.SendLocalizedMessage(1062052); // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159); // Your target is bleeding!
            defender.SendLocalizedMessage(1060160); // You are bleeding!

            if( defender is PlayerMobile )
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757); // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BeginBleed(defender, attacker);
        }
示例#7
0
        public bool ValidatePlacement(Mobile from, Point3D loc)
        {
            if (from.AccessLevel >= AccessLevel.GameMaster)
                return true;

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return false;
            }

            Map map = from.Map;

            if (map == null)
                return false;

            BaseHouse house = BaseHouse.FindHouseAt(loc, map, 20);

            if (house != null && !house.IsFriend(from))
            {
                from.SendLocalizedMessage(500269); // You cannot build that there.
                return false;
            }

            if (!map.CanFit(loc, 20))
            {
                from.SendLocalizedMessage(500269); // You cannot build that there.
                return false;
            }

            return true;
        }
示例#8
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
                return false;
            }

            Key key = dropped as Key;

            if (key == null || key.KeyValue == 0)
            {
                from.SendLocalizedMessage(501689); // Only non-blank keys can be put on a keyring.
                return false;
            }
            else if (this.Keys.Count >= MaxKeys)
            {
                from.SendLocalizedMessage(1008138); // This keyring is full.
                return false;
            }
            else
            {
                this.Add(key);
                from.SendLocalizedMessage(501691); // You put the key on the keyring.
                return true;
            }
        }
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( 0.1 > Utility.RandomDouble() )
			{
				/* Blood Bath
				 * Start cliloc 1070826
				 * Sound: 0x52B
				 * 2-3 blood spots
				 * Damage: 2 hps per second for 5 seconds
				 * End cliloc: 1070824
				 */
			
				ExpireTimer timer = (ExpireTimer)m_Table[defender];

				if ( timer != null )
		{
					timer.DoExpire();
					defender.SendLocalizedMessage( 1070825 ); // The creature continues to rage!
				}
				else
					defender.SendLocalizedMessage( 1070826 ); // The creature goes into a rage, inflicting heavy damage!

				timer = new ExpireTimer( defender, this );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
      public override void OnDoubleClick( Mobile from ) 
      	{ 
         	if ( !from.InRange( GetWorldLocation(), 2 ) ) 
        	{ 
            		from.SendLocalizedMessage( 500446 ); // That is too far away. 
         	} 
         	else 
		{
			if ( from.Mounted == true )
			{
				from.SendLocalizedMessage( 1042561 );
			}

			else
         		{ 
           		 	if ( from.BodyValue == 0x190 ) 
           			{ 
              				from.BodyMod = 0x191; 
               				from.HueMod = 0x0; 
               				from.PlaySound( 61 );
					from.PlaySound( 813 );
					this.Delete();
            			} 
           			else 
            			{  
                  			from.BodyMod = 0x190;
					from.HueMod = 0x0; 
                  			from.PlaySound( 61 );
					from.PlaySound( 1087 );
					this.Delete();
				}
  			}
		} 
	} 
示例#11
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.VerifyMove(from))
                return;

            if (!from.InRange(this.GetWorldLocation(), 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            Point3D fireLocation = this.GetFireLocation(from);

            if (fireLocation == Point3D.Zero)
            {
                from.SendLocalizedMessage(501695); // There is not a spot nearby to place your campfire.
            }
            else if (!from.CheckSkill(SkillName.Camping, 0.0, 100.0))
            {
                from.SendLocalizedMessage(501696); // You fail to ignite the campfire.
            }
            else
            {
                this.Consume();

                if (!this.Deleted && this.Parent == null)
                    from.PlaceInBackpack(this);

                new Campfire().MoveToWorld(fireLocation, from.Map);
            }
        }
示例#12
0
		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return;
			}
			else if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
			{
				from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
				return;
			}

			from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
示例#13
0
		public override void OnDoubleClick(Mobile from)
		{
			if (!IsChildOf(from.Backpack))
			{
				from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			}
			else if (from.EraAOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
			{
				from.SendLocalizedMessage(1075857); // You cannot use that while paralyzed.
			}
			else
			{
				if (m_Timer == null)
				{
					m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), OnFirebombTimerTick);
					m_LitBy = from;
					from.SendLocalizedMessage(1060582); // You light the firebomb.  Throw it now!
					from.Target = new ThrowTarget(this);
				}
				//else
				//	from.SendLocalizedMessage( 1060581 ); // You've already lit it!  Better throw it now!
				/*
				if ( m_Users == null )
					m_Users = new List<Mobile>();

				if ( !m_Users.Contains( from ) )
					m_Users.Add( from );
*/
			}
		}
示例#14
0
		protected override void OnTarget( Mobile from, object target ) // Override the protected OnTarget() for our feature
		{
			if ( m_Deed.Deleted || m_Deed.RootParent != from )
				return;

			if ( target is Item )
			{
				Item item = (Item)target;

				if (item.LootType == LootType.Blessed || item.BlessedFor == from || (Mobile.InsuranceEnabled && item.EraAOS && item.Insured)) // Check if its already newbied (blessed)
				{
					from.SendLocalizedMessage( 1045113 ); // That item is already blessed
				}
				else if ( item.LootType != LootType.Regular )
				{
					from.SendLocalizedMessage( 1045114 ); // You can not bless that item
				
				}
				else
				{
					item.LootType = LootType.Blessed;
					from.SendLocalizedMessage( 1010026 ); // You bless the item....

					m_Deed.Delete(); // Delete the bless deed
				}
			}
			else
			{
				from.SendLocalizedMessage( 500509 ); // You cannot bless that object
			}
		}
示例#15
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Mobile )
				{
					from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
				}
				else if ( targeted is Food )
				{
					if ( from.CheckTargetSkill( SkillName.TasteID, targeted, 0, 100 ) )
					{
						Food targ = (Food)targeted;

						if ( targ.Poison != null )
						{
							from.SendLocalizedMessage( 1038284 ); // It appears to have poison smeared on it
						}
						else
						{
							// No poison on the food
							from.SendLocalizedMessage( 502823 ); // You cannot discern anything about this substance
						}
					}
					else
					{
						// Skill check failed
						from.SendLocalizedMessage( 502823 ); // You cannot discern anything about this substance
					}
				}
				else
				{
					// The target is not food. (Potion support in the next version)
					from.SendLocalizedMessage( 502820 ); // That's not something you can taste
				}
			}
示例#16
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			// Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
			TransformContext context = TransformationSpell.GetContext( defender );

			if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) ||
				(defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
			{
				attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!
				return;
			}

			attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding!
			defender.SendLocalizedMessage( 1060160 ); // You are bleeding!

			if ( defender is PlayerMobile )
			{
				defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
				defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
			}

			defender.PlaySound( 0x133 );
			defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

			BeginBleed( defender, attacker );
		}
示例#17
0
		public static bool VerifyCast( Mobile Caster, bool messages )
		{
			if( Caster == null ) // Sanity
				return false;

			BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if( weap == null )
				weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( weap != null ) {
				if ( Core.ML && Caster.Skills[weap.Skill].Base < 50 ) {
					if ( messages ) {
						Caster.SendLocalizedMessage( 1076206 ); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
					}
					return false;
				}
			} else if ( !( Caster.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
				if ( messages ) {
					Caster.SendLocalizedMessage( 1062944 ); // You must have a weapon or a shield equipped to use this ability!
				}
				return false;
			}

			if ( !Caster.CanBeginAction( typeof( Evasion ) ) ) {
				if ( messages ) {
					Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
				}
				return false;
			}

			return true;
		}
示例#18
0
文件: Deeds.cs 项目: Crome696/ServUO
        protected override void OnTarget(Mobile from, object o)
        {
            IPoint3D ip = o as IPoint3D;

            if (ip != null)
            {
                if (ip is Item)
                    ip = ((Item)ip).GetWorldTop();

                Point3D p = new Point3D(ip);

                Region reg = Region.Find(new Point3D(p), from.Map);

                if (from.AccessLevel >= AccessLevel.GameMaster || reg.AllowHousing(from, p))
                    this.m_Deed.OnPlacement(from, p);
                else if (reg.IsPartOf(typeof(TempNoHousingRegion)))
                    from.SendLocalizedMessage(501270); // Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
                else if (reg.IsPartOf(typeof(TreasureRegion)) || reg.IsPartOf(typeof(HouseRegion)))
                    from.SendLocalizedMessage(1043287); // The house could not be created here.  Either something is blocking the house, or the house would not be on valid terrain.
                else if (reg.IsPartOf(typeof(HouseRaffleRegion)))
                    from.SendLocalizedMessage(1150493); // You must have a deed for this plot of land in order to build here.
                else
                    from.SendLocalizedMessage(501265); // Housing can not be created in this area.
            }
        }
示例#19
0
		public void BeginLaunch( Mobile from, bool useCharges )
		{
			Map map = from.Map;

			if ( map == null || map == Map.Internal )
				return;

			if ( useCharges )
			{
				if ( Charges > 0 )
				{
					--Charges;
				}
				else
				{
					from.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
					return;
				}
			}

			from.SendLocalizedMessage( 502615 ); // You launch a firework!

			Point3D ourLoc = GetWorldLocation();

			Point3D startLoc = new Point3D( ourLoc.X, ourLoc.Y, ourLoc.Z + 10 );
			Point3D endLoc = new Point3D( startLoc.X + Utility.RandomMinMax( -2, 2 ), startLoc.Y + Utility.RandomMinMax( -2, 2 ), startLoc.Z + 32 );

			Effects.SendMovingEffect( new Entity( Serial.Zero, startLoc, map ), new Entity( Serial.Zero, endLoc, map ),
				0x36E4, 5, 0, false, false );

			Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( FinishLaunch ), new object[]{ from, endLoc, map } );
		}
示例#20
0
文件: Dyes.cs 项目: Crome696/ServUO
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is DyeTub)
                {
                    DyeTub tub = (DyeTub)targeted;

                    if (tub.Redyable)
                    {
                        if (tub.CustomHuePicker == null)
                            from.SendHuePicker(new InternalPicker(tub));
                        else
                            from.SendGump(new CustomHuePickerGump(from, tub.CustomHuePicker, new CustomHuePickerCallback(SetTubHue), tub));
                    }
                    else if (tub is BlackDyeTub)
                    {
                        from.SendLocalizedMessage(1010092); // You can not use this on a black dye tub.
                    }
                    else
                    {
                        from.SendMessage("That dye tub may not be redyed.");
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500857); // Use this on a dye tub.
                }
            }
示例#21
0
文件: Disarm.cs 项目: Crome696/ServUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker))
                return;

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (this.CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
示例#22
0
		public void DoCure( Mobile from )
		{
			bool cure = false;

			CureLevelInfo[] info = LevelInfo;

			for ( int i = 0; i < info.Length; ++i )
			{
				CureLevelInfo li = info[i];

				if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
				{
					cure = true;
					break;
				}
			}

			if ( cure && from.CurePoison( from ) )
			{
				from.SendLocalizedMessage( 500231 ); // You feel cured of poison!

				from.FixedEffect( 0x373A, 10, 15 );
				from.PlaySound( 0x1E0 );
			}
			else if ( !cure )
			{
				from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment!
			}
		}
示例#23
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                if (targeted is BaseCreature && from.CanBeHarmful((Mobile)targeted, true))
                {
                    BaseCreature creature = (BaseCreature)targeted;

                    if (!this.m_Instrument.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1062488); // The instrument you are trying to play is no longer in your backpack!
                    }
                    else if (creature.Controlled)
                    {
                        from.SendLocalizedMessage(501590); // They are too loyal to their master to be provoked.
                    }
                    else if (creature.IsParagon && BaseInstrument.GetBaseDifficulty(creature) >= 160.0)
                    {
                        from.SendLocalizedMessage(1049446); // You have no chance of provoking those creatures.
                    }
                    else
                    {
                        from.RevealingAction();
                        this.m_Instrument.PlayInstrumentWell(from);
                        from.SendLocalizedMessage(1008085); // You play your music and your target becomes angered.  Whom do you wish them to attack?
                        from.Target = new InternalSecondTarget(from, this.m_Instrument, creature);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(501589); // You can't incite that!
                }
            }
示例#24
0
		protected override void OnTarget( Mobile from, object target ) // Override the protected OnTarget() for our feature
		{
			if ( target is BaseClothing )
			{
				Item item = (Item)target;

				if ( item.LootType == LootType.Blessed || item.BlessedFor == from /*|| (Mobile.InsuranceEnabled && item.Insured)*/ ) // Check if its already newbied (blessed)
				{
					from.SendLocalizedMessage( 1045113 ); // That item is already blessed
				}
				else if ( item.LootType != LootType.Regular )
				{
					from.SendLocalizedMessage( 1045114 ); // You can not bless that item
				}
				else
				{
					if( item.RootParent != from ) // Make sure its in their pack or they are wearing it
					{
						from.SendLocalizedMessage( 500509 ); // You cannot bless that object
					}
					else
					{
						item.LootType = LootType.Blessed;
						from.SendLocalizedMessage( 1010026 ); // You bless the item....

						m_Deed.Delete(); // Delete the bless deed
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 500509 ); // You cannot bless that object
			}
		}
示例#25
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			if( IsImmune( defender ) )	//Intentionally going after Mana consumption
			{
				attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
				defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
				return;
			}

			defender.FixedEffect( 0x376A, 9, 32 );
			defender.PlaySound( 0x204 );

			attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
			defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you!

			TimeSpan duration = defender.Player ? PlayerFreezeDuration : NPCFreezeDuration;

			// Treat it as paralyze not as freeze, effect must be removed when damaged.
			defender.Paralyze( duration );

			BeginImmunity( defender, duration + FreezeDelayDuration );
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsDeadPet )
				return;

			if ( from.IsBodyMod && !from.Body.IsHuman )
			{
				from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
				return;
			}

			if ( from.Mounted )
			{
				from.SendLocalizedMessage( 1005583 ); // Please dismount first.
				return;
			}

			if ( from.InRange( this, 1 ) )
			{
				Rider = from;
			}
			else
			{
				from.SendLocalizedMessage( 500206 ); // That is too far away to ride.
			}
		}
示例#27
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Item.Deleted )
					return;

				/*if ( targeted is Item && !((Item)targeted).IsStandardLoot() )
				{
					from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
				}
				else */
				if( Core.AOS && targeted == from )
				{
					from.SendLocalizedMessage( 1062845 + Utility.Random( 3 ) );	//"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
				}
				else if( Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 && ( DateTime.Now - from.LastMoveTime ) < from.ComputeMovementSpeed( from.Direction ) )
				{
					from.SendLocalizedMessage( 1063305 ); // Didn't your parents ever tell you not to run with scissors in your hand?!
				}
				else if( targeted is IScissorable )
				{
					IScissorable obj = (IScissorable)targeted;

					if( obj.Scissor( from, m_Item ) )
						from.PlaySound( 0x248 );
				}
				else
				{
					from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
				}
			}
示例#28
0
		public virtual void OnTarget(Mobile from, object targeted)
		{
			if (!Deleted)
			{
				if (targeted != null && targeted is Mobile)
				{
					Mobile to = targeted as Mobile;

					if (to is PlayerMobile)
					{
						if (to != from)
						{
							m_From = from.Name;
							m_To = to.Name;
							from.SendLocalizedMessage(1077498); //You fill out the card. Hopefully the other person actually likes you...
							InvalidateProperties();
						}
						else
						{
							from.SendLocalizedMessage(1077495); //You can't give yourself a card, silly!
						}
					}
					else
					{
						from.SendLocalizedMessage(1077496); //You can't possibly be THAT lonely!
					}
				}
				else
				{
					from.SendLocalizedMessage(1077488); //That's not another player!
				}
			}
		}
示例#29
0
		private bool CheckUse( Mobile from )
		{
			if ( !IsAccessibleTo( from ) )
				return false;

			if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS(this) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return false;
			}

			if ( !from.CanBeginAction( typeof( FireHorn ) ) )
			{
				from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath.
				return false;
			}

			int sulfAsh = Core.AOS ? 4 : 15;
			if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh )
			{
				from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
				return false;
			}

			return true;
		}
示例#30
0
		public override void OnDoubleClickSecureTrade( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
			}
			else if ( m_Entries.Count == 0 )
			{
				from.SendLocalizedMessage( 1062381 ); // The book is empty.
			}
			else
			{
				from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

				SecureTradeContainer cont = GetSecureTradeCont();

				if ( cont != null )
				{
					SecureTrade trade = cont.Trade;

					if ( trade != null && trade.From.Mobile == from )
						trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.To.Mobile), this ) );
					else if ( trade != null && trade.To.Mobile == from )
						trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.From.Mobile), this ) );
				}
			}
		}
示例#31
0
        public static Clone GetDeflect(Mobile attacker, Mobile defender)
        {
            Clone clone = null;

            if (HasClone(defender) && (defender.Skills.Ninjitsu.Value / 133.2) > Utility.RandomDouble())
            {
                IPooledEnumerable eable = defender.GetMobilesInRange(4);

                foreach (Mobile m in eable)
                {
                    clone = m as Clone;

                    if (clone != null && clone.Summoned && clone.SummonMaster == defender)
                    {
                        attacker?.SendLocalizedMessage(1063141); // Your attack has been diverted to a nearby mirror image of your target!

                        defender.SendLocalizedMessage(1063140);  // You manage to divert the attack onto one of your nearby mirror images.
                        break;
                    }
                }

                eable.Free();
            }

            return(clone);
        }
示例#32
0
        public virtual void Expire(Mobile parent)
        {
            parent?.SendLocalizedMessage(1072515, Name ?? $"#{LabelNumber}"); // The ~1_name~ expired...

            Effects.PlaySound(GetWorldLocation(), Map, 0x201);

            Delete();
        }
示例#33
0
        public override int LabelNumber => 1041508; // a faction trap removal kit

        public void ConsumeCharge(Mobile consumer)
        {
            --Charges;

            if (Charges <= 0)
            {
                Delete();

                consumer?.SendLocalizedMessage(1042531); // You have used all of the parts in your trap removal kit.
            }
        }
示例#34
0
 public override void OnDoubleClick(Mobile m)
 {
     if (m != null && m_Controller.Enabled)
     {
         ItemID ^= 2;
         Effects.PlaySound(Location, Map, 0x3E8);
         m_Controller.LeverPulled(Code);
     }
     else
     {
         m?.SendLocalizedMessage(1060001); // You throw the switch, but the mechanism cannot be engaged again so soon.
     }
 }
示例#35
0
 private static void EndAction(Mobile m)
 {
     m?.EndAction <FireHorn>();
     m?.SendLocalizedMessage(1049621); // You catch your breath.
 }
示例#36
0
        public void Placement_OnTarget(Mobile from, object targeted, object state)
        {
            IPoint3D p = targeted as IPoint3D;

            if (p == null)
            {
                return;
            }

            Point3D loc = new Point3D(p);

            BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16);

            if (house != null && house.IsCoOwner(from))
            {
                bool northWall = BaseAddon.IsWall(loc.X, loc.Y - 1, loc.Z, from.Map);
                bool westWall  = BaseAddon.IsWall(loc.X - 1, loc.Y, loc.Z, from.Map);

                if (northWall && westWall)
                {
                    switch (from.Direction & Direction.Mask)
                    {
                    case Direction.North:
                    case Direction.South: northWall = true; westWall = false; break;

                    case Direction.East:
                    case Direction.West: northWall = false; westWall = true; break;

                    default: from.SendMessage("Turn to face the wall on which to hang this trophy."); return;
                    }
                }

                int itemID = 0;

                if (northWall)
                {
                    itemID = 0x9964;
                }
                else if (westWall)
                {
                    itemID = 0x9965;
                }
                else
                {
                    from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall.
                }
                if (itemID > 0)
                {
                    Item addon = new StaghornFernAddon();

                    addon.ItemID = itemID;
                    addon.MoveToWorld(loc, from.Map);

                    house.Addons[addon] = from;
                    Delete();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042036); // That location is not in your house.
            }
        }
示例#37
0
        public void OnTick()
        {
            if (HasBegun && !Complete)
            {
                foreach (KeyValuePair <PlayerMobile, PlayerStatsEntry> part in GetParticipants(true))
                {
                    PlayerMobile pm = part.Key;

                    if (!RidingFlyingAllowed && pm.Mounted)
                    {
                        IMount mount = pm.Mount;

                        if (mount != null)
                        {
                            mount.Rider = null;
                            pm.SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(10), false);
                        }

                        if (InPreFight)
                        {
                            pm.SendLocalizedMessage(1115997); // The rules prohibit riding a mount or flying.
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1115998); // The rules prohibit riding a mount or flying. You have received penalty damage!

                            int damage = 37;

                            if (!Warned.Contains(pm))
                            {
                                Warned.Add(pm);
                            }
                            else
                            {
                                damage = 237;
                            }

                            AOS.Damage(pm, null, damage, 0, 0, 0, 0, 0, 0, 100);
                        }
                    }

                    if (!RangedWeaponsAllowed)
                    {
                        Item item = pm.FindItemOnLayer(Layer.TwoHanded);

                        if (item is BaseRanged)
                        {
                            pm.AddToBackpack(item);
                            pm.SendLocalizedMessage(1115996); // The rules prohibit the use of ranged weapons!
                        }
                    }

                    if (!SummonSpellsAllowed)
                    {
                        foreach (Mobile mob in Arena.Region.GetEnumeratedMobiles())
                        {
                            if (mob is BaseCreature creature && creature.Summoned)
                            {
                                Mobile master = creature.GetMaster();

                                master?.SendLocalizedMessage(1149603); // The rules prohibit the use of summoning spells!

                                creature.Delete();
                            }
                        }
                    }
                }

                if (InPreFight)
                {
                    if (EntryDeadline != DateTime.MinValue && EntryDeadline < DateTime.UtcNow)
                    {
                        BeginDuel();
                    }
                }
                else if (EndTime < DateTime.UtcNow)
                {
                    EndDuel();
                }
            }
        }