Example #1
1
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this.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 = this.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!" );
					Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
				}

				Effects.PlaySound( this.GetWorldLocation(), this.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 #2
0
        public static void Effect( Mobile attacker, Mobile defender, int featlevel )
        {
            IKhaerosMobile featuser = attacker as IKhaerosMobile;
            ArrayList list = new ArrayList();

            foreach( Mobile m in defender.GetMobilesInRange( featlevel + 2 ) )
            {
                if( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) || featuser.IsAllyOf( m ) )
                    continue;

                if( !attacker.InRange( m, ((BaseWeapon)attacker.Weapon).MaxRange ) )
                    continue;

                if( m != attacker && Spells.SpellHelper.ValidIndirectTarget( attacker, m ) )
                {
                    if( attacker.InLOS( m ) )
                        list.Add( m );
                }
            }

            for( int i = 0; i < Math.Min( list.Count, featlevel + 1 ); ++i )
            {
                int random = Utility.Random( list.Count );
                Mobile m = (Mobile)list[random];

                featuser.CleaveAttack = true;
                ((BaseWeapon)attacker.Weapon).OnSwing( attacker, m, 0.5, true );

            }
        }
Example #3
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;
		}
Example #4
0
        public override void OnDoubleClick( Mobile from )
        {
            PlayerMobile pm = from as PlayerMobile;

            if ( pm == null )
                return;

            if ( !from.InLOS( this.GetWorldLocation() ) )
            {
                from.SendLocalizedMessage( 502800 ); // You can't see that.
                return;
            }

            if ( from.GetDistanceToSqrt( this.GetWorldLocation() ) > 2 )
            {
                from.SendLocalizedMessage( 500446 ); // That is too far away.
                return;
            }

            if ( pm.Bedlam )
            {
                BaseCreature.TeleportPets( pm, BedlamEntrance, from.Map );
                pm.MoveToWorld( BedlamEntrance, Map );
            }
            else
            {
                pm.SendLocalizedMessage( 1074276 ); // You press and push on the iron maiden, but nothing happens.
            }
        }
Example #5
0
		public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
		{
			base.GetContextMenuEntries( from, list );

			if ( ( from == m_owner ) && from.InLOS( this ) )
				list.Add( new DismissCRVendorEntry( this ) );
		}
