Pacify() 공개 메소드

public Pacify ( Mobile master, DateTime endtime ) : void
master Mobile
endtime DateTime
리턴 void
예제 #1
0
        public override void OnGotMeleeAttack(Mobile d)
        {
            if (0.2 >= Utility.RandomDouble())
            {
                this.Say(500131);
            }

            if (this.Hits < this.HitsMax / 2)
            {
                if (BandageContext.GetContext(this) == null)
                {
                    BandageContext.BeginHeal(this, this);
                    this.Say("*Aplicandose vendajes*");
                }
            }

            if (d is BaseCreature)
            {
                BaseCreature t = (BaseCreature)d;
                if (t.Controlled && !(t as BaseCreature).IsDispellable)
                {
                    if (0.5 >= Utility.RandomDouble())
                    {
                        t.Combatant = null;
                        t.Warmode   = false;
                        t.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(20.0));
                    }
                    if (this.Combatant == t)
                    {
                        this.Provoke(this, t.ControlMaster, true);
                    }
                }
            }
        }
예제 #2
0
        public override void OnDamagedBySpell(Mobile d)
        {
            if (0.3 >= Utility.RandomDouble())
            {
                this.Say("Hereje, tus brujerias no podran salvarte");
            }
            if (this.Hits < this.HitsMax / 2)
            {
                if (BandageContext.GetContext(this) == null)
                {
                    BandageContext.BeginHeal(this, this);
                    this.Say("Se aplica un vendaje.");
                }
            }

            if (d is BaseCreature)
            {
                BaseCreature t = (BaseCreature)d;
                if (t.Controlled && !(t as BaseCreature).IsDispellable)
                {
                    if (0.5 >= Utility.RandomDouble())
                    {
                        t.Combatant = null;
                        t.Warmode   = false;
                        t.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(20.0));

                        if (this.Combatant == t)
                        {
                            this.Provoke(this, t.ControlMaster, true);
                        }
                    }
                }
            }
        }
예제 #3
0
        public override void OnDamagedBySpell(Mobile d)
        {
            if (0.3 >= Utility.RandomDouble())
            {
                this.Say("Tvoje kouzla ti nepomohou.");
            }

            if (this.Hits < this.HitsMax / 2)
            {
                if (BandageContext.GetContext(this) == null)
                {
                    BandageContext.BeginHeal(this, this);
                    this.Say("Používa bandáž.");
                }
            }

            if (d is BaseCreature)
            {
                BaseCreature t = (BaseCreature)d;
                if (t.Controlled && !(t as BaseCreature).IsDispellable)
                {
                    if (0.5 >= Utility.RandomDouble())
                    {
                        t.Combatant = null;
                        t.Warmode   = false;
                        t.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(20.0));

                        if (this.Combatant == t)
                        {
                            this.Provoke(this, t.ControlMaster, true);
                        }
                    }
                }
            }
        }
예제 #4
0
        public void Peace(Mobile target)
        {
            if (target is PlayerMobile)
            {
                PlayerMobile player = (PlayerMobile)target;

                if (player.PeacedUntil <= DateTime.Now)
                {
                    player.PeacedUntil = DateTime.Now + TimeSpan.FromSeconds(PeaceDuration);
                    player.SendLocalizedMessage(500616);                       // You hear lovely music, and forget to continue battling!
                }
            }
            else if (target is BaseCreature)
            {
                BaseCreature creature = (BaseCreature)target;

                if (!creature.BardPacified)
                {
                    creature.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(PeaceDuration));
                }
            }

            PlaySound(0x58B);

            m_NextPeaceTime = DateTime.Now + TimeSpan.FromSeconds(PeaceMinDelay + Utility.RandomDouble() * PeaceMaxDelay);
        }
예제 #5
0
        public void DoPeacemaking()
        {
            DebugSay("I Peace!");

            double diff  = BaseInstrument.GetBaseDifficulty(Combatant) - 10.0;
            double music = this.Skills[SkillName.Musicianship].Value;

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

            if (!this.CheckTargetSkill(SkillName.Peacemaking, Combatant, diff - 25.0, diff + 25.0))
            {
                DebugSay("Peace failure :(");
                this.PlaySound(FailureSound);
            }
            else
            {
                DebugSay("Peace success!");
                this.PlaySound(SuccessSound);

                double seconds = 100 - (diff / 1.5);
                Utility.FixMinMax(ref seconds, 10, 120);

                Combatant.Combatant = null;
                Combatant.Warmode   = false;

                if (Combatant is BaseCreature)
                {
                    DebugSay("I have peaced a creature!");

                    BaseCreature bc = (BaseCreature)Combatant;

                    bc.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(seconds));
                }
                else
                {
                    DebugSay("I have paced a player!");
                    // TODO: es correcto este mensaje?
                    Combatant.SendLocalizedMessage(500616);                       // You hear lovely music, and forget to continue battling!

                    m_List.Add(Combatant);

                    Timer.DelayCall(TimeSpan.FromSeconds(seconds), new TimerStateCallback(Expire_Callback), Combatant);
                }
            }
        }
예제 #6
0
        public override void OnGotMeleeAttack(Mobile d)
        {
            Item item = this.FindItemOnLayer(Layer.TwoHanded);

            if (item != null)
            {
                Item dagger = this.Backpack.FindItemByType(typeof(Dagger));
                this.Backpack.DropItem(item);
                EquipItem(dagger);
                SetDamage(5, 12);
                InvalidateProperties();
            }

            if (0.2 >= Utility.RandomDouble())
            {
                this.Say(500131);
            }
            if (this.Hits < this.HitsMax / 2)
            {
                if (BandageContext.GetContext(this) == null)
                {
                    BandageContext.BeginHeal(this, this);
                    this.Say("*Používa bandáž*");
                }
            }

            if (d is BaseCreature)
            {
                BaseCreature t = (BaseCreature)d;
                if (t.Controlled && !(t as BaseCreature).IsDispellable)
                {
                    if (0.5 >= Utility.RandomDouble())
                    {
                        t.Combatant = null;
                        t.Warmode   = false;
                        t.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(20.0));

                        if (this.Combatant == t)
                        {
                            this.Provoke(this, t.ControlMaster, true);
                        }
                    }
                }
            }
        }
        public override void OnDamagedBySpell(Mobile d)
        {
            if (0.3 >= Utility.RandomDouble())
            {
                this.Say("Tus brujerias no te ayudaran.");
            }

            if (d is BaseCreature)
            {
                if ((d as BaseCreature).IsDispellable)
                {
                    if (DateTime.Now >= m_NextCastTime)
                    {
                        this.Say("An Ort");
                        Effects.SendLocationParticles(EffectItem.Create(d.Location, d.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
                        Effects.PlaySound(d, d.Map, 0x201);
                        m_NextCastTime = DateTime.Now + TimeSpan.FromSeconds(5.0);
                        if (this.Combatant == d)
                        {
                            this.Combatant = null;
                        }
                        d.Delete();
                    }
                }

                BaseCreature t = (BaseCreature)d;
                if (t.Controlled && !(t as BaseCreature).IsDispellable)
                {
                    if (0.5 >= Utility.RandomDouble())
                    {
                        t.Combatant = null;
                        t.Warmode   = false;
                        t.Pacify(this, DateTime.Now + TimeSpan.FromSeconds(20.0));

                        if (this.Combatant == t)
                        {
                            this.Provoke(this, t.ControlMaster, true);
                        }
                    }
                }
            }
        }