Esempio n. 1
1
        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.SendAsciiMessage( "You feel cured of poison!" ); // You feel cured of poison!

                from.FixedEffect( 0x373A, 10, 15 );
                from.PlaySound( 0x1E0 );
            }
            else if ( !cure )
            {
                from.SendAsciiMessage( "That potion was not strong enough to cure your ailment!" ); // That potion was not strong enough to cure your ailment!
            }
        }
Esempio n. 2
0
        public override void Abrir( Mobile from )
        {
            PlagueBeastLord m = RootParent as PlagueBeastLord;
            if ( m == null ) return;

            from.Direction = from.GetDirectionTo( m );
            if ( Abierto )
            {
                from.LocalOverheadMessage( MessageType.Emote, 0x66B, false, Plague_Texts.Line[21] );
            }
            else
            {
                from.LocalOverheadMessage( MessageType.Emote, 0x66B, false, Plague_Texts.Line[22] );
                from.PlaySound( 0x248 );
                from.PlaySound( 0x2AC );
                Agujero.Visible = true;

                base.Abrir( from );
                //Si no hay cerebro, la herida empieza a sangrar directamente
                if ( HoldBrain == BrainTypes.Brain_None )
                {
                    PlagueBrain pb = Mybrain as PlagueBrain;
                    pb.Sangrar( from );
                }
            }
        }
     		public override void OnDoubleClick( Mobile from ) 
		{ 
			
                        if ( Parent != from ) 
                        { 
                                from.SendMessage( "The costume must be equiped to be used." ); 
                        } 

			else if ( from.Mounted == true )
			{
				from.SendMessage( "You cannot be mounted while wearing your costume!" );
			}
			
			else if ( from.BodyMod == 0x0 )
                        { 
				
				LootType = LootType.Blessed;
               			from.SendMessage( "You pull the mask over your head." );
				from.PlaySound( 0x440 );
				from.BodyMod = 769;
				from.DisplayGuildTitle = false; 
				ItemID = 9860;
                        
			}
			else
			{
				from.SendMessage( "You lower the mask." );
				from.PlaySound( 0x440 );
				from.BodyMod = 0x0;		
				from.DisplayGuildTitle = true;
				ItemID = 0x1F03;
			}
		}
Esempio n. 4
0
        public void OnCompleted( Mobile from )
        {
            Mobile creature = new ClockworkCreature( CreatureDef );
            Point3D p = from.Location;

            creature.MoveToWorld( p, from.Map );

            Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback(
                delegate
                {
                    from.PlaySound( 0xFA );
                    from.PlaySound( 0x5BC );
                    from.PlaySound( 0x5C7 );

                    Effects.SendLocationEffect( p, from.Map, 0x1FD4, 30, 16, 0x21, 4 );

                    for ( int j = 0; j < 5; j++ )
                    {
                        Point3D loc = new Point3D( p.X, p.Y, 10 + p.Z + ( j * 20 ) );

                        Effects.SendLocationEffect( loc, from.Map, 0x1AA1, 17, 16, 0x481, 4 );
                        Effects.SendLocationEffect( loc, from.Map, 0x1A9F, 10, 16, 0x481, 4 );
                        Effects.SendLocationEffect( loc, from.Map, 0x1A8, 25, 16, 0x47E, 4 );
                    }

                    // The training clockwork fails and the creature vanishes.
                    from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1112987, from.Client );

                    Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerCallback(
                        delegate
                        {
                            creature.Delete();
                        } ) );
                } ) );
        }
		public override bool OnMoveOver( Mobile m )
		{
			if( !m_AllowCreatures && !m.Player )
				return true;
			
			if( m.Alive)
					{
					m.SendMessage( "You must be dead to use this portal." );
					m.Say("Duh... I am not dead... Hello? Use a Rune book..");
					m.PlaySound( 0x440 );
					return true;
					}
			if( m_TelePets)
				{
				Server.Mobiles.BaseCreature.TeleportPets( m, m_DestLoc, m_DestMap );
				}
				
				m.Say("Have mercy on my soul.");
				World.Broadcast( 32, true, "A Darkening chime is heard throughout the land as Dracula has consumed another victim. May {0} rest in peace.", m.Name );
				m.PlaySound(0x1F7);

				m.MoveToWorld( m_DestLoc, m_DestMap );

				return false;
				
			

		}
		// Healing Ki
		// Activate to heal all nearby allies for 1d4 (1 to 4), plus an additional 
		// 1d4 (1 to 4) for every two monk levels. (Does not harm undead)
		public static void LightCombo( Mobile from )
		{
			from.SendMessage( 2075, "You execute the maneuver: Healing Ki" );

			List<Mobile> mobiles = new List<Mobile>();

			foreach ( Mobile m in from.GetMobilesInRange( 4 ) )
			{
				if ( m != null )
					if ( NotorietyHandlers.Mobile_AllowBeneficial( from, m ) )
						mobiles.Add( m );
			}

			MonkFists mf = from.FindItemOnLayer( Layer.Gloves ) as MonkFists;
			int amount = 0;	

			if ( mf != null )
				amount = Utility.Dice( mf.Teir, 3, (3 * mf.Teir) );
			else
				amount = Utility.Dice( 2, 6, 0 );

			for ( int i = 0; i < mobiles.Count; i++ )
			{
				mobiles[i].FixedParticles( 0x3967, 10, 30, 5013, 36, 4, EffectLayer.CenterFeet, 0 );
				mobiles[i].Heal( amount, from );
			}

			if ( from.Female )
				from.PlaySound( 0x339 );
			else
				from.PlaySound( 0x44B );
		}
