/// <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.º 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)
            {
                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.º 3
0
        /// <summary>
        /// Handle an item given to the scholar.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="item"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
        {
            if (base.ReceiveItem(source, target, item))
            {
                return(true);
            }

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

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

            if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
            {
                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);
        }