Exemplo n.º 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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

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

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactId, versions[";;"]);
                    string reply = $"Do you see how the stars in the band have begun to glow, {player.CharacterClass.Name}? That is because the magic of the bracelet is active again. It shall flow through the Band and into you, then back into the Band. Because of this flow, you may not give the bracelet to anyone else. Destroying the Bracelet will end the flow of magic and once stopped, it cannot be restarted again. May the Band of Stars guide you to success in the trials,  {player.CharacterClass.Name}.";
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 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)
            {
                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);
        }
Exemplo n.º 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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

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

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactId, versions[";;"]);
                    string reply = "Great! Thanks! This should help us in 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);
        }
Exemplo n.º 4
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

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

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactId, versions[";;"]);
                    string reply = $"Ahh. This is a tale about some great crazy champion named Remus. There\'s not much known about him, or his father, except what is in this tale. I\'ve read pieces of it, but never did we find all the letters. It\'s a great find. Thank you, {player.Name}.";
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 5
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

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

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactId, versions[";;"]);
                    string reply = $"Here is the Healer\'s Embrace Cloak, restored to its original power. It is a fine cloak and I wish I could keep it, but it is for you and you alone. Do not destroy it because you will never have access to its full power again. Take care of it and it shall aid you in the trials, {player.CharacterClass.Name}!";
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 6
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

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

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactId, versions[";;"]);
                    string reply = $"Can you feel the magic of the Guard of Valor flowing once again? It comes from Aloeus\' love for his beautiful Nikolia. When Aloeus presented the gift to Nikolia, the magic in it bound to her. And now as I present it to you, the magic in it will bind itself to you, so that no other may wear it. I beg you, {player.CharacterClass.Name}, take care not to destroy such a gift! It cannot be replaced! I wish you well, {player.CharacterClass.Name}.";
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 7
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));
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

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

                if (versions.Count > 0 && RemoveItem(player, item))
                {
                    GiveItem(scholar, player, ArtifactId, versions[";;"]);
                    string reply = "Brilliant, thank you! Here, take the artifact. I\'ve unlocked its powers for you. As I\'ve said before, I\'m more interested in the stories and the history behind these artifacts than the actual items themselves.";
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
        /// <summary>
        /// Called from ArtifactScholar when he receives a whisper
        /// </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)
        {
            GamePlayer      player  = source as GamePlayer;
            ArtifactScholar scholar = target as ArtifactScholar;

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

            //Did they send a valid string?
            if (m_curTypes.Contains(text))
            {
                //Apend their choice to the chosen types
                m_chosenTypes = string.Format("{0}{1};", m_chosenTypes, text);

                //Lets get the next set of options
                //Get the versions of this art
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID, (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);

                //If we still have more options, give it to them
                if (GetNextOptions(versions) && virtualStep < MAXNUMOFSTEPS)
                {
                    SaveProperties();

                    scholar.TurnTo(player);
                    scholar.SayTo(player, string.Format("Would you prefer {0} of {1}?", GetOptions(), ArtifactID));
                    Step++;
                }
                //Else lets hand them their finished artifact!
                else
                {
                    scholar.TurnTo(player);
                    //Attempt to get the right version of the artifact

                    m_chosenTypes = m_chosenTypes.Replace(";;", ";");

                    if (!versions.ContainsKey(m_chosenTypes))
                    {
                        log.Warn(String.Format("Artifact version {0} not found", m_chosenTypes));
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, "I can't find your chosen replacement, it may not be available for your class. Please try again.");
                        ReturnArtifact(player);
                        return(true);
                    }

                    ItemTemplate template = versions[m_chosenTypes] as ItemTemplate;

                    if (GiveItem(player, template))
                    {
                        FinishQuest();
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, string.Format("Here is your {0}, {1}. May it serve you well!", ArtifactID, player.CharacterClass.Name));
                        return(true);
                    }

                    return(false);
                }
            }
            return(base.WhisperReceive(source, target, text));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Called from ArtifactScholar when he receives a whisper
        /// </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 (!(source is GamePlayer player) || !(target is ArtifactScholar scholar))
            {
                return(false);
            }

            // Did they send a valid string?
            if (CurrentTypes.Contains(text))
            {
                // Apend their choice to the chosen types
                ChosenTypes = $"{ChosenTypes}{text};";

                // Lets get the next set of options
                // Get the versions of this art
                Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactId, (eCharacterClass)player.CharacterClass.ID, player.Realm);

                // If we still have more options, give it to them
                if (GetNextOptions(versions) && _virtualStep < MaxNumOfSteps)
                {
                    SaveProperties();

                    scholar.TurnTo(player);
                    scholar.SayTo(player, $"Would you prefer {GetOptions()} of {ArtifactId}?");
                    Step++;
                }

                // Else lets hand them their finished artifact!
                else
                {
                    scholar.TurnTo(player);

                    // Attempt to get the right version of the artifact
                    ChosenTypes = ChosenTypes.Replace(";;", ";");

                    if (!versions.ContainsKey(ChosenTypes))
                    {
                        Log.Warn($"Artifact version {ChosenTypes} not found");
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, "I can't find your chosen replacement, it may not be available for your class. Please try again.");
                        ReturnArtifact(player);
                        return(true);
                    }

                    ItemTemplate template = versions[ChosenTypes];

                    if (GiveItem(player, template))
                    {
                        FinishQuest();
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, $"Here is your {ArtifactId}, {player.CharacterClass.Name}. May it serve you well!");
                        return(true);
                    }

                    return(false);
                }
            }

            return(base.WhisperReceive(source, target, text));
        }
