protected bool SpawnCreature( BaseCreature creature )
		{
			for ( int i = 0; i < 5; i++ ) // Try 5 times
			{
				int x = Location.X + Utility.RandomMinMax( -1, 1 );
				int y = Location.Y + Utility.RandomMinMax( -1, 1 );
				int z = Map.GetAverageZ( x, y );

				if ( Map.CanSpawnMobile( x, y, Location.Z ) )
				{
					creature.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
					creature.Combatant = From;
					return true;
				}
				else if ( Map.CanSpawnMobile( x, y, z ) )
				{
					creature.MoveToWorld( new Point3D( x, y, z ), Map );
					creature.Combatant = From;
					return true;
				}
			}

			return false;
		}
        public static void UnStablePet(Mobile from, BaseCreature pet, Mobile gm)
        {
            if (from == null || from.Deleted || pet == null || pet.Deleted || gm == null || gm.Deleted)
                return;

			if (from.Stabled.Contains(pet))
			{
				gm.SendMessage("Warning: This is a force claiming. Followers count will not be checked!");

				pet.SetControlMaster(from);
				if (pet.Summoned)
					pet.SummonMaster = from;

				pet.ControlTarget = from;
				pet.ControlOrder = OrderType.Follow;

				if (from.Map == Map.Internal)
				{
					gm.MoveToWorld(from.Location, from.Map);
				}
				else
				{
					pet.MoveToWorld(from.Location, from.Map);
				}

				pet.IsStabled = false;
				from.Stabled.Remove(pet);
				//break;
			}
        }
Exemple #3
0
		public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
		{
			if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
			{
				caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
				creature.Delete();
				return false;
			}

			m_Summoning = true;

			if ( controlled )
				creature.SetControlMaster( caster );

			creature.RangeHome = 10;
			creature.Summoned = true;

			creature.SummonMaster = caster;

			Container pack = creature.Backpack;

			if ( pack != null )
			{
				for ( int i = pack.Items.Count - 1; i >= 0; --i )
				{
					if ( i >= pack.Items.Count )
						continue;

					pack.Items[i].Delete();
				}
			}

			#region Mondain's Legacy
			creature.SetHits((int)Math.Floor(creature.HitsMax * (1 + ArcaneEmpowermentSpell.GetSpellBonus(caster, false) / 100.0)));
			#endregion

			new UnsummonTimer( caster, creature, duration ).Start();
			creature.m_SummonEnd = DateTime.Now + duration;

			creature.MoveToWorld( p, caster.Map );

			Effects.PlaySound( p, creature.Map, sound );

			m_Summoning = false;

			return true;
		}
