Inheritance: BaseCreature
Exemplo n.º 1
0
        public override void OnDamagedBySpell(Mobile caster)
        {
            if (Map != null && caster != this && 0.10 > Utility.RandomDouble())
            {
                Map map = Map;

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

                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 = caster;

                Say("You cannot defeat me!");
            }

            base.OnDamagedBySpell(caster);
        }
Exemplo n.º 2
0
		public static void CheckSummon( Mobile from )
		{
			if ( Utility.RandomDouble() > 0.90 )
			{
				Skeleton skel;

				for ( int i = 0; i < 5; i++ )
				{
					skel = new Skeleton();
					new Server.Spells.UnsummonTimer( from, skel, TimeSpan.FromMinutes( 5 ) ).Start();
					skel.MoveToWorld( new Point3D( 
						from.X + Utility.RandomMinMax( -1, 1 ),
						from.Y + Utility.RandomMinMax( -1, 1 ),
						from.Z ), from.Map
					);
				}

				if ( from.Hits < (from.Hits/2) )
				{
					from.BodyMod = 50;
					from.HueMod = 0;
					from.NameMod = "a skeleton";
				}
			}
		}
Exemplo n.º 3
0
        public override void OnTrigger( Mobile from )
        {
            if( from is PlayerMobile )
            {
                PlayerMobile m = from as PlayerMobile;

                if( m.Friendship.Undead < 1 )
                {
                    int randomchance = Utility.RandomMinMax( 1, 10 );

                    if( randomchance > 8 )
                    {
                        Mobile skeleton = skeleton = new Skeleton();

                        if( randomchance > 9 )
                            skeleton = new SkeletalSoldier();

                        skeleton.MoveToWorld( this.Location, this.Map );
                        skeleton.PlaySound( 1169 );
                        skeleton.Combatant = m;
                        this.Delete();
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void Target(object obj)
        {
            if (CheckSequence())
            {
                // Scriptiz : Amélioration en ciblant un Mobile, le mort l'attaque
                Point3D location;

                if (obj is LandTarget)
                    location = ((LandTarget)obj).Location;
                else if(obj is Mobile)
                    location = ((Mobile)obj).Location;
                else
                {
                    Caster.SendMessage("Veuillez cibler une zone valide. (" + obj.GetType().ToString() + ")");
                    return;
                }

                SpellHelper.Turn(Caster, location);

                double getLich = Caster.Skills.Necromancy.Value / 10;
                double getSkeleton = Caster.Skills.Necromancy.Value / 5;

                int chance = Utility.Random(100);

                BaseCreature undead;

                if (chance <= getLich)
                    undead = new Lich();
                else if (chance <= getSkeleton)
                    undead = new Skeleton();
                else
                    undead = new Zombie();

                undead.ControlSlots = 1;
                undead.Fame = 0;
                undead.Karma = -1500;

                Caster.Karma -= 500;
                Effects.PlaySound(location, Caster.Map, 0x1FB);
                Effects.SendLocationParticles(EffectItem.Create(location, Caster.Map, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);

                TimeSpan delay = TimeSpan.FromMinutes((Caster.Skills.Necromancy.Base + Caster.Skills.EvalInt.Base) * 3);
                BaseCreature.Summon(undead, false, Caster, location, 0x28, delay);

                // Si la cible est une mobile on l'attaque
                if (obj is Mobile)
                {
                    undead.Attack((Mobile)obj);
                }
            }

            FinishSequence();
        }
Exemplo n.º 5
0
		public void SpawnVampireBats( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;
			
			if ( Skeletons == null )
				Skeletons = new ArrayList();

			int newVampireBats = Utility.RandomMinMax( 4, 8 );

			for ( int i = 0; i < newVampireBats; ++i )
			{
				Skeleton vampirebat = new Skeleton();

				Skeletons.Add(vampirebat);

				vampirebat.Team = this.Team;
				vampirebat.FightMode = FightMode.Closest;

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

				Effects.SendLocationParticles( EffectItem.Create( loc, map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );
				vampirebat.MoveToWorld( loc, map );
				vampirebat.Combatant = target;
			}
		}
Exemplo n.º 6
0
            protected override void OnTick()
            {
                if ( m_Item.Deleted )
                    return;

                Mobile spawn;

                switch ( Utility.Random( 12 ) )
                {
                    default:
                    case 0: spawn = new Skeleton(); break;
                    case 1: spawn = new Zombie(); break;
                    case 2: spawn = new Wraith(); break;
                    case 3: spawn = new Spectre(); break;
                    case 4: spawn = new Spectre(); break;
                    case 5: spawn = new Mummy(); break;
                    case 6: spawn = new Zombie(); break;
                    case 7: spawn = new Zombie(); break;
                    case 8: spawn = new Zombie(); break;
                    case 9: spawn = new SkeletalSoldier(); break;
                    case 10: spawn = new Zombie(); break;
                    case 11: spawn = new Zombie(); break;
                }

                spawn.MoveToWorld( m_Item.Location, m_Item.Map );

                m_Item.Delete();
            }
 public void SpawnUndead( Mobile m )
 {
     Map map = this.Map;
     Effects.SendLocationParticles( EffectItem.Create( this.Location, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 );
     Mobile spawn;
     switch ( Utility.Random( 12 ) )
     {
         default:
         case 0: spawn = new Skeleton(); break;
         case 1: spawn = new Zombie(); break;
         case 2: spawn = new Wraith(); break;
         case 3: spawn = new Spectre(); break;
         case 4: spawn = new Ghoul(); break;
         case 5: spawn = new Mummy(); break;
         case 6: spawn = new Bogle(); break;
         case 7: spawn = new RottingCorpse(); break;
         case 8: spawn = new BoneKnight(); break;
         case 9: spawn = new SkeletalKnight(); break;
         case 10: spawn = new Lich(); break;
         case 11: spawn = new LichLord(); break;
     }
     spawn.Hidden = true;
     spawn.MoveToWorld( m.Location, m.Map );
 }
Exemplo n.º 8
0
        public void IntervalEffect()
        {
            if (Deleted || !Alive)
            {
                return;
            }

            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            AbilityInProgress = true;

            int    summonMotions  = 5 - (int)(Math.Ceiling(4 * spawnPercent));
            double summonDuration = 1;

            int creaturesToSummon = 2 + (int)(Math.Ceiling(8 * spawnPercent));

            double stationaryDelay = summonMotions * summonDuration + 1;

            double minRange = 8;
            double maxRange = 24;

            Point3D location = Location;
            Map     map      = Map;

            int range     = 10 + (int)(Math.Ceiling(20 * spawnPercent));
            int effectHue = Hue - 1;

            Combatant        = null;
            NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay);

            AIObject.NextMove              = AIObject.NextMove + TimeSpan.FromSeconds(stationaryDelay);
            LastSwingTime                  = LastSwingTime + TimeSpan.FromSeconds(stationaryDelay);
            NextSpellTime                  = NextSpellTime + TimeSpan.FromSeconds(stationaryDelay);
            NextCombatHealActionAllowed    = NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDelay);
            NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDelay);
            NextCombatEpicActionAllowed    = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDelay);

            SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, stationaryDelay, true, 0, false, "", "", "-1");

            PublicOverheadMessage(MessageType.Regular, 0, false, "*draws upon the breath of the living*");

            for (int a = 0; a < summonMotions; a++)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(a * summonDuration), delegate
                {
                    if (Deleted || !Alive)
                    {
                        return;
                    }

                    CantWalk = true;
                    Frozen   = true;

                    Effects.PlaySound(Location, Map, GetAngerSound());

                    Animate(12, 12, 1, true, false, 0);

                    Queue m_Queue = new Queue();

                    IPooledEnumerable mobilesInRange = map.GetMobilesInRange(location, range);

                    foreach (Mobile mobile in mobilesInRange)
                    {
                        if (mobile.Deleted)
                        {
                            continue;
                        }
                        if (!mobile.Alive)
                        {
                            continue;
                        }
                        if (mobile == this)
                        {
                            continue;
                        }
                        if (mobile.AccessLevel > AccessLevel.Player)
                        {
                            continue;
                        }

                        bool validTarget = false;

                        PlayerMobile pm_Target = mobile as PlayerMobile;
                        BaseCreature bc_Target = mobile as BaseCreature;

                        if (pm_Target != null)
                        {
                            validTarget = true;
                        }

                        if (bc_Target != null)
                        {
                            if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                            {
                                validTarget = true;
                            }
                        }

                        if (validTarget)
                        {
                            m_Queue.Enqueue(mobile);
                        }
                    }

                    mobilesInRange.Free();

                    while (m_Queue.Count > 0)
                    {
                        Mobile mobile = (Mobile)m_Queue.Dequeue();

                        mobile.MovingEffect(this, 0x3728, 5, 1, false, false, effectHue, 0);
                    }
                });
            }

            Timer.DelayCall(TimeSpan.FromSeconds((double)summonMotions * summonDuration), delegate
            {
                if (Deleted || !Alive)
                {
                    return;
                }

                CantWalk = false;
                Frozen   = false;

                AbilityInProgress = false;

                PlaySound(0x64F);

                Queue m_Queue = new Queue();

                IPooledEnumerable mobilesInRange = map.GetMobilesInRange(location, range);

                foreach (Mobile mobile in mobilesInRange)
                {
                    if (mobile.Deleted)
                    {
                        continue;
                    }
                    if (!mobile.Alive)
                    {
                        continue;
                    }
                    if (mobile == this)
                    {
                        continue;
                    }
                    if (mobile.AccessLevel > AccessLevel.Player)
                    {
                        continue;
                    }

                    bool validTarget = false;

                    PlayerMobile pm_Target = mobile as PlayerMobile;
                    BaseCreature bc_Target = mobile as BaseCreature;

                    if (pm_Target != null)
                    {
                        validTarget = true;
                    }

                    if (bc_Target != null)
                    {
                        if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                        {
                            validTarget = true;
                        }
                    }

                    if (validTarget)
                    {
                        m_Queue.Enqueue(mobile);
                    }
                }

                mobilesInRange.Free();

                while (m_Queue.Count > 0)
                {
                    Mobile mobile          = (Mobile)m_Queue.Dequeue();
                    Point3D mobileLocation = mobile.Location;

                    int distance = range - (int)GetDistanceToSqrt(mobile);

                    double damage = DamageMax;

                    if (mobile is BaseCreature)
                    {
                        damage *= 2;
                    }

                    Direction direction = Utility.GetDirection(location, mobileLocation);
                    int windId          = GetWindItemId(direction, false);
                    MovingEffect(mobile, windId, 5, 1, false, false, effectHue, 0);

                    SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobile, damage, distance, -1, "", "You are knocked back by the breath of life!");
                }

                Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                {
                    if (Deleted || !Alive)
                    {
                        return;
                    }

                    for (int a = 0; a < creaturesToSummon; a++)
                    {
                        Point3D spawnLocation = Location;

                        List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 10, true);

                        if (m_ValidLocations.Count > 0)
                        {
                            spawnLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                        }

                        int particleSpeed = 5;

                        IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 3), Map);
                        IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(spawnLocation.X, spawnLocation.Y, spawnLocation.Z + 3), map);

                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3728, particleSpeed, 0, false, false, 0, 0);

                        double distance         = Utility.GetDistanceToSqrt(Location, spawnLocation);
                        double destinationDelay = (double)distance * .08;

                        Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                        {
                            if (Deleted || !Alive)
                            {
                                return;
                            }

                            Effects.PlaySound(spawnLocation, map, 0x653);

                            Effects.SendLocationParticles(effectEndLocation, 0x3709, 10, 20, effectHue, 0, 5029, 0);
                            Effects.SendLocationParticles(effectEndLocation, 0x3779, 10, 60, effectHue, 0, 5029, 0);
                            Effects.SendLocationParticles(effectEndLocation, 0x3996, 10, 60, effectHue, 0, 5029, 0);

                            Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                            {
                                if (this == null)
                                {
                                    return;
                                }
                                if (Deleted || !Alive)
                                {
                                    return;
                                }

                                BaseCreature monsterToSpawn = null;

                                int maxCreatureValue = 1 + (int)(Math.Ceiling(10 * spawnPercent));

                                if (maxCreatureValue > 10)
                                {
                                    maxCreatureValue = 10;
                                }

                                switch (Utility.RandomMinMax(1, maxCreatureValue))
                                {
                                case 1: monsterToSpawn = new Zombie(); break;

                                case 2: monsterToSpawn = new Skeleton(); break;

                                case 3: monsterToSpawn = new Ghoul(); break;

                                case 4: monsterToSpawn = new PatchworkSkeleton(); break;

                                case 5: monsterToSpawn = new ZombieMagi(); break;

                                case 6: monsterToSpawn = new SkeletalMage(); break;

                                case 7: monsterToSpawn = new SkeletalKnight(); break;

                                case 8: monsterToSpawn = new Mummy(); break;

                                case 9: monsterToSpawn = new SkeletalDrake(); break;

                                case 10: monsterToSpawn = new RottingCorpse(); break;
                                }

                                if (monsterToSpawn != null)
                                {
                                    monsterToSpawn.BossMinion = true;
                                    monsterToSpawn.MoveToWorld(spawnLocation, map);

                                    m_Creatures.Add(monsterToSpawn);
                                }
                            });
                        });
                    }
                });
            });
        }
