protected override void OnTarget(Mobile from, object targ)
 {
     if (!(targ is Mobile))
     {
         from.SendMessage("You can't heal that!");
     }
     else if (targ is BaseCreature)
     {
         pet = (BaseCreature)targ;
         if (!pet.Controled)
         {
             from.SendMessage("You can only heal tamed creatures");
         }
         else if (!(m_Player.InRange(pet.Location, 2)))
         {
             m_Player.SendMessage("You are too far from your pet");
         }
         else
         {
             pet.Hits         += Utility.RandomMinMax(50, 150);
             phpot.TargetDrink = true;
             from.SendMessage("You heal your pet!");
             phpot.Drink(from);
         }
     }
     else
     {
         from.SendMessage("You can only heal creatures");
     }
 }
Example #2
0
            protected override void OnTick()
            {
                if (!(target.Alive))
                {
                    player.SendMessage("Your patient died before you could finish");
                }
                else if (!(player.Alive))
                {
                    player.SendMessage("You died before you could heal your patient");
                }
                else if (!(player.InRange(target.Location, 2)))
                {
                    player.SendMessage("You moved too far from your patient");
                }
                else
                {
                    if (target.Hits + healpts > target.MaxHits)
                    {
                        target.Hits = target.MaxHits;
                    }
                    else
                    {
                        target.Hits += healpts;
                    }

                    player.SendMessage("You finish splinting your patient");
                    splint.Delete();
                }
            }
Example #3
0
        protected override void OnTarget(Mobile from, object targ)
        {
            if (!(targ is TeiravonMobile))
            {
                from.SendMessage("You can only splint that!");
            }
            else
            {
                m_player = (TeiravonMobile)from;
                m_targ   = (TeiravonMobile)targ;
                if (m_targ == m_player)
                {
                    m_player.SendMessage("You cannot splint yourself!");
                }
                else if (!m_targ.Alive)
                {
                    m_player.SendMessage("That person is not alive!");
                }
                else if (!(m_player.InRange(m_targ.Location, 2)))
                {
                    m_player.SendMessage("You are too far away");
                }
                else
                {
                    Container pack = m_player.Backpack;
                    if (pack != null)
                    {
                        BaseWeapon wpn = (BaseWeapon)m_player.Weapon;
                        pack.DropItem(wpn);
                    }
                    BaseWeapon.BlockEquip(m_player, TimeSpan.FromSeconds(6.0));

                    int healmin = (int)((m_player.Skills.Healing.Value + m_player.Skills.Anatomy.Value) / 3);
                    int healmax = (int)((m_player.Skills.Healing.Value + m_player.Skills.Anatomy.Value) / 2);
                    int healamt = Utility.RandomMinMax(healmin, healmax);

                    m_player.Emote("Begins splinting {0}", m_targ.Name);

                    m_timer = new InternalTimer(m_player, m_targ, healamt, splint);
                    m_timer.Start();
                }
            }
        }