Exemple #4
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            if (tool is GargoylesPickaxe && def == this.m_OreAndStone && 0.1 > Utility.RandomDouble() && HarvestMap.CheckMapOnHarvest(from, harvested, def) == null)
            {
                HarvestResource res = vein.PrimaryResource;

                if (res == resource && res.Types.Length >= 3)
                {
                    try
                    {
                        Map map = from.Map;

                        if (map == null)
                        {
                            return;
                        }

                        BaseCreature spawned = Activator.CreateInstance(res.Types[2], new object[] { 25 }) as BaseCreature;

                        if (spawned != null)
                        {
                            int offset = Utility.Random(8) * 2;

                            for (int i = 0; i < m_Offsets.Length; i += 2)
                            {
                                int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
                                int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

                                if (map.CanSpawnMobile(x, y, from.Z))
                                {
                                    spawned.OnBeforeSpawn(new Point3D(x, y, from.Z), map);
                                    spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
                                    spawned.Combatant = from;
                                    return;
                                }
                                else
                                {
                                    int z = map.GetAverageZ(x, y);

                                    if (Math.Abs(z - from.Z) < 10 && map.CanSpawnMobile(x, y, z))
                                    {
                                        spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
                                        spawned.MoveToWorld(new Point3D(x, y, z), map);
                                        spawned.Combatant = from;
                                        return;
                                    }
                                }
                            }

                            spawned.OnBeforeSpawn(from.Location, from.Map);
                            spawned.MoveToWorld(from.Location, from.Map);
                            spawned.Combatant = from;
                        }
                    }
                    catch
                    {
                    }
                }
            }
            //base.OnHarvestStarted(from, tool, def, resource);
        }
		protected void Spawn( Point3D p, Map map, BaseCreature spawn )
		{
			if ( map == null )
			{
				spawn.Delete();
				return;
			}

			int x = p.X, y = p.Y;

			for ( int j = 0; j < 20; ++j )
			{
				int tx = p.X - 2 + Utility.Random( 5 );
				int ty = p.Y - 2 + Utility.Random( 5 );

				Tile t = map.Tiles.GetLandTile( tx, ty );

				if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
				{
					x = tx;
					y = ty;
					break;
				}
			}

			spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );
		}
        public static bool Summon( BaseCreature creature, bool controled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendAsciiMessage( "You have too many followers to summon that creature." );
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            if ( controled )
                creature.SetControlMaster( caster );

            creature.RangeHome = 10;
            creature.Summoned = true;

            creature.SummonMaster = caster;

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    ((Item)pack.Items[i]).Delete();
                }
            }

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            creature.MoveToWorld( p, caster.Map );

            Effects.PlaySound( p, creature.Map, sound );

            m_Summoning = false;

            return true;
        }
        public void SpawnAnt( BaseCreature ant )
        {
            m_Spawned.Add( ant );

            Map map = Map;
            Point3D p = Location;

            for ( int i = 0; i < 5; i++ )
                if ( SpellHelper.FindValidSpawnLocation( map, ref p, false ) )
                    break;

            ant.MoveToWorld( p, map );
            ant.Home = Location;
            ant.RangeHome = 10;
        }
Exemple #8
0
		public void SpawnHelper( BaseCreature helper, Point3D location )
		{
			if ( helper == null )
				return;

			helper.Home = location;
			helper.RangeHome = 4;
		
			if ( m_Altar != null )
				m_Altar.AddHelper( helper );
				
			helper.MoveToWorld( location, Map );			
		}
Exemple #9
0
        public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            if ( controlled )
                creature.SetControlMaster( caster );

            creature.RangeHome = 10;
            creature.Summoned = true;
            creature.SummonMaster = caster;

            #region Kaltar, OnSummon

            if (caster is Jogador)
            {
                SummonUtil.Instance.OnSummon((Jogador)caster, creature, ref p, ref duration);
            }

            #endregion

            #region DeletarItensDaMochila

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    pack.Items[i].Delete();
                }
            }

            #endregion

            #region Duracao do summon

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            #endregion

            creature.MoveToWorld( p, caster.Map );
            Effects.PlaySound( p, creature.Map, sound );

            m_Summoning = false;

            return true;
        }