Exemplo n.º 9
0
			protected override void OnTick()
			{
				if ( m_Item.Deleted )
					return;

				Mobile spawn;

				switch ( Utility.Random( 12 ) )
				{
					default:
					case 0: spawn = new Skeleton(); break;
					case 1: spawn = new Zombie(); break;
					case 2: spawn = new Wraith(); break;
					case 3: spawn = new Spectre(); break;
					case 4: spawn = new Ghoul(); break;
					case 5: spawn = new Mummy(); break;
					case 6: spawn = new Bogle(); break;
					case 7: spawn = new RottingCorpse(); break;
					case 8: spawn = new BoneKnight(); break;
					case 9: spawn = new SkeletalKnight(); break;
					case 10: spawn = new Lich(); break;
					case 11: spawn = new LichLord(); break;
				}

				spawn.MoveToWorld( m_Item.Location, m_Item.Map );

				m_Item.Delete();
			}
Exemplo n.º 10
0
		public void SpawnSkeleton( Mobile from )
		{
			BaseCreature skele;
			skele = new Skeleton();
			skele.Map = from.Map;
			skele.Location = from.Location;
			skele.Combatant = from;
		}
Exemplo n.º 11
0
        public void SpawnSkeletons( Mobile target )
        {
            Map map = this.Map;

            if ( map == null )
                return;

            int newSkeletons = Utility.RandomMinMax( 2, 3 );

            for ( int i = 0; i < newSkeletons; ++i )
            {
                Skeleton skeleton = new Skeleton();

                skeleton.Team = this.Team;
                skeleton.FightMode = FightMode.Closest;

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

                skeleton.MoveToWorld( loc, map );
                skeleton.Combatant = target;
                skeleton.VanishTime = DateTime.Now + TimeSpan.FromHours( 1 );
                skeleton.VanishEmote = "*crumbles into dust*";
                this.PlaySound( 1109 );
            }

            int newZombies = Utility.RandomMinMax( 2, 3 );

            for ( int i = 0; i < newZombies; ++i )
            {
                Zombie zombie = new Zombie();

                zombie.Team = this.Team;
                zombie.FightMode = FightMode.Closest;

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

                zombie.MoveToWorld( loc, map );
                zombie.Combatant = target;
                this.PlaySound( 1109 );
            }

            this.Emote( "*freshly created undead burst forth from the sickening chasm of his mouth*" );
        }