Example #4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                //from.RevealingAction();

                if (m_Angry is BaseCreature)
                {
                    BaseCreature m_Creature = m_Angry as BaseCreature;

                    if (targeted is TeiravonMobile)
                    {
                        TeiravonMobile tav = targeted as TeiravonMobile;

                        if (m_Creature.Unprovokable)
                        {
                            from.SendLocalizedMessage(1049446); // You have no chance of provoking those creatures.
                        }
                        else if (m_Creature.Map != tav.Map || !m_Creature.InRange(tav, BaseInstrument.GetBardRange(from, SkillName.Provocation)))
                        {
                            from.SendLocalizedMessage(1049450); // The creatures you are trying to provoke are too far away from each other for your music to have an effect.
                        }
                        else
                        {
                            from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);

                            double diff  = ((m_Instrument.GetDifficultyFor(m_Creature) + m_Instrument.GetDifficultyFor(tav)) * 0.5) - 5.0;
                            double music = from.Skills[SkillName.Musicianship].Value;

                            if (music > 100.0)
                            {
                                diff -= (music - 100.0) * 0.5;
                            }

                            if (from is TeiravonMobile)
                            {
                                diff -= ((TeiravonMobile)from).PlayerLevel;
                            }

                            if (from.CanBeHarmful(m_Creature, true) && from.CanBeHarmful(tav, true))
                            {
                                if (!BaseInstrument.CheckMusicianship(from))
                                {
                                    from.SendLocalizedMessage(500612); // You play poorly, and there is no effect.
                                    m_Instrument.PlayInstrumentBadly(from);
                                    m_Instrument.ConsumeUse(from);
                                }
                                else
                                {
                                    //from.DoHarmful( m_Creature );
                                    //from.DoHarmful( creature );

                                    if (!from.CheckTargetSkill(SkillName.Provocation, tav, diff - 25.0, diff + 25.0))
                                    {
                                        from.SendLocalizedMessage(501599); // Your music fails to incite enough anger.
                                        m_Instrument.PlayInstrumentBadly(from);
                                        m_Instrument.ConsumeUse(from);
                                    }
                                    else
                                    {
                                        from.SendLocalizedMessage(501602); // Your music succeeds, as you start a fight.
                                        m_Instrument.PlayInstrumentWell(from);
                                        m_Instrument.ConsumeUse(from);
                                        m_Creature.Provoke(from, tav, true);
                                    }
                                }
                            }
                        }
                    }
                    if (targeted is BaseCreature)
                    {
                        BaseCreature creature = (BaseCreature)targeted;

                        if (m_Creature.Unprovokable || creature.Unprovokable)
                        {
                            from.SendLocalizedMessage(1049446);     // You have no chance of provoking those creatures.
                        }
                        else if (m_Creature.Map != creature.Map || !m_Creature.InRange(creature, BaseInstrument.GetBardRange(from, SkillName.Provocation)))
                        {
                            from.SendLocalizedMessage(1049450);     // The creatures you are trying to provoke are too far away from each other for your music to have an effect.
                        }
                        else if (m_Creature != creature)
                        {
                            from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);

                            double diff  = ((m_Instrument.GetDifficultyFor(m_Creature) + m_Instrument.GetDifficultyFor(creature)) * 0.5) - 5.0;
                            double music = from.Skills[SkillName.Musicianship].Value;

                            if (music > 100.0)
                            {
                                diff -= (music - 100.0) * 0.5;
                            }

                            if (from.CanBeHarmful(m_Creature, true) && from.CanBeHarmful(creature, true))
                            {
                                if (!BaseInstrument.CheckMusicianship(from))
                                {
                                    from.SendLocalizedMessage(500612);     // You play poorly, and there is no effect.
                                    m_Instrument.PlayInstrumentBadly(from);
                                    m_Instrument.ConsumeUse(from);
                                }
                                else
                                {
                                    //from.DoHarmful( m_Creature );
                                    //from.DoHarmful( creature );

                                    if (!from.CheckTargetSkill(SkillName.Provocation, creature, diff - 25.0, diff + 25.0))
                                    {
                                        from.SendLocalizedMessage(501599);     // Your music fails to incite enough anger.
                                        m_Instrument.PlayInstrumentBadly(from);
                                        m_Instrument.ConsumeUse(from);
                                    }
                                    else
                                    {
                                        from.SendLocalizedMessage(501602);     // Your music succeeds, as you start a fight.
                                        m_Instrument.PlayInstrumentWell(from);
                                        m_Instrument.ConsumeUse(from);
                                        m_Creature.Provoke(from, creature, true);
                                    }
                                }
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(501593);     // You can't tell someone to attack themselves!
                        }
                    }
                }

                if (m_Angry is TeiravonMobile)
                {
                    TeiravonMobile m_Creature = m_Angry as TeiravonMobile;

                    if (targeted is TeiravonMobile)
                    {
                        TeiravonMobile tav = targeted as TeiravonMobile;

                        if (m_Creature.Map != tav.Map || !m_Creature.InRange(tav, BaseInstrument.GetBardRange(from, SkillName.Provocation)))
                        {
                            from.SendLocalizedMessage(1049450); // The creatures you are trying to provoke are too far away from each other for your music to have an effect.
                        }
                        else
                        {
                            from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);

                            double diff  = ((m_Instrument.GetDifficultyFor(m_Creature) + m_Instrument.GetDifficultyFor(tav)) * 0.5) - 5.0;
                            double music = from.Skills[SkillName.Musicianship].Value;

                            if (music > 100.0)
                            {
                                diff -= (music - 100.0) * 0.5;
                            }

                            if (from.CanBeHarmful(m_Creature, true) && from.CanBeHarmful(tav, true))
                            {
                                if (!BaseInstrument.CheckMusicianship(from))
                                {
                                    from.SendLocalizedMessage(500612); // You play poorly, and there is no effect.
                                    m_Instrument.PlayInstrumentBadly(from);
                                    m_Instrument.ConsumeUse(from);
                                }
                                else
                                {
                                    //from.DoHarmful( m_Creature );
                                    //from.DoHarmful( creature );

                                    if (!from.CheckTargetSkill(SkillName.Provocation, tav, diff - 25.0, diff + 25.0))
                                    {
                                        from.SendLocalizedMessage(501599); // Your music fails to incite enough anger.
                                        m_Instrument.PlayInstrumentBadly(from);
                                        m_Instrument.ConsumeUse(from);
                                    }
                                    else
                                    {
                                        from.SendLocalizedMessage(501602); // Your music succeeds, as you start a fight.
                                        m_Instrument.PlayInstrumentWell(from);
                                        m_Instrument.ConsumeUse(from);
                                        m_Creature.Combatant = tav;
                                        m_Creature.LocalOverheadMessage(MessageType.Regular, 0x22, true, String.Format(AggressedFormat, tav.Name));
                                        m_Creature.Warmode = true;
                                    }
                                }
                            }
                        }
                    }
                    if (targeted is BaseCreature)
                    {
                        BaseCreature creature = (BaseCreature)targeted;

                        if (creature.Unprovokable)
                        {
                            from.SendLocalizedMessage(1049446);     // You have no chance of provoking those creatures.
                        }
                        else if (m_Creature.Map != creature.Map || !m_Creature.InRange(creature, BaseInstrument.GetBardRange(from, SkillName.Provocation)))
                        {
                            from.SendLocalizedMessage(1049450);     // The creatures you are trying to provoke are too far away from each other for your music to have an effect.
                        }
                        else
                        {
                            from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);

                            double diff  = ((m_Instrument.GetDifficultyFor(m_Creature) + m_Instrument.GetDifficultyFor(creature)) * 0.5) - 5.0;
                            double music = from.Skills[SkillName.Musicianship].Value;

                            if (music > 100.0)
                            {
                                diff -= (music - 100.0) * 0.5;
                            }

                            if (from.CanBeHarmful(m_Creature, true) && from.CanBeHarmful(creature, true))
                            {
                                if (!BaseInstrument.CheckMusicianship(from))
                                {
                                    from.SendLocalizedMessage(500612);     // You play poorly, and there is no effect.
                                    m_Instrument.PlayInstrumentBadly(from);
                                    m_Instrument.ConsumeUse(from);
                                }
                                else
                                {
                                    //from.DoHarmful( m_Creature );
                                    //from.DoHarmful( creature );

                                    if (!from.CheckTargetSkill(SkillName.Provocation, creature, diff - 25.0, diff + 25.0))
                                    {
                                        from.SendLocalizedMessage(501599);     // Your music fails to incite enough anger.
                                        m_Instrument.PlayInstrumentBadly(from);
                                        m_Instrument.ConsumeUse(from);
                                    }
                                    else
                                    {
                                        from.SendLocalizedMessage(501602);     // Your music succeeds, as you start a fight.
                                        m_Instrument.PlayInstrumentWell(from);
                                        m_Instrument.ConsumeUse(from);
                                        m_Creature.LocalOverheadMessage(MessageType.Regular, 0x22, true, String.Format(AggressedFormat, creature.Name));
                                        m_Creature.Combatant = creature;
                                        m_Creature.Warmode   = true;
                                    }
                                }
                            }
                        }
                    }
                }
            }