Example #6
0
        public override bool DoEffect( Mobile from, Mobile target )
        {
            if ( !SpellHelper.HasStatEffect( from, m_Stat ) && from.InLOS( target ) && target.Alive && from.CanBeBeneficial( target ) )
            {
                from.DoBeneficial( target );
                SpellHelper.Turn( from, target );

                if ( m_Stat != StatType.All )
                {
                    SpellHelper.AddStatBonus( null, target, m_Stat );
                }
                else
                {
                    SpellHelper.AddStatBonus( null, target, StatType.Str ); SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatBonus( null, target, StatType.Dex );
                    SpellHelper.AddStatBonus( null, target, StatType.Int ); SpellHelper.DisableSkillCheck = false;
                }

                target.FixedParticles( m_EffIID, m_EffSpd, m_Dur, m_Eff, m_ELayer );
                target.PlaySound( m_Snd );

                return true;
            }
            else
            {
                return false;
            }
        }
 public override void OnDoubleClick(Mobile from)
 {
     if ((!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) && from.AccessLevel == AccessLevel.Player)
     {
         from.SendLocalizedMessage(500446); // That is too far away.
         return;
     }
     m_TimeOut = DateTime.UtcNow - m_LastBuild;
     if (m_UpdateTimer < m_TimeOut || itemarray == null)
         BuildArrayList(from);
     else if (turboslotsarray != null)
     {
         foreach (TurboSlot t in turboslotsarray)
         {
             if ((t == null || t.Deleted) )
             {
                 BuildArrayList(from);
                 break;
             }
         }
     }
     if (turboslotsarray != null)
     {
         from.CloseGump(typeof(TurboSlotsStatGump));
         from.SendGump(new TurboSlotsStatGump(from, turboslotsarray));
     }
 }
		public static void CheckSoulForge( Mobile from, int range, out bool sforge )
		{
			sforge = false;

			Map map = from.Map;

			if ( map == null )
				return;

			IPooledEnumerable eable = map.GetItemsInRange( from.Location,1 );

			foreach ( Item item in eable )
			{
				bool isSForge = ((item.ItemID >= 17015 && item.ItemID <= 17030) || (item.ItemID >= 16995 && item.ItemID <= 17010) );

				if ( isSForge )
				{
					if ( (from.Z + 16) < item.Z || (item.Z + 16) < from.Z || !from.InLOS( item ) )
						continue;

					sforge = sforge || isSForge;

					if ( sforge )
						break;
				}
			}
		}
        public override void OnDoubleClick( Mobile from )
        {
            Direction dir;
            if ( from.Location != this.Location )
                dir = from.GetDirectionTo( this );
            else if ( this.East )
                dir = Direction.West;
            else
                dir = Direction.North;

            from.Direction = dir;

            bool canThrow = true;

            if ( !from.InRange( this, 4 ) || !from.InLOS( this ) )
                canThrow = false;
            else if ( this.East )
                canThrow = ( dir == Direction.Left || dir == Direction.West || dir == Direction.Up );
            else
                canThrow = ( dir == Direction.Up || dir == Direction.North || dir == Direction.Right );

            if ( canThrow )
                Throw( from );
            else
                from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
        }
        public static void CheckAnvilAndForge(Mobile from, int range, out bool anvil, out bool forge)
        {
            anvil = false;
            forge = false;

            Map map = from.Map;

            if (map == null)
                return;

            IPooledEnumerable eable = map.GetItemsInRange(from.Location, range);

            foreach (Item item in eable)
            {
                Type type = item.GetType();

                bool isAnvil = (type.IsDefined(typeofAnvil, false) || item.ItemID == 4015 || item.ItemID == 4016 || item.ItemID == 0x2DD5 || item.ItemID == 0x2DD6);
                bool isForge = (type.IsDefined(typeofForge, false) || item.ItemID == 4017 || (item.ItemID >= 6522 && item.ItemID <= 6569) || item.ItemID == 0x2DD8);

                if (isAnvil || isForge)
                {
                    if ((from.Z + 16) < item.Z || (item.Z + 16) < from.Z || !from.InLOS(item))
                        continue;

                    anvil = anvil || isAnvil;
                    forge = forge || isForge;

                    if (anvil && forge)
                        break;
                }
            }

            eable.Free();

            for (int x = -range; (!anvil || !forge) && x <= range; ++x)
            {
                for (int y = -range; (!anvil || !forge) && y <= range; ++y)
                {
                   StaticTile[] tiles = map.Tiles.GetStaticTiles(from.X + x, from.Y + y, true);

                    for (int i = 0; (!anvil || !forge) && i < tiles.Length; ++i)
                    {
                        int id = tiles[i].ID & 0x3FFF;

                        bool isAnvil = (id == 4015 || id == 4016 || id == 0x2DD5 || id == 0x2DD6);
                        bool isForge = (id == 4017 || (id >= 6522 && id <= 6569) || id == 0x2DD8);

                        if (isAnvil || isForge)
                        {
                            if ((from.Z + 16) < tiles[i].Z || (tiles[i].Z + 16) < from.Z || !from.InLOS(new Point3D(from.X + x, from.Y + y, tiles[i].Z + (tiles[i].Height / 2) + 1)))
                                continue;

                            anvil = anvil || isAnvil;
                            forge = forge || isForge;
                        }
                    }
                }
            }
        }