Exemplo n.º 12
0
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;
                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if ( m_Item != null )
                    m_Item.IsDigging = false;

                if ( equip is BaseWeapon )
                {
                    BaseWeapon weapon = (BaseWeapon)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats( out attributeCount, out min, out max );

                    BaseRunicTool.ApplyAttributesTo( weapon, attributeCount, min, max );
                }
                else if ( equip is BaseArmor )
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats( out attributeCount, out min, out max );

                    BaseRunicTool.ApplyAttributesTo( armor, attributeCount, min, max );
                }
                else if ( equip is BaseJewel )
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats( out attributeCount, out min, out max );

                    BaseRunicTool.ApplyAttributesTo( (BaseJewel)equip, attributeCount, min, max );
                }

                if ( Utility.Random( 100 ) < 85 )
                {
                    switch ( Utility.Random ( 15 ) )
                    {
                        case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location = m_From.Location;
                        skel.Map = m_From.Map;
                        skel.Combatant = m_From;

                            World.AddMobile( skel );
                        break;

                        case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location = m_From.Location;
                        ghoul.Map = m_From.Map;
                        ghoul.Combatant = m_From;

                            World.AddMobile( ghoul );
                        break;

                        case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location = m_From.Location;
                        wraith.Map = m_From.Map;
                        wraith.Combatant = m_From;

                            World.AddMobile( wraith );
                        break;

                        case 3:
                        Lich lich = new Lich();
                        lich.Location = m_From.Location;
                        lich.Map = m_From.Map;
                        lich.Combatant = m_From;

                            World.AddMobile( lich );
                        break;

                        case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location = m_From.Location;
                        lichl.Map = m_From.Map;
                        lichl.Combatant = m_From;

                            World.AddMobile( lichl );
                        break;

                        case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location = m_From.Location;
                        alich.Map = m_From.Map;
                        alich.Combatant = m_From;

                            World.AddMobile( alich );
                        break;

                        case 6:
                        Mummy mum = new Mummy();
                        mum.Location = m_From.Location;
                        mum.Map = m_From.Map;
                        mum.Combatant = m_From;

                            World.AddMobile( mum );
                        break;

                        case 7:
                        Zombie zom = new Zombie();
                        zom.Location = m_From.Location;
                        zom.Map = m_From.Map;
                        zom.Combatant = m_From;

                            World.AddMobile( zom );
                        break;

                        case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location = m_From.Location;
                        sk.Map = m_From.Map;
                        sk.Combatant = m_From;

                            World.AddMobile( sk );
                        break;

                        case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location = m_From.Location;
                        sm.Map = m_From.Map;
                        sm.Combatant = m_From;

                            World.AddMobile( sm );
                        break;

                        case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location = m_From.Location;
                        bk.Map = m_From.Map;
                        bk.Combatant = m_From;

                            World.AddMobile( bk );
                        break;

                        case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location = m_From.Location;
                        bm.Map = m_From.Map;
                        bm.Combatant = m_From;

                            World.AddMobile( bm );
                        break;

                        case 12:
                        Spectre spec = new Spectre();
                        spec.Location = m_From.Location;
                        spec.Map = m_From.Map;
                        spec.Combatant = m_From;

                            World.AddMobile( spec );
                        break;

                        case 13:
                        Shade shade = new Shade();
                        shade.Location = m_From.Location;
                        shade.Map = m_From.Map;
                        shade.Combatant = m_From;

                            World.AddMobile( shade );
                        break;
                    }
                    m_From.SendMessage( "The spirits have rose from the dead.." );
                }
                else if ( m_From.Skills[SkillName.Mining].Base < 15.0 )
                {
                    if ( Utility.Random( 100 ) < 85 )
                    {
                        m_From.SendMessage( "You fail to dig anything up." );
                    }
                    else
                    {
                        switch ( Utility.Random ( 3 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( gem );
                            m_From.SendMessage( "You dig up a gem." );
                            break;

                            case 1:
                            m_From.AddToBackpack( reg );
                            m_From.SendMessage( "You dig up a reagent." );
                            break;

                            case 2:
                            m_From.AddToBackpack( equip );
                            m_From.SendMessage( "You dig up some equipment." );
                            break;
                        }
                    }
                }
                else if ( m_From.Skills[SkillName.Mining].Base < 35.0 )
                {
                    if ( Utility.Random( 100 ) < 85 )
                    {
                        m_From.SendMessage( "You fail to dig anything up." );
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax( 2, 4 );
                        reg.Amount = Utility.RandomMinMax( 2, 4 );

                        switch ( Utility.Random ( 5 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( gem );
                            m_From.SendMessage( "You dig up some gems." );
                            break;

                            case 1:
                            m_From.AddToBackpack( reg );
                            m_From.SendMessage( "You dig up some reagents." );
                            break;

                            case 2:
                            m_From.AddToBackpack( equip );
                            m_From.SendMessage( "You dig up some equipment." );
                            break;

                            case 3:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 20, SpellbookType.Regular ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 4:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 5, SpellbookType.Necromancer ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;
                        }
                    }
                }
                else if ( m_From.Skills[SkillName.Mining].Base < 50.0 )
                {
                    if ( Utility.Random( 100 ) < 85 )
                    {
                        m_From.SendMessage( "You fail to dig anything up." );
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax( 2, 10 );
                        reg.Amount = Utility.RandomMinMax( 2, 10 );

                        switch ( Utility.Random ( 6 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( gem );
                            m_From.SendMessage( "You dig up some gems." );
                            break;

                            case 1:
                            m_From.AddToBackpack( reg );
                            m_From.SendMessage( "You dig up some reagents." );
                            break;

                            case 2:
                            m_From.AddToBackpack( equip );
                            m_From.SendMessage( "You dig up some equipment." );
                            break;

                            case 3:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 40, SpellbookType.Regular ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 4:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 10, SpellbookType.Regular ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 5:
                            m_From.AddToBackpack( new Bones() );
                            m_From.SendMessage( "You dig up a bones." );
                            break;
                        }
                    }
                }
                else if ( m_From.Skills[SkillName.Mining].Base < 75.0 )
                {
                    if ( Utility.Random( 100 ) < 85 )
                    {
                        m_From.SendMessage( "You fail to dig anything up." );
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax( 2, 20 );
                        reg.Amount = Utility.RandomMinMax( 2, 20 );

                        switch ( Utility.Random ( 7 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( gem );
                            m_From.SendMessage( "You dig up some gems." );
                            break;

                            case 1:
                            m_From.AddToBackpack( reg );
                            m_From.SendMessage( "You dig up some reagents." );
                            break;

                            case 2:
                            m_From.AddToBackpack( equip );
                            m_From.SendMessage( "You dig up some equipment." );
                            break;

                            case 3:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 50, SpellbookType.Regular ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 4:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 13, SpellbookType.Necromancer ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 5:
                            m_From.AddToBackpack( new Bones() );
                            m_From.SendMessage( "You dig up a bones." );
                            break;

                        }
                    }
                }
                else if ( m_From.Skills[SkillName.Mining].Base < 90.0 )
                {
                    if ( Utility.Random( 100 ) < 85 )
                    {
                        m_From.SendMessage( "You fail to dig anything up." );
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax( 10, 30 );
                        reg.Amount = Utility.RandomMinMax( 10, 30 );

                        switch ( Utility.Random ( 8 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( gem );
                            m_From.SendMessage( "You dig up some gems." );
                            break;

                            case 1:
                            m_From.AddToBackpack( reg );
                            m_From.SendMessage( "You dig up some reagents." );
                            break;

                            case 2:
                            m_From.AddToBackpack( equip );
                            m_From.SendMessage( "You dig up some equipment." );
                            break;

                            case 3:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 4:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 15, SpellbookType.Necromancer ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 5:
                            m_From.AddToBackpack( new Bones() );
                            m_From.SendMessage( "You dig up a bones." );
                            break;
                        }
                    }
                }
                else if ( m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if ( Utility.Random( 500 ) < 5 )
                    {
                        m_From.SendMessage( "You dig up and item of great value." );
                        switch ( Utility.Random ( 5 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( new ArmoredRobe() );
                            break;

                            case 1:
                            m_From.AddToBackpack( new ButchersResolve() );
                            break;

                            case 2:
                            m_From.AddToBackpack( new FollowerOfTheOldLord() );
                            break;

                            case 3:
                            m_From.AddToBackpack( new SkirtOfTheAmazon() );
                            break;

                            case 4:
                            m_From.AddToBackpack( new HolyHammerOfExorcism() );
                            break;
                        }
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax( 2, 40 );
                        reg.Amount = Utility.RandomMinMax( 2, 40 );

                        switch ( Utility.Random ( 8 ) )
                        {
                            case 0:
                            m_From.AddToBackpack( gem );
                            m_From.SendMessage( "You dig up some gems." );
                            break;

                            case 1:
                            m_From.AddToBackpack( reg );
                            m_From.SendMessage( "You dig up some reagents." );
                            break;

                            case 2:
                            m_From.AddToBackpack( equip );
                            m_From.SendMessage( "You dig up some equipment." );
                            break;

                            case 3:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 4:
                            m_From.AddToBackpack( Loot.RandomScroll( 0, 15, SpellbookType.Necromancer ) );
                            m_From.SendMessage( "You dig up a scroll." );
                            break;

                            case 5:
                            m_From.AddToBackpack( new Bones() );
                            m_From.SendMessage( "You dig up a bones." );
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage( "You fail to dig anything up." );
                }

                Stop();
            }
///////////////////////
		public void SpawnSkeleton( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int skeletons = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 30 ) )
			{
				if ( m is Skeleton )
					++skeletons;
			}

			if ( skeletons < 3 )
			{
				PlaySound( 0x3D );

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

				for ( int i = 0; i < newSkeletons; ++i )
				{
					BaseCreature skeleton;

					switch ( Utility.Random( 5 ) )
					{
						default:
						case 0: case 1:	skeleton = new Skeleton(); break;
						case 2: case 3:	skeleton = new Skeleton(); break;
						case 4:			skeleton = new Skeleton(); break;
					}

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

					skeleton.MoveToWorld( loc, map );
					skeleton.Combatant = target;
				}
			}
		}
////
		public void SpawnEvil( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int spawned = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 10 ) )
			{
if ( m is Skeleton || m is Executioner || m is EvilNecromancer )
					++spawned;
			}

			if ( spawned < 10 )
			{
				int newSpawned = Utility.RandomMinMax( 1, 6 );

				for ( int i = 0; i < newSpawned; ++i )
				{
					BaseCreature spawn;

					switch ( Utility.Random( 5 ) )
					{
						default:
						case 0: case 1:	spawn = new Skeleton(); break;
						case 2: case 3:	spawn = new Executioner(); break;
						case 4:			spawn = new EvilNecromancer(); break;
					}

					spawn.Team = this.Team;
					spawn.Map = map;

					bool validLocation = false;

					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 ) )
							spawn.Location = new Point3D( x, y, Z );
						else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
							spawn.Location = new Point3D( x, y, z );
					}

					if ( !validLocation )
						spawn.Location = this.Location;

					spawn.Combatant = target;
				}
			}
		}