Exemplo n.º 12
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactId.ToLower())
            {
                string reply = "The scholars have often remarked about the craftsmanship that went into these bracers. I\'m impressed. I don\'t think we can make anything to compare with it. Hmm. Well, I\'m here to study the lifestyles of Atlanteans through their written words, not their crafts. Hand me the Arbiter\'s Personal Papers please. If you don\'t have it, I suggest you hunt the creatures of Oceanus til you find it.";
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }
            else if (Step == 3)
            {
                switch (text.ToLower())
                {
                case "strength":
                case "constitution":
                case "dexterity":
                case "quickness":
                case "casting":
                {
                    string versionId = $";;{text.ToLower()}";
                    Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactId, (eCharacterClass)player.CharacterClass.ID, player.Realm);
                    ItemTemplate template = versions[versionId];
                    if (template == null)
                    {
                        Log.Warn($"Artifact version {versionId} not found");
                        return(false);
                    }

                    if (GiveItem(scholar, player, ArtifactId, template))
                    {
                        string reply = "You have made your choice. Here is your bracer. Do not lose it. It is irreplaceable.";
                        scholar.TurnTo(player);
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                        FinishQuest();
                        return(true);
                    }

                    return(false);
                }
                }

                return(false);
            }

            return(false);
        }
Exemplo n.º 13
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);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Check if player can use the reward.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public virtual bool CheckRewardQualification(GamePlayer player)
        {
            if (player == null)
            {
                return(false);
            }

            Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactId, (eCharacterClass)player.CharacterClass.ID, player.Realm);

            return(versions.Count > 0);
        }
Exemplo n.º 16
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);
        }
Exemplo n.º 17
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);
        }
Exemplo n.º 18
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                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, player.Realm);

                    string reply;

                    if (versions.Count > 1)
                    {
                        reply = "Great! ";
                        DisplayStep3(scholar, player, reply);
                        Step = 3;
                        return(true);
                    }

                    reply = $"The magic of Eirene\'s Chestpiece is unlocked 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)}, {player.CharacterClass.Name}!";

                    using (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);
        }
Exemplo n.º 19
0
        public void DisplayStep3(Scholar scholar, GamePlayer player, string reply)
        {
            Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactId, (eCharacterClass)player.CharacterClass.ID, 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(";", string.Empty) + "],";
            }

            reply = reply.TrimEnd(',');

            scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
        }
