Inheritance: BaseCreature
		public void SpawnDragon( Mobile target )
		{
			int drag = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 20 ) )
			{
				if ( m is Dragon )
					++drag;
			}

			if ( drag < 5 )
			{
			BaseCreature dragon = new Dragon();

			Map map = target.Map;

			Point3D loc = this.Location;
			bool validLocation = false;

			for ( int j = 0; !validLocation && j < 10; ++j )
			{
				int x = this.X + 5;
				int y = this.Y + 5;
				int z = map.GetAverageZ( x, y );
			}

			dragon.MoveToWorld( loc, map );
		}
		}
        public int Move(PlayerMobile from)
        {
            if (drag == null || drag.Deleted)
            {
                drag = new Dragon();
                drag.Frozen = true;
                drag.Blessed = true;
                drag.Direction = from.Direction;
                drag.MoveToWorld(from.Location, from.Map);
            }
            drag.Direction = from.Direction;
            switch (from.Direction)
            {
                case Direction.North:
                    drag.X = from.X - 1;
                    drag.Y = from.Y - 1;
                    return drag.Z + NorthZ;
                    break;
                case Direction.Right:
                    drag.X = from.X;
                    drag.Y = from.Y - 1;
                    return drag.Z + RightZ;
                    break;
                case Direction.East:
                    drag.X = from.X;
                    drag.Y = from.Y;
                    return drag.Z + EastZ;
                    break;
                case Direction.Down:
                    drag.X = from.X;
                    drag.Y = from.Y;
                    return drag.Z + DownZ;
                    break;
                case Direction.South:
                    drag.X = from.X;
                    drag.Y = from.Y;
                    return drag.Z + SouthZ;
                    break;
                case Direction.Left:
                    drag.X = from.X - 1;
                    drag.Y = from.Y;
                    return drag.Z + LeftZ;
                    break;
                case Direction.West:
                    drag.X = from.X - 1;
                    drag.Y = from.Y - 1;
                    return drag.Z + WestZ;
                    break;
                case Direction.Up:
                    drag.X = from.X - 1;
                    drag.Y = from.Y - 1;
                    return drag.Z + EastZ;
                    break;
                default:
                    return 0;
                    break;
            }

        }