Example #11
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_Boat == null || from == null)
                return;

            BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);
            int range = boat != null && boat == this.Boat ? 3 : 8;
            bool canMove = false;

            if (m_Boat != null)
                m_Boat.Refresh();

            if (boat != null && m_Boat != boat)
                boat.Refresh();

            if (!from.InRange(this.Location, range))
                from.SendLocalizedMessage(500295); //You are too far away to do that.
            else if (!from.InLOS(this.Location))
                from.SendLocalizedMessage(500950); //You cannot see that.
            else if (m_Boat.IsMoving || m_Boat.IsTurning)
                from.SendLocalizedMessage(1116611); //You can't use that while the ship is moving!
            else if (BaseBoat.IsDriving(from))
                from.SendLocalizedMessage(1116610); //You can't do that while piloting a ship!
            else if (BaseHouse.FindHouseAt(from) != null)
                from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
            else if (!m_Boat.IsClassicBoat)
            {
                if (boat == m_Boat && !MoveToNearestDockOrLand(from))
                    from.SendLocalizedMessage(1149796); //You can not dock a ship this far out to sea. You must be near land or shallow water.
                else if (boat == null)
                {
                    if (!from.Alive)
                        from.SendLocalizedMessage(1060190); //You cannot do that while dead!
                    else if ((m_Boat is BaseGalleon && ((BaseGalleon)m_Boat).HasAccess(from)) || (m_Boat is RowBoat && ((RowBoat)m_Boat).HasAccess(from)))
                        canMove = true;
                    else
                        from.SendLocalizedMessage(1116617); //You do not have permission to board this ship.
                }
                else if (boat != null && m_Boat != boat)
                {
                    if (!from.Alive)
                        from.SendLocalizedMessage(1060190); //You cannot do that while dead!
                    else if (boat is BaseGalleon && m_Boat is RowBoat && ((RowBoat)m_Boat).HasAccess(from))
                        canMove = true;
                    else if (boat is RowBoat && m_Boat is BaseGalleon && ((BaseGalleon)m_Boat).HasAccess(from))
                        canMove = true;
                    else if (boat is BaseGalleon && m_Boat is BaseGalleon && ((BaseGalleon)m_Boat).HasAccess(from))
                        canMove = true;
                    else
                        from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
                }
            }

            if (canMove)
            {
                BaseCreature.TeleportPets(from, this.Location, this.Map);
                from.MoveToWorld(this.Location, this.Map);
            }
        }
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker )  )
                return;

            ClearCurrentAbility( attacker );

            Map map = attacker.Map;

            if ( map == null )
                return;

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if ( weapon == null )
                return;

            if ( !CheckMana( attacker, true ) )
                return;

            attacker.FixedEffect( 0x3728, 10, 15 );
            attacker.PlaySound( 0x2A1 );

            ArrayList list = new ArrayList();

            foreach ( Mobile m in attacker.GetMobilesInRange( 1 ) )
                list.Add( m );

            Party p = Party.Get( attacker );

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

                if (m != defender && m != attacker &&
                    SpellHelper.ValidIndirectTarget(attacker, m) &&
                    attacker.CanBeHarmful(m, false) &&
                    (p == null || !p.Contains(m)))
                {
                    if ( m == null || m.Deleted || attacker.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.Alive || !attacker.CanSee( m ) )
                        continue;

                    if ( !attacker.InRange( m, weapon.MaxRange ) )
                        continue;

                    if ( attacker.InLOS( m ) )
                    {
                        attacker.RevealingAction();

                        attacker.SendLocalizedMessage( 1060161 ); // The whirling attack strikes a target!
                        m.SendLocalizedMessage( 1060162 ); // You are struck by the whirling attack and take damage!

                        weapon.OnHit( attacker, m );
                    }
                }
            }
        }
Example #13
0
		public override void OnDoubleClick( Mobile from )
		{
			Map map = this.Map;
			Point3D loc = this.Location;

			if ( Parent != null || Movable || IsLockedDown || IsSecure || map == null || map == Map.Internal )
				return;

			if ( !from.InRange( loc, 2 ) || !from.InLOS( this ) )
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "Vous ne pouvez atteindre cela" ); // I can't reach that.
			else if ( !m_Picked )
				OnPicked( from, loc, map );
		}
