Example #1
0
        public static TimeSpan OnUse( Mobile m )
        {
            Spell spell = new SpiritSpeakSpell( m );

            spell.Cast();

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

            return TimeSpan.Zero;
        }
Example #2
0
        public static TimeSpan OnUse(Mobile m)
        {
            Spell spell = new SpiritSpeakSpell(m);

            spell.Cast();

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

            return(TimeSpan.Zero);
        }
Example #3
0
        public static TimeSpan OnUse(Mobile m)
        {
            EventSink.InvokeSkillUsed(new SkillUsedEventArgs(m, m.Skills[SkillName.SpiritSpeak]));

            if (Core.AOS)
            {
                Spell spell = new SpiritSpeakSpell(m);

                spell.Cast();

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

                return(TimeSpan.Zero);
            }

            m.RevealingAction();

            if (m.CheckSkill(SkillName.SpiritSpeak, 0, 100))
            {
                if (!m.CanHearGhosts)
                {
                    Timer  t    = new SpiritSpeakTimer(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;
                }

                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));
        }
Example #4
0
		public static TimeSpan OnUse(Mobile m)
		{
			if (Core.AOS)
			{
				Spell spell = new SpiritSpeakSpell(m);

				spell.Cast();

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

				return TimeSpan.Zero;
			}

			m.RevealingAction();

			if (m.CheckSkill(SkillName.SpiritSpeak, 0, 100))
			{
				if (!m.CanHearGhosts)
				{
					Timer t = new SpiritSpeakTimer(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;
				}

				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);
		}
Example #5
0
        public static TimeSpan OnUse( Mobile m )
        {
            if( m.Player && !((PlayerMobile)m).Undead )
            {
                m.SendMessage( "You cannot commune with spirits!" );
                return TimeSpan.Zero;
            }
            m.RevealingAction();

            Spell spell = new SpiritSpeakSpell( m );

            spell.Cast();

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

            return TimeSpan.Zero;
        }
Example #6
0
        public static TimeSpan OnUse(Mobile m)
        {
            // Move spirit check section above AOS test so it applies whether AOS is on or not
            if (m.CheckSkill(SkillName.SpiritSpeak, 0, 100))
            {
                if (!m.CanHearGhosts)
                {
                    Timer  t    = new SpiritSpeakTimer(m);
                    double secs = m.Skills[SkillName.SpiritSpeak].Base / 50;
                    secs *= 45;
                    if (secs < 15)
                    {
                        secs = 15;
                    }
                    t.Delay = TimeSpan.FromSeconds(secs);                       //15 seconds to 3 minutes
                    t.Start();
                    m.CanHearGhosts = true;
                }
                m.PlaySound(0x24A);
                m.SendLocalizedMessage(502444);          //You contact the neitherworld.
            }
            else
            {
                m.SendLocalizedMessage(502443);                  //You fail to contact the neitherworld.
                m.CanHearGhosts = false;
            }

            if (Core.AOS)
            {
                Spell spell = new SpiritSpeakSpell(m);

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

                return(TimeSpan.Zero);
            }

            m.RevealingAction();
            return(TimeSpan.FromSeconds(1.0));
        }
Example #7
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (m.Player && !((PlayerMobile)m).Undead)
            {
                m.SendMessage("You cannot commune with spirits!");
                return(TimeSpan.Zero);
            }
            m.RevealingAction();

            Spell spell = new SpiritSpeakSpell(m);

            spell.Cast();

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

            return(TimeSpan.Zero);
        }
        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));
        }
Example #9
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (m is TeiravonMobile)
            {
                TeiravonMobile tav = m as TeiravonMobile;

                if (tav.IsPaladin() || tav.IsCleric() || tav.IsDarkCleric())
                {
                    GivePrayer(tav);
                    return(TimeSpan.FromSeconds(10.0));
                }
                else
                {
                    Spell spell = new SpiritSpeakSpell(m);

                    spell.Cast();

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

                    return(TimeSpan.Zero);
                }
            }

            else
            {
                Spell spell = new SpiritSpeakSpell(m);

                spell.Cast();

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

                return(TimeSpan.Zero);
            }

            m.RevealingAction();

            if (m.CheckSkill(SkillName.SpiritSpeak, 0, 100))
            {
                if (!m.CanHearGhosts)
                {
                    Timer  t    = new SpiritSpeakTimer(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;
                }

                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));
        }