コード例 #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                if (targeted is Mobile)
                {
                    if (((Mobile)targeted) != from)
                    {
                        if (targeted is PlayerMobile)
                        {
                            PlayerMobile player = targeted as PlayerMobile;
                            from.Direction = from.GetDirectionTo(player);

                            from.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("You begin to hypnotize {0}", player.Name));
                            player.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("{0} begins to hypnotize you!", from.Name));
                            from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("* begins hypnotizing {0} *", player.Name));

                            new InternalTimer(from, player, Utility.Random(3, 3)).Start();

                            m_SetSkillTime = false;
                        }
                        else if (targeted is BaseCreature)
                        {
                            BaseCreature creature = targeted as BaseCreature;
                            from.Direction = from.GetDirectionTo(creature);

                            from.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("You begin to hypnotize {0}", creature.Name));
                            from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("* begins hypnotizing {0} *", creature.Name));

                            new InternalTimer(from, creature, Utility.Random(2, 3)).Start();

                            m_SetSkillTime = false;
                        }
                        else if (targeted is BaseEscortable)
                        {
                            BaseEscortable escortable = targeted as BaseEscortable;
                            from.Direction = from.GetDirectionTo(escortable);

                            from.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("You begin to hypnotize {0}", escortable.Name));
                            from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("* begins hypnotizing {0} *", escortable.Name));

                            new InternalTimer(from, escortable, Utility.Random(3, 3)).Start();

                            m_SetSkillTime = false;
                        }
                        else
                        {
                            from.SendMessage("That being will not be hypnotized.");
                        }
                    }
                    else
                    {
                        from.SendMessage("You cannot hypnotize yourself!");
                    }
                }
                else
                {
                    from.SendMessage("You can not hypnotize that!");
                }
            }
コード例 #2
0
 public EscortableTimer(Mobile from, Mobile oldMaster, BaseEscortable escortable, int duration)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), duration)
 {
     maxcount     = duration;
     m_From       = from;
     m_Escortable = escortable;
     m_OldMaster  = oldMaster;
 }
コード例 #3
0
 public InternalTimer(Mobile from, BaseEscortable escortabletarget, int count)
     : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0), count)
 {
     m_From      = from;
     m_Mobile    = escortabletarget;
     Priority    = TimerPriority.TwoFiftyMS;
     isCreature  = false;
     m_FullCount = count;
 }
