public static bool DoSpellHeal(BaseCreature creature, Mobile target)
        {
            Spell spell = new GreaterHealSpell(creature, null);

            if (target != null)
            {
                creature.SpellTarget = target;
                spell.Cast();

                return(true);
            }

            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);
            Mobile from = e.Mobile;

            if (from.FindItemOnLayer(Layer.Helm) is NecromaticMask)
            {
                if (e.Speech.IndexOf("nwapslleh") >= 0)
                {
                    GreaterHealSpell gheal = new GreaterHealSpell(this, null); // get your spell
                    if (gheal.Cast())                                          // if it casts the spell
                    {
                        m_CastTimer = new GHCastTimer(gheal, from, gheal.GetCastDelay());
                        m_CastTimer.Start();
                    }
                }
            }
        }
Beispiel #3
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
            {
                return;
            }
            base.OnSpeech(e);
            Mobile from = e.Mobile;

            if (from.FindItemOnLayer(Layer.Helm) is NecromaticMask)
            {
                if (e.Speech.IndexOf("nwapslleh") >= 0)
                {
                    GreaterHealSpell gheal = new GreaterHealSpell(this, null); // get your spell
                    if (gheal.Cast())                                          // if it casts the spell
                    {
                        m_CastTimer = new GHCastTimer(gheal, from, gheal.GetCastDelay());
                        m_CastTimer.Start();
                    }
                }
            }
        }
Beispiel #4
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);
            Mobile from = e.Mobile;

//if( e.Layer.Helm is NecromaticMask )
            if (from.FindItemOnLayer(Layer.Helm) is NecromaticMask)
            {
                if (e.Speech.IndexOf("nwapslleh") >= 0)
                //if (e.Speech.ToLower().IndexOf( "nwapslleh" ) >= 0  )
                {
                    // if ( e.Hits < (e.HitsMax - 50) && from.Poisoned == false )
                    //{
                    m_ghs = new GreaterHealSpell(this, null); // get your spell
                    if (m_ghs.Cast())                         // if it casts the spell
                    {
                        TimeSpan castDelay = m_ghs.GetCastDelay();
                        m_CastTimer = new GHCastTimer(m_ghs, from, castDelay);
                        m_CastTimer.Start();
                    }
                }
            }
            //}
        }
        public override bool Think()
        {
            if (m_Mobile.Deleted)
            {
                return(false);
            }

            if (m_Mobile.Target is AsyncSpellTarget target)
            {
                switch (target.Spell)
                {
                case CureSpell:
                    ProcessTarget(target, ACure);
                    break;

                case GreaterHealSpell:
                    ProcessTarget(target, AgHeal);
                    break;

                case HealSpell:
                    ProcessTarget(target, AlHeal);
                    break;

                default:
                    m_Mobile.Target.Cancel(m_Mobile, TargetCancelType.Canceled);
                    break;
                }
            }
            else
            {
                Mobile toHelp = Find(All);

                if (toHelp != null)
                {
                    if (NeedCure(toHelp))
                    {
                        if (m_Mobile.Debug)
                        {
                            m_Mobile.DebugSay("{0} needs a cure", toHelp.Name);
                        }

                        var spell = new CureSpell(m_Mobile, null);
                        if (spell.CanCast())
                        {
                            spell.Cast();
                        }
                    }
                    else if (NeedGHeal(toHelp))
                    {
                        if (m_Mobile.Debug)
                        {
                            m_Mobile.DebugSay("{0} needs a greater heal", toHelp.Name);
                        }

                        var spell = new GreaterHealSpell(m_Mobile, null);
                        if (spell.CanCast())
                        {
                            spell.Cast();
                        }
                    }
                    else if (NeedLHeal(toHelp))
                    {
                        if (m_Mobile.Debug)
                        {
                            m_Mobile.DebugSay("{0} needs a lesser heal", toHelp.Name);
                        }

                        new HealSpell(m_Mobile, null).Cast();
                    }
                }
                else
                {
                    if (AcquireFocusMob(m_Mobile.RangePerception, FightMode.Weakest, false, true, false))
                    {
                        WalkMobileRange(m_Mobile.FocusMob, 1, false, 4, 7);
                    }
                    else
                    {
                        WalkRandomInHome(3, 2, 1);
                    }
                }
            }

            return(true);
        }