Пример #1
0
        public void Explode(Mobile from, bool direct, Point3D loc, Map map)
        {
            if (Deleted)
            {
                return;
            }

            Consume();

            for (int i = 0; m_Users != null && i < m_Users.Count; ++i)
            {
                Mobile      m    = (Mobile)m_Users[i];
                ThrowTarget targ = m.Target as ThrowTarget;

                if (targ != null && targ.Potion == this)
                {
                    Target.Cancel(m);
                }
            }

            if (map == null)
            {
                return;
            }

            Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
            Effects.PlaySound(loc, map, 0x229);

            IPooledEnumerable eable     = LeveledExplosion ? map.GetObjectsInRange(loc, ExplosionRange) : map.GetMobilesInRange(loc, ExplosionRange);
            ArrayList         toExplode = new ArrayList();

            int toDamage = 0;

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
                    toExplode.Add(o);
                    ++toDamage;
                }
                else if (o is BasePoisonExplosionPotion && o != this)
                {
                    toExplode.Add(o);
                }
            }

            eable.Free();

            for (int i = 0; i < toExplode.Count; ++i)
            {
                object o = toExplode[i];

                if (o is Mobile)
                {
                    Mobile m = (Mobile)o;

                    if (from == null || (SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false)))
                    {
                        if (from != null)
                        {
                            from.DoHarmful(m);
                        }

                        int level = 0;
                        if (this.PotionEffect == PotionEffect.ExplosionLesser)
                        {
                            level = 1;
                        }
                        else if (this.PotionEffect == PotionEffect.Explosion)
                        {
                            level = 2;
                        }
                        else if (this.PotionEffect == PotionEffect.ExplosionGreater)
                        {
                            level = 3;
                        }

                        m.ApplyPoison(from, Poison.GetPoison(level));
                    }
                }
                else if (o is BasePoisonExplosionPotion)
                {
                    BasePoisonExplosionPotion pot = (BasePoisonExplosionPotion)o;

                    pot.Explode(from, false, pot.GetWorldLocation(), pot.Map);
                }
            }
        }
			public ThrowTarget( BasePoisonExplosionPotion potion ) : base( 12, true, TargetFlags.None )
			{
				m_Potion = potion;
			}
Пример #3
0
 public ThrowTarget(BasePoisonExplosionPotion potion) : base(12, true, TargetFlags.None)
 {
     m_Potion = potion;
 }