Example #14
0
        public override void OnDoubleClick(Mobile from)
        {
            if ( RootParent == from || ( from.InRange( GetWorldLocation(), 3 ) && from.InLOS( GetWorldLocation() ) ) )
            {
                if ( !Unrolled )
                {
                    Unroll();
                    MoveToWorld( from.Location, from.Map );
                }
                else if ( ItemID == 0x0A55 )
                {
                    if ( Parent == null )
                    {
                        IPooledEnumerable eable = from.GetItemsInRange( 7 );
                        Campfire fire = null;
                        foreach ( Item item in eable )
                        {
                            if ( item is Campfire )
                            {
                                fire = (Campfire)item;
                                break;
                            }
                        }
                        eable.Free();

                        if ( fire != null )
                        {
                            if ( fire.CanLogout( from ) )
                                new BedRollLogoutMenu().SendTo( from.NetState );
                            else
                                from.SendAsciiMessage( "Your camp is not yet secure." );
                        }
                        else
                        {
                            Roll();
                            from.AddToBackpack( this );
                        }
                    }
                    else
                    {
                        // is in a container (not on ground)
                        Roll();
                        from.AddToBackpack( this );
                    }
                }
            }
            else
            {
                from.SendAsciiMessage( "You must be closer to use that." );
            }
        }
Example #15
0
		public static BaseCreature[] GetDeadPets(Mobile from)
		{
			List<BaseCreature> pets = new List<BaseCreature>();

			foreach (Mobile m in from.GetMobilesInRange(12))
			{
				BaseCreature bc = m as BaseCreature;

				if (bc != null && bc.IsDeadBondedPet && bc.ControlMaster == from && from.InLOS(bc))
					pets.Add(bc);
			}

			return pets.ToArray();
		}
		public override void OnDoubleClick( Mobile m )
		{
			if ( !m.InRange( this.GetWorldLocation(), 3 ) || !m.InLOS(this) )
				return;
			if ( m_Controller.Enabled )
				return;

			if ( (m_Wanderer == null || !m_Wanderer.Alive) )
			{
				m_Wanderer = new WandererOfTheVoid();
				m_Wanderer.MoveToWorld( LeverPuzzleController.lr_Enter, Map.Malas );
				m_Wanderer.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1060002, "" ); // I am the guardian of...
				Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( CallBackMessage ) );
			}
		}
		public static ArrayList GetAllAttackers( Mobile m, int range )
		{
			ArrayList targets = new ArrayList(); 

			if ( m.Combatant != null && m.InLOS( m.Combatant ) )
			{
				if ( m.GetDistanceToSqrt( m.Combatant ) <= range )
				{
					targets.Add( m.Combatant );
				}
			}

// Current combatant has double chance to get an attack because of the above code

			foreach ( Mobile t in m.GetMobilesInRange( range ) )
			{
				if (t.Combatant == m && m.InLOS(t) && !t.Hidden )										
				{
					targets.Add( t );
				}
			}

			return targets;
		}
Example #18
0
		public override void OnDoubleClick(Mobile from)
		{
			if (from == null || Disabled) return;

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

			base.OnDoubleClick(from);

			// delete after use
			Delete();
		}
Example #19
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( from.InRange( this, 2 ) && from.InLOS(this) )
			{
				Map map = Map;

				if ( map == Map.Trammel || map == Map.Felucca )
				{
					from.MoveToWorld( new Point3D( 5922, 2024, 0 ), map );
					PublicOverheadMessage( MessageType.Regular, 0x3B2, true, String.Format( "* {0} dives into the hole and disappears!*", from.Name ) ); 
				}
			}
			else
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
Example #20
0
        public override void OnComponentUsed(AddonComponent stew, Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            else
            {
                {
                    stew.Visible = false;

                    BreadLoaf hagstew = new BreadLoaf();        //this decides your fillrate
                    hagstew.Eat(from);

                    Timer m_timer = new ShowStew(stew);
                    m_timer.Start();
                }
            }
        }
