Esempio n. 1
0
        public virtual void DoDamage(Item g, int mindmg, int maxdmg)
        {
            if (g == null || g.Deleted)
            {
                return;
            }

            IPooledEnumerable eable = g.GetMobilesInRange(4);

            foreach (Mobile m in eable)
            {
                if (m != null)
                {
                    if (m.Alive && m is PlayerMobile && m.AccessLevel == AccessLevel.Player)
                    {
                        m.DoHarmful(m);
                        m.Damage(Utility.RandomMinMax(mindmg, maxdmg), m);
                        m.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1154446); // *Poisonous gas escapes from the ruptured barrel enveloping you in a noxious cloud!*
                        m.ApplyPoison(m, Poison.Deadly);
                        m.PlaySound(0x474);
                    }
                }
            }

            eable.Free();
            g.Delete();
        }
Esempio n. 2
0
            protected override void OnTick()
            {
                foreach (Mobile m in m_Item.GetMobilesInRange(5))
                {
                    if (Utility.RandomBool())
                    {
                        continue;
                    }

                    if (m is Hunter)
                    {
                        switch (Utility.Random(3))
                        {
                        case 2: m.Say(true, "The rabbits must go!"); break;

                        case 1: m.Say(true, "Who does Burian think he is?! Hunting is the only way to solve this."); break;

                        case 0: m.Say(true, "I've seen the easter bunny once. Almost got him in my trap!"); break;
                        }
                    }
                    break;
                }
                //new InternalTimer(m_Item, TimeSpan.Zero, TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10))).Start();
                //Stop();
            }
Esempio n. 3
0
 protected override void OnTick()
 {
     if (t_Item.Parent != null)              //not on the ground
     {
         return;
     }
     foreach (Mobile mob in t_Item.GetMobilesInRange(0))
     {
         if (Utility.RandomDouble() < ((double)mob.BAC / 300) && mob.BAC > 0)
         {
             Map m = t_Item.Map;
             int x = t_Item.X + Utility.RandomMinMax(-1, 1);
             int y = t_Item.Y + Utility.RandomMinMax(-1, 1);
             int z = t_Item.Z;
             if (!m.CanFit(x, y, z, 16, false, true, true))
             {
                 z = m.GetAverageZ(x, y);
                 if (z == t_Item.Z || !m.CanFit(x, y, z, 16, false, true, true))
                 {
                     continue;
                 }
             }
             Item trash = new SelfDestructiveBarTrash(mob);
             trash.MoveToWorld(new Point3D(x, y, z), m);
         }
     }
 }
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Map map = m_Item.Map;

                if (map == null)
                {
                    return;
                }

                ArrayList list = new ArrayList();

                foreach (Mobile mob in m_Item.GetMobilesInRange(2))
                {
                    if (mob == null || mob.Deleted || mob.Map != map || !mob.InRange(m_Item, 2) || !mob.Alive || mob.IsDeadBondedPet)
                    {
                        continue;
                    }

                    if (mob is BaseCreature && (((BaseCreature)mob).Controlled || ((BaseCreature)mob).Summoned))
                    {
                        list.Add(mob);
                    }
                    else if (mob.Player)
                    {
                        list.Add(mob);
                    }
                }

                Effects.SendLocationParticles(EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
                Effects.PlaySound(m_Item.Location, m_Item.Map, 0x307);

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

                    AOS.Damage(mob, mob, Utility.RandomMinMax(15, 20), 0, 100, 0, 0, 0);

                    if (mob.Alive && mob.Body.IsHuman && !mob.Mounted)
                    {
                        mob.Animate(20, 7, 1, true, false, 0);                           // take hit
                    }
                    //Effects.PlaySound(loc, map, 0x207);
                    //Effects.SendLocationEffect(loc, map, 0x36BD, 20);
                }

                m_Item.Delete();
            }
Esempio n. 5
0
            protected override void OnTick()
            {
                if (m_FireRing.Deleted)
                {
                    return;
                }

                if (DateTime.Now > m_Duration)
                {
                    Stop();
                }
                else
                {
                    Map map = m_FireRing.Map;

                    if (map != null)
                    {
                        foreach (Mobile m in m_FireRing.GetMobilesInRange(1))
                        {
                            if ((m.Z + 16) > m_FireRing.Z && (m_FireRing.Z + 12) > m.Z)
                            {
                                m_Queue.Enqueue(m);
                            }
                        }

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

                            if (m_FireRing.Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                            {
                                m_Caster.DoHarmful(m);

                                int damage = Utility.Random(1, 2);

                                if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
                                {
                                    damage = Utility.Random(1);

                                    m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                                }

                                AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
                                m.PlaySound(0x1DD);
                                m.SendLocalizedMessage(503000);
                            }
                        }
                    }
                }
            }
Esempio n. 6
0
        public virtual void DoDamage(Item g, int mindmg, int maxdmg)
        {
            foreach (Mobile m in g.GetMobilesInRange(4))
            {
                if (m != null)
                {
                    if (m.Alive && m is PlayerMobile && m.AccessLevel == AccessLevel.Player)
                    {
                        m.DoHarmful(m);
                        m.FixedParticles(0x376A, 1, 3, 5052, EffectLayer.Waist);
                        m.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1154447); // *The barrel explodes sending deadly debris hurdling in your direction!*
                        m.Damage(Utility.RandomMinMax(mindmg, maxdmg), m);
                        Effects.PlaySound(g, g.Map, 0x307);
                    }
                }
            }

            n_SourceItem.Delete();
        }
Esempio n. 7
0
        public static void Cleanup(Item spot)
        {
            ArrayList clean = new ArrayList();

            foreach (Item item in spot.GetItemsInRange(0))
            {
                if (!(item is WorkingSpots) && item.Location == spot.Location)
                {
                    clean.Add(item);
                }
            }
            foreach (Mobile mobile in spot.GetMobilesInRange(0))
            {
                if (mobile.Location == spot.Location && (
                        mobile is SpellCritter ||
                        mobile is TradesmanAlchemist ||
                        mobile is TradesmanLeather ||
                        mobile is TradesmanLogger ||
                        mobile is TradesmanLumber ||
                        mobile is TradesmanMiner ||
                        mobile is TradesmanSmelter ||
                        mobile is TradesmanSmith ||
                        mobile is TrainingBow ||
                        mobile is TrainingFishing ||
                        mobile is TrainingMagery ||
                        mobile is TrainingSingle ||
                        mobile is Warriors))
                {
                    clean.Add(mobile);
                }
            }
            for (int i = 0; i < clean.Count; ++i)
            {
                if (clean[i] is Item)
                {
                    ((Item)clean[i]).Delete();
                }
                else if (clean[i] is Mobile)
                {
                    ((Mobile)clean[i]).Delete();
                }
            }
        }
Esempio n. 8
0
        public static void DoDamage(Item g, int mindmg, int maxdmg)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in g.GetMobilesInRange(2))
            {
                if (!m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is Server.Mobiles.BaseCreature && (((Server.Mobiles.BaseCreature)m).Controlled || ((Server.Mobiles.BaseCreature)m).Summoned))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);

                m.FixedParticles(0x36BD, 50, 50, 5052, EffectLayer.Waist);

                int toStrike = Utility.RandomMinMax(mindmg, maxdmg);

                m.Damage(toStrike, m);

                if (0.8 >= Utility.RandomDouble())
                {
                    m.SendMessage("You are caught in the powerful blast!");
                }
            }
        }