Exemple #1
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                                                                                             (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactID, versions[";;"]);
                    String reply = String.Format("Great! Thanks! This should help us in {0} {1}",
                                                 "our studies. We've found several other references to this shield. Don't know how",
                                                 "much this book will help, but it certainly can't hurt!");
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                scholar.TurnTo(player);
                if (RemoveItem(player, item))
                {
                    String reply = String.Format("Ahh. These notes are well-preserved. {0} {1} {2}",
                                                 "Here, these bracers are unlike any other artifact. I can unlock one power,",
                                                 "[strength], [constitution], [dexterity], [quickness] or [casting]. You can",
                                                 "only choose one, and can not return for another. Choose wisely.");
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    Step = 3;
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                scholar.TurnTo(player);
                if (RemoveItem(player, item))
                {
                    String reply = String.Format("You now have a decision to make, {0}. {1} {2} {3} {4} {5}",
                                                 player.CharacterClass.Name,
                                                 "I can unlock your Malice Axe so it uses [slashing] skills or so it uses",
                                                 "[crushing] skills. In both cases, I can unlock it as a one-handed weapon",
                                                 "or a two-handed one. All you must do is decide which kind of damage you",
                                                 "would like to do to your enemies. Once you have chosen, you cannot change",
                                                 "your mind.");
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    Step = 3;
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("Do you have the story that goes along with that? {0} {1}",
                                             "If you do, hand it in to me, and I will unlock the power that these boots had",
                                             "been vested with. If not, go get the story!");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
    static void Main(string[] args)
    {
        var o = new
        {
            Id      = 1,
            Name    = "Patrick",
            Courses = new[] { new { Id = 1, Name = "C#" } }
        };

        Student student = null;
        Scholar scholar = null;

        if (o.CanBeConverted <Student>())
        {
            student = o.ConvertToType <Student>();
        }
        else if (o.CanBeConverted <Scholar>())
        {
            scholar = o.ConvertToType <Scholar>();
        }

        System.Console.WriteLine(student?.ToString());
        System.Console.WriteLine(scholar?.ToString());

        System.Console.ReadKey();
    }
Exemple #6
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("This bracelet was quite beautiful and powerful. {0} {1} {2}",
                                             "Let's get that power flowing again! Give me the King's Vase and I shall examine it.",
                                             "Once I have uncovered the secrets in the Vase, I shall make the Band of Stars",
                                             "available to you.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #7
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("Ah, the Shield of Khaos! What do you know of {0} {1}",
                                             "it? Probably as much as we do! Well, do you have the book on it? Come on then, hand it",
                                             "over. I'll unlock this shield's abilities for you once you hand me the book.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #8
0
        // Creates a new user
        private User createUser(string firstName, string lastName, string title, string userName,
                                string password, string email, string userType)
        {
            User user = null;

            switch (userType)
            {
            case "student":
                Student student = new Student(firstName, lastName, userName, password, email);
                user = student;
                UserService.Instance.AddUser(student);
                break;

            case "scholar":
                Scholar scholar = new Scholar(firstName, lastName, userName, password, email);
                user = scholar;
                UserService.Instance.AddUser(scholar);
                break;

            case "institution":
                Institution institution = new Institution(title, userName, password, email);
                user = institution;
                UserService.Instance.AddUser(institution);
                break;
            }

            return(user);
        }
Exemple #9
0
        public ActionResult AddScholarship(Scholar obj)
        {
            try
            {
                string       message;
                DB49Entities k = new DB49Entities();

                List <Student> students = k.Students.ToList();
                ViewBag.StudentList = new SelectList(students, "StudentID", "Name");

                List <Scholarshipss> scholarships = k.Scholarshipsses.ToList();
                ViewBag.ScholarshipList = new SelectList(scholarships, "ScholarshipID", "Scholarship");


                Student       s = new Student();
                Scholarshipss t = new Scholarshipss();

                Scholar d = new Scholar();

                d.StudentID = obj.StudentID;

                d.ScholarshipID = obj.ScholarshipID;
                d.ScholarID     = obj.ScholarID;

                k.Scholars.Add(d);
                k.SaveChanges();
            }

            catch (DbEntityValidationException e)
            {
                Console.WriteLine(e.ToString());
            }
            return(View(obj));
        }
Exemple #10
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("Tell me, {0}, do you have any versions of the Love Story {1} {2} {3} {4}",
                                             player.CharacterClass.Name,
                                             "to go with the Guard of Valor? I have found a few copies, but I am always looking",
                                             "for more. Each one has different information in them that helps me with",
                                             "my research. Please give me the Love Story now while I finish up with",
                                             "the Guard of Valor.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #11
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = "Oh, the mysterious Belt of the Moon. Do you have the scrolls on it? I've found a few that allude to its true nature, but haven't found anything with any detail.";
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("The Arms of the Winds! If I only had Anthos' {0} {1} {2}",
                                             "Fish Skin. It is important that I have the scales, since Anthos trapped the magic of",
                                             "the Arms of the Winds in the Skin. If you have lost the skin, and I hope you haven't,",
                                             "you will have to go find the scales again and bring them to me.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #13
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("Some of the other scholars have been {0} {1} {2} {3} {4}",
                                             "studying this shield. It belonged to someone named Remus, supposedly a great champion.",
                                             "Do you happen to have the story of the Aten Shield? Perhaps it will tell us more of",
                                             "Remus. I'm curious what the Atlanteans considered a great champion. Also, with the story,",
                                             "I should be able to unlock the power of this shield. If you don't have the story, go seek",
                                             "it out amongst the creatures of Oceanus.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #14
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("The magic contained in the Alvarus' Letter has {0} {1} {2} {3}",
                                             "already begun to work on the Leggings while they were in your possession. All I",
                                             "need now are the letters you have bundled up so that the spell will be complete.",
                                             "If you have accidentally lost those letters, you must go and find them before",
                                             "the spell can be completed.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #15
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                                                                                             (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                IDictionaryEnumerator versionsEnum = versions.GetEnumerator();
                versionsEnum.MoveNext();

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactID, versionsEnum.Value as ItemTemplate);
                    String reply = String.Format("Thank you! Here, take this cloak. {0}",
                                                 "I hope you find it useful. Please don't lose it, I can't replace it!");
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(base.ReceiveItem(source, target, item));
        }
Exemple #16
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                                                                                             (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    IDictionaryEnumerator versionsEnum = versions.GetEnumerator();
                    versionsEnum.MoveNext();
                    GiveItem(scholar, player, ArtifactID, versionsEnum.Value as ItemTemplate);
                    String reply = String.Format("Here is your staff. Do not lose it, it is irreplaceable.");
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemple #17
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("Tartaros' Gift is an interesting staff. The story of its {0} {1}",
                                             "making rather unique, don't you think? If you give me the scroll, I'll give you the",
                                             "staff, with all its ancient powers back.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("Vara was a very skilled healer and she put her skills {0} {1} {2}",
                                             "into the Healer's Embrace cloak. It would help me to unlock them if I was to read",
                                             "her Medical Log. Please give me Vara's Medical Log now so that I may awaken the",
                                             "magic within the Cloak for you.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            return(false);
        }
Exemple #19
0
        public ScholarActionsController(Scholar scholar)
        {
            _planner  = new ScholarActionsPlanner(scholar);
            _executer = new ScholarActionsExecuter();
            _executer.OnActionDone += ActionDone;

            Reset();
        }
Exemple #20
0
    public void Set(Scholar s)
    {
        active            = true;
        scholar           = s;
        scholar_name.text = "Scholar #" + scholar.Info.number;

        Refresh();
    }
Exemple #21
0
        public ActionResult ShowScholarship()
        {
            DB49Entities   db = new DB49Entities();
            List <Scholar> p  = new List <Scholar>();
            Scholar        o  = new Scholar();

            p = db.Scholars.ToList();
            return(View(p));
        }
Exemple #22
0
        public static IScholarItem Create(Scholar scholar, Type type)
        {
            switch (type)
            {
            case Type.Phone:
                return(new Phone(scholar));
            }

            throw new InvalidEnumArgumentException();
        }
Exemple #23
0
        public override bool Interact(Scholar scholar, GamePlayer player)
        {
            if (Step == 3)
            {
                string reply = "";
                DisplayStep3(scholar, player, reply);
            }

            return(false);
        }
Exemple #24
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                scholar.TurnTo(player);
                if (RemoveItem(player, item))
                {
                    Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID, (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                    String reply = "";

                    if (versions.Count > 1)
                    {
                        reply = "Great! ";
                        DisplayStep3(scholar, player, reply);
                        Step = 3;
                        return(true);
                    }
                    else
                    {
                        reply = String.Format("The magic of Eirene's Chestpiece is unlocked {0} {1}. {2} {3} {4} {5}, {1}!",
                                              "and linked now to you,", player.CharacterClass.Name,
                                              "Please know that if you lose or destroy this Chestpiece, it will be gone",
                                              "from you forever. I hope it will help you succeed in the trials.",
                                              "Bring glory to", GlobalConstants.RealmToName(player.Realm));

                        Dictionary <String, ItemTemplate> .Enumerator venum = versions.GetEnumerator();
                        venum.MoveNext();

                        if (GiveItem(scholar, player, ArtifactID, venum.Current.Value))
                        {
                            scholar.TurnTo(player);
                            scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                            FinishQuest();
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                String armorType = GlobalConstants.ArmorLevelToName(player.BestArmorLevel,
                                                                    (eRealm)player.Realm);
                ItemTemplate template = null;
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                                                                                             (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                foreach (String versionKey in versions.Keys)
                {
                    String[] serializedKey = versionKey.Split(';');
                    if (serializedKey[0] == armorType)
                    {
                        template = versions[versionKey];
                        break;
                    }
                }

                if (template != null && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactID, template);
                    String reply = String.Format("I feel fortunate to {0} {1} {2} {3} {4}. {5} {6} {7} {8}.",
                                                 "be able to study some of these artifacts that have survived from the days of the",
                                                 "Atlanteans. I am only sad that I shall never get to meet the people that created",
                                                 "wonderful objects like the Arms of the Winds. The magic in them has been",
                                                 "reawakened for you,",
                                                 player.CharacterClass.Name,
                                                 "You must take care of these sleeves because I cannot do it again. If you lose them",
                                                 "or they are  destroyed, the Arms of the Winds will be forever lost to you. I hope",
                                                 "they serve you well,",
                                                 player.CharacterClass.Name);
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemple #26
0
        public ScholarGOAPContext(Scholar scholar)
        {
            Add("Item_Phone_Have", true);

            Add("Program", "None");
            Add("Item", "None");
            Add("Location", "DockStation");

            _scholar = scholar;
            scholar.Items.OnItemsChanged       += ItemsChanged;
            scholar.Location.OnLocationChanged += LocationChanged;
        }
Exemple #27
0
        public ScholarAction GetPlan(Scholar scholar, string goalKey)
        {
            var actionsConstructor = new ScholarActionsConstructor(scholar);
            var operations         = new List <IScholarOperation>();
            var plan = GetGOAPPlan(scholar, goalKey);

            foreach (var action in plan)
            {
                operations.AddRange(actionsConstructor.Create(action.Name));
            }

            return(new ScholarAction(operations));
        }
Exemple #28
0
        /// <summary>
        /// Handle whispers to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, GameLiving target, string text)
        {
            if (base.WhisperReceive(source, target, text))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactID.ToLower())
            {
                String reply = String.Format("There is powerful magic flowing through that artifact, {0}, {1} {2}",
                                             player.CharacterClass.Name,
                                             "but I cannot release it without the spell hidden in the Journal. Please give me Eirene's",
                                             "Journal now. If you no longer have it, go and find the pages again. I will wait for you.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            if (Step == 3)
            {
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID, (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
                string version = text + ";;";

                if (versions.ContainsKey(version))
                {
                    if (GiveItem(scholar, player, ArtifactID, versions[version]))
                    {
                        String reply = String.Format("The magic of Eirene's Chestpiece is unlocked {0} {1}. {2} {3} {4} {5}, {1}!",
                                                     "and linked now to you,", player.CharacterClass.Name,
                                                     "Please know that if you lose or destroy this Chestpiece, it will be gone",
                                                     "from you forever. I hope it will help you succeed in the trials.",
                                                     "Bring glory to ", GlobalConstants.RealmToName(player.Realm));
                        scholar.TurnTo(player);
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                        FinishQuest();
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #29
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

            GamePlayer player  = source as GamePlayer;
            Scholar    scholar = target as Scholar;

            if (player == null || scholar == null)
            {
                return(false);
            }

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                String armorType = GlobalConstants.ArmorLevelToName(player.BestArmorLevel,
                                                                    (eRealm)player.Realm);
                ItemTemplate template = null;
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                                                                                             (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                foreach (String versionKey in versions.Keys)
                {
                    String[] serializedKey = versionKey.Split(';');
                    if (serializedKey[0] == armorType)
                    {
                        template = versions[versionKey];
                        break;
                    }
                }

                if (template != null && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactID, template);
                    String reply = String.Format("The spell is complete and the magic {0} {1}! {2} {3} {4}",
                                                 "of the Leggings has been reawakened from its long sleep! But heed this warning,",
                                                 player.CharacterClass.Name,
                                                 "Take good care of these leggings, because the magic contained within them is",
                                                 "fragile and if the leggings are lost or destroyed, the magic will be gone forever.",
                                                 "May these leggings serve you well as you travel through the trial planes.");
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemple #30
0
        private List <IGOAPReadOnlyAction> GetGOAPPlan(Scholar scholar, string goalKey)
        {
            var context  = new GOAPStateContext(scholar.GoapContext, scholar.ClassRoom.GoapContext);
            var comparer = new BaseCostComparer();
            var planner  = new GOAPPlanner(context, comparer);

            List <IGOAPReadOnlyAction> plan;

            if (!planner.TryGetBestPlan(GOAPGoalsManager.Instance.Goals[goalKey], out plan))
            {
                throw new Exception($"{scholar} не нашел план для цели \"{goalKey}\"");
            }

            return(plan);
        }
 /// <summary>
 /// Handle interaction with the scholar.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="text"></param>
 /// <param name="target"></param>
 /// <returns></returns>
 public virtual bool Interact(Scholar scholar, GamePlayer player)
 {
     return false;
 }
Exemple #32
0
		public void DisplayStep3(Scholar scholar, GamePlayer player, string reply)
		{
			Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID, (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

			reply += "Now you need to decide what version of " + ArtifactID + " you would like.  The following are available to you, please choose wisely. ";

			// versions will be in the format Name;  ... strip the ; when displaying, add it back when searching

			foreach (string version in versions.Keys)
			{
				reply += " [" + version.Replace(";", "") + "],";
			}

			reply = reply.TrimEnd(',');

			scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
		}
Exemple #33
0
		public override bool Interact(Scholar scholar, GamePlayer player)
		{
			if (Step == 3)
			{
				string reply = "";
				DisplayStep3(scholar, player, reply);
			}

			return false;
		}