Exemplo n.º 15
0
		public virtual void SpawnEnemies( RVS Handeling, String RegionName, int amount)
		{
			int numberOfEnemies = amount;
			int kindOfEnemy = 0;
			int randomEnemy = 0;
			Mobile Enemy = null;
			//Mobile Enemy = new Sheep();
			
			int randomValueX = 0;
			int randomValueY = 0;
			int negative = 0;
			
			Point3D spawn;
			Map spawnmap;
			
			if ( RegionName == "Sheep" )
			{
				spawn = SheepSpawnPoint;
				spawnmap = SheepSpawnMap;
				kindOfEnemy = 0;
			}
			else if ( RegionName == "Rabbit" )
			{
				spawn = RabbitSpawnPoint;
				spawnmap = RabbitSpawnMap;
				kindOfEnemy = 1;
			}
			else
			{
				spawn = SheepSpawnPoint;
				spawnmap = SheepSpawnMap;
				kindOfEnemy = 0;
			}
			
			for ( int i = 0; i < numberOfEnemies; i++ )
			{
				//kindOfEnemy = Utility.Random( 5 );
				
				randomValueX = Utility.Random( 11 );
				negative = Utility.Random( 2 );
				if ( negative > 0 )
					randomValueX *= -1;
					
				negative = Utility.Random( 2 );
				randomValueY = Utility.Random( 11 );
				if ( negative > 0 )
					randomValueY *= -1;
				
				if ( Handeling.RvS )
				{ 
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Sheep();
								break;
							}
						case 1:
							{
								Enemy = new Rabbit();
								break;
							}
					}
				}
				else if ( Handeling.Orcs )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
					
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Orc();
								break;
							}
						case 1:
							{
								Enemy = new OrcishLord();
								break;
							}
						case 2:
							{
								Enemy = new Ettin();
								break;
							}
						case 3:
							{
								Enemy = new OrcishMage();
								break;
							}
					}
				}
				else if ( Handeling.Lizardmen )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Snake();
								break;
							}
						case 1:
							{
								Enemy = new GiantSerpent();
								break;
							}
						case 2:
							{
								Enemy = new Lizardman();
								break;
							}
						case 3:
							{
								Enemy = new Drake();
								break;
							}
					}
				}
				else if ( Handeling.Ratmen )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 15 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Sewerrat();
								break;
							}
						case 1:
							{
								Enemy = new GiantRat();
								break;
							}
						case 2:
							{
								Enemy = new Ratman();
								break;
							}
						case 3:
							{
								Enemy = new RatmanMage();
								break;
							}	
						case 4:
							{
								Enemy = new RatmanArcher();
								break;
							}
					}
				}
				else if ( Handeling.Undead )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 50 )
						kindOfEnemy++;
					if ( randomEnemy <= 40 )
						kindOfEnemy++;
					if ( randomEnemy <= 30 )
						kindOfEnemy++;
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
						
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Skeleton();
								break;
							}
						case 1:
							{
								Enemy = new Zombie();
								break;
							}
						case 2:
							{
								Enemy = new RestlessSoul();
								break;
							}
						case 3:
							{
								Enemy = new SkeletalMage();
								break;
							}
						case 4:
							{
								Enemy = new SkeletalKnight();
								break;
							}
						case 5:
							{
								Enemy = new Mummy();
								break;
							}
						case 6:
							{
								Enemy = new Lich();
								break;
							}
					}
				}
				
				Enemy.Map = spawnmap;
				Enemy.Location = new Point3D((spawn.X + randomValueX), (spawn.Y + randomValueY), (spawn.Z));
				
				Enemies.Add(Enemy);
			}
		}