Example #21
0
		public override void OnComponentUsed( AddonComponent c, Mobile from )
		{
			if ( from.InRange( this.GetWorldLocation(), 2 ) && from.InLOS( this.GetWorldLocation() ) )
			{
				if ( Utility.RandomBool() )
				{
					from.Location = Location;
					c.ItemID = 0x124A;

					Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 3, new TimerStateCallback( Activate ), new object[] { c, from } );
				}
				else
					from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt.
			}
			else
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
Example #22
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.CheckUse(from))
                return;
            Map map = this.Map;
            Point3D loc = this.Location;

            if (from.InRange(loc, 1) || from.InLOS(this))
            {
                (this).Delete();

                Snake snake = new Snake();
                Mongbat mongbat = new Mongbat();
                SilverSerpent silverserpent = new SilverSerpent();
                Raptor raptor = new Raptor();
                Ballem ballem = new Ballem();
                FNPitchfork fnpitchfork = new FNPitchfork();

                switch (Utility.Random(18))
                {
                    case 0:
                        snake.MoveToWorld(loc, map);
                        break;
                    case 1:
                        mongbat.MoveToWorld(loc, map);
                        break;
                    case 2:
                        silverserpent.MoveToWorld(loc, map);
                        break;
                    case 3:
                        raptor.MoveToWorld(loc, map);
                        break;
                    case 4:
                        ballem.MoveToWorld(loc, map);
                        break;
                    case 5: case 10: case 15:
						if (Utility.RandomDouble() < 0.20)
                        {
                            fnpitchfork.MoveToWorld(loc, map);
                            from.SendMessage("You find Farmer Nash's pitchfork under one of the brambles of weeds. You pick up the pitchfork and put it in your backpack."); 
                        }
						break;
                  }
             }
        }
Example #23
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.SendLocalizedMessage(501816);
                return;
            }

            switch (Utility.Random(5))
            {
                default:
                case 0: this.PublicOverheadMessage(MessageType.Regular, 0, false, "T'as vu comment sa poupée est bien roulée!"); break;
                case 1: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Tu me regardes encore comme ça et je t'éclate la tronche!"); break;
                case 2: this.PublicOverheadMessage(MessageType.Regular, 0, false, "De la bière, vite!"); break;
                case 3: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Tu vois bien que je suis occupé!"); break;
                case 4: this.PublicOverheadMessage(MessageType.Regular, 0, false, "En tout cas, c'est moi qui ai la plus grosse..."); break;
            }
        }
			protected override void OnTarget(Mobile from, object targeted)
			{
			    if( targeted == null )
			    {
					return;
		        }
			
				if( targeted is Mobile || targeted is Container || targeted is Corpse || targeted is LandTarget || targeted is Static )
				{
				    from.SendLocalizedMessage(502816); // You feel that such an action would be inappropriate
				    return;
				}
				
				if (targeted is Item)
				{
					Item theitem = targeted as Item;
					if( theitem.IsChildOf( from.Backpack ) )
					{
						//Note: is this necessary?
					    if (!from.InLOS(theitem) || !theitem.IsAccessibleTo(from) || !theitem.Movable )
					    {
					        from.SendLocalizedMessage(502816); // You feel that such an action would be inappropriat
				        	return;
				    	}
				    	
				    	//if it's in your backpack already, it shouldn't be also worn
				    	if( theitem.ParentEntity is Mobile )
				    	{
					        from.SendMessage(33, "You cannot target Mobiles or something on a Mobile. Try again.");
				        	return;
				    	}
				    	
				    	//pass over to the extras dealie
				    	ExecuteExtras.ToggleKeyGuard( from, theitem );
				
				
					}
					else
					{
					    from.SendMessage(33, "Item needs to be in your backpack");
					}
		    	}
			}