Esempio n. 7
0
		public override bool Use( Mobile from ) {
			if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
				int amount = Utility.Dice( 3, 3, 3 );
				int time = Utility.RandomMinMax( 5, 30 );

				from.PlaySound( 0x2D6 );

				if ( from.Body.IsHuman ) {
					from.Animate( 34, 5, 1, true, false, 0 );
				}

				from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
				from.PlaySound( 0x1EB );

				StatMod mod = from.GetStatMod( "Concussion" );

				if ( mod != null ) {
					from.RemoveStatMod( "Concussion" );
					from.Mana -= mod.Offset;
				}

				from.PlaySound( 0x1EE );
				from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );

				Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
					from.EndAction( typeof( ClarityPotion ) );
				} );

				return true;
			}

			return false;
		}
Esempio n. 8
0
		public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return false;

			ClearCurrentAbility( attacker );

			attacker.SendMessage( "You become one with you weapon, allowing it to guide you hand. The effects of this attack are unpredictable, but effective." );
			defender.SendMessage( "You enemie become one with their weapon and the effects of his attack are unpredictable" );

				attacker.PlaySound( 0x20C );
				attacker.PlaySound( 0x56 );
				attacker.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

				IEntity from = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z ), attacker.Map );
				IEntity to = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z + 50 ), attacker.Map );
				Effects.SendMovingParticles( from, to, 0xF5F, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

			int damage = 10; 

			damage += Math.Min( 5, (int)(Math.Abs( attacker.Skills[SkillName.Anatomy].Value + attacker.Skills[SkillName.ArmsLore].Value ) / 8));

			defender.Damage( damage, attacker );

			return true;
		}
Esempio n. 9
0
        public override void OnDoubleClick( Mobile m )
      {
         if( Parent != m )
         {
            m.SendMessage( "You must be wearing the robe to use it!" );
         }
         else
         {
            if ( ItemID == 0x2683 || ItemID == 0x2684 )
            {
               m.SendMessage( "You lower the hood." );
               m.PlaySound( 0x57 );
               ItemID = 0x1F03;
               m.NameMod = null;
               m.RemoveItem(this);
               m.EquipItem(this);

            }
            else if ( ItemID == 0x1F03 || ItemID == 0x1F04 )
            {
               m.SendMessage( "You pull the hood over your head." );
               m.PlaySound( 0x57 );
               ItemID = 0x2683;
               m.RemoveItem(this);
               m.EquipItem(this);

            }
         }
      }
 public override void OnDoubleClick( Mobile m )
 {
    if( Parent != m )
    {
       m.SendMessage( "You can not use this item from your pack!" );
    }
    else
    {
       if ( ItemID == 0x2683 || ItemID == 0x2684 )
       {
          m.SendMessage( "You lower the hood." );
          m.PlaySound( 0x57 );
          ItemID = 0x1F03;
          m.NameMod = null;
          LootType=LootType.Blessed;
          m.RemoveItem(this);
          m.EquipItem(this);
       }
       else if ( ItemID == 0x1F03 || ItemID == 0x1F04 )
       {
          m.SendMessage( "You pull the hood over your head." );
          m.PlaySound( 0x57 );
          ItemID = 0x2683;
          LootType=LootType.Blessed;
          m.RemoveItem(this);
          m.EquipItem(this);
       }
    }
 }
Esempio n. 11
0
     		public override void OnDoubleClick( Mobile from ) 
		{ 
			
                        if ( Parent != from ) 
                        { 
                                from.SendMessage( "The costume must be equiped to be used." ); 
                        } 

			else if ( from.Mounted == true )
			{
				from.SendMessage( "You cannot be mounted while wearing your costume!" );
			}


			else if ( from.BodyMod == 0x0 )
                        { 
				

               			from.SendMessage( "You pull the mask over your head." );
				from.PlaySound( 0x440 );
				from.BodyMod = 75;
				from.DisplayGuildTitle = false; 
                        
			}
			else
			{
				from.SendMessage( "You lower the mask." );
				from.PlaySound( 0x440 );
				from.BodyMod = 0x0;
				from.DisplayGuildTitle = true;
				this.Transformed = false;
			}
		}
        public override void Drink(Mobile from)
        {
            Item am = from.Backpack.FindItemByType(typeof(RecluseStingMarker));
            if (am != null)
            {
                from.BodyMod = 0;
                from.Hue = -1;
                from.YellowHealthbar = false;

                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    BasePotion.PlayDrinkEffect(from);

                    this.Consume();
                    from.SendGump(new RecluseAntidoteGump());
                    //am.Delete();
                }
                else if (am == null )
                {
                    from.SendGump(new RecluseCuredGump());
                    
                }
            }