Exemplo n.º 16
0
        public void SummonUndead(Mobile target)
        {
            BaseCreature summon = null;

            switch (Utility.Random(11))
            {
                default:
                case 0:
                    summon = new Skeleton();
                    break;
                case 1:
                    summon = new Zombie();
                    break;
                case 2:
                    summon = new Wraith();
                    break;
                case 3:
                    summon = new Spectre();
                    break;
                case 4:
                    summon = new Ghoul();
                    break;
                case 5:
                    summon = new Mummy();
                    break;
                case 6:
                    summon = new Bogle();
                    break;
                case 7:
                    summon = new BoneKnight();
                    break;
                case 8:
                    summon = new SkeletalKnight();
                    break;
                case 9:
                    summon = new Lich();
                    break;
                case 10:
                    summon = new SkeletalMage();
                    break;
            }

            summon.Team = Team;
            summon.FightMode = FightMode.Closest;
            summon.MoveToWorld(target.Location, target.Map);
            Effects.SendLocationEffect(summon.Location, summon.Map, 0x3728, 10, 10, 0, 0);
            summon.Combatant = target;
            summon.PlaySound(summon.GetAttackSound());
        }
Exemplo n.º 17
0
		public void SpawnUndeads( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int undeads = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 10 ) )
			{
				if ( m is Skeleton || m is SkeletalMage || m is Zombie || m is BoneMagi || m is Ghoul || m is Wraith || m is Shade || m is Spectre )
					++undeads;
			}

			if ( undeads < 7 )
			{
				PlaySound( 586 );

				int newUndeads = Utility.RandomMinMax( 2, 5 );

				for ( int i = 0; i < newUndeads; ++i )
				{
					BaseCreature undead;

					switch ( Utility.Random( 16 ) )
					{
						default:
						case 0: case 1:	undead = new Skeleton(); break;
						case 2: case 3:	undead = new SkeletalMage(); break;
						case 4:	case 5:	undead = new BoneMagi(); break;
						case 6:	case 7:	undead = new Zombie(); break;
						case 8:	case 9:	undead = new Ghoul(); break;
						case 10: case 11: undead = new Wraith(); break;
						case 12: case 13: undead = new Shade(); break;
						case 14: case 15: undead = new Spectre(); break;
					}

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

					undead.MoveToWorld( loc, map );
					undead.Combatant = target;
				}
			}
		}
			protected override void OnTick() 
			{
				if ( m_Item != null )
					m_Item.IsDigging = false;
					
				if ( !m_From.Alive )
				{
					m_From.SendMessage( "You cannot continue digging in this state." );
					Stop();
				}
				else
				{
					if ( Utility.Random( 100 ) < 35 )
					{
						switch ( Utility.Random ( 10 ) )
						{
							case 0:
							Skeleton skel = new Skeleton();
							skel.Location = m_From.Location;
							skel.Map = m_From.Map;
							skel.Combatant = m_From;

							if ( Utility.Random( 100 ) < 50 )
								skel.IsParagon = true;

	        					World.AddMobile( skel );
							break;

							case 1:
							Ghoul ghoul = new Ghoul();
							ghoul.Location = m_From.Location;
							ghoul.Map = m_From.Map;
							ghoul.Combatant = m_From;

							if ( Utility.Random( 100 ) < 50 )
								ghoul.IsParagon = true;
	
	        					World.AddMobile( ghoul );
							break;

							case 2:
							Lich lich = new Lich();
							lich.Location = m_From.Location;
							lich.Map = m_From.Map;
							lich.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								lich.IsParagon = true;

	        					World.AddMobile( lich );
							break;

							case 3:
							LichLord lichl = new LichLord();
							lichl.Location = m_From.Location;
							lichl.Map = m_From.Map;
							lichl.Combatant = m_From;

							if ( Utility.Random( 100 ) < 50 )
								lichl.IsParagon = true;
	
	        					World.AddMobile( lichl );
							break;
	
							case 4:
							AncientLich alich = new AncientLich();
							alich.Location = m_From.Location;
							alich.Map = m_From.Map;
							alich.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								alich.IsParagon = true;
	
	        					World.AddMobile( alich );
							break;
	
							case 5:
							Zombie zom = new Zombie();
							zom.Location = m_From.Location;
							zom.Map = m_From.Map;
							zom.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								zom.IsParagon = true;
	
	        					World.AddMobile( zom );
							break;
	
							case 6:
							SkeletalKnight sk = new SkeletalKnight();
							sk.Location = m_From.Location;
							sk.Map = m_From.Map;
							sk.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								sk.IsParagon = true;
	
	        					World.AddMobile( sk );
							break;

							case 7:
							SkeletalMage sm = new SkeletalMage();
							sm.Location = m_From.Location;
							sm.Map = m_From.Map;
							sm.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								sm.IsParagon = true;
	
	        					World.AddMobile( sm );
							break;
	
							case 8:
							Spectre spec = new Spectre();
							spec.Location = m_From.Location;
							spec.Map = m_From.Map;
							spec.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								spec.IsParagon = true;

	        					World.AddMobile( spec );
							break;
	
							case 9:
							Shade shade = new Shade();
							shade.Location = m_From.Location;
							shade.Map = m_From.Map;
							shade.Combatant = m_From;
	
							if ( Utility.Random( 100 ) < 50 )
								shade.IsParagon = true;
	
	        					World.AddMobile( shade );
							break;
						}
						m_From.SendMessage( "You have angered the spirits." );
					}
					else if ( m_From.Skills[SkillName.Mining].Base > 10 )
					{
						if ( Utility.Random( 120 ) >= (m_From.Skills[SkillName.Mining].Base) )
						{
							m_From.SendMessage( "You fail to dig anything up." );
						}
						else
						{
							m_From.SendMessage( "You dig up the hideous remains of the demon.  Unfortunately your shovel breaks in the process." );
							m_From.AddToBackpack( new PumpkinheadRemains() );
							m_Item.Delete();
							
						}
					}
					else if ( m_From.Skills[SkillName.Mining].Base <= 10 )
					{
						if ( Utility.Random( 120 ) > 10 )
						{
							m_From.SendMessage( "You fail to dig anything up." );
						}
						else
						{
							m_From.SendMessage( "You dig up the hideous remains of the demon.  Unfortunately your shovel breaks in the process." );
							m_From.AddToBackpack( new PumpkinheadRemains() );
							m_Item.Delete();
							
						}
					}
					else
					{
						m_From.SendMessage( "You fail to dig anything up." );
					}
		
					Stop();
				}
			}