コード例 #4
0
        public PrisonerMessage(BaseCamp c, BaseEscortable escort)
            : base(c.Prisoner, null, "", null)
        {
            m_Camp = c;

            switch (Utility.Random(13))
            {
            case 0: Subject = "A kidnapping!"; break;

            case 1: Subject = "Help!"; break;

            case 2: Subject = "Help us, please!"; break;

            case 3: Subject = "Adventurers needed!"; break;

            case 4: Subject = "Seeking assistance"; break;

            case 5: Subject = "In need of aid"; break;

            case 6: Subject = "Canst thou help us?"; break;

            case 7: Subject = "Shall any save our friend?"; break;

            case 8: Subject = "A friend was kidnapped!"; break;

            case 9: Subject = "Heroes wanted!"; break;

            case 10: Subject = "Can any assist us?"; break;

            case 11: Subject = "Kidnapped!"; break;

            case 12: Subject = "Taken prisoner"; break;
            }

            double        distance;
            BulletinBoard board = FindClosestBB(c.Prisoner, out distance);

            List <String> myLines = new List <String>();

            string[] subtext1 = { "foul", "vile", "evil", "dark", "cruel", "vicious", "scoundrelly", "dastardly", "cowardly", "craven", "foul and monstrous", "monstrous", "hideous", "terrible", "cruel, evil", "truly vile", "vicious and cunning", "" };

            string camp;

            switch (c.Camp)
            {
            default:
            case CampType.Default: camp = ""; break;

            //case CampType.EvilMage: camp = "evil mages"; break;
            //case CampType.GoodMage: camp = "mages"; break;
            case CampType.Lizardman: camp = "lizardmen"; break;

            case CampType.Orc: camp = "orcs"; break;

            case CampType.Ratman: camp = "ratmen"; break;

            case CampType.Brigand: camp = "brigands"; break;
                //case CampType.Gypsy: camp = "gypsys"; break;
                //case CampType.Warlord: camp = "a warlord"; break;
            }

            myLines.Add(String.Format("Help us please! {0} hath", escort.Name));
            myLines.Add(String.Format("been kidnapped by "));
            myLines.Add(String.Format("{0} {1}!", subtext1[Utility.Random(subtext1.Length)], camp));
            myLines.Add(String.Format("We believe that {0} is held at", escort.Female ? "she" : "he"));

            int  xLong = 0, yLat = 0;
            int  xMins = 0, yMins = 0;
            bool xEast = false, ySouth = false;

            if (Sextant.Format(c.Location, c.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
            {
                myLines.Add(String.Format("{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"));
            }

            /*myLines.Add(String.Format("{0}"));
            *  myLines.Add(String.Format("{0}."));
            *  myLines.Add(String.Format("{0}"));*/

            Lines = myLines.ToArray();

            if (board != null)
            {
                board.AddItem(this);
            }
            else
            {
                Delete();
            }
        }
コード例 #5
0
        public EscortMessage(Mobile m)
            : base(m, null, "", null)
        {
            m_Mobile = m;

            BaseEscortable escort  = m as BaseEscortable;
            String         subtext = "";

            switch (m.GetType().Name)
            {
            case "EscortableHealer1": subtext = "Greetings! I am a poor healer who seeks a worthy escort. I can offer some small pay to any doughty warrior able to assist me. It is imperative that I reach my destination, or innocents may perish!"; break;

            case "Peasant": subtext = "'Tis a terrible thing to be a parent with an ungrateful child! Yet such is my situation. Because of the poor behavior and lack of character of this offspring of mine, I am obliged to foster them away from home. So now I am in need of an able escort of good character who might serve as role model, and who can ensure that my child reaches their destination safely. I shall let my child post their whereabouts so that thou mayst meet with them and arrange terms." + "---"; break;

            case "BrideGroom": subtext = "I am so happy! I am to be married, and my life will finally be complete! Alas, I am no warrior, and the wedding is not to take place here. I am in need of an escort, for the roads are treacherous and my future spouse would be sad indeed to hear that an ettin ate me before the wedding."; break;

            case "EscortableMage1": subtext = "Wizard seeks escort to a conference."; break;

            case "Merchant": subtext = "Reputable merchant seeks able warriors to serve as mercantile escort. Pay is scale; we prefer to hire experienced mercenaries."; break;

            case "Messenger": subtext = "I am one of Lord British's couriers, and I seek an able warrior to escort me safely, as the message I carry is of utmost importance to the realm!"; break;

            case "Noble": subtext = "'Tis a bit of a problem to admit it, but our normally trustworthy household guard seem to have broken his leg! If thou art able with a weapon, we are pleased to take applications for his replacement, to serve as guard and escort on our forthcoming journey."; break;

            default:
            case "SeekerOfAdventure": subtext = "I've always wished for adventure! Now I can have it at last! My weaponsmaster in school always said I was a dab hand with a blade, and I am afire with the love of adventure! Plus I have money. So if you are willing to hire on as my bodyguard and join me as we seek the deepest depths of the Abyss, and as we conquer dragons with the rapid flick of our sharp swords, disregarding all danger and ignorant of fear, seek me out! Cowards need not apply!"; break;
            }

            switch (Utility.Random(9))
            {
            case 0: Subject = "Escort needed"; break;

            case 1: Subject = "Guard needed"; break;

            case 2: Subject = "I need an escort!"; break;

            case 3: Subject = "Traveling companion?"; break;

            case 4: Subject = "Seeking companion"; break;

            case 5: Subject = "Now hiring"; break;

            case 6: Subject = "Hiring a guard"; break;

            case 7: Subject = "Hiring an escort"; break;

            case 8: Subject = "Seeking escort"; break;
            }

            double        distance;
            BulletinBoard board = FindClosestBB(m, out distance);

            String direction;

            if (m.GetDirectionTo(board) == Direction.North)
            {
                direction = "South";//North
            }
            else if (m.GetDirectionTo(board) == Direction.South)
            {
                direction = "North";//South
            }
            else if (m.GetDirectionTo(board) == Direction.East)
            {
                direction = "West";//East
            }
            else if (m.GetDirectionTo(board) == Direction.West)
            {
                direction = "East";//West
            }
            else if (m.GetDirectionTo(board) == Direction.Up)
            {
                direction = "Southeast";//Northwest
            }
            else if (m.GetDirectionTo(board) == Direction.Left)
            {
                direction = "Northeast";//Southwest
            }
            else if (m.GetDirectionTo(board) == Direction.Right)
            {
                direction = "Southwest";//Northeast
            }
            else if (m.GetDirectionTo(board) == Direction.Down)
            {
                direction = "Northwest";//Southeast
            }
            else
            {
                direction = "in some direction.";
            }

            String line = String.Format("{0} I can be found {1} {2} of here. When thou dost find me, look at me close to accept the task of taking me to {3}. {4}", subtext, (distance < 50 ? "a fair distance" : "a long way"), direction, escort.Destination, escort.Name);

            Lines = MakeLines(line);

            if (board != null)
            {
                board.AddItem(this);
            }
            else
            {
                Delete();
            }
            //board.AddItem(this);
        }
コード例 #6
0
                protected override void OnTick()
                {
                    m_Count++;

                    if (isCreature)
                    {
                        DamageEntry de           = m_Creature.FindMostRecentDamageEntry(false);
                        bool        alreadyOwned = m_Creature.Owners.Contains(m_From);

                        if (!m_From.InRange(m_Creature, 6))
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are too far away to continue hypnotizing.", m_From.NetState);
                            Stop();
                        }
                        else if (!m_From.CheckAlive())
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are dead, and cannot continue hypnotizing.", m_From.NetState);
                            Stop();
                        }
                        else if (!m_Creature.CheckAlive())
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "The creature is dead, so you cannot continue hypnotizing it.", m_From.NetState);
                            Stop();
                        }
                        else if (m_Creature.Controlled && m_Creature.ControlMaster == m_From)
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "The creature will already obey you.", m_From.NetState);
                            Stop();
                        }
                        else if (!m_From.CanSee(m_Creature) || !m_From.InLOS(m_Creature))
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You do not have a clear path to the creature you are hypnotizing, and must cease your attempt.", m_From.NetState);
                            Stop();
                        }
                        else if (m_Creature.Frozen && m_Creature.Paralyzed)
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "It appears to be already in a trance.", m_From.NetState);
                            Stop();
                        }
                        else if (m_Count < m_FullCount)
                        {
                            m_From.RevealingAction();

                            switch (Utility.Random(5))
                            {
                            case 0: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "You are getting sleepy....", false); break;

                            case 1: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look into my eyes....", false); break;

                            case 2: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look deep into my eyes....", false); break;

                            case 3: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Your eyes are getting very heavy....", false); break;

                            case 4: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Sleepy....very sleepy....", false); break;
                            }

                            if (!alreadyOwned) // Passively check animal lore for gain
                            {
                                m_From.CheckTargetSkill(SkillName.AnimalLore, m_Creature, 0.0, 120.0);
                            }
                        }
                        else
                        {
                            m_From.RevealingAction();
                            m_From.NextSkillTime = Core.TickCount;

                            double minSkill = (double)m_Creature.Int / 3.0;

                            if (minSkill < -10.0)
                            {
                                minSkill = -10.0;
                            }
                            if (minSkill > 90.0)
                            {
                                minSkill = 90.0;
                            }

                            minSkill += 8.3;

                            LokaiSkill    lokaiSkill = LokaiSkillUtilities.XMLGetSkills(m_From).Hypnotism;
                            SuccessRating rating     = LokaiSkillUtilities.CheckLokaiSkill(m_From, lokaiSkill, minSkill, alreadyOwned ? minSkill : minSkill + 40);

                            if (rating >= SuccessRating.PartialSuccess)
                            {
                                if (rating == SuccessRating.TooEasy)
                                {
                                    m_From.SendLocalizedMessage(502797); // That wasn't even challenging.
                                }
                                else
                                {
                                    m_From.SendMessage("You succeed in hypnotizing the creature.");
                                }

                                double duration = 15.0;
                                switch (rating)
                                {
                                case SuccessRating.PartialSuccess: break;

                                case SuccessRating.Success: duration += 5.0; break;

                                case SuccessRating.CompleteSuccess: duration += 15.0; break;

                                case SuccessRating.ExceptionalSuccess: duration += 25.0; break;

                                case SuccessRating.TooEasy: duration += 45; break;
                                }

                                m_Creature.Freeze(TimeSpan.FromSeconds(duration));
                                m_Creature.Paralyze(TimeSpan.FromSeconds(duration));
                                m_Creature.Pacify(m_From, DateTime.Now.AddSeconds(duration));
                            }
                            else
                            {
                                m_From.SendMessage("You fail to hypnotize the creature.");
                            }
                        }
                    }
                    else
                    {
                        DamageEntry de = m_Mobile.FindMostRecentDamageEntry(false);

                        if (!m_From.InRange(m_Mobile, 6))
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_Mobile.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are too far away to continue hypnotizing.", m_From.NetState);
                            Stop();
                        }
                        else if (!m_From.CheckAlive())
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_Mobile.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are dead, and cannot continue hypnotizing.", m_From.NetState);
                            Stop();
                        }
                        else if (!m_From.CanSee(m_Mobile) || !m_From.InLOS(m_Mobile))
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_Mobile.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You do not have a clear path to the person you are hypnotizing, and must cease your attempt.", m_From.NetState);
                            Stop();
                        }
                        else if (!m_Mobile.CheckAlive())
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "The person is dead, so you cannot continue hypnotizing them.", m_From.NetState);
                            Stop();
                        }
                        else if (m_Mobile is BaseEscortable && ((BaseEscortable)m_Mobile).Controlled && ((BaseEscortable)m_Mobile).ControlMaster == m_From)
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "They will already obey you.", m_From.NetState);
                            Stop();
                        }
                        else if (m_Mobile.Frozen && m_Mobile.Paralyzed)
                        {
                            m_From.NextSkillTime = Core.TickCount;
                            m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "They appear to be already in a trance.", m_From.NetState);
                            Stop();
                        }
                        else if (m_Count < m_FullCount)
                        {
                            m_From.RevealingAction();

                            switch (Utility.Random(5))
                            {
                            case 0: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "You are getting sleepy....", false); break;

                            case 1: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look into my eyes....", false); break;

                            case 2: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look deep into my eyes....", false); break;

                            case 3: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Your eyes are getting very heavy....", false); break;

                            case 4: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Sleepy....very sleepy....", false); break;
                            }

                            m_From.CheckTargetSkill(SkillName.EvalInt, m_Mobile, 0.0, 120.0);
                        }
                        else
                        {
                            m_From.RevealingAction();
                            m_From.NextSkillTime = Core.TickCount;

                            m_From.CheckTargetSkill(SkillName.EvalInt, m_Mobile, 0.0, 120.0);

                            double minSkill = (double)m_Mobile.Int / 3.0;

                            if (minSkill < -10.0)
                            {
                                minSkill = -10.0;
                            }
                            if (minSkill > 90.0)
                            {
                                minSkill = 90.0;
                            }

                            minSkill += 10.0;

                            LokaiSkill    lokaiSkill = LokaiSkillUtilities.XMLGetSkills(m_From).Hypnotism;
                            SuccessRating rating     = LokaiSkillUtilities.CheckLokaiSkill(m_From, lokaiSkill, minSkill, minSkill + 40);

                            if (rating >= SuccessRating.PartialSuccess)
                            {
                                double duration = 15.0;
                                switch (rating)
                                {
                                case SuccessRating.PartialSuccess: break;

                                case SuccessRating.Success: duration += 5.0; break;

                                case SuccessRating.CompleteSuccess: duration += 15.0; break;

                                case SuccessRating.ExceptionalSuccess: duration += 25.0; break;

                                case SuccessRating.TooEasy: duration += 45; break;
                                }
                                m_From.SendMessage("You successfully put your subject in a trance.");

                                Mobile master = null;

                                if (m_Mobile is BaseEscortable)
                                {
                                    BaseEscortable target = (BaseEscortable)m_Mobile;
                                    if (((BaseEscortable)m_Mobile).Controlled)
                                    {
                                        master = target.ControlMaster;
                                    }
                                    target.Controlled    = true;
                                    target.ControlMaster = m_From;
                                    m_From.SendMessage("The target will obey you for {0} seconds.", duration.ToString("F1"));
                                    new EscortableTimer(m_From, master, target, (int)duration).Start();
                                }
                                else
                                {
                                    m_Mobile.Freeze(TimeSpan.FromSeconds(duration));
                                    m_Mobile.Paralyze(TimeSpan.FromSeconds(duration));
                                    m_Mobile.SendMessage("You have been hypnotized!");
                                    m_From.SendGump(new HypnotismGump(m_From, m_Mobile, duration, 1));
                                }
                            }
                            else
                            {
                                m_From.SendMessage("You fail to hypnotize your subject.");
                            }
                        }
                    }
                }