Esempio n. 13
0
        public override void OnDoubleClick( Mobile from )
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack."); return;
            }

            from.SendMessage("You consume the thick liquid; it makes you nauseous.");
            from.Poison = Poison.Regular;

            if (from.Female) from.PlaySound(0x32D);
            else from.PlaySound(0x43F);

            Consume();

            if (from.StatCap >= from.RawStatTotal + 15)
            {
                if (from.RawStr + 5 < 125)
                    from.RawStr += 5;

                else from.RawStr = 125;

                if (from.RawInt + 5 < 125)
                    from.RawInt += 5;

                else from.RawInt = 125;

                if (from.RawDex + 5 < 125)
                    from.RawDex += 5;

                else from.RawDex = 125;
            }
        }
Esempio n. 14
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if ( !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			IMount mount = defender.Mount;

			if ( mount != null && !(defender is ChaosDragoonElite) )
			{
				defender.SendLocalizedMessage( 1062315 ); // You fall off your mount!

				defender.PlaySound( 0x140 );
				defender.FixedParticles( 0x3728, 10, 15, 9955, EffectLayer.Waist );

				mount.Rider = null;

				BaseMount.SetMountPrevention( defender, BlockMountType.Dazed, TimeSpan.FromSeconds( 10.0 ) );

				if( Core.ML && attacker is BaseCreature && ((BaseCreature)attacker).ControlMaster != null )
					BaseMount.SetMountPrevention( ((BaseCreature)attacker).ControlMaster, BlockMountType.DismountRecovery, TimeSpan.FromSeconds( 3.0 ) );
				else
					BaseMount.SetMountPrevention( attacker, BlockMountType.DismountRecovery, TimeSpan.FromSeconds( 3.0 ) );
			}
			else
			{
				//if ( WeaponAbility.ParalyzingBlow.IsImmune( defender ) )
				//{
					//attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
					//defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.

				//}
				//else
				//{
					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 ? TimeSpan.FromSeconds( 3.0 ) : TimeSpan.FromSeconds( 6.0 );
					defender.Paralyze( duration );
					//WeaponAbility.ParalyzingBlow.BeginImmunity( defender, duration + TimeSpan.FromSeconds( 8.0 ) );
				//}
			}

			int amount = 15;

			switch( Utility.Random( 5 ) )
			{
				case 0: AOS.Damage( defender, attacker, amount, 100, 0, 0, 0, 0 ); break;
				case 1: AOS.Damage( defender, attacker, amount, 0, 100, 0, 0, 0 ); break;
				case 2: AOS.Damage( defender, attacker, amount, 0, 0, 100, 0, 0 ); break;
				case 3: AOS.Damage( defender, attacker, amount, 0, 0, 0, 100, 0 ); break;
				case 4: AOS.Damage( defender, attacker, amount, 0, 0, 0, 0, 100 ); break;
			}

		}
Esempio n. 15
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (targeted is Item)
            {
                Item targ = (Item)targeted;

                if (!targ.IsChildOf(from.Backpack))
                {
                    //if (from.Region is HouseRegion)
                    //{
                    //    targ.Hue = m_Item.Hue;
                    //    from.PlaySound(0x23F);
                    //}
                    //else
                    //{
                    //    from.SendLocalizedMessage(1062617); //	You can only hue objects that are in your backpack.
                    //    // You don't have room for the item in your pack, so you stop working on it.
                    //    //1042001	That must be in your pack for you to use it.
                    //    //1045112	You cannot hue that item
                    //    //1062617	You can only hue objects that are in your backpack.
                    //    //1042083	You cannot dye that.
                    //}
                    BaseHouse house = BaseHouse.FindHouseAt(from);

                    if (house == null || !house.IsCoOwner(from))
                    {
                        from.SendLocalizedMessage(502092); //You must be in your house to do this.
                    }
                    else
                    {
                        if (!house.IsInside(targ))
                        {
                            from.SendLocalizedMessage(1042270);  //That is not in your house.
                        }
                        else
                        {
                            if (!(from.InRange(targ.GetWorldLocation(), 2)))
                            {
                                from.SendLocalizedMessage(500295);  //You are too far away to do that.
                            }
                            else
                            {
                                targ.Hue = m_Item.Hue;
                                from.PlaySound(0x23F);
                                //from.SendLocalizedMessage(1062617); //	You can only hue objects that are in your backpack.
                            }
                        }
                    }
                }
                else
                {
                    targ.Hue = m_Item.Hue;
                    from.PlaySound(0x23F);
                }
            }
        }