Example #25
0
        public static void Effect( Mobile attacker, Mobile defender, int featlevel )
        {
            if( !BaseCustomSpell.HasEnoughMana( attacker, ( featlevel * 5 ) ) )
                return;

            ArrayList list = new ArrayList();
            IKhaerosMobile featuser = attacker as IKhaerosMobile;

            foreach( Mobile m in attacker.GetMobilesInRange( 5 ) )
                list.Add( m );

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

                if( ((IKhaerosMobile)attacker).IsAllyOf( m ) )
                {
                    if( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) )
                        continue;

                    if( attacker.InLOS( m ) && m.Hits < m.HitsMax )
                    {
                        double heal = ( 0.10 * featlevel ) * attacker.Skills[SkillName.Faith].Base;

                        if( m is PlayerMobile && attacker is PlayerMobile && ((PlayerMobile)m).ChosenDeity != ChosenDeity.None &&
                           ((PlayerMobile)m).ChosenDeity == ((PlayerMobile)attacker).ChosenDeity &&
                           ((PlayerMobile)m).Backgrounds.BackgroundDictionary[BackgroundList.Faithful].Level > 0 )
                            heal = heal + ( heal * 0.1 );

                        m.PlaySound( 0x1F2 );
                        m.FixedEffect( 0x376A, 9, 32 );
                        m.Hits += Convert.ToInt32( heal );
                        attacker.Mana -= ( 5 * featlevel );
                        m.LocalOverheadMessage( Network.MessageType.Regular, 170, false, "+" + Convert.ToInt32( heal ) );

                        if( attacker.Target != null && attacker.Target is BaseCustomSpell.CustomSpellTarget )
                            attacker.Target = null;

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

            ClearCurrentAbility( attacker );

            Map map = attacker.Map;

            if ( map != null )
            {
                defender.PlaySound( 0x5BF );

                ArrayList targets = new ArrayList();

                foreach ( Mobile m in defender.GetMobilesInRange( 5 ) )
                {
                    if ( SpellHelper.ValidIndirectTarget( attacker, m ) && attacker.CanBeHarmful( m, false ) && defender.InLOS( m ) && defender.CanSee( m ) )
                        targets.Add( m );
                }

                double dm;

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

                    if ( attacker.CanBeHarmful( m ) && attacker != m )
                    {
                        attacker.DoHarmful( m );

                        Effects.SendBoltEffect( m, false, 0 );

                        // TODO: Revisar formula del daño

                        dm = Utility.RandomMinMax( 25, 30 );

                        SpellHelper.Damage( TimeSpan.Zero, m, attacker, dm, 0, 0, 0, 0, 100 );
                    }
                }
            }
        }
Example #27
0
        public override void OnDoubleClick(Mobile from)
        {
            if ( !IsChildOf( from, true ) )
            {
                from.SendAsciiMessage( "That must be in your backpack to use it." );
                return;
            }
            else if ( !from.InRange( GetWorldLocation(), 3 ) || !from.InLOS( GetWorldLocation() ) )
            {
                from.SendAsciiMessage( "You cannot reach that." );
                return;
            }

            from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( OnTarget ) );
            if ( from.Target != null )
            {
                from.Target.CheckLOS = false;
                from.Target.BeginTimeout( from, TimeSpan.FromSeconds( 15.0 ) );
            }
        }
Example #28
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( !from.InLOS( this.GetWorldLocation() ) )
            {
                from.SendLocalizedMessage( 502800 ); // You can't see that.
                return;
            }

            if ( from.GetDistanceToSqrt( this.GetWorldLocation() ) > 2 )
            {
                from.SendLocalizedMessage( 500446 ); // That is too far away.
                return;
            }

            Point3D dest = new Point3D( 330, 1973, 0 );
            Map map = Map.Malas;

            BaseCreature.TeleportPets( from, dest, map );
            from.MoveToWorld( dest, map );
        }
Example #29
0
        public override void OnDoubleClick(Mobile from)
        {
            if ( from.Player && from.InRange( this, 1 ) && from.InLOS( this ) )
            {
                object o = m_Table[from];
                if ( o == null || ( o is DateTime && ((DateTime)o)+TimeSpan.FromHours( 6 ) < DateTime.Now ) )
                {
                    from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                    from.PlaySound( 0x202 );

                    from.SendAsciiMessage( "You feel a magical energy surround you." );

                    from.Hits = from.HitsMax;
                    from.Mana = from.ManaMax;
                    from.Stam = from.StamMax;
                    from.CurePoison( from );

                    m_Table[from] = DateTime.Now;
                }
            }
        }