Exemplo n.º 19
0
        public override void OnDoubleClick( Mobile from )
        {
            if( !from.Alive || from.Paralyzed || !from.InRange( this, 2 ) || !from.InLOS( this ) )
            {
                from.SendMessage( "That is too far away." );
                return;
            }

            if( this.CoffinSlave == null && from.AccessLevel > AccessLevel.Player )
            {
                from.SendMessage( "Creating a slave for the coffin." );
                DiabloDungeonCoffinSlave slave = new DiabloDungeonCoffinSlave();
                slave.Map = this.Map;
                slave.Location = new Point3D( this.X - 1, this.Y, this.Z );
                this.CoffinSlave = slave;
                slave.CoffinMaster = this;
                return;
            }

            if( this.CanBeOpened )
            {
                this.m_LastTimeOpened = DateTime.Now;

                int chance = Utility.RandomMinMax( 1, 100 );

                if( chance > 70 )
                {
                    from.SendMessage( "You have found some copper coins inside the coffin!" );
                    chance = Utility.RandomMinMax( 3, 6 );
                    Copper copper = new Copper( chance );
                    Container pack = from.Backpack;
                    pack.DropItem( copper );
                }

                else
                {
                    from.SendMessage( "You have disturbed the undead!" );

                    BaseCreature skeleton = new Skeleton() as BaseCreature;

                    if( chance < 20 )
                        skeleton = new SkeletalSoldier() as BaseCreature;

                    skeleton.FightMode = FightMode.Closest;

                    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 = this.Map.GetAverageZ( x, y );

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

                    skeleton.MoveToWorld( loc, this.Map );
                    skeleton.Combatant = from;
                    skeleton.VanishTime = DateTime.Now + TimeSpan.FromHours( 1 );
                    skeleton.VanishEmote = "*crumbles into dust*";
                    skeleton.PlaySound( 1169 );
                }
            }

            else
                from.SendMessage( "The coffin appears to be empty." );
        }
Exemplo n.º 20
0
        public void SummonUndead(Mobile target)
        {
            Point3D[] locs = new Point3D[4];

            locs[0] = Location;

            for (int i = 1; i < 4; i++)
            {
                bool validLocation = false;

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

                    if (validLocation = this.Map.CanFit(x, y, this.Z, 16, false, false))
                        locs[i] = new Point3D(x, y, Z);
                    else if (validLocation = this.Map.CanFit(x, y, z, 16, false, false))
                        locs[i] = new Point3D(x, y, z);
                }
            }

            bool movelich = false;

            for (int i = 0; i < 4; i++)
            {
                BaseCreature summon = null;

                if (!movelich && (Utility.Random(4) == 0 || i == 3))
                {
                    summon = this;
                    BodyMod = Utility.RandomList(50, 56, 57, 3, 26, 148, 147, 153, 154, 24, 35, 36);
                    HueMod = 0;
                    movelich = true;
                }
                else
                {
                    switch (Utility.Random(12))
                    {
                        default:
                        case 0: summon = new Skeleton(); break;
                        case 1: summon = new Zombie(); break;
                        case 2: summon = new Wraith(); break;
                        case 3: summon = new Spectre(); break;
                        case 4: summon = new Ghoul(); break;
                        case 5: summon = new Mummy(); break;
                        case 6: summon = new Bogle(); break;
                        case 7: summon = new BoneKnight(); break;
                        case 8: summon = new SkeletalKnight(); break;
                        case 9: summon = new Lich(); break;
                        case 10: summon = new Lizardman(); break;
                        case 11: summon = new SkeletalMage(); break;
                    }

                    summon.Team = this.Team;
                    summon.FightMode = FightMode.Closest;
                }

                summon.MoveToWorld(locs[i], Map);
                Effects.SendLocationEffect(summon.Location, summon.Map, 0x3728, 10, 10, 0, 0);
                summon.PlaySound(0x48F);
                summon.PlaySound(summon.GetAttackSound());
                summon.Combatant = target;
            }
        }