Esempio n. 16
0
		protected override void OnTarget( Mobile from, object targeted )
		{
			if ( targeted is Item )
			{
				Item targ = (Item)targeted;
				if (!targ.IsChildOf (from.Backpack))
				{
					from.SendMessage(38, "The item is not in your backpack!" );
					return;
				}
				else if ( targeted is DyeTub )
				{
					DyeTub tub = (DyeTub)targeted;
					if ( tub.Redyable == true )
					{
						tub.DyedHue =  m_Item.Hue;
						targ.Name = "Dying Tub: "+ Convert.ToString(m_Item.Hue);
						from.PlaySound( 0x23F );
						if ( Reusable == false )
						{
							tub.Redyable = false;
							m_Item.Delete();
							return;
						}
						return;
					}else
						from.SendMessage(38, "This dyetub has already been dyed!" );
				}
				else if ( targeted is UniversalDyeTub )
				{
					UniversalDyeTub utub = (UniversalDyeTub)targeted;
					if ( Reusable == false )
					{
						if ( utub.Hue == 0 )
						{
							utub.Hue = m_Item.Hue;
							targ.Name = "Universal Dying Tub: "+ Convert.ToString(m_Item.Hue);
							from.PlaySound( 0x23F );
							m_Item.Delete();
							return;
						}else from.SendMessage(38, "This Universal dyetub has already been dyed!" );
					}else if ( Reusable == true )
					{
						utub.Hue = m_Item.Hue;
						targ.Name = "Universal Dying Tub: "+ Convert.ToString(m_Item.Hue);
						from.PlaySound( 0x23F );
						return;		
					}	
				}else
					from.SendMessage(38, "This is not a dyetub!!" );				
			}else
				from.SendMessage(38, "You cannot Dye Mobiles!!" );
		}	
Esempio n. 17
0
    public override void OnDoubleClick( Mobile from )
		{
            switch (Utility.Random(5))
                {
				default:
                case 0: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Euh je suis timide"); break;
                case 1: from.PlaySound(0x004C); break;
                case 2: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Euh desolé c'est ma fille.."); break;
                case 3: from.PlaySound(0x020B); break;
                case 4: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Je sais pas je vais demander à ma femme."); break;
			}

        }
Esempio n. 18
0
		public override bool Use( Mobile from ) {
			if ( Faction.ClearSkillLoss( from ) ) {
				from.LocalOverheadMessage( Server.Network.MessageType.Regular, 2219, false, "The gem shatters as you invoke its power." );
				from.PlaySound( 909 );

				from.FixedEffect( 0x373A, 10, 30 );
				from.PlaySound( 0x209 );

				return true;
			}

			return false;
		}
Esempio n. 19
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( from.Backpack != null && IsChildOf( from.Backpack ) )
            {
                List<BaseKeyFragment> keys = from.Backpack.FindItemsByType<BaseKeyFragment>();

                if ( keys.Count < 3 )
                {
                    // You are still missing ~1_KEY~ key fragments.
                    from.SendLocalizedMessage( 1114319, ( 3 - keys.Count ).ToString() );
                }
                else
                {
                    foreach ( BaseKeyFragment key in keys )
                        key.Delete();

                    from.PlaySound( 0x506 );

                    // You swiftly join the three fragments and reassemble the Tripartite Key.
                    from.SendLocalizedMessage( 1111650 );

                    for ( int i = 0; i < 2; i++ )
                    {
                        from.PlaySound( 0xFA );
                        from.PlaySound( 0x5BC );
                        from.PlaySound( 0x5C7 );

                        Effects.SendLocationEffect( from, from.Map, 0xF6C, 30, 16, 0x47E, 4 );

                        for ( int j = 0; j < 5; j++ )
                        {
                            Point3D loc = new Point3D( from.X, from.Y, 10 + from.Z + ( j * 20 ) );

                            Effects.SendLocationEffect( loc, from.Map, 0x1AA1, 17, 16, 0x481, 4 );
                            Effects.SendLocationEffect( loc, from.Map, 0x1A9F, 10, 16, 0x481, 4 );
                            Effects.SendLocationEffect( loc, from.Map, 0x1A8, 25, 16, 0x47E, 4 );
                        }
                    }

                    // You have proven thyself worthy, and may now enter the Abyss.
                    from.LocalOverheadMessage( MessageType.Regular, 0x59, 1113708 );

                    // The key vanishes
                    from.SendLocalizedMessage( 1113709 );

                    if ( from is PlayerMobile )
                        ( (PlayerMobile) from ).SacredQuest = true;
                }
            }
        }
