示例#1
0
        public static bool DoSpellCure(BaseCreature creature, Mobile target)
        {
            Spell spell = new CureSpell(creature, null);

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

            else
            {
                return(false);
            }
        }
示例#2
0
        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);
        }