Example #1
0
        public void SpawnMercenary(Mobile target)
        {
            Map map = target.Map;

            if (map == null)
            {
                return;
            }

            int mercenarys = 0;

            foreach (Mobile m in this.GetMobilesInRange(3))
            {
                if (m is Mercenary)
                {
                    ++mercenarys;
                }
            }

            if (mercenarys < 2)
            {
                BaseCreature mercenary = new Mercenary();

                mercenary.Team = this.Team;

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

                for (int j = 0; !validLocation && j < 7; ++j)
                {
                    int x = target.X + Utility.Random(3) - 1;
                    int y = target.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, this.Z);
                    }
                    else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }

                mercenary.MoveToWorld(loc, map);

                mercenary.Combatant = target;
            }
        }
Example #2
0
            public MercTrainingPrompt( Mobile from, Mercenary mercenary )
            {
                merc = mercenary;
                PlayerMobile m = from as PlayerMobile;

                from.SendMessage( "Please type the code for the feat you wish to teach to this mercenary." );
                from.SendMessage( 60, "Code - Feat Name - Feat Level" );

                for( int i = 1; i < 21; i++ )
                {
                    if( MercTraining.GetFeat( m, i ) > 0 && MercTraining.GetFeat( merc, i ) < 1 )
                        from.SendMessage( 5 * i, "{0} - {1}", i.ToString(), MercTraining.GetMercFeatName(i) );
                }
            }
Example #3
0
            public PayTimer( Mercenary merc, TimeSpan delay )
                : base(delay)
            {
                m_merc = merc;

                Priority = TimerPriority.OneMinute;
            }