Esempio n. 20
0
        public override void OnDoubleClick( Mobile from )
        {
            {
                from.PlaySound( 0x8E );

            }
        }
Esempio n. 21
0
		public void Throw( Mobile from )
		{
			BaseKnife knife = from.Weapon as BaseKnife;

			if ( knife == null )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife...
				return;
			}

			from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
			from.MovingEffect( this, knife.ItemID, 7, 1, false, false );
			from.PlaySound( 0x238 );

			double rand = Utility.RandomDouble();

			int message;
			if ( rand < 0.05 )
				message = 500752; // BULLSEYE! 50 Points!
			else if ( rand < 0.20 )
				message = 500753; // Just missed the center! 20 points.
			else if ( rand < 0.45 )
				message = 500754; // 10 point shot.
			else if ( rand < 0.70 )
				message = 500755; // 5 pointer.
			else if ( rand < 0.85 )
				message = 500756; // 1 point.  Bad throw.
			else
				message = 500757; // Missed.

			PublicOverheadMessage( MessageType.Regular, 0x3B2, message );
		}
Esempio n. 22
0
		public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
		{
			if( (dropped is Arrow || dropped is Bolt) && base.CheckHold( from, dropped, sendFullMessage, true ) )
			{
				from.PlaySound( GetDroppedSound( dropped ) );
				UpdateTotal( dropped, TotalType.Weight, 0 );

				for( int i = 0; i < this.Items.Count; i++ )
				{
					Item item = this.Items[i];

					if( !(item is Container) && item.StackWith( from, dropped, false ) )
					{
						UpdateTotals();
						InvalidateProperties();

						return true;
					}
				}

				DropItem( dropped );

				return true;
			}

			return false;
		}
Esempio n. 23
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendAsciiMessage( "Target can not be seen." );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 );
                m.PlaySound( 0x203 );

                m.Hidden = true;

                RemoveTimer( m );

                TimeSpan duration = TimeSpan.FromSeconds( ((6 * Caster.Skills.Magery.Fixed) / 50) + 1 );

                Timer t = new InternalTimer( m, duration );

                m_Table[m] = t;

                t.Start();
            }

            FinishSequence();
        }
Esempio n. 24
0
 public void SendEBolt(Mobile to)
 {
     this.MovingParticles(to, 0x379F, 7, 0, false, true, 0xBE3, 0xFCB, 0x211);
     to.PlaySound(0x229);
     this.DoHarmful(to);
     AOS.Damage(to, this, 50, 0, 0, 0, 0, 100);
 }
Esempio n. 25
0
        public bool SubmitSolution(Mobile m, UnderworldPuzzleSolution solution)
        {
            if (solution.Matches(m_Solution))
            {
                Item item = Loot.Construct(m_Rewards[Utility.Random(m_Rewards.Length)]);

                if (item != null)
                {
                    if (item is VoidEssence || item is SilverSerpentVenom || item is ToxicVenomSac)
                        item.Amount = 30;

                    if (item is LuckyCoin)
                        item.Amount = Utility.RandomMinMax(2, 6);

                    if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
                        m.BankBox.DropItem(item);
                }

                m.PlaySound(0x3D);
                m.SendLocalizedMessage(1113579); // Correct Code Entered. Crystal Lock Disengaged.

                Delete();
                return true;
            }

            return false;
        }
Esempio n. 26
0
		public override bool Use( Mobile from ) {
			Faction ourFaction = Faction.Find( from );

			bool used = false;

			foreach ( Mobile mob in from.GetMobilesInRange( 8 ) ) {
				if ( mob.Player && !mob.Alive && from.InLOS( mob ) ) {
					if ( Faction.Find( mob ) != ourFaction ) {
						continue;
					}

					BaseHouse house = BaseHouse.FindHouseAt( mob );

					if ( house == null || ( house.IsFriend( from ) || house.IsFriend( mob ) ) ) {
						Faction.ClearSkillLoss( mob );

						mob.SendGump( new ResurrectGump( mob, from, ResurrectMessage.Generic ) );
						used = true;
					}
				}
			}

			if ( used ) {
				from.LocalOverheadMessage( Server.Network.MessageType.Regular, 2219, false, "The urn shatters as you invoke its power." );
				from.PlaySound( 64 );

				Effects.PlaySound( from.Location, from.Map, 1481 );
			}

			return used;
		}
Esempio n. 27
0
        public bool TryCombine(Mobile from, RuinedShipPlans plans)
        {
            if (m_Joined.Contains(plans.Type))
            {
                from.SendLocalizedMessage(1116787); //This part is already attached.
                return false;
            }

            plans.Delete();
            from.PlaySound(0x249);

            foreach (PlanType type in plans.Joined)
            {
                if(!m_Joined.Contains(type))
                    m_Joined.Add(type);
            }

            InvalidateProperties();

            if (m_Joined.Count == 8)
            {
                from.AddToBackpack(new OrcishGalleonDeed());
                from.SendLocalizedMessage(1116788); //You have completed a deed for an Orc Ship!

                this.Delete();
            }
            else
                from.Target = new InternalTarget(this);
            return true;
        }