Exemplo n.º 21
0
        private void SpawnMinions()
        {
            if ( CountAliveMinions() != 0 )
                return;

            m_Minions.Clear();

            Map map = this.Map;

            if ( map == null )
                return;

            int type = Utility.Random( 2 );

            BaseMobileHelper.ShowMorphEffect( this );

            switch ( type )
            {
                default:
                case 0:
                    BodyMod = Utility.RandomList( 50, 56 );
                    break;
                case 1:
                    BodyMod = 3;
                    break;
            }

            int minions = Utility.RandomMinMax( 5, 8 );

            for ( int i = 0; i < minions; ++i )
            {
                BaseCreature minion;

                switch ( type )
                {
                    default:
                    case 0:
                        minion = new Skeleton();
                        break;
                    case 1:
                        minion = new Zombie();
                        break;
                }

                minion.Team = this.Team;

                bool validLocation = false;

                Point3D loc = this.Location;

                for ( int j = 0; !validLocation && j < 5; ++j )
                {
                    int x = X + Utility.Random( 8 ) - 4;
                    int y = Y + Utility.Random( 8 ) - 4;
                    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 );
                }

                minion.MoveToWorld( loc, map );
                minion.Combatant = Combatant;

                m_Minions.Add( minion );
            }

            m_NextReturnTime = DateTime.Now + TimeSpan.FromSeconds( m_ReturnTime );
        }
Exemplo n.º 22
0
        ////25JUL2008 Lord_Greywolf fix for bad X *** END   ***

        protected virtual void SpawnGenerate(Point2D p, Map map)
        {
            BaseCreature spawn;

            switch (Utility.Random(4))
            {
                default:
                case 0: spawn = new Lich(); break;
                case 1: spawn = new Skeleton(); break;
                case 2: spawn = new Mongbat(); break;
                case 3: spawn = new Troll(); break;
            }

            Spawn(p, map, spawn);

            Delete();
        }
Exemplo n.º 23
0
        public override void OnClick()
        {
            Race race = ((Player)pm).Race;

            switch (race)
            {
                case Race.Ogre:
                    {
                        pm.Target = new OgreTarget();
                        pm.SendMessage("Target a creature to bash!");
                        break;
                    }

                case Race.Terathan:
                    {
                        mobList = new List<Mobile>();

                        foreach (Mobile mobile in pm.GetMobilesInRange(8))
                        {
                            if (mobile.AccessLevel > pm.AccessLevel)
                                continue;
                            else if (mobile.Blessed || !mobile.Alive)
                                continue;
                            else if (mobile == pm)
                                continue;
                            else
                                mobList.Add(mobile);
                        }

                        if (mobList != null)
                        {
                            Timer.DelayCall(TimeSpan.FromSeconds(8.0), new TimerCallback(FinishWebs));

                            pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, "*Begins hurling webs at nearby creatures*");

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

                                if (m is PlayerMobile && 0.51 > Utility.RandomDouble())
                                {
                                    m.SendMessage("You've been struck by a terathan web!");
                                }

                                m.CantWalk = true;

                                Effects.SendMovingEffect(pm, m, 4308, 0, 10, false, false);
                            }

                            Effects.PlaySound(pm.Location, pm.Map, 0x027);

                            pm.NextRaceAbility = TimeSpan.FromMinutes(1);

                        }

                        break;
                    }
                case Race.Liche:
                    {
                        if (pm.Followers >= pm.FollowersMax)
                        {
                            pm.SendMessage("You already have too many followers to summon more.");
                        }

                        else
                        {
                            do
                            {
                                BaseCreature bc = null;

                                switch (Utility.Random(3))
                                {
                                    case 0: bc = new Skeleton(); break;
                                    case 1: bc = new Zombie(); break;
                                    case 2: bc = new Wraith(); break;
                                }

                                if (bc != null && BaseCreature.Summon(bc, true, pm, Point3D.Zero, 0x1E2, TimeSpan.FromMinutes(1.5)))
                                {
                                    bc.MoveToWorld(new Point3D(pm.X + Utility.RandomMinMax(1, 3), pm.Y - Utility.RandomMinMax(0, 3), pm.Z), pm.Map);

                                    Effects.SendLocationEffect(pm.Location, pm.Map, 0x3709, 15, 945, 0);
                                }

                            }

                            while (pm.Followers < pm.FollowersMax);

                            pm.NextRaceAbility = TimeSpan.FromMinutes(2.0);
                        }
                        break;
                    }

                case Race.HalfDaemon:
                    {
                        if (pm.AbilityActive)
                        {
                            pm.RaceBody = 0;
                            pm.BodyDamageBonus = 0;
                            pm.AdjustBody();

                            pm.Str -= 40;
                            pm.Dex -= 20;
                            pm.Int += 60;

                            pm.AbilityActive = false;

                            pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, String.Format("*{0} begins to shrink, taking the form of a human*", pm.Name));

                        }

                        else
                        {
                            for (int x = 1; x <= 2; x++)
                            {
                                Item toDisarm = pm.FindItemOnLayer(Layer.OneHanded);

                                if (toDisarm == null || !toDisarm.Movable)
                                    toDisarm = pm.FindItemOnLayer(Layer.TwoHanded);

                                Container pack = pm.Backpack;
                                pack.DropItem(toDisarm);
                            }

                            pm.RaceBody = 792;
                            pm.AdjustBody();
                            pm.BodyDamageBonus = 36;

                            pm.Str += 40;
                            pm.Dex += 20;
                            pm.Int -= 60;

                            pm.AbilityActive = true;

                            pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, String.Format("*{0}'s flesh begins to buldge and tear as something emerges from within*", pm.Name));

                        }

                        break;
                    }

                case Race.Shapeshifter:
                    {
                        pm.Target = new ShapeshifterTarget();
                        pm.SendMessage("Select a creature to assume their form.");
                        break;
                    }

                case Race.Marid:
                    {
                        if (pm.AbilityActive)
                        {
                            pm.AbilityActive = false;
                            pm.CanSwim = false;
                            Effects.SendLocationParticles(EffectItem.Create(pm.Location, pm.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);

                            try
                            {
                                IMount mount = pm.Mount;
                                mount.Rider = null;
                                ((EtherealMount)mount).Delete();
                            }

                            catch { }
                        }

                        else
                        {
                            for (int x = 1; x <= 2; x++)
                            {
                                Item toDisarm = pm.FindItemOnLayer(Layer.OneHanded);

                                if (toDisarm == null || !toDisarm.Movable)
                                    toDisarm = pm.FindItemOnLayer(Layer.TwoHanded);

                                Container pack = pm.Backpack;
                                pack.DropItem(toDisarm);
                            }

                            pm.AbilityActive = true;
                            pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, String.Format("*A mass of vapors condenses under {0}, forming a steed*", pm.Name));
                            pm.CanSwim = true;

                            bool isWater = false;

                            Map map = pm.Map;
                            LandTile land = map.Tiles.GetLandTile(pm.X, pm.Y);
                            StaticTile[] tiles = map.Tiles.GetStaticTiles(pm.X, pm.Y);

                            isWater = (land.Z == pm.Z && ((land.ID >= 168 && land.ID <= 171) || (land.ID >= 310 && land.ID <= 311)));

                            for (int i = 0; i < tiles.Length; ++i)
                            {
                                StaticTile tile = tiles[i];
                                isWater = (tile.ID >= 0x1796 && tile.ID <= 0x17B2);
                            }

                            try
                            {
                                if (isWater)
                                {
                                    EtherealMount seaHorse = new EtherealSeaHorse();
                                    seaHorse.MoveToWorld(pm.Location);
                                    seaHorse.Rider = pm;
                                }

                                else
                                {
                                    EtherealMount horse = new EtherealHorse();
                                    horse.MoveToWorld(pm.Location);
                                    horse.Rider = pm;
                                }
                            }

                            catch { }
                        }

                        break;
                    }

                default: break;
            }
        }