Exemple #10
0
        public void SpawnWave()
        {
            Wave++;

            Region.SendRegionMessage(1152528, Wave.ToString());

            int toSpawn = (int)Math.Ceiling(Math.Max(5, Math.Sqrt(Wave) * 2) * 1.5);
            List <BaseCreature> creatures = new List <BaseCreature>();

            for (int i = 0; i < toSpawn; i++)
            {
                Point3D start = i % 2 == 0 ? StartPoint1 : StartPoint2;

                for (int j = 0; j < 25; j++)
                {
                    int x = start.X + Utility.RandomMinMax(start.X - (StartPointVariance / 2), start.X + (StartPointVariance / 2));
                    int y = start.Y + Utility.RandomMinMax(start.Y - (StartPointVariance / 2), start.Y + (StartPointVariance / 2));
                    int z = Map.GetAverageZ(x, y);

                    if (Map.CanSpawnMobile(x, y, z))
                    {
                        start = new Point3D(x, y, z);
                        break;
                    }
                }

                int  ran = Utility.RandomMinMax(0, Stage < 10 ? 12 : Stage < 15 ? 14 : 15);
                Type t;

                switch (ran)
                {
                default:
                case 0:
                case 1:
                case 3:
                case 4: t = SpawnTable[(int)VoidType][0]; break;

                case 5:
                case 6:
                case 7:
                case 8: t = SpawnTable[(int)VoidType][1]; break;

                case 9:
                case 10:
                case 11: t = SpawnTable[(int)VoidType][2]; break;

                case 12:
                case 13: t = SpawnTable[(int)VoidType][3]; break;

                case 14:
                case 15: t = SpawnTable[(int)VoidType][4]; break;
                }

                BaseCreature bc = Activator.CreateInstance(t, Wave, true) as BaseCreature;

                if (bc != null)
                {
                    bc.NoLootOnDeath = true;
                    Timer.DelayCall(TimeSpan.FromSeconds(i * .75), () =>
                    {
                        if (OnGoing)
                        {
                            bc.MoveToWorld(start, Map);
                            bc.Home      = EndPoint;
                            bc.RangeHome = 1;

                            creatures.Add(bc);

                            bc.CurrentWayPoint = GetNearestWaypoint(bc);
                        }
                        else
                        {
                            bc.Delete();
                        }
                    });
                }
            }

            var gate1 = new VoidPoolGate();

            gate1.MoveToWorld(StartPoint1, Map);
            Effects.PlaySound(StartPoint1, Map, 0x20E);

            var gate2 = new VoidPoolGate();

            gate2.MoveToWorld(StartPoint2, Map);
            Effects.PlaySound(StartPoint2, Map, 0x20E);

            Timer.DelayCall(TimeSpan.FromSeconds(toSpawn * .80), () =>
            {
                Effects.SendLocationParticles(EffectItem.Create(gate1.Location, gate1.Map, EffectItem.DefaultDuration), 0x376A, 9, 20, 5042);
                Effects.PlaySound(gate1.GetWorldLocation(), gate1.Map, 0x201);

                Effects.SendLocationParticles(EffectItem.Create(gate2.Location, gate2.Map, EffectItem.DefaultDuration), 0x376A, 9, 20, 5042);
                Effects.PlaySound(gate2.GetWorldLocation(), gate2.Map, 0x201);

                gate1.Delete();
                gate2.Delete();
            });

            Waves.Add(new WaveInfo(Wave, creatures));
            NextWave = GetNextWaveTime();
        }
Exemple #11
0
        public void EndClaimList(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive() || !m_Stored.ContainsKey(from))
                return;

            if ((from.Followers + pet.ControlSlots) <= from.FollowersMax)
            {
                pet.SetControlMaster(from);

                if (pet.Summoned)
                    pet.SummonMaster = from;

                pet.ControlTarget = from;
                pet.ControlOrder = OrderType.Follow;

                pet.MoveToWorld(from.Location, from.Map);

                pet.IsStabled = false;

                if (m_Stored[from].Contains(pet))
                    m_Stored[from].Remove(pet);

                from.SendLocalizedMessage(1042559); // Here you go... and good day to you!
            }
            else
            {
                from.SendLocalizedMessage(1049612, pet.Name); // ~1_NAME~ remained in the stables because you have too many followers.
            }
        }
Exemple #12
0
        private void Spawn(bool tribe, params Type[] types)
        {
            if (Map == null || NextSpawn > DateTime.UtcNow)
            {
                return;
            }

            NextSpawn = DateTime.UtcNow + TimeSpan.FromMinutes(10);

            for (var i = 0; i < 5; i++)
            {
                var          t  = types[Utility.Random(types.Length)];
                BaseCreature bc = null;

                if (t.IsSubclassOf(typeof(BaseEodonTribesman)))
                {
                    bc = Activator.CreateInstance(t, EodonTribe.Barrab) as BaseCreature;
                }
                else
                {
                    bc = Activator.CreateInstance(t) as BaseCreature;
                }

                if (bc != null)
                {
                    var rec = new Rectangle2D(X - 5, Y - 5, 10, 10);
                    var p   = Location;

                    bc.NoLootOnDeath = true;

                    for (var j = 0; j < 20; j++)
                    {
                        p = Map.GetRandomSpawnPoint(rec);

                        if (Map.CanSpawnMobile(p))
                        {
                            break;
                        }
                    }

                    if (p == Location)
                    {
                        bc.Delete();
                    }
                    else
                    {
                        bc.MoveToWorld(p, Map);

                        if (tribe)
                        {
                            bc.Home = new Point3D(914, 1872, 0);
                        }
                        else
                        {
                            bc.Home = new Point3D(913, 1792, 0);
                        }

                        bc.RangeHome = 15;
                    }
                }
            }
        }
