Пример #1
0
            protected override void OnTick()
            {
                // cap the strike potential
                if (m_context.SlayerDamageHP > Context.SlayerDamageHPMax)
                {
                    m_context.SlayerDamageHP = Context.SlayerDamageHPMax;
                }

                if (m_context.Owner == null || m_context.Owner.Deleted || m_context.Owner.NetState == null || m_context.Owner.Map == Map.Internal)
                {
                    return;
                }

                // alert senior staff for analysis purposes
                SpiritSpeak.UsageReport(m_context.Owner, "Spirit Speak: SlayerDamage");

                // apply the bonus
                Memory.ObjectMemory om = SpiritSpeak.SlayerDamageCache.Recall(Context.Owner as object);
                if (om != null)
                {                       // delete the old cached bonus
                    SpiritSpeak.SlayerDamageCache.Forget(Context.Owner);
                }

                // you have 20 seconds to use this strike
                SpiritSpeak.SlayerDamageCache.Remember(Context.Owner, Context, new TimerStateCallback(Context.DoRelease), 20);
                Context.Owner.SendMessage("You have 20 seconds to utilize this slayer strike.");
            }
Пример #2
0
        public static TimeSpan OnUse(Mobile m)
        {
            #region AOS
            if (Core.AOS)
            {
                Spell spell = new SpiritSpeakSpell(m);

                spell.Cast();

                if (spell.IsCasting)
                {
                    return(TimeSpan.FromSeconds(5.0));
                }

                return(TimeSpan.Zero);
            }
            #endregion AOS

            m.RevealingAction();

            if (m.CheckSkill(SkillName.SpiritSpeak, 0, 100))
            {
                #region ghosts
                // ghosts
                if (!m.CanHearGhosts)
                {
                    Timer  t    = new HearGhostsTimer(m);
                    double secs = m.Skills[SkillName.SpiritSpeak].Base / 50;
                    secs *= 90;
                    if (secs < 15)
                    {
                        secs = 15;
                    }

                    t.Delay = TimeSpan.FromSeconds(secs);                    //15seconds to 3 minutes
                    t.Start();
                    m.CanHearGhosts = true;
                }
                #endregion ghosts

                if (Core.UOAI || Core.UOAR)
                {
                    #region summon healing
                    // summon healing
                    if (m.Followers > 0)
                    {                           // okay, we have some followers
                        if (m_HealSummonsMemory.Recall(m) == false)
                        {                       // We don't remember this guy so create a new memory
                            double           MaxHealed = ((m.Skills.SpiritSpeak.Value + (m.Int * 2.0) + (m.Skills.Meditation.Value * 2.0)) / 5.0);
                            HealSummonsTimer th        = new HealSummonsTimer(new HealSummonsContext(m, MaxHealed));
                            m_HealSummonsMemory.Remember(m, th, 10);
                            th.Context.HealSummonsHP += th.Context.HealSummonsHPMax / 4.0;
                        }
                        else
                        {                               // we remember this guy so update
                            Memory.ObjectMemory om = m_HealSummonsMemory.Recall(m as object);
                            HealSummonsTimer    th = (HealSummonsTimer)om.Context;
                            if (th is HealSummonsTimer && th.Context != null)
                            {
                                th.Context.HealSummonsHP += th.Context.HealSummonsHPMax / 4.0;
                            }
                        }
                    }
                    #endregion summon healing
                }

                if (Core.UOAI || Core.UOAR)
                {
                    #region slayer damage bonus
                    // slayer damage bonus
                    if (CheckSlayer(m))
                    {                           // okay, they are holding a slayer
                        if (SpiritSpeak.SlayerDamageCache.Recall(m) == false)
                        {                       // no unused cached charge
                            if (m_SlayerDamageAccumulator.Recall(m) == false)
                            {                   // We don't remember this guy so create a new memory
                                double            spiritStrike = ((m.Skills.SpiritSpeak.Value + (m.Dex * 2.0) + (m.Skills.Tactics.Value * 2.0)) / 5.0);
                                SlayerDamageTimer th           = new SlayerDamageTimer(new SlayerDamageContext(m, spiritStrike));
                                m_SlayerDamageAccumulator.Remember(m, th, 10);
                                th.Context.SlayerDamageHP += th.Context.SlayerDamageHPMax / 4.0;
                                // (m_SlayerDamageAccumulator.Recall(m as object) as Memory.ObjectMemory).OnReleaseEventHandler = new Memory.OnReleaseEventHandler(th.Context.DoRelease);
                            }
                            else
                            {                                   // we remember this guy so update
                                Memory.ObjectMemory om = m_SlayerDamageAccumulator.Recall(m as object);
                                SlayerDamageTimer   th = (SlayerDamageTimer)om.Context;
                                if (th is SlayerDamageTimer && th.Context != null)
                                {
                                    th.Context.SlayerDamageHP += th.Context.SlayerDamageHPMax / 4.0;
                                }
                            }
                        }
                        else
                        {
                            Memory.ObjectMemory om  = SpiritSpeak.SlayerDamageCache.Recall(m as object);
                            SlayerDamageContext sdc = om.Context as SlayerDamageContext;
                            if (sdc.SlayerDamageHP > 0)
                            {
                                m.SendMessage("Your weapon is already fully charged.");
                            }
                            // else they have discharged their weapon and must now wait
                        }
                    }
                    #endregion slayer damage bonus
                }

                m.PlaySound(0x24A);
                m.SendLocalizedMessage(502444);                //You contact the neitherworld.
            }
            else
            {
                m.SendLocalizedMessage(502443);                //You fail to contact the neitherworld.
                m.CanHearGhosts = false;
            }

            return(TimeSpan.FromSeconds(1.0));
        }
