C# (CSharp) Class Mobile, 0 Code Examples

C# (CSharp) Mobile - 30 examples found. These are the top rated real world C# (CSharp) examples of class Mobile from package 0 extracted from open source projects. You can rate examples to help us improve the quality of examples
Inheritance: System.Web.UI.Page
Example #1
0
		public override bool IsEnemy( Mobile m )
		{
			if ( m.Player && m.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
				return false;

			return base.IsEnemy( m );
		}
Example #2
0
        public static bool HasSpellMastery(Mobile m)
        {
            //Publish 71 PVP Spell damage increase cap changes. If you have GM of one school of magic and no others, you are "focused" in that school of magic and have 30% sdi cap instead of 15%.
            List<SkillName> schools = new List<SkillName>()
            {
                SkillName.Magery,
                SkillName.AnimalTaming,
                SkillName.Musicianship,
                SkillName.Mysticism,
                SkillName.Spellweaving,
                SkillName.Chivalry,
                SkillName.Necromancy,
                SkillName.Bushido,
                SkillName.Ninjitsu
            };

            bool spellMastery = false;

            foreach (SkillName skill in schools)
            {
                if (m.Skills[skill].Base >= 30.0 && spellMastery)
                    return false;
                if (m.Skills[skill].Base >= 100.0)
                    spellMastery = true;
            }
            return spellMastery;
        }
Example #3
0
		protected override void OnTarget( Mobile from, object o )
		{
			if ( o is Mobile )
			{
				Mobile m = (Mobile)o;
				Party p = Party.Get( from );
				Party mp = Party.Get( m );

				if ( from == m )
					from.SendLocalizedMessage( 1005439 ); // You cannot add yourself to a party.
				else if ( p != null && p.Leader != from )
					from.SendLocalizedMessage( 1005453 ); // You may only add members to the party if you are the leader.
				else if ( m.Party is Mobile )
					return;
				else if ( p != null && (p.Members.Count + p.Candidates.Count) >= Party.Capacity )
					from.SendLocalizedMessage( 1008095 ); // You may only have 10 in your party (this includes candidates).
				else if ( !m.Player && m.Body.IsHuman )
					m.SayTo( from, 1005443 ); // Nay, I would rather stay here and watch a nail rust.
				else if ( !m.Player )
					from.SendLocalizedMessage( 1005444 ); // The creature ignores your offer.
				else if ( mp != null && mp == p )
					from.SendLocalizedMessage( 1005440 ); // This person is already in your party!
				else if ( mp != null )
					from.SendLocalizedMessage( 1005441 ); // This person is already in a party!
				else
					Party.Invite( from, m );
			}
			else
			{
				from.SendLocalizedMessage( 1005442 ); // You may only add living things to your party!
			}
		}
        public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
        {
            if ( tool.Deleted || tool.UsesRemaining < 0 )
                return 1044038; // You have worn out your tool!
            else if ( !BaseTool.CheckAccessible( tool, from ) )
                return 1044263; // The tool must be on your person to use.

            if ( typeItem != null )
            {
                object o = Activator.CreateInstance( typeItem );

                if ( o is SpellScroll )
                {
                    SpellScroll scroll = (SpellScroll)o;
                    Spellbook book = Spellbook.Find( from, scroll.SpellID );

                    bool hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );

                    scroll.Delete();

                    return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
                }
                else if ( o is Item )
                {
                    ((Item)o).Delete();
                }
            }

            return 0;
        }
Example #5
0
		public override void CraftInit( Mobile from )
		{
			double skillValue = from.Skills[SkillName.Cartography].Value;
			int dist = 64 + (int)(skillValue * 2);

			SetDisplay( from.X - dist, from.Y - dist, from.X + dist, from.Y + dist, 200, 200 );
		}
		//public override bool DisplayLootType{ get{ return true; } }

		public override void OnDoubleClick( Mobile from ) // Override double click of the deed to call our target
		{
			if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
			{
				 from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
		 		this.Delete(); 
				from.SendMessage( "The item has been placed in your backpack." );
				switch ( Utility.Random( 5 ) ) //Random chance of armor 
                        	{ 
                          		case 0: from.AddToBackpack( new Vicodin( ) ); 
                          		break; 
                          		case 1: from.AddToBackpack( new Vicodin( ) ); 
                          		break; 
                          		case 2: from.AddToBackpack( new Vicodin( ) ); 
                          		break; 
                          		case 3: from.AddToBackpack( new Vicodin( ) ); 
                          		break; 
                          		case 4: from.AddToBackpack( new Vicodin( ) ); 
                          		break; 
                        	} 

			 }
		}	