Exemple #13
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (info.ButtonID == 1) // Main Menu
            {
                from.SendGump(new PetInventoryGump(m_Broker, from));
            }
            else if (info.ButtonID < 200) // LORE
            {
                int id = info.ButtonID - 100;

                if (id >= 0 && id < m_Entries.Count)
                {
                    PetBrokerEntry entry = m_Entries[id];

                    if (entry != null && entry.Pet != null && m_Broker.BrokerEntries.Contains(entry))
                    {
                        from.SendGump(new PetInventoryGump(m_Broker, from));

                        if (from is PlayerMobile)
                        {
                            Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
                            {
                                BaseGump.SendGump(new NewAnimalLoreGump((PlayerMobile)from, entry.Pet));
                            });
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1150368); // The selected animal is not available.
                    }
                }
            }
            else if (info.ButtonID < 300) // VIEW
            {
                int id = info.ButtonID - 200;

                if (id >= 0 && id < m_Entries.Count)
                {
                    PetBrokerEntry entry = m_Entries[id];

                    if (entry != null && entry.Pet != null && m_Broker.BrokerEntries.Contains(entry) && entry.Pet.IsStabled)
                    {
                        BaseCreature pet = entry.Pet;

                        pet.Blessed = true;
                        pet.SetControlMaster(m_Broker);
                        pet.ControlTarget = m_Broker;
                        pet.ControlOrder  = OrderType.None;
                        pet.MoveToWorld(m_Broker.Location, m_Broker.Map);
                        pet.IsStabled = false;
                        pet.Home      = pet.Location;
                        pet.RangeHome = 2;
                        pet.Loyalty   = BaseCreature.MaxLoyalty;

                        PetBroker.AddToViewTimer(pet);
                        from.SendLocalizedMessage(1150369, String.Format("{0}\t{1}", entry.TypeName, pet.Name)); // The ~1_TYPE~ named "~2_NAME~" is now in the animal broker's pen for inspection.
                    }
                    else
                    {
                        from.SendLocalizedMessage(1150368); // The selected animal is not available.
                    }
                }

                from.SendGump(new PetInventoryGump(m_Broker, from));
            }
            else // BUY
            {
                int id = info.ButtonID - 300;

                if (id >= 0 && id < m_Entries.Count)
                {
                    PetBrokerEntry entry = m_Entries[id];

                    if (entry != null && entry.Pet != null && m_Broker.BrokerEntries.Contains(entry))
                    {
                        from.SendGump(new ConfirmBuyPetGump(m_Broker, entry));
                    }
                }
            }
        }
Exemple #14
0
        public void Claim(Mobile from)
        {
            if (this.Deleted || !from.CheckAlive())
            {
                return;
            }

            bool          claimed = false;
            int           stabled = 0;
            List <Mobile> list    = new List <Mobile>(from.Stabled);

            foreach (Mobile m in list)
            {
                BaseCreature pet = m as BaseCreature;

                if (pet == null || pet.Deleted)
                {
                    pet.IsStabled = false;
                    from.Stabled.Remove(pet);
                }
                else
                {
                    ++stabled;

                    if ((from.Followers + pet.ControlSlots) <= from.FollowersMax)
                    {
                        pet.SetControlMaster(from);

                        if (pet.Summoned)
                        {
                            pet.SummonMaster = from;
                        }

                        pet.ControlTarget = from;
                        pet.ControlOrder  = OrderType.Follow;

                        pet.MoveToWorld(from.Location, from.Map);

                        pet.IsStabled = false;

                        if (Core.SE)
                        {
                            pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy
                        }
                        from.Stabled.Remove(pet);
                        claimed = true;
                    }
                    else
                    {
                        from.SendLocalizedMessage(1049612, pet.Name); // ~1_NAME~ remained in the stables because you have too many followers.
                    }
                }
            }

            list.Clear();
            list.TrimExcess();

            if (claimed)
            {
                from.SendLocalizedMessage(1042559); // Here you go... and good day to you!
            }
            else if (stabled == 0)
            {
                from.SendLocalizedMessage(502671); // But I have no animals stabled with me at the moment!
            }
        }
