Esempio n. 1
0
        public void SpawnBoneKnight(Mobile m)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            BoneKnight spawned = new BoneKnight();

            spawned.Team = this.Team;

            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);
                }
            }

            spawned.MoveToWorld(loc, map);
            spawned.Combatant = m;
        }
Esempio n. 2
0
        public override bool OnBeforeDeath()
        {
            BoneKnight rm = new BoneKnight();

            rm.Team         = Team;
            rm.Combatant    = Combatant;
            rm.NoKillAwards = true;

            if (rm.Backpack == null)
            {
                Backpack pack = new Backpack();
                pack.Movable = false;
                rm.AddItem(pack);
            }

            for (int i = 0; i < 2; i++)
            {
                LootPack.FilthyRich.Generate(this, rm.Backpack, true, LootPack.GetLuckChanceForKiller(this));
                LootPack.FilthyRich.Generate(this, rm.Backpack, false, LootPack.GetLuckChanceForKiller(this));
            }

            Effects.PlaySound(this, Map, GetDeathSound());
            Effects.SendLocationEffect(Location, Map, 0x3709, 30, 10, 0x835, 0);
            rm.MoveToWorld(Location, Map);

            Delete();
            return(false);
        }
Esempio n. 3
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            if (Map != null && attacker != this && 0.10 > Utility.RandomDouble())
            {
                Map map = Map;

                if (map == null)
                {
                    return;
                }
                BaseCreature spawn = new BoneKnight();

                spawn.Team = Team;
                bool    validLocation = false;
                Point3D loc           = Location;

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

                    if (validLocation = map.CanFit(x, y, 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);
                    }
                }
                spawn.MoveToWorld(loc, map);
                Effects.SendLocationEffect(loc, map, 0x3709, 30);
                spawn.Combatant = attacker;

                Say("My minions shall destroy you!");
            }

            base.OnGotMeleeAttack(attacker);
        }
Esempio n. 4
0
		public override bool OnBeforeDeath()
		{
			BoneKnight rm = new BoneKnight();
			rm.Team = this.Team;
			rm.Combatant = this.Combatant;
			rm.NoKillAwards = true;

			if ( rm.Backpack == null )
			{
				Backpack pack = new Backpack();
				pack.Movable = false;
				rm.AddItem( pack );
			}

			for ( int i = 0; i < 2; i++ )
			{
				LootPack.FilthyRich.Generate( this, rm.Backpack, true, LootPack.GetLuckChanceForKiller( this ) );
				LootPack.FilthyRich.Generate( this, rm.Backpack, false, LootPack.GetLuckChanceForKiller( this ) );
			}

			Effects.PlaySound(this, Map, GetDeathSound());
			Effects.SendLocationEffect( Location, Map, 0x3709, 30, 10, 0x835, 0 );
			rm.MoveToWorld( Location, Map );

			Delete();
			return false;
		}
Esempio n. 5
0
        public void SpawnMobiles(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int red = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is BoneMagi || m is BoneKnight || m is BoneMagi)
                {
                    ++red;
                }
            }

            if (red < 5)
            {
                int newblue = Utility.RandomMinMax(1, 2);

                for (int i = 0; i < newblue; ++i)
                {
                    BaseCreature yellow;

                    switch (Utility.Random(2))
                    {
                    default:
                    case 0: yellow = new BoneMagi(); break;

                    case 1: yellow = new BoneKnight(); break;
                    }

                    yellow.Team = this.Team;

                    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);
                        }
                    }

                    yellow.MoveToWorld(loc, map);
                    yellow.Combatant = target;
                    yellow.PlaySound(yellow.GetIdleSound());
                    yellow.FixedParticles(0x3728, 1, 10, 9910, EffectLayer.Head);
                }
            }
        }
		public void SpawnBoneKnight( Mobile m )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			BoneKnight spawned = new BoneKnight();

			spawned.Team = this.Team;

			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 );
			}

			spawned.MoveToWorld( loc, map );
			spawned.Combatant = m;
		}
Esempio n. 7
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            if (Map != null && attacker != this && 0.10 > Utility.RandomDouble())
            {
                Map map = Map;

                if (map == null)
                    return;
                BaseCreature spawn = new BoneKnight();

                spawn.Team = Team;
                bool validLocation = false;
                Point3D loc = Location;

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

                    if (validLocation = map.CanFit(x, y, 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);
                }
                spawn.MoveToWorld(loc, map);
                Effects.SendLocationEffect(loc, map, 0x3709, 30);
                spawn.Combatant = attacker;

                Say("My minions shall destroy you!");
            }

            base.OnGotMeleeAttack(attacker);
        }