Example #7
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
                return;

            ClearCurrentAbility( attacker );

            defender.PlaySound( 0x213 );

            attacker.SendLocalizedMessage( 1074383 ); // Your shot sends forth a wave of psychic energy.
            defender.SendLocalizedMessage( 1074384 ); // Your mind is attacked by psychic force!

            int extraDamage = 10 * (int) ( attacker.Int / defender.Int );

            if ( extraDamage < 10 )
                extraDamage = 10;
            if ( extraDamage > 20 )
                extraDamage = 20;

            AOS.Damage( defender, attacker, extraDamage, 100, 0, 0, 0, 0 ); // 100% Physical Damage

            if ( m_EffectTable.ContainsKey( defender ) )
                m_EffectTable[defender].Stop();

            m_EffectTable[defender] = Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( Expire_Callback ), defender );
        }
Example #8
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
				return;

			base.OnDoubleClick( from );
		}
        public override void OnSingleClick(Mobile from)
        {
            base.OnSingleClick(from);

            if (IsArcane)
                LabelTo(from, 1061837, String.Format("{0}\t{1}", m_CurArcaneCharges, m_MaxArcaneCharges));
        }
Example #10
0
        public override bool OnMoveOver(Mobile m)
        {
            if (Core.ML)
                return true;

            return base.OnMoveOver(m);
        }
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted == m_Ticket )
				{
					from.SendLocalizedMessage( 501928 ); // You can't target the same ticket!
				}
				else if ( targeted is EtherealMountDeed )
				{
					EtherealMountDeed theirTicket = targeted as EtherealMountDeed;
					Mobile them = theirTicket.m_Owner;

					if ( them == null || them.Deleted )
					{
						from.SendLocalizedMessage( 501930 ); // That is not a valid ticket.
					}
					else
					{
						from.SendGump( new InternalGump( from, m_Ticket ) );
						them.SendGump( new InternalGump( them, theirTicket ) );
					}
				}
				else if ( targeted is Item && ((Item)targeted).ItemID == 0x14F0 )
				{
					from.SendLocalizedMessage( 501931 ); // You need to find another ticket marked NEW PLAYER.
				}
				else
				{
					from.SendLocalizedMessage( 501929 ); // You will need to select a ticket.
				}
			}
	public override void OnDoubleClick( Mobile from )
	{
		if(IsPartOf != null)
			IsPartOf.OnDoubleClick(from);
		else
			base.OnDoubleClick(from);
	}
 public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
 {
     from.RevealingAction();
     from.SendLocalizedMessage( 1049525 ); // Whom do you wish to calm?
     from.Target = new InternalTarget( from, instrument );
     from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
 }
Example #14
0
	public override void OnDoubleClick( Mobile from )
	{
		if (! from.InRange( this.GetWorldLocation(), 1 ))
		{
			from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that.
		}	
	}
