Exemplo n.º 1
0
                protected override void OnTarget(Mobile from, object targ)
                {
                    if (targ is IPoint2D point2D)
                    {
                        Point2D p = new Point2D(point2D);

                        if (!m_Snake.InRange(p, 10))
                        {
                            from.SendLocalizedMessage(500643); // Target is too far away.
                        }
                        else
                        {
                            m_Snake.BeginCharm(from, p);

                            from.SendLocalizedMessage(502479); // The animal walks where it was instructed to.

                            from.BeginAction(typeof(SnakeCharmerFlute));

                            Timer.DelayCall(TimeSpan.FromSeconds(5.0), delegate { from.EndAction(typeof(SnakeCharmerFlute)); });

                            m_Flute.PlayInstrumentWell(from);
                            m_Flute.UsesRemaining--;

                            if (m_Flute.UsesRemaining == 0)
                            {
                                from.SendLocalizedMessage(1112177); // You broke your snake charmer flute.

                                m_Flute.Delete();
                            }
                        }
                    }
                }
Exemplo n.º 2
0
                protected override void OnTarget(Mobile from, object targ)
                {
                    if (targ is IPoint2D)
                    {
                        Point2D p = new Point2D((IPoint2D)targ);

                        if (!from.CheckSkill(SkillName.Musicianship, 0.0, 120.0))
                        {
                            from.SendLocalizedMessage(502472);                               // You don't seem to be able to persuade that to move.

                            m_Flute.PlayInstrumentBadly(from);
                        }
                        else if (!m_Snake.InRange(p, 10))
                        {
                            from.SendLocalizedMessage(500643);                               // Target is too far away.
                        }
                        else
                        {
                            m_Snake.BeginCharm(from, p);

                            from.SendLocalizedMessage(502479);                               // The animal walks where it was instructed to.

                            from.BeginAction(typeof(SnakeCharmerFlute));
                            Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(
                                                delegate { from.EndAction(typeof(SnakeCharmerFlute)); }));

                            m_Flute.PlayInstrumentWell(from);
                            m_Flute.UsesRemaining--;

                            if (m_Flute.UsesRemaining == 0)
                            {
                                from.SendLocalizedMessage(1112177);                                   // You broke your snake charmer flute.

                                m_Flute.Delete();
                            }
                        }
                    }
                }