Exemplo n.º 24
0
        public void SummonUndead( Mobile target )
        {
            Point3D[] locs = new Point3D[4];

            locs[0] = Location;

            for ( int i = 1; i < 4; i++ )
            {
                bool validLocation = false;

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

                    if ( validLocation = this.Map.CanFit( x, y, this.Z, 16, false, false ) )
                        locs[i] = new Point3D( x, y, Z );
                    else if ( validLocation = this.Map.CanFit( x, y, z, 16, false, false ) )
                        locs[i] = new Point3D( x, y, z );
                }
            }

            bool movelich = false;

            for ( int i = 0;i < 4; i++ )
            {
                BaseCreature summon = null;

                if ( !movelich && ( Utility.Random( 4 ) == 0 || i == 3 ) )
                {
                    summon = this;
                    BodyMod = Utility.RandomList( 50, 56 );
                    HueMod = 0;
                    movelich = true;
                }
                else
                {
                    summon = new Skeleton();
                    summon.Team = this.Team;
                    summon.FightMode = FightMode.Closest;
                }

                summon.MoveToWorld( locs[i], Map );
                Effects.SendLocationEffect( summon.Location, summon.Map, 0x3728, 10, 10, 0, 0 );
                summon.PlaySound( 0x48F );
                summon.PlaySound( summon.GetAttackSound() );
                summon.Combatant = target;
            }
        }
Exemplo n.º 25
0
        public void DamageEffect(Mobile from)
        {
            if (Deleted || !Alive)
            {
                return;
            }
            if (from == null)
            {
                return;
            }
            if (from.Deleted || !from.Alive)
            {
                return;
            }

            if (AbilityInProgress)
            {
                return;
            }

            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            Mobile  mobile   = from;
            Point3D location = Location;
            Map     map      = Map;

            int effectHue = Hue - 1;

            if (InLOS(mobile) && GetDistanceToSqrt(mobile) <= 16)
            {
                Animate(4, 4, 1, true, false, 0);

                double stationaryDelay = 2;

                Combatant        = null;
                NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay);

                AIObject.NextMove              = AIObject.NextMove + TimeSpan.FromSeconds(stationaryDelay);
                LastSwingTime                  = LastSwingTime + TimeSpan.FromSeconds(stationaryDelay);
                NextSpellTime                  = NextSpellTime + TimeSpan.FromSeconds(stationaryDelay);
                NextCombatHealActionAllowed    = NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDelay);
                NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDelay);
                NextCombatEpicActionAllowed    = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDelay);

                SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, stationaryDelay, true, 0, false, "", "", "-1");

                IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 8), map);

                Animate(15, 8, 1, true, false, 0); //Staff

                Effects.PlaySound(mobile.Location, mobile.Map, 0x64C);

                Direction direction = Utility.GetDirection(location, mobile.Location);
                int       windId    = GetWindItemId(direction, true);

                MovingEffect(mobile, windId, 5, 1, false, false, effectHue, 0);

                double distance         = Utility.GetDistanceToSqrt(location, mobile.Location);
                double destinationDelay = (double)distance * .08;

                Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                {
                    if (Deleted || !Alive)
                    {
                        return;
                    }
                    if (mobile == null)
                    {
                        return;
                    }
                    if (mobile.Deleted || !mobile.Alive)
                    {
                        return;
                    }

                    Point3D mobileLocation = mobile.Location;

                    int damage = DamageMin;

                    if (mobile is BaseCreature)
                    {
                        damage = (int)((double)damage * 2);
                    }

                    int knockbackDistance = 4 + (int)(Math.Ceiling(8 * spawnPercent));

                    SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobile, damage, knockbackDistance, -1, "", "You are knocked back!");

                    Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                    {
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        int particleSpeed = 5;

                        IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 3), Map);
                        IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(mobileLocation.X, mobileLocation.Y, mobileLocation.Z + 3), map);

                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3728, particleSpeed, 0, false, false, 0, 0);

                        double newDistance         = Utility.GetDistanceToSqrt(Location, mobileLocation);
                        double newDestinationDelay = (double)newDistance * .08;

                        Timer.DelayCall(TimeSpan.FromSeconds(newDestinationDelay), delegate
                        {
                            if (Deleted || !Alive)
                            {
                                return;
                            }

                            Effects.PlaySound(mobileLocation, map, 0x653);

                            Effects.SendLocationParticles(effectEndLocation, 0x3709, 10, 20, effectHue, 0, 5029, 0);
                            Effects.SendLocationParticles(effectEndLocation, 0x3779, 10, 60, effectHue, 0, 5029, 0);
                            Effects.SendLocationParticles(effectEndLocation, 0x3996, 10, 60, effectHue, 0, 5029, 0);

                            Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                            {
                                if (Deleted || !Alive)
                                {
                                    return;
                                }

                                BaseCreature monsterToSpawn = null;

                                int maxCreatureValue = 1 + (int)(Math.Ceiling(10 * spawnPercent));

                                if (maxCreatureValue > 10)
                                {
                                    maxCreatureValue = 10;
                                }

                                switch (Utility.RandomMinMax(1, maxCreatureValue))
                                {
                                case 1: monsterToSpawn = new Zombie(); break;

                                case 2: monsterToSpawn = new Skeleton(); break;

                                case 3: monsterToSpawn = new Ghoul(); break;

                                case 4: monsterToSpawn = new PatchworkSkeleton(); break;

                                case 5: monsterToSpawn = new ZombieMagi(); break;

                                case 6: monsterToSpawn = new SkeletalMage(); break;

                                case 7: monsterToSpawn = new SkeletalKnight(); break;

                                case 8: monsterToSpawn = new Mummy(); break;

                                case 9: monsterToSpawn = new SkeletalDrake(); break;

                                case 10: monsterToSpawn = new RottingCorpse(); break;
                                }

                                if (monsterToSpawn != null)
                                {
                                    monsterToSpawn.EventMinion = true;
                                    monsterToSpawn.MoveToWorld(mobileLocation, map);

                                    m_Creatures.Add(monsterToSpawn);
                                }
                            });
                        });
                    });
                });
            }
        }