Esempio n. 28
0
        public override bool Eat( Mobile from )
        {
            if ( !CheckCooldown( from ) )
                return false;

            // The grapes of wrath invigorate you for a short time, allowing you to deal extra damage.
            from.SendLocalizedMessage( 1074847 );

            m_InfluenceList.Add( from );
            m_CooldownTable.Add( from, DateTime.Now + Cooldown );

            Timer.DelayCall( Duration, new TimerStateCallback( delegate { m_InfluenceList.Remove( from ); } ), from );

            // Play a random "eat" sound
            from.PlaySound( Utility.Random( 0x3A, 3 ) );

            from.Animate( 6 );

            if ( Poison != null )
                from.ApplyPoison( Poisoner, Poison );

            Consume();

            return true;
        }
Esempio n. 29
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042010 ); // You must have the object in your backpack to use it.
            }
            else if ( m_CooldownTable.ContainsKey( from ) )
            {
                Timer resetTimer = m_CooldownTable[from];
                TimeSpan left = resetTimer.Next - DateTime.Now;

                if ( left >= TimeSpan.FromMinutes( 1.0 ) )
                    from.SendLocalizedMessage( 1079265, left.Minutes.ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
                else
                    from.SendLocalizedMessage( 1079263, left.Seconds.ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.
            }
            else if ( from.Mana == from.ManaMax )
            {
                from.SendLocalizedMessage( 1095127 ); // You are already at full mana!
            }
            else
            {
                from.SendLocalizedMessage( 1095128 ); // The sour draught instantly restores some of your mana!
                from.PlaySound( 0x3C );

                from.Mana += Utility.RandomMinMax( 25, 40 );

                m_CooldownTable[from] = Timer.DelayCall( Cooldown, new TimerStateCallback<Mobile>( RemoveCooldown ), from );

                Delete();
            }
        }
Esempio n. 30
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			if( Server.Items.ParalyzingBlow.IsImmune( defender ) )	//After mana consumption intentional
			{
				attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
				defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
				return;
			}

			attacker.SendLocalizedMessage( 1063356 ); // You cripple your target with a nerve strike!
			defender.SendLocalizedMessage( 1063357 ); // Your attacker dealt a crippling nerve strike!

			attacker.PlaySound( 0x204 );
			defender.FixedEffect( 0x376A, 9, 32 );
			defender.FixedParticles( 0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist );

			AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), 100, 0, 0, 0, 0 );	//10-25

			defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
			Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );
		}
Esempio n. 31
0
        public static void DoMoves(BaseCreature from, Mobile target)
        {
            switch (Utility.Random(3))
            {
            case 0:

                if (Utility.Random(500) <= from.RoarAttack)
                {
                    int power;
                    int mindam;
                    int maxdam;

                    if (from.RoarAttack > 3)
                    {
                        mindam = from.RoarAttack / 3;
                        maxdam = from.RoarAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    if (from.RoarAttack > 10)
                    {
                        power = from.RoarAttack / 10;
                    }
                    else
                    {
                        power = 1;
                    }

                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in from.GetMobilesInRange(power))
                    {
                        if (m != from)
                        {
                            targets.Add(m);
                        }
                    }

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = (BaseCreature)m;

                            bc.BeginFlee(TimeSpan.FromSeconds(30.0));
                            AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 20, 20, 20, 20, 20);
                        }
                    }
                }

                break;

            case 1:

                if (Utility.Random(500) <= from.PetPoisonAttack)
                {
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    Effects.PlaySound(target.Location, target.Map, 0x229);

                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    int level = from.PetPoisonAttack / 20;

                    if (level > 5)
                    {
                        level = 5;
                    }

                    target.ApplyPoison(from.ControlMaster, Poison.GetPoison(level));
                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
                }

                break;

            case 2:

                if (Utility.Random(500) <= from.FireBreathAttack)
                {
                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    from.PlaySound(Core.AOS ? 0x15E : 0x44B);
                    target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    target.PlaySound(0x208);

                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);

                    Timer t = new FireBreathDOT(target, from, from.FireBreathAttack);
                    t.Start();
                }

                break;
            }
        }