Example #15
0
 public override void PlayCraftEffect(Mobile from)
 {
     from.PlaySound(0x2B); // bellows
     //if ( from.Body.Type == BodyType.Human && !from.Mounted )
     //	from.Animate( 9, 5, 1, true, false, 0 );
     //new InternalTimer( from ).Start();
 }
 public SewerQuestGump( Mobile owner )
     : base(50,50)
 {
     //----------------------------------------------------------------------------------------------------
     AddPage( 0 );AddImageTiled(  54, 33, 369, 400, 2624 );AddAlphaRegion( 54, 33, 369, 400 );AddImageTiled( 416, 39, 44, 389, 203 );
     //--------------------------------------Window size bar--------------------------------------------
     AddImage( 97, 49, 9005 );AddImageTiled( 58, 39, 29, 390, 10460 );AddImageTiled( 412, 37, 31, 389, 10460 );
     AddBackground(85, 30, 329, 408, 3500);
     AddLabel( 140, 60, 0x34, "Infested Sewer" );
     //----------------------/----------------------------------------------/
     AddHtml( 107, 140, 300, 230, " < BODY > " +
     "<BASEFONT COLOR=YELLOW>Hi, I'm Brent. I work for Britain's <BR>" +
     "<BASEFONT COLOR=YELLOW>sewer management department. Recently<BR>" +
     "<BASEFONT COLOR=YELLOW>radioactive slimes have infested the<BR>" +
     "<BASEFONT COLOR=YELLOW>sewers. Needless to say I havent been<BR>" +
     "<BASEFONT COLOR=YELLOW>back to work since.  If you could kill<BR>" +
     "<BASEFONT COLOR=YELLOW>a few of them off and bring me back<BR>" +
     "<BASEFONT COLOR=YELLOW>30 bottles of radioactive acid as proof<BR>" +
     "<BASEFONT COLOR=YELLOW>I will reward you. Just be cautious, you<BR>" +
     "<BASEFONT COLOR=YELLOW>wouldn't believe the weird stuff people<BR>" +
     "<BASEFONT COLOR=YELLOW>flush down the drain.<BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "</BODY>", false, true);
     //----------------------/----------------------------------------------/
     AddImage( 430, 9, 10441);AddImageTiled( 40, 38, 17, 391, 9263 );AddImage( 6, 25, 10421 );AddImage( 34, 12, 10420 );AddImageTiled( 94, 25, 342, 15, 10304 );AddImageTiled( 40, 427, 415, 16, 10304 );AddImage( -10, 314, 10402 );AddImage( 56, 150, 10411 );AddImage( 155, 120, 2103 );AddImage( 136, 84, 96 );AddButton( 225, 390, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
 }
Example #17
0
        public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
        {
            if (toolBroken)
                from.SendLocalizedMessage(1044038); // You have worn out your tool

            if (failed)
            {
                if (lostMaterial)
                    return 1044043; // You failed to create the item, and some of your materials are lost.
                else
                    return 1044157; // You failed to create the item, but no materials were lost.
            }
            else
            {
                from.PlaySound(0x41); // glass breaking

                if (quality == 0)
                    return 502785; // You were barely able to make this item.  It's quality is below average.
                else if (makersMark && quality == 2)
                    return 1044156; // You create an exceptional quality item and affix your maker's mark.
                else if (quality == 2)
                    return 1044155; // You create an exceptional quality item.
                else
                    return 1044154; // You create the item.
            }
        }
Example #18
0
        public override void OnSingleClick(Mobile from)
        {
            base.OnSingleClick(from);

            if (!String.IsNullOrEmpty(this.m_Subtext))
                this.LabelTo(from, m_Subtext);
        }
Example #19
0
		public override TimeSpan OnSwing( Mobile attacker, Mobile defender ) {
			// Make sure we've been standing still for one second
			if( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( Core.AOS ? 0.5 : 1.0 )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) ) {
				bool canSwing = true;

				if( Core.AOS ) {
					canSwing = (!attacker.Paralyzed && !attacker.Frozen);

					if( canSwing ) {
						Spell sp = attacker.Spell as Spell;

						canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement);
					}
				}

				if( canSwing && attacker.HarmfulCheck( defender ) ) {
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );

					if( OnFired( attacker, defender ) ) {
						if( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}

				return GetDelay( attacker );
			} else {
				return TimeSpan.FromSeconds( 0.25 );
			}
		}
Example #20
0
        public override void OnDoubleClick(Mobile from)
        {
            bool wasBurning = this.Burning;

            base.OnDoubleClick(from);

            if (!wasBurning && this.Burning)
            {
                PlayerMobile player = from as PlayerMobile;

                if (player == null)
                    return;

                QuestSystem qs = player.Quest;

                if (qs != null && qs is HaochisTrialsQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(SixthTrialIntroObjective));

                    if (obj != null && !obj.Completed)
                        obj.Complete();

                    this.SendLocalizedMessageTo(from, 1063251); // You light a candle in honor.
                }
            }
        }
Example #21
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         }
     }
     else
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " bales of cotton"));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a bale of cotton"));
         }
     }
 }
Example #22
0
 public override bool IsAccessibleTo(Mobile check)
 {
     //if ( ( check == m_Owner && m_Open ) || check.AccessLevel >= AccessLevel.GameMaster )
      		return base.IsAccessibleTo (check);
      	//else
      		//return false;
 }
