Esempio n. 1
0
        public static void acrobatie_OnCommand(CommandEventArgs e)
        {
            NubiaPlayer p = e.Mobile as NubiaPlayer;

            if (p.Competences.mustWait())
            {
                return;
            }

            if (p.InCombat)
            {
                p.SendMessage("Vous ne pouvez pas faire d'acrobatie pour l'instant");
                return;
            }

            bool can = p.Competences[CompType.Acrobaties].roll(15);

            if (can)
            {
                p.Emote("*execute une acrobatie*");
                foreach (Mobile m in p.GetMobilesInRange(8))
                {
                    if (m is NubiaPlayer)
                    {
                        NubiaPlayer player = m as NubiaPlayer;
                        if (player.CanSee(p))
                        {
                            player.changeMoral(Utility.Random(1, 8));
                        }
                    }
                }
            }
            else
            {
                p.Emote("*rate son acrobatie*");
                p.Damage(Utility.Random(1, 4));
            }
        }
Esempio n. 2
0
            protected override void OnTarget(Mobile f, object o)
            {
                if (o is Item)
                {
                    m_Owner.SendMessage("Visez le sol");
                    return;
                }
                if (!(o is IPoint3D))
                {
                    return;
                }

                IPoint3D p = o as IPoint3D;



                if (p != null)
                {
                    SpellHelper.GetSurfaceTop(ref p);


                    if (!m_Owner.CanSee(p))
                    {
                        m_Owner.SendMessage("Vous ne voyez pas votre point de chute");
                        return;
                    }
                    if (Factions.Sigil.ExistsOn(m_Owner))
                    {
                        m_Owner.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                    }
                    else if (Server.Misc.WeightOverloading.IsOverloaded(m_Owner))
                    {
                        m_Owner.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                    }
                    else if (!SpellHelper.CheckTravel(m_Owner, TravelCheckType.TeleportFrom))
                    {
                    }
                    else if (!SpellHelper.CheckTravel(m_Owner, m_Owner.Map, new Point3D(p), TravelCheckType.TeleportTo))
                    {
                    }
                    else if (m_Owner.Map == null || !m_Owner.Map.CanSpawnMobile(p.X, p.Y, p.Z))
                    {
                        m_Owner.SendLocalizedMessage(501942); // That location is blocked.
                    }
                    else if (SpellHelper.CheckMulti(new Point3D(p), m_Owner.Map))
                    {
                        m_Owner.SendLocalizedMessage(501942); // That location is blocked.
                    }

                    int hauteur = p.Z - m_Owner.Z;
                    if (hauteur < 0)
                    {
                        hauteur = 0;
                    }
                    hauteur /= 5;
                    int distance = (int)m_Owner.GetDistanceToSqrt(p);
                    int diff     = (10 + distance) + (hauteur);
                    if (m_Owner.Stam < diff)
                    {
                        m_Owner.SendMessage("Trop loin, trop dur");
                        return;
                    }

                    Point3D from = m_Owner.Location;
                    Point3D to   = new Point3D(p);
                    m_Owner.Stam -= diff;

                    if (m_Owner.Competences[CompType.Saut].roll(diff))
                    {
                        m_Owner.Emote("*Saute*");

                        m_Owner.Stam    += diff / 2;
                        m_Owner.Location = to;
                        //m_Owner.ProcessDelta();
                    }
                    else
                    {
                        m_Owner.Emote("*Essaie de sauter*");
                        m_Owner.Damage(6, null);
                        m_Owner.SendMessage("Vous n'y arrivez pas");
                    }

                    /* if (m_Owner.Player && m_Owner.Hidden == false)
                     * {
                     *   Effects.SendLocationParticles(EffectItem.Create(from, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                     *   Effects.SendLocationParticles(EffectItem.Create(to, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                     * }
                     * else
                     * {
                     *   m_Owner.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
                     * }*/
                }
            }
Esempio n. 3
0
            protected override void OnTick()
            {
                m_Count++;

                DamageEntry de           = m_Creature.FindMostRecentDamageEntry(false);
                bool        alreadyOwned = m_Creature.Owners.Contains(m_Tamer);

                if (!m_Tamer.InRange(m_Creature, 6))
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502795, m_Tamer.NetState); // You are too far away to continue taming.
                    Stop();
                }
                else if (!m_Tamer.CheckAlive())
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502796, m_Tamer.NetState); // You are dead, and cannot continue taming.
                    Stop();
                }
                else if (!m_Tamer.CanSee(m_Creature) || !m_Tamer.InLOS(m_Creature))
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049654, m_Tamer.NetState); // You do not have a clear path to the animal you are taming, and must cease your attempt.
                    Stop();
                }
                else if (!m_Creature.Tamable)
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049655, m_Tamer.NetState); // That creature cannot be tamed.
                    Stop();
                }
                else if (m_Creature.Controlled)
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502804, m_Tamer.NetState); // That animal looks tame already.
                    Stop();
                }
                else if (m_Creature.Owners.Count >= BaseCreature.MaxOwners && !m_Creature.Owners.Contains(m_Tamer))
                {
                    ;
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1005615, m_Tamer.NetState); // This animal has had too many owners and is too upset for you to tame.
                    Stop();
                }
                else if (MustBeSubdued(m_Creature))
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1054025, m_Tamer.NetState); // You must subdue this creature before you can tame it!
                    Stop();
                }
                else if (de != null && de.LastDamage > m_StartTime)
                {
                    m_Tamer.NextSkillTime = DateTime.Now;
                    m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502794, m_Tamer.NetState); // The animal is too angry to continue taming.
                    Stop();
                }
                else if (m_Count < m_MaxCount)
                {
                    m_Tamer.RevealingAction();

                    switch (Utility.Random(3))
                    {
                    case 0: m_Tamer.PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(502790, 4)); break;

                    case 1: m_Tamer.PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(1005608, 6)); break;

                    case 2: m_Tamer.PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(1010593, 4)); break;
                    }


                    //XP Gain
                    m_Tamer.GiveXP(5);

                    if (m_Creature.Paralyzed)
                    {
                        m_Paralyzed = true;
                    }
                }
                else
                {
                    m_Tamer.RevealingAction();
                    m_Tamer.NextSkillTime = DateTime.Now;

                    if (m_Creature.Paralyzed)
                    {
                        m_Paralyzed = true;
                    }


                    if (alreadyOwned || m_Tamer.Competences[CompType.Dressage].roll(m_Creature.DressageDD))
                    {
                        if (alreadyOwned)
                        {
                            m_Tamer.SendLocalizedMessage(502797); // That wasn't even challenging.
                        }
                        else
                        {
                            m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502799, m_Tamer.NetState); // It seems to accept you as master.
                            m_Creature.Owners.Add(m_Tamer);
                        }

                        m_Creature.SetControlMaster(m_Tamer);
                        m_Creature.IsBonded = false;
                    }
                    else
                    {
                        m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502798, m_Tamer.NetState); // You fail to tame the creature.
                    }
                }
            }