Esempio n. 32
0
        public static int Damage(
            Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois,
            int nrgy, int chaos = 0, int direct = 0, bool keepAlive = false, bool archer = false, bool deathStrike = false
            )
        {
            if (m?.Deleted != false || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                MeerMage.StopEffect(m, true);
            }

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return(damage);
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);
            Fix(ref chaos);
            Fix(ref direct);

            if (Core.ML && chaos > 0)
            {
                switch (Utility.Random(5))
                {
                case 0:
                    phys += chaos;
                    break;

                case 1:
                    fire += chaos;
                    break;

                case 2:
                    cold += chaos;
                    break;

                case 3:
                    pois += chaos;
                    break;

                case 4:
                    nrgy += chaos;
                    break;
                }
            }

            BaseQuiver quiver = null;

            if (archer && from != null)
            {
                quiver = from.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
            }

            int totalDamage;

            if (!ignoreArmor)
            {
                // Armor Ignore on OSI ignores all defenses, not just physical.
                var resPhys = m.PhysicalResistance;
                var resFire = m.FireResistance;
                var resCold = m.ColdResistance;
                var resPois = m.PoisonResistance;
                var resNrgy = m.EnergyResistance;

                totalDamage  = damage * phys * (100 - resPhys);
                totalDamage += damage * fire * (100 - resFire);
                totalDamage += damage * cold * (100 - resCold);
                totalDamage += damage * pois * (100 - resPois);
                totalDamage += damage * nrgy * (100 - resNrgy);

                totalDamage /= 10000;

                if (Core.ML)
                {
                    totalDamage += damage * direct / 100;

                    if (quiver != null)
                    {
                        totalDamage += totalDamage * quiver.DamageIncrease / 100;
                    }
                }

                if (totalDamage < 1)
                {
                    totalDamage = 1;
                }
            }
            else if (Core.ML && m is PlayerMobile && from is PlayerMobile)
            {
                if (quiver != null)
                {
                    damage += damage * quiver.DamageIncrease / 100;
                }

                if (!deathStrike)
                {
                    totalDamage = Math.Min(damage, 35); // Direct Damage cap of 35
                }
                else
                {
                    totalDamage = Math.Min(damage, 70); // Direct Damage cap of 70
                }
            }
            else
            {
                totalDamage = damage;

                if (Core.ML && quiver != null)
                {
                    totalDamage += totalDamage * quiver.DamageIncrease / 100;
                }
            }

            if (from?.Player != true && m.Player && m.Mount is SwampDragon pet)
            {
                if (pet.HasBarding)
                {
                    var percent  = pet.BardingExceptional ? 20 : 10;
                    var absorbed = Scale(totalDamage, percent);

                    totalDamage   -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031); // Your dragon's barding has been destroyed!
                    }
                }
            }

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from?.Deleted == false && from.Alive)
            {
                var reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if ((from as ExodusMinion)?.FieldActive == true ||
                        (from as ExodusOverseer)?.FieldActive == true)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(
                            Scale(damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance)) / 10000, reflectPhys),
                            m
                            );
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
Esempio n. 33
0
        public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive, int armorIgnore)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
                return 0;


            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
                Mobiles.MeerMage.StopEffect(m, true);

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return damage;
            }
            bool Stalker = false;
            TeiravonMobile TavMobile;
            double var = 1;
            if (from != null && from is TeiravonMobile)
            {
                TavMobile = from as TeiravonMobile;
                var = .9 - (TavMobile.PlayerLevel * .01);
                if (TavMobile.HasFeat(TeiravonMobile.Feats.StalkingPrey))
                    Stalker = true;
            }

            if (from != null && Spells.Third.BlessSpell.narindun.Contains(from))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(from, m, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, from, m.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            if (from !=null && Spells.Third.BlessSpell.narindun.Contains(m))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(m, from, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, m, from.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);

            int resPhys = m.PhysicalResistance;
            int resFire = m.FireResistance;
            int resCold = m.ColdResistance;
            int resPois = m.PoisonResistance;
            int resNrgy = m.EnergyResistance;

            if (Spells.Third.BlessSpell.saerin.Contains(m))
                resPhys = 95;

            if (armorIgnore > 0 )
            {
                double f = (100 - armorIgnore) / 100.0;
                resPhys =(int)(resPhys * f);
                resFire = (int)(resFire * f);
                resCold = (int)(resCold * f);
                resPois = (int)(resPois * f);
                resNrgy = (int)(resNrgy * f);
            }
            if (from != null && IsTracking(from, m) && Stalker)
            {
                resPhys = (int)(resPhys * var);
                resFire = (int)(resFire * var);
                resCold = (int)(resCold * var);
                resPois = (int)(resPois * var);
                resNrgy = (int)(resNrgy * var);
            }

            if (m_ArmorIgnore)
                resPhys = resFire = resCold = resPois = resNrgy = 0;

            if (Spells.Third.BlessSpell.saerin.Contains(m) && resPhys < 50)
                resPhys = 50;

            int totalDamage;



            totalDamage = damage * phys * (100 - resPhys);
            totalDamage += damage * fire * (100 - resFire);
            totalDamage += damage * cold * (100 - resCold);
            totalDamage += damage * pois * (100 - resPois);
            totalDamage += damage * nrgy * (100 - resNrgy);

            totalDamage /= 10000;

            if (totalDamage < 1)
                totalDamage = 1;

            #region Dragon Barding
            if ((!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP = 0;

                        m.SendLocalizedMessage(1053031); // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
                totalDamage = m.Hits;

            if (from != null)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - resPhys)) / 10000, reflectPhys), m);
                    }
                }
            }

            if (from != null && Spells.Third.BlessSpell.valar.Contains(m))
            {
                ArrayList TargList = new ArrayList();

                foreach (Mobile x in m.GetMobilesInRange(2))
                {
                    if (x != m && x.AccessLevel <= m.AccessLevel && !x.Blessed)
                        TargList.Add(x);

                }

                if (TargList.Count > 0)
                {
                    m.FixedParticles(0x376A, 9, 32, 5005, 2634, 2, EffectLayer.Waist);
                    totalDamage = totalDamage / TargList.Count;
                    for (int i = 0; i < TargList.Count; ++i)
                    {
                        Mobile dude = TargList[i] as Mobile;
                        dude.Damage(totalDamage, from);
                    }
                }
            }

            if (m is TeiravonMobile)
            {
                TeiravonMobile tav = m as TeiravonMobile;
                if (((tav.IsOrc() && tav.HasFeat(TeiravonMobile.Feats.Tuffness) || tav.HasFeat(TeiravonMobile.Feats.PhysicalResistance)) && from != null && from != tav))
                {
                    double reduce = (((double)(100 - Utility.RandomMinMax(0, 5)) - (double)(tav.PlayerLevel / 1.75)) / (double)100);

                    int temp = totalDamage;

                    totalDamage = (int)((double)totalDamage * (double)reduce);

                    if (temp - totalDamage < 1)
                        totalDamage -= 1;

                    if (totalDamage < 0)
                        totalDamage = 0;

                    if (Utility.RandomMinMax(1, 20) > 19)
                    {
                        totalDamage = 0;
                        tav.SendMessage("Your tough skin deflects the attack!");
                        from.SendMessage("{0} deflects the attack!", tav.Name);
                    }

                }
            }

            if (Spells.Third.BlessSpell.kamalini.Contains(m) && (((DateTime)Spells.Third.BlessSpell.kamalini[m] + TimeSpan.FromSeconds(3)).CompareTo(DateTime.Now)) < 0)
            {
                IPooledEnumerable eable = m.GetMobilesInRange(2);
                ArrayList targets = new ArrayList();
                int total = 0;
                foreach (Mobile t in eable)
                {
                    if (t.AccessLevel > m.AccessLevel || t.Blessed || t == m)
                        continue;
                    targets.Add(t);
                }
                eable.Free();

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile x = (Mobile)targets[i];
                    total += (int)(x.Hits * .03);
                }
                if (total > 2)
                {
                    m.Heal(Utility.RandomMinMax((int)(total * .75), total));
                    m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                    Spells.Third.BlessSpell.kamalini[m] = DateTime.Now;
                }
            }
            m.Damage(totalDamage, from);
            return totalDamage;
        }