Example #30
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.SendLocalizedMessage(501816);
                return;
            }


            switch (Utility.Random(6))
            {
                default:
                case 0: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Oh non! Mes ongles!"); break;
                case 1: this.PublicOverheadMessage(MessageType.Regular, 0, false, "J'ai une amie qui... oh non... je ne suis pas une commère comme elle"); break;
                case 2: this.PublicOverheadMessage(MessageType.Regular, 0, false, "S'il te plaît, laisse-moi faire le ménage!"); break;
                case 3: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Mon rêve? La paix dans le monde!"); break;
                case 4: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Quand je serai grande, je veux un mari pour qui cuisiner!"); break;
                case 5: this.PublicOverheadMessage(MessageType.Regular, 0, false, "Arrête, j'ai mal à la tête!"); break;

            }
        }
        public static void Honor(Mobile from, object targeted)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            Mobile targ = targeted as Mobile;

            if (targ == null)
            {
                return;
            }

            VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Honor);

            if (targ == from)
            {
                if (CantEmbrace(from))
                {
                    from.SendLocalizedMessage(1063230);                       // You must wait awhile before you can embrace honor again.

                    return;
                }

                if (level < VirtueLevel.Seeker)
                {
                    from.SendLocalizedMessage(1063234);                       // You do not have enough honor to do that

                    return;
                }

                Timer t = (Timer)m_Table[from];

                if (t != null)
                {
                    t.Stop();
                }

                Timer t2 = (Timer)m_Table2[from];

                if (t2 != null)
                {
                    t.Stop();
                }

                double delay = 0;

                switch (level)
                {
                case VirtueLevel.Seeker:
                    delay = 60.0;
                    break;

                case VirtueLevel.Follower:
                    delay = 90.0;
                    break;

                case VirtueLevel.Knight:
                    delay = 120.0;
                    break;
                }

                m_Table[from] = t = Timer.DelayCall(TimeSpan.FromSeconds(delay), new TimerStateCallback(Expire_Callback), from);

                m_Table2[from] = t2 = Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(Expire_Callback2), from);

                from.SendLocalizedMessage(1063235);                   // You embrace your honor

                if (VirtueHelper.Atrophy(from, VirtueName.Honor))
                {
                    from.SendLocalizedMessage(1063227);                       // You have lost some Honor.
                }
            }
            else
            {
                if (targ is BaseCreature)
                {
                    BaseCreature cr = targ as BaseCreature;

                    if (cr.HonorOpponent != null && cr.HonorOpponent != from)
                    {
                        from.SendLocalizedMessage(1063233);                           // Somebody else is honoring this opponent

                        return;
                    }
                }

                if (targ is PlayerMobile)
                {
                    PlayerMobile pm = targ as PlayerMobile;

                    if (pm.HonorOpponent != null && pm.HonorOpponent != from)
                    {
                        from.SendLocalizedMessage(1063233);                           // Somebody else is honoring this opponent

                        return;
                    }
                }

                if (VirtueHelper.IsHighestPath(from, VirtueName.Honor))
                {
                    from.SendLocalizedMessage(1063228);                       // You cannot gain more Honor.

                    return;
                }

                if (!from.InRange(targ.Location, 5))
                {
                    from.SendLocalizedMessage(1063232);                       // You are too far away to honor your opponent

                    return;
                }

                if (((targ.Hits * 100) / Math.Max(targ.HitsMax, 1)) < 85)
                {
                    from.SendLocalizedMessage(1063166);                       // You cannot honor this monster because it is too damaged.

                    return;
                }

                if (!NotorietyHandlers.Mobile_AllowHarmful(from, targ))
                {
                    return;
                }

                if (!from.CanSee(targ) || !from.InLOS(targ))
                {
                    return;
                }

                from.Direction = from.GetDirectionTo(targ.Location);

                from.Animate(32, 5, 1, true, false, 0);

                from.Say(1063231);                   // I honor you

                PlayerMobile player = from as PlayerMobile;

                player.HonorOpponent = targ;

                if (targ is BaseCreature)
                {
                    ((BaseCreature)targ).HonorOpponent = player;
                }

                if (targ is PlayerMobile)
                {
                    ((PlayerMobile)targ).HonorOpponent = player;
                }

                player.SpotHonor = player.Location;

                player.Perfection = 0;
            }
        }