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)
            {
                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 #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);
            }

            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))
                {
                    string reply = $"You now have a decision to make, {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 #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)
        {
            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));
        }
        /// <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);
        }
Exemple #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 = $"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);
        }
        /// <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);
        }
        /// <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);
        }
Exemple #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))
                {
                    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 #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);
            }

            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);
        }
        /// <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);
        }
Exemple #11
0
        /// <summary>
        /// Check whether it's actually possible to do the combine.
        /// </summary>
        /// <param name="selectedTarget"></param>
        /// <returns></returns>
        public override bool CheckBeginCast(GameLiving selectedTarget)
        {
            if (!base.CheckBeginCast(selectedTarget))
            {
                return(false);
            }

            if (!(Caster is GamePlayer player))
            {
                return(false);
            }

            InventoryItem scroll = player.UseItem;

            if (scroll == null || !ArtifactMgr.IsArtifactScroll(scroll))
            {
                return(false);
            }

            var backpack = player.Inventory.GetItemRange(eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack);

            foreach (InventoryItem item in backpack)
            {
                if (item != null && item != scroll)
                {
                    if (ArtifactMgr.CanCombine(scroll, item))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #12
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);
        }
Exemple #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))
                {
                    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);
        }
        /// <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));
        }
Exemple #15
0
        /// <summary>
        /// Check if player is eligible for this quest.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            // Must have the encounter, must have the book; must not be on the quest
            // and must not have the quest finished either.

            Type encounterType = ArtifactMgr.GetEncounterType(ArtifactID);

            if (encounterType == null)
            {
                m_reasonFailQualification = "It does not appear this encounter type is set up correctly.";
                log.Warn("ArtifactQuest: EncounterType is null for ArtifactID " + ArtifactID);
                return(false);
            }

            if (player == null)
            {
                m_reasonFailQualification = "Player is null for quest, serious error!";
                log.Warn("ArtifactQuest: Player is null for ArtifactID " + ArtifactID + " encounterType " + encounterType.FullName);
                return(false);
            }

            if (player.CanReceiveArtifact(ArtifactID) == false)
            {
                m_reasonFailQualification = "Your class is not eligible for this artifact.";
                return(false);
            }

            if (player.Level < Level)
            {
                m_reasonFailQualification = "You must be at least level " + Level + " in order to complete this quest.";
                return(false);
            }

            if (player.HasFinishedQuest(this.GetType()) != 0)
            {
                m_reasonFailQualification = "You've already completed the quest for this artifact.";
                return(false);
            }

            if (player.HasFinishedQuest(encounterType) <= 0)
            {
                m_reasonFailQualification = "You must first get the encounter credit for this artifact.";
                return(false);
            }

            if (!ArtifactMgr.HasBook(player, ArtifactID))
            {
                m_reasonFailQualification = "You are missing the correct book for this artifact.";
                return(false);
            }

            if (player.IsDoingQuest(this.GetType()) != null)
            {
                m_reasonFailQualification = "You've already started the quest for this artifact.";
                return(false);
            }

            return(true);
        }
Exemple #16
0
        /// <summary>
        /// When finishing an artifact quest remove the encounter
        /// credit.
        /// </summary>
        public override void FinishQuest()
        {
            base.FinishQuest();

            Type encounterType = ArtifactMgr.GetEncounterType(ArtifactID);

            QuestPlayer.RemoveEncounterCredit(encounterType);
        }
Exemple #17
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));
        }
Exemple #18
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);
        }
        /// <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 #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)
            {
                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>
        /// 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);
        }
Exemple #22
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 #23
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 #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);
            }

            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);
        }
Exemple #25
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);
        }
Exemple #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 == 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));
        }
Exemple #28
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);
        }
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)
            {
                scholar.TurnTo(player);
                if (RemoveItem(player, item))
                {
                    String reply = String.Format("Great! Now, I can make you a [single] handed or [double] handed version");

                    switch (player.CharacterClass.ID)
                    {
                    case (int)eCharacterClass.Armsman:
                        reply += " or I can make you a [polearm] version. Which would you prefer?";
                        break;

                    default:
                        reply += ", which would you prefer?";
                        break;
                    }

                    scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
                    Step = 3;
                    return(true);
                }
            }

            return(false);
        }
Exemple #30
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);
        }