Exemple #15
0
        //25JUL2008 Lord_Greywolf fix for bad X *** START ***
        //        protected void Spawn( Point2D p, Map map, BaseCreature spawn )
        //        {
        //            if ( map == null )
        //            {
        //                spawn.Delete();
        //                return;
        //            }

        //            int x = p.X, y = p.Y;

        ////			for ( int j = 0; j < 5; ++j )
        ////			{
        ////				int tx = p.X - 2 + Utility.Random( 5 );
        ////				int ty = p.Y - 2 + Utility.Random( 5 );
        ////			}

        //            spawn.MoveToWorld( new Point3D( x, y, 0 ), map );
        //            spawn.PackItem( new TreasureMessageChest() );
        //}
        protected void Spawn(Point2D p, Map map, BaseCreature spawn)
        {
            if (map == null) { spawn.Delete(); return; }

            int x = p.X, y = p.Y;

            if (map.CanSpawnMobile(x, y, 0))
            {
                spawn.MoveToWorld(new Point3D(x, y, 0), map);
            }
            else
            {
                int z = map.GetAverageZ(x, y);
                if (map.CanSpawnMobile(x, y, z))
                {
                    spawn.MoveToWorld(new Point3D(x, y, z), map);
                }
                else if (map.CanSpawnMobile(x, y, z + 10))
                {
                    spawn.MoveToWorld(new Point3D(x, y, z + 10), map);
                }
                else if (map.CanSpawnMobile(x + 1, y + 1, z))
                {
                    spawn.MoveToWorld(new Point3D(x + 1, y + 1, z), map);
                }
                else if (map.CanSpawnMobile(x + 1, y + 1, z + 10))
                {
                    spawn.MoveToWorld(new Point3D(x + 1, y + 1, z + 10), map);
                }
                else
                {
                    spawn.MoveToWorld(new Point3D(x - 1, y - 1, 100), map);
                }
            }
            spawn.PackItem(new TreasureMessageChest(Utility.RandomMinMax((((m_Level - 1) * 400) + 100), (((m_Level - 1) * 400) + 500))));
        }
        public void SpawnMobile(BaseCreature bc)
        {
            if(this.Map == null || bc == null)
            {
                if(bc != null)
                    bc.Delete();
                return;
            }

            int x = this.X;
            int y = this.Y;
            int z = this.Z;
            Point3D p = new Point3D(x, y, z);

            for(int i = 0; i < 25; i++)
            {
                x = Utility.RandomMinMax(this.X - 15, this.X + 15);
                y = Utility.RandomMinMax(this.Y - 15, this.Y + 15);
                z = this.Map.GetAverageZ(x, y);

                if (this.Map.CanSpawnMobile(x, y, z))
                {
                    p = new Point3D(x, y, z);
                    break;
                }
            }

            bc.MoveToWorld(p, this.Map);
        }
Exemple #17
0
		protected void Spawn( Point3D p, Map map, BaseCreature spawn )
		{
			if ( map == null )
			{
				spawn.Delete();
				return;
			}

			int x = p.X, y = p.Y;

			for ( int j = 0; j < 20; ++j )
			{
				int tx = p.X - 2 + Utility.Random( 5 );
				int ty = p.Y - 2 + Utility.Random( 5 );

				LandTile t = map.Tiles.GetLandTile( tx, ty );

				if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
				{
					x = tx;
					y = ty;
					break;
				}
			}

			spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );

			if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
				spawn.PackItem( new MessageInABottle( map == Map.Felucca ? Map.Felucca : Map.Trammel ) );
		}