Exemplo n.º 20
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("Here, take these boots! I hope you find {0}",
                                                 "them useful. Don't lose them, I can only unlock their power for you once!");
                    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)
        {
            GamePlayer      player  = source as GamePlayer;
            ArtifactScholar scholar = target as ArtifactScholar;

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

            //If the player is on the right step (the give me an art step)
            if (Step == 0)
            {
                //Lets see if they gave us a valid artifact
                string ArtID = ArtifactMgr.GetArtifactIDFromItemID(item.Id_nb);
                Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtID, (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
                //If this artifact has more than one option for them, give them the quest
                if (versions != null && item != null && versions.Count > 1 && RemoveItem(player, item))
                {
                    m_artifactID = ArtID;
                    SetCustomProperty("Art", ArtifactID);
                    SetCustomProperty("Id_nb", item.Id_nb);
                    SetCustomProperty("AXP", (item as InventoryArtifact).Experience.ToString());
                    SetCustomProperty("ALevel", (item as InventoryArtifact).ArtifactLevel.ToString());

                    GetNextOptions(versions);

                    SaveProperties();

                    scholar.TurnTo(player);
                    scholar.SayTo(player, string.Format("Would you prefer {0} of {1}?", GetOptions(), ArtifactID));
                    Step = 1;
                    return(true);
                }
            }
            else
            {
                //Why are they giving this to us!
                player.Out.SendMessage(string.Format("{0} doesn't want that item.", scholar.Name),
                                       eChatType.CT_Say, eChatLoc.CL_SystemWindow);
            }

            return(base.ReceiveItem(source, target, item));
        }
Exemplo n.º 22
0
        /// <summary>
        /// Check if player is eligible for this quest.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            bool          artCheck = false;
            List <string> arts     = ArtifactMgr.GetArtifacts(player);

            foreach (string art in arts)
            {
                Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(art, (eCharacterClass)player.CharacterClass.ID, player.Realm);
                if (versions.Count > 1)
                {
                    artCheck = true;
                    break;
                }
            }

            return(player != null &&
                   player.IsDoingQuest(GetType()) == null &&
                   artCheck);
        }
Exemplo n.º 23
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 (!(source is GamePlayer player) || !(target is ArtifactScholar scholar))
            {
                return(false);
            }

            // If the player is on the right step (the give me an art step)
            if (Step == 0)
            {
                // Lets see if they gave us a valid artifact
                string artId = ArtifactMgr.GetArtifactIDFromItemID(item.Id_nb);
                Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(artId, (eCharacterClass)player.CharacterClass.ID, player.Realm);

                // If this artifact has more than one option for them, give them the quest
                if (versions != null && versions.Count > 1 && RemoveItem(player, item))
                {
                    _artifactId = artId;
                    SetCustomProperty("Art", ArtifactId);
                    SetCustomProperty("Id_nb", item.Id_nb);
                    SetCustomProperty("AXP", (item as InventoryArtifact)?.Experience.ToString());
                    SetCustomProperty("ALevel", (item as InventoryArtifact)?.ArtifactLevel.ToString());

                    GetNextOptions(versions);

                    SaveProperties();

                    scholar.TurnTo(player);
                    scholar.SayTo(player, $"Would you prefer {GetOptions()} of {ArtifactId}?");
                    Step = 1;
                    return(true);
                }
            }
            else
            {
                // Why are they giving this to us!
                player.Out.SendMessage($"{scholar.Name} doesn't want that item.", eChatType.CT_Say, eChatLoc.CL_SystemWindow);
            }

            return(base.ReceiveItem(source, target, item));
        }