Esempio n. 34
0
        public override void OnResponse(NetState state, int index)
        {
            Mobile from = state.Mobile;

            if (from != null && m_Timer != null && m_Timer.Running)
            {
                from.Frozen = false;
                m_Timer.Stop();
            }

            if (index == 0 && from != null)
            {
                if (from.Location != m_Location)
                {
                    from.SendAsciiMessage("Thou hast wandered too far from the site of thy resurrection!");
                    return;
                }

                PlayerMobile pm = from as PlayerMobile;
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false) || m_Location != from.Location)
                {
                    from.SendAsciiMessage("Thou can not be resurrected there!");
                    return;
                }
                else if (pm != null && pm.SpiritCohesion <= 0)
                {
                    from.SendAsciiMessage("Your spirit is too weak to return to corporeal form.");
                    return;
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();

                if (m_Heal)
                {
                    from.Hits = from.HitsMax;
                    from.Stam = from.StamMax;
                }

                //Regions.HouseRegion hr = from.Region as Regions.HouseRegion;
                //if ( hr != null && hr.House != null && !hr.House.Deleted )
                //	from.Location = hr.House.BanLocation;

                if (pm != null)
                {
                    pm.SpiritCohesion--;
                    switch (pm.SpiritCohesion)
                    {
                    case 0:
                        from.SendAsciiMessage("Your spirit returns to corporeal form, but is too weak to do so again for a while.");
                        break;

                    case 1:
                        from.SendAsciiMessage("Your spirit barely manages to return to corporeal form.");
                        break;

                    case 2:
                        from.SendAsciiMessage("With some effort your spirit returns to corporeal form.");
                        break;

                    case 3:
                    default:
                        from.SendAsciiMessage("Your spirit easily returns to corporeal form.");
                        break;
                    }
                }
            }
        }