Пример #3
0
        /*public virtual bool OtherAttackers(Mobile cur)
         * {
         *      //anything that hasnt attacked us in over a minute is low priority
         *      DateTime LowAttackIntrest = DateTime.Now - TimeSpan.FromMinutes(1.0);
         *      //somehow current target just went null so forget about it.
         *      if(cur == null)
         *              return true;
         *
         *      ArrayList aggressors = m_Mobile.Aggressors;
         *      if ( aggressors.Count > 0 )
         *      {
         *              for ( int i = 0; i < aggressors.Count; ++i )
         *              {
         *                      AggressorInfo info = (AggressorInfo)aggressors[i];
         *                      Mobile temp = info.Attacker;
         *
         *                      if(info.LastCombatTime > LowAttackIntrest && temp != null && temp != cur
         *                              && m_Mobile.CanSee(temp) && m_Mobile.InLOS(temp) &&
         *                              temp.Alive && !temp.IsDeadBondedPet && m_Mobile.CanBeHarmful( temp, false ) && temp.Map == m_Mobile.Map)
         *                              return true; //were being attacked by something else recently and we can still fight em
         *              }
         *      }
         *      return false; //nothing thats a big concern
         * }*/

        public virtual bool DoProcessReveal(Mobile c)
        {
            m_Mobile.DebugSay("I am going to try and reveal {0} from memory", c.Name);

            bool   tryReveal = false;
            double ss        = m_Mobile.Skills.DetectHidden.Value;
            double ts        = c.Skills[SkillName.Hiding].Value;

            Memory.ObjectMemory om = ShortTermMemory.Recall(c as object);

            if (om == null)
            {
                return(tryReveal);
            }

            // we don't reveal the mobile's current location, we reveal the last location we SAW the mobile at
            Point3D px = om.Context is Point3D ? (Point3D)om.Context : new Point3D();

            if (m_Mobile.Debug == true)
            {
                if ((m_Mobile.Skills.DetectHidden.Value >= 40 && ss >= ts) == false)
                {
                    m_Mobile.DebugSay("I am not skilled enough to use DetectHidden");
                }

                if ((m_Mobile.Mana >= 30 && m_Mobile.Skills.Magery.Value >= 70) == false)
                {
                    m_Mobile.DebugSay("I am not skilled enough to use RevealSpell");
                }
            }

            m_Mobile.DebugSay("Doing reveal logic");
            if (m_Mobile.Skills.DetectHidden.Value >= 40 && ss >= ts)
            {
                //compute range
                double srcSkill = m_Mobile.Skills[SkillName.DetectHidden].Value;
                int    range    = (int)(srcSkill / 20.0);

                if (!m_Mobile.InRange(px, range))
                {
                    RunTo(px, CanRun);
                }
                else
                {
                    if (m_Mobile.Target != null && m_Mobile.Target.GetType() != typeof(DetectHidden.InternalTarget))
                    {
                        m_Mobile.Target.Cancel(m_Mobile, TargetCancelType.Canceled);
                    }

                    m_Mobile.UseSkill(SkillName.DetectHidden);

                    tryReveal = true;
                }
            }
            else if (m_Mobile.Mana >= 30 && m_Mobile.Skills.Magery.Value >= 70 && (m_Mobile.Spell == null || (m_Mobile.Spell != null && m_Mobile.Spell.GetType() != typeof(RevealSpell))) && DateTime.Now >= m_Mobile.NextSpellTime)
            {
                int range = 1 + (int)(m_Mobile.Skills[SkillName.Magery].Value / 20.0);

                //cancel spell
                ISpell i = m_Mobile.Spell;
                if (i != null && i.IsCasting)
                {
                    Spell s = (Spell)i;
                    s.Disturb(DisturbType.EquipRequest, true, false);
                    m_Mobile.FixedEffect(0x3735, 6, 30);
                }
                m_Mobile.Spell = null;

                if (!m_Mobile.InRange(px, range))
                {
                    RunTo(px, CanRun);
                }
                else
                {
                    new RevealSpell(m_Mobile, null).Cast();
                    tryReveal = true;
                }
            }

            return(tryReveal);
        }