Beispiel #1
0
        public void DoSpecialAbility()
        {
            // build target list
            List <Mobile> mlist = new List <Mobile>();

            foreach (Mobile mob in Map.GetMobilesInRange(Location, RangePerception))
            {
                if (null != mob && !mob.Deleted && !mob.Paralyzed && AccessLevel.Player == mob.AccessLevel)
                {
                    mlist.Add(mob);
                }
            }

            // pick a random target and sling the web
            if (0 != mlist.Count)
            {
                int    i = Utility.Random(mlist.Count);
                Mobile m = mlist.ToArray()[i];
                Direction = GetDirectionTo(m);
                Item web = new NavreyParalyzingWeb();
                if (Utility.RandomDouble() > 0.1)
                {
                    m.Paralyze(TimeSpan.FromSeconds(15));
                }
                web.MoveToWorld(m.Location, Map);
            }
        }
Beispiel #2
0
        public void DoSpecialAbility()
        {
            // build target list
            List <Mobile> mlist = new List <Mobile>();

            IPooledEnumerable eable = this.GetMobilesInRange(12);

            foreach (Mobile mob in eable)
            {
                if (mob == null || mob == this || !mob.Alive || mob.Hidden || !CanSee(mob) || !CanBeHarmful(mob) || mob.AccessLevel > AccessLevel.Player)
                {
                    continue;
                }

                if (m_Table.ContainsKey(mob))
                {
                    continue;
                }

                if (mob.Player)
                {
                    mlist.Add(mob);
                }

                else if (mob is BaseCreature && (((BaseCreature)mob).Summoned || ((BaseCreature)mob).Controlled))
                {
                    mlist.Add(mob);
                }
            }
            eable.Free();

            // pick a random target and sling the web
            if (mlist.Count > 0)
            {
                Mobile m = mlist[Utility.Random(mlist.Count)];

                Direction = GetDirectionTo(m);
                TimeSpan duration = TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10));

                Item web = new NavreyParalyzingWeb(duration, m);

                Effects.SendMovingParticles(this, m, web.ItemID, 12, 0, false, false, 0, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(ThrowWeb_Callback), new object[] { web, m, duration });

                Combatant  = m;
                m_Table[m] = web as NavreyParalyzingWeb;
            }
        }