Exemple #18
0
        public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            if ( controlled )
                creature.SetControlMaster( caster );

            creature.RangeHome = 10;
            creature.Summoned = true;

            creature.SummonMaster = caster;

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    pack.Items[i].Delete();
                }
            }

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            creature.MoveToWorld( p, caster.Map );

            Effects.PlaySound( p, creature.Map, sound );

            if (creature is BladeSpirits)
            {
                new BSTimer(creature).Start();
                Effects.SendLocationParticles(EffectItem.Create(creature.Location, creature.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
            }

            m_Summoning = false;

            return true;
        }
		private void DoClaim( Mobile from, BaseCreature pet )
		{
			pet.SetControlMaster( from );

			if ( pet.Summoned )
				pet.SummonMaster = from;

			pet.ControlTarget = from;
			pet.ControlOrder = OrderType.Follow;

			pet.MoveToWorld( from.Location, from.Map );

			pet.IsStabled = false;
            pet.StabledBy = null;

			if ( Core.SE )
				pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy
		}
        private bool SpawnMobile(BaseCreature bc, Rectangle2D spawnrec)
        {
            if (bc != null)
            {
                for (int i = 0; i < 25; i++)
                {
                    Point3D p = spawnrec.GetRandomSpawnPoint(this.Map);
                    bool exempt = false;

                    if (spawnrec.X == 6444 && spawnrec.Y == 2446)
                    {
                        exempt = true;
                        p.Z = -2;
                    }

                    if (exempt || this.Map.CanFit(p.X, p.Y, p.Z, 16, false, false, true))
                    {
                        bc.MoveToWorld(p, this.Map);
                        bc.Home = Defs[CurrentInvasion].BeaconLoc;
                        bc.SeeksHome = true;
                        bc.RangeHome = Utility.RandomMinMax(5, 10);

                        bc.Tamable = false;

                        return true;
                    }
                }
            }

            return false;
        }
		public void EndClaimList( Mobile from, BaseCreature pet )
		{
			if ( pet == null || pet.Deleted || from.Map != this.Map || !from.InRange( this, 14 ) || !from.Stabled.Contains( pet ) || !from.CheckAlive() )
				return;

			if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax )
			{
				pet.SetControlMaster( from );

				if ( pet.Summoned )
					pet.SummonMaster = from;

				pet.ControlTarget = from;
				pet.ControlOrder = OrderType.Follow;

				pet.MoveToWorld( from.Location, from.Map );

				pet.IsStabled = false;
				from.Stabled.Remove( pet );

				SayTo( from, 1042559 ); // Here you go... and good day to you!
			}
			else
			{
				SayTo( from, 1049612, pet.Name ); // ~1_NAME~ remained in the stables because you have too many followers.
			}
		}
Exemple #22
0
        public virtual void Exit(Mobile fighter)
        {
            // teleport fighter
            if (fighter.NetState == null)
            {
                fighter.LogoutLocation = m_ExitDest;
            }
            else
            {
                fighter.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                fighter.PlaySound(0x1FE);

                if (this is CitadelAltar)
                {
                    fighter.MoveToWorld(m_ExitDest, Map.Tokuno);
                }
                else
                {
                    fighter.MoveToWorld(m_ExitDest, Map);
                }
            }

            // teleport his pets
            if (m_Pets.ContainsKey(fighter))
            {
                for (int i = 0; i < m_Pets[fighter].Count; i++)
                {
                    BaseCreature pet = m_Pets[fighter][i] as BaseCreature;

                    if (pet != null && (pet.Alive || pet.IsBonded) && pet.Map != Map.Internal)
                    {
                        if (pet is BaseMount)
                        {
                            BaseMount mount = (BaseMount)pet;

                            if (mount.Rider != null && mount.Rider != fighter)
                            {
                                mount.Rider.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                                mount.Rider.PlaySound(0x1FE);

                                if (this is CitadelAltar)
                                {
                                    mount.Rider.MoveToWorld(m_ExitDest, Map.Tokuno);
                                }
                                else
                                {
                                    mount.Rider.MoveToWorld(m_ExitDest, Map);
                                }

                                continue;
                            }
                            else if (mount.Rider != null)
                            {
                                continue;
                            }
                        }

                        pet.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                        pet.PlaySound(0x1FE);

                        if (this is CitadelAltar)
                        {
                            pet.MoveToWorld(m_ExitDest, Map.Tokuno);
                        }
                        else
                        {
                            pet.MoveToWorld(m_ExitDest, Map);
                        }
                    }
                }
            }

            m_Fighters.Remove(fighter);
            m_Pets.Remove(fighter);

            fighter.SendLocalizedMessage(1072677);               // You have been transported out of this room.

            if (m_Fighters.Count == 0)
            {
                FinishSequence();
            }
        }