Disturb() public méthode

public Disturb ( DisturbType type ) : void
type DisturbType
Résultat void
Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile && m_spell.CheckHSequence((Mobile)targeted))
                {
                    Mobile targ = (Mobile)targeted;

                    SpellHelper.Turn(m_spell.Caster, targ);

                    Spell.Disturb(targ);

                    SpellHelper.CheckReflect((int)m_spell.Circle, m_spell.Caster, ref targ);

                    DateTime endtime = DateTime.Now + TimeSpan.FromSeconds(0);

                    Timer t = new EtouffementsSpell.InternalTimer(targ, endtime);

                    EtouffementsSpell.m_Timers[targ] = t;

                    t.Start();

                    Effects.SendTargetParticles(targ, 14276, 9, 32, 5007, EffectLayer.Waist);
                    targ.PlaySound(534);
                }

                m_spell.FinishSequence();
            }
Exemple #2
0
            protected override void OnTick()
            {
                if (DateTime.Now >= ending)
                {
                    Stop();
                }
                else if (!m_caster.Alive)
                {
                    Stop();
                }
                else
                {
                    if (loc is Item)
                    {
                        loc = ((Item)loc).GetWorldLocation();
                    }

                    ArrayList targets = new ArrayList();

                    Map map = m_caster.Map;

                    if (map != null)
                    {
                        IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(loc), (int)SpellHelper.AdjustValue(m_caster, 1 + m_caster.Skills[SkillName.Evocation].Base / 25, true));

                        foreach (Mobile m in eable)
                        {
                            if (m_caster != m && SpellHelper.ValidIndirectTarget(m_caster, m, true) && m_caster.CanBeHarmful(m, false) && m_caster.InLOS(m) && !(m_caster.Party == m.Party))
                            {
                                targets.Add(m);
                            }
                        }

                        eable.Free();
                    }

                    if (targets.Count > 0)
                    {
                        m_caster.PlaySound(0x29);

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

                            double chance = 60;

                            if (chance > Utility.Random(0, 100))
                            {
                                Spell.Disturb(m);

                                m_caster.DoHarmful(m);
                                AOS.Damage(m, m_caster, (int)s_damage, 0, 0, 0, 0, 100);

                                Effects.SendBoltEffect(m, true, 0);
                            }
                        }
                    }
                }
            }