Example #3
0
        public void SpawnDragons( Mobile target )
        {
            Map map = this.Map;
            if( map == null )
                return;

            int newDragons = Utility.RandomMinMax( 1, 2 );

            for( int i = 0; i < newDragons; ++i )
            {
                switch( Utility.Random( 3 ) )
                {
                    default:
                    case 0:
                        {
                            Dragon dragon = new Dragon();

                            dragon.Team = this.Team;
                            dragon.FightMode = this.FightMode;

                            bool validLocation = false;
                            Point3D loc = this.Location;

                            for( int j = 0; !validLocation && j < 10; ++j )
                            {
                                int x = X + Utility.Random( 3 ) - 1;
                                int y = Y + Utility.Random( 3 ) - 1;
                                int z = map.GetAverageZ( x, y );

                                if( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
                                    loc = new Point3D( x, y, Z );
                                else if( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                                    loc = new Point3D( x, y, z );
                            }

                            dragon.MoveToWorld( loc, map );
                            dragon.Combatant = target;

                            break;
                        }
                    case 1:
                        {
                            IronDragon idragon = new IronDragon();

                            idragon.Team = this.Team;
                            idragon.FightMode = this.FightMode;

                            bool validLocation = false;
                            Point3D loc = this.Location;

                            for( int j = 0; !validLocation && j < 10; ++j )
                            {
                                int x = X + Utility.Random( 3 ) - 1;
                                int y = Y + Utility.Random( 3 ) - 1;
                                int z = map.GetAverageZ( x, y );

                                if( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
                                    loc = new Point3D( x, y, Z );
                                else if( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                                    loc = new Point3D( x, y, z );
                            }

                            idragon.MoveToWorld( loc, map );
                            idragon.Combatant = target;

                            break;
                        }
                    case 2:
                        {
                            GreenDiamondDragon gdragon = new GreenDiamondDragon();

                            gdragon.Team = this.Team;
                            gdragon.FightMode = this.FightMode;

                            bool validLocation = false;
                            Point3D loc = this.Location;

                            for( int j = 0; !validLocation && j < 10; ++j )
                            {
                                int x = X + Utility.Random( 3 ) - 1;
                                int y = Y + Utility.Random( 3 ) - 1;
                                int z = map.GetAverageZ( x, y );

                                if( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
                                    loc = new Point3D( x, y, Z );
                                else if( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                                    loc = new Point3D( x, y, z );
                            }

                            gdragon.MoveToWorld( loc, map );
                            gdragon.Combatant = target;

                            break;
                        }
                }
            }
        }
Example #4
0
        public override void IncreaseTier()
        {
            base.IncreaseTier();

            List<object> list = new List<object>();
            BaseCreature c;

            // haven't got a clue if levels are OSI
            switch ( this.Tier )
            {
                case 1:
                    c = new Crane();
                    c.MoveToWorld(new Point3D(4500, 1382, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 2:
                    c = new DireWolf();
                    c.MoveToWorld(new Point3D(4494, 1370, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new DireWolf();
                    c.MoveToWorld(new Point3D(4494, 1360, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new WhiteWolf();
                    c.MoveToWorld(new Point3D(4491, 1366, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new WhiteWolf();
                    c.MoveToWorld(new Point3D(4497, 1366, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new GreyWolf();
                    c.MoveToWorld(new Point3D(4497, 1366, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 3:
                    c = new Quagmire();
                    c.MoveToWorld(new Point3D(4483, 1392, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new BogThing();
                    c.MoveToWorld(new Point3D(4486, 1385, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new PlagueBeast();
                    c.MoveToWorld(new Point3D(4486, 1379, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 4:
                    c = new PolarBear();
                    c.MoveToWorld(new Point3D(4513, 1395, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new PolarBear();
                    c.MoveToWorld(new Point3D(4508, 1393, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 5:
                    c = new Yamandon();
                    c.MoveToWorld(new Point3D(4498, 1393, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 6:
                    c = new Changeling();
                    c.MoveToWorld(new Point3D(4518, 1358, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 7:
                    c = new Wyvern();
                    c.MoveToWorld(new Point3D(4512, 1381, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 8:
                    c = new Dragon();
                    c.MoveToWorld(new Point3D(4511, 1372, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    c = new Drake();
                    c.MoveToWorld(new Point3D(4516, 1371, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 9:
                    c = new Reptalon();
                    c.MoveToWorld(new Point3D(4530, 1387, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    break;
                case 10:
                    c = new SilverSteed();
                    c.MoveToWorld(new Point3D(4506, 1358, 23), this.Map);
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add(c);

                    /*
                    c = new Sphynx();
                    c.MoveToWorld( new Point3D( 4506, 1358, 23 ), Map );
                    c.Blessed = true;
                    c.Tamable = false;
                    list.Add( c );*/

                    break;
            }

            if (list.Count > 0)
                this.Tiers.Add(list);
        }
Example #5
0
        public void SpawnDragons(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int newDragons = Utility.RandomMinMax(1, 2);

            for (int i = 0; i < newDragons; ++i)
            {
                switch (Utility.Random(3))
                {
                default:
                case 0:
                {
                    Dragon dragon = new Dragon();

                    dragon.Team      = this.Team;
                    dragon.FightMode = this.FightMode;

                    bool    validLocation = false;
                    Point3D loc           = this.Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = X + Utility.Random(3) - 1;
                        int y = Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    dragon.MoveToWorld(loc, map);
                    dragon.Combatant = target;

                    break;
                }

                case 1:
                {
                    IronDragon idragon = new IronDragon();

                    idragon.Team      = this.Team;
                    idragon.FightMode = this.FightMode;

                    bool    validLocation = false;
                    Point3D loc           = this.Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = X + Utility.Random(3) - 1;
                        int y = Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    idragon.MoveToWorld(loc, map);
                    idragon.Combatant = target;

                    break;
                }

                case 2:
                {
                    GreenDiamondDragon gdragon = new GreenDiamondDragon();

                    gdragon.Team      = this.Team;
                    gdragon.FightMode = this.FightMode;

                    bool    validLocation = false;
                    Point3D loc           = this.Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = X + Utility.Random(3) - 1;
                        int y = Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    gdragon.MoveToWorld(loc, map);
                    gdragon.Combatant = target;

                    break;
                }
                }
            }
        }
Example #6
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if(m == null || Word == null || (RequireIdentification && !m_Identified)) return;

            if(DateTime.Now < m_EndTime) return;

            string msgstr = "Activating the power of " + Word;

            // assign powers to certain words
            switch ( Word )
            {
                case "Shoda":
                    m.AddStatMod( new StatMod( StatType.Int, "Shoda", 20, Duration ) );
                    m.SendMessage("Your mind expands!");
                    break;
                case "Malik":
                    m.AddStatMod( new StatMod( StatType.Str, "Malik", 20, Duration ) );
                    m.SendMessage("Your strength surges!");
                    break;
                case "Lepto":
                    m.AddStatMod( new StatMod( StatType.Dex, "Lepto", 20, Duration ) );
                    m.SendMessage("You are more nimble!");
                    break;
                case "Velas":
                    Timer.DelayCall( TimeSpan.Zero, new TimerStateCallback( Hide_Callback ), new object[]{ m } );
                    m.SendMessage("You disappear!");
                    break;
                case "Tarda":
                    m.AddSkillMod( new TimedSkillMod( SkillName.Tactics, true, 20, Duration ) );
                    m.SendMessage("You are more skillful warrior!");
                    break;
                case "Marda":
                    m.AddSkillMod( new TimedSkillMod( SkillName.Magery, true, 20, Duration ) );
                    m.SendMessage("You are more skillful mage!");
                    break;
                case "Vas Malik":
                    m.AddStatMod( new StatMod( StatType.Str, "Vas Malik", 40, Duration ) );
                    m.SendMessage("You are exceptionally strong!");
                    break;
                case "Nartor":
                    BaseCreature b = new Dragon();
                    b.MoveToWorld(m.Location, m.Map);
                    b.Owners.Add( m );
                    b.SetControlMaster( m );
                    if(b.Controlled)
                        m.SendMessage("You master the beast!");
                    break;
                case "Santor":
                    b = new Horse();
                    b.MoveToWorld(m.Location, m.Map);
                    b.Owners.Add( m );
                    b.SetControlMaster( m );
                    if(b.Controlled)
                        m.SendMessage("You master the beast!");
                    break;
                default:
                    m.SendMessage("There is no effect.");
                    break;
            }

            // display activation effects
            Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 );
            Effects.PlaySound( m, m.Map, 0x201 );

            // display a message over the item it was attached to
            if(AttachedTo is Item )
            {
                ((Item)AttachedTo).PublicOverheadMessage( MessageType.Regular, 0x3B2, true, msgstr );
            }

            Charges--;

            // remove the attachment after the charges run out
            if(Charges == 0)
            {
                Delete();
            }
            else
            {
                m_EndTime = DateTime.Now + Refractory;
            }
        }
Example #7
0
		public virtual void BeginMate(Dragon mate)
		{
			if (AIObject is DragonAI)
				(AIObject as DragonAI).BeginMate(mate);
		}
Example #8
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
				{
					m_Birthdate = reader.ReadDateTime();
					m_Chick = reader.ReadMobile() as Dragon;
					m_Health = reader.ReadInt();

					break;
				}
			}
		}
Example #9
0
		public DragonEgg(Dragon child)
			: base(4963, 80)
		{
			Name = "dragon egg";
			Weight = 8;
			Hue = 1053;

			m_Birthdate = DateTime.Now + TimeSpan.FromDays(5.0 + 2 * Utility.RandomDouble());
			if (TestCenter.Enabled)
				m_Birthdate = DateTime.Now + TimeSpan.FromMinutes(20.0 + 5 * Utility.RandomDouble());
			m_Chick = child;
			m_Hatch = null;
			m_Health = 5;

			if (m_Chick != null)
			{
				m_Chick.SpawnerTempMob = true;
				m_Chick.Maturity = Dragon.DragonMaturity.Egg;
				m_Eggs.Add(this);
			}
		}
Example #10
0
		public void EndMate(bool success)
		{
			if (success)
			{
				m_LastMate = DateTime.Now;
			}

			m_MateTarget = null;
			m_NextMateAttempt = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(MinMateAttemptDelay, MaxMateAttemptDelay));
			m_BeganTheNasty = DateTime.MaxValue;
			BreedingState = BreedState.None;
		}
Example #11
0
		public void BeginMate(Dragon mate)
		{
			// mark us as gettin down
			Action = ActionType.Interact; // important that this happens BEFORE setting BeganTheNasty - OnActionChanged will overwrite it otherwise
			m_BeganTheNasty = DateTime.Now;
			m_MateTarget = mate;
		}
Example #12
0
		public bool CheckMateAccept(Dragon male)
		{
			if (m_Mobile.Deleted || !m_Mobile.Alive)
				return false; // we've got bigger shit to worry about

			if (!m_Mobile.Female || male == null || male.Female)
				return false; // dragons only swing one way

			if (!m_Mobile.Controlled)
				return false; // only tame drags mate

			if (!InFireDungeon(m_Mobile))
				return false; // only mate in fire dungeon

			if ((double)m_Mobile.Hits / m_Mobile.HitsMax < MateHealthThreshold)
				return false; // must be minimum health                   

			if ((Action != ActionType.Wander && Action != ActionType.Interact) ||
				m_Mobile.ControlOrder != OrderType.None || m_BecameIdle + MateIdleDelay > DateTime.Now)
				return false; // we are busy

			if (m_MateTarget == male)
				return true; // we're already mating with them, they're ok

			if (m_MateTarget != null && m_MateTarget != male)
				return false; // we're already mating with someone else

			if (m_LastMate + FemaleMateDelay > DateTime.Now)
				return false; // haven't waited long enough yet - need to recoup!

			// male's wisdom can up chances up to .10, our patience can up chances up to .05, our temper can lower chances up to .15
			double score = Utility.RandomDouble() - male.Wisdom / 1000.0 - m_Mobile.Patience / 2000.0 + m_Mobile.Temper * 3.0 / 2000.0;
			if (score < MateAcceptChance)
				return true;
			else
				return false;
		}
Example #13
0
		protected virtual void FindMate()
		{
			if (m_Mobile.Female)
				return;

			m_Mobile.DebugSay("Love shack.. In the looove shack...");
			IPooledEnumerable eable = m_Mobile.Map.GetMobilesInRange(m_Mobile.Location);
			m_MateTarget = null;
			double dist = Double.MaxValue;

			// find the closest female dragon
			foreach (Mobile m in eable)
			{
				Dragon c = m as Dragon;
				double d = m_Mobile.GetDistanceToSqrt(m);
				if (c != null && c.Female && c.BreedingParticipant && d < dist)
				{
					m_MateTarget = c;
					dist = d;
				}
			}
			eable.Free();

			if (m_MateTarget != null)
				m_Mobile.DebugSay("A woman!");
			else
				m_Mobile.DebugSay("Man, it's a sausage fest around here...");
		}
Example #14
0
		public DragonAI(BaseCreature m)
			: base(m)
		{
			m_MateTarget = null;
			m_BecameIdle = DateTime.Now;
			m_NextMateAttempt = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(MinMateAttemptDelay, MaxMateAttemptDelay));
			m_LastMate = DateTime.MinValue;
			m_BeganTheNasty = DateTime.MaxValue;
			m_Ignore = null;
		}
 public override void OnRemoved(object parent)
 {
     if (parent != null && parent is PlayerMobile && drag != null)
     {
         drag.Delete();
         drag = null;
     }
 }
 public override void OnDoubleClick(Mobile from)
 {
     base.OnDoubleClick(from);
     drag = new Dragon();
     drag.Frozen = true;
     drag.Blessed = true;
     drag.Direction = from.Direction;
     drag.MoveToWorld(from.Location, from.Map);
 }