Example #23
0
		public void Target( Mobile m )
		{
			if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
				 * making them more vulnerable to Fire and Poison damage,
				 * but increasing their resistance to Physical and Cold damage.
				 * 
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
				 * 
				 * NOTE: Algorithm above is fixed point, should be:
				 * ((ss-mr)/2.5) + 40
				 * 
				 * NOTE: Resistance is not checked if targeting yourself
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];

				if ( timer != null )
					timer.DoExpire();
				else
					m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.

				 if ( m.Spell != null )
					m.Spell.OnCasterHurt();
				
				m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
				m.PlaySound( 0x1BB );

				double ss = GetDamageSkill( Caster );
				double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );

				ResistanceMod[] mods = new ResistanceMod[4]
					{
						new ResistanceMod( ResistanceType.Fire, -15 ),
						new ResistanceMod( ResistanceType.Poison, -15 ),
						new ResistanceMod( ResistanceType.Cold, +10 ),
						new ResistanceMod( ResistanceType.Physical, +10 )
					};

				timer = new ExpireTimer( m, mods, duration );
				timer.Start();

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );

				m_Table[m] = timer;

				for ( int i = 0; i < mods.Length; ++i )
					m.AddResistanceMod( mods[i] );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
Example #24
0
        public void Target(Mobile m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, this.Caster, ref m);

                SpellHelper.AddStatCurse(this.Caster, m, StatType.Dex);

                if (m.Spell != null)
                    m.Spell.OnCasterHurt();

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(0x1DF);

                int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
                TimeSpan length = SpellHelper.GetDuration(this.Caster, m);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));

                this.HarmfulSpell(m);
            }

            this.FinishSequence();
        }
		public override void OnDoubleClick(Mobile from)
		{

		  if (from == null || from.Deleted || from.Backpack == null || from.Backpack.Deleted )
		    return;

		  PlayerMobile m_PMobile = (PlayerMobile)from;


		  if ( !this.IsChildOf(from.Backpack ))
		  {
			from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			return;
		  }

		  if ( !m_PMobile.Young )
		  {
			from.SendMessage("Only young players are allowed to use and have this.");
			this.Delete();
			return;
		  }

		  from.CloseGump(typeof(NewPlayerGump));
		  from.SendGump(new NewPlayerGump(from));
		}
Example #26
0
 protected override void OnTarget(Mobile from, object o)
 {
     if (o is Mobile)
     {
         this.m_Owner.Target((Mobile)o);
     }
 }
Example #27
0
		public override bool HandlesOnSpeech( Mobile from )
		{
			if ( from.AccessLevel >= AccessLevel.GameMaster )
				return true;

			return base.HandlesOnSpeech( from );
		}
Example #28
0
		public void OnTargetGears( Mobile from, object targ )
		{
			Gears g = targ as Gears;

			if ( g == null || !g.IsChildOf( from.Backpack ) )
			{
				from.SendMessage( "Those are not gears." ); // Apparently gears that aren't in your backpack aren't really gears at all. :-(
			}
			else if ( IsModified )
			{
				from.SendMessage( "That has already been modified." );
			}
			else if ( !IsChildOf( from.Backpack ) )
			{
				from.SendMessage( "This must be in your backpack to modify it." );
			}
			else if ( from.Skills[SkillName.Fletching].Base < 100.0 )
			{
				from.SendMessage( "Only a grandmaster bowcrafter can modify this weapon." );
			}
			else
			{
				g.Consume();

				Hue = 0x453;
				Slayer = (SlayerName)Utility.Random( 2, 25 );

				from.SendMessage( "You modify it." );
			}
		}
Example #29
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
			else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse )
			{
				Point3D p = GetWorldLocation();

				if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) )
				{
					Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() );
					from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" );
					SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
				}

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

				Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) );
				Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) );

				Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) );

				m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
			}
		}
Example #30
0
		public override bool DropToItem( Mobile from, Item target, Point3D p )
		{
			bool ret = base.DropToItem( from, target, p );

			if ( ret && !Accepted && Parent != from.Backpack )
			{
				if ( from.AccessLevel > AccessLevel.Player )
				{
					return true;
				}
				else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
				{
					return true;
				}
				else
				{
					from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
					return false;
				}
			}
			else
			{
				return ret;
			}
		}