Exemplo n.º 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)
            {
                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("Do you see how the stars in the {0} {1}? {2} {3} {4} {5} {6} {7}.",
                                                 "band have begun to glow, ",
                                                 player.CharacterClass.Name,
                                                 "That is because the magic of the bracelet is active again. It shall flow through",
                                                 "the Band and into you, then back into the Band. Because of this flow, you may not",
                                                 "give the bracelet to anyone else. Destroying the Bracelet will end the flow of",
                                                 "magic and once stopped, it cannot be restarted again. May the Band of Stars guide",
                                                 "you to success in the trials, ",
                                                 player.CharacterClass.Name);
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 25
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactId.ToLower())
            {
                string reply = $"There is powerful magic flowing through that artifact, {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, player.Realm);
                string version = text + ";;";

                if (versions.ContainsKey(version))
                {
                    if (GiveItem(scholar, player, ArtifactId, versions[version]))
                    {
                        string reply = $"The magic of Eirene\'s Chestpiece is unlocked 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)}, {player.CharacterClass.Name}!";
                        scholar.TurnTo(player);
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                        FinishQuest();
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 26
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 > -1 && 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("Here is the {0}, {1} {2} {3} {4}, {5}!",
                                                 "restored to its original power. It is a fine item and I wish I could keep",
                                                 "it, but it is for you and you alone. Do not destroy it because you will never",
                                                 "have access to its full power again. Take care of it and it shall aid you in",
                                                 "the trials",
                                                 ArtifactID,
                                                 player.CharacterClass.Name);
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 27
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("Ahh. This is a tale about some great {0} {1} {2} {3}.",
                                                 "crazy champion named Remus. There's not much known about him, or his father,",
                                                 "except what is in this tale. I've read pieces of it, but never did we find all",
                                                 "the letters. It's a great find. Thank you,",
                                                 player.Name);
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 28
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("Brilliant, thank you! Here, take the artifact. {0} {1} {2}",
                                                 "I've unlocked its powers for you. As I've said before, I'm more interested",
                                                 "in the stories and the history behind these artifacts than the actual items",
                                                 "themselves.");
                    scholar.TurnTo(player);
                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    FinishQuest();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 29
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 scholars have often remarked about the {0} {1} {2} {3} {4}",
                                             "craftsmanship that went into these bracers. I'm impressed. I don't think we can make",
                                             "anything to compare with it. Hmm. Well, I'm here to study the lifestyles of Atlanteans",
                                             "through their written words, not their crafts. Hand me the Arbiter's Personal Papers",
                                             "please. If you don't have it, I suggest you hunt the creatures of Oceanus til you",
                                             "find it.");
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }
            else if (Step == 3)
            {
                switch (text.ToLower())
                {
                case "strength":
                case "constitution":
                case "dexterity":
                case "quickness":
                case "casting":
                {
                    String versionID = String.Format(";;{0}", text.ToLower());
                    Dictionary <String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
                                                                                                 (eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
                    ItemTemplate template = versions[versionID];
                    if (template == null)
                    {
                        log.Warn(String.Format("Artifact version {0} not found", versionID));
                        return(false);
                    }
                    if (GiveItem(scholar, player, ArtifactID, template))
                    {
                        String reply = String.Format("You have made your choice. Here is your {0}",
                                                     "bracer. Do not lose it. It is irreplaceable.");
                        scholar.TurnTo(player);
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                        FinishQuest();
                        return(true);
                    }
                    return(false);
                }
                }
                return(false);
            }

            return(false);
        }
Exemplo n.º 30
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);
            }

            if (!(source is GamePlayer player) || !(target is Scholar scholar))
            {
                return(false);
            }

            if (Step == 1 && text.ToLower() == ArtifactId.ToLower())
            {
                string reply =
                    $"Ah, Bruiser! Many smiths would love a hammer such as that! Well, for  {player.GetName(1, false)} like you, I am not sure what purpose it will serve! I hope you have better luck than its previous owner! Do you have any scrolls with it?";
                scholar.TurnTo(player);
                scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                Step = 2;
                return(true);
            }

            if (Step == 3)
            {
                switch (text.ToLower())
                {
                case "single":
                case "double":
                case "polearm":
                {
                    if (text.ToLower() == "polearm" && player.CharacterClass.ID != (int)eCharacterClass.Armsman)
                    {
                        return(false);
                    }

                    string versionId = $";{text.ToLower()};";
                    Dictionary <string, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactId, (eCharacterClass)player.CharacterClass.ID, player.Realm);
                    if (!versions.ContainsKey(versionId))
                    {
                        Log.Warn($"Artifact version {versionId} not found");
                        return(false);
                    }

                    ItemTemplate template = versions[versionId];
                    if (GiveItem(scholar, player, ArtifactId, template))
                    {
                        string reply = "May Bruiser serve you well. Do not lose this, for I can only unlock the artifact\'s powers once.";
                        scholar.TurnTo(player);
                        scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                        FinishQuest();
                        return(true);
                    }

                    return(false);
                }
                }

                return(false);
            }

            return(false);
        }