コード例 #1
0
ファイル: ChampionTitle.cs プロジェクト: towbes/DOLSharp
        /// <summary>
        /// The title value, shown over player's head.
        /// </summary>
        /// <param name="source">The player looking.</param>
        /// <param name="player">The title owner.</param>
        /// <returns>The title value.</returns>
        public override string GetValue(GamePlayer source, GamePlayer player)
        {
            if (player.Champion && player.ChampionLevel > 0)
            {
                return(LanguageMgr.TryTranslateOrDefault(source, string.Format("!CL Title {0}!", player.ChampionLevel), string.Format("Titles.CL.Level{0}", player.ChampionLevel)));
            }

            return(string.Empty);
        }
コード例 #2
0
        /// <summary>
        /// The title value, shown over player's head.
        /// </summary>
        /// <param name="source">The player looking.</param>
        /// <param name="player">The title owner.</param>
        /// <returns>The title value.</returns>
        public override string GetValue(GamePlayer source, GamePlayer player)
        {
            if (player.MLGranted && player.MLLevel > 0)
            {
                // try get player ML Number
                int mlline = GetPlayerMLLine(player);
                return(LanguageMgr.TryTranslateOrDefault(source, string.Format("!ML Title {0}!", mlline), string.Format("Titles.ML.Line{0}", mlline)));
            }

            return(LanguageMgr.TryTranslateOrDefault(source, "!None!", "DetailDisplayHandler.HandlePacket.None"));
        }
コード例 #3
0
        public String GetTitle(GamePlayer player, int skillLevel)
        {
            string profession = LanguageMgr.TryTranslateOrDefault(player, "!Profession!", Profession);

            try
            {
                return(LanguageMgr.TryTranslateOrDefault(player, "!None {0}!", GetTitleFormat(skillLevel), profession));
            }
            catch
            {
                return("<you may want to check your Crafting.txt language file>");
            }
        }
コード例 #4
0
        public virtual string GetTitle(GamePlayer player, int level)
        {
            // Clamp level in 5 by 5 steps - 50 is the max available translation for now
            int clamplevel = Math.Min(50, (level / 5) * 5);

            string none = LanguageMgr.TryTranslateOrDefault(player, "!None!", "PlayerClass.GetTitle.none");

            if (clamplevel > 0)
            {
                return(LanguageMgr.TryTranslateOrDefault(player, string.Format("!{0}!", m_name), string.Format("PlayerClass.{0}.GetTitle.{1}", m_name, clamplevel)));
            }

            return(none);
        }
コード例 #5
0
ファイル: CraftTitle.cs プロジェクト: towbes/DOLSharp
        /// <summary>
        /// The title value, shown over player's head.
        /// </summary>
        /// <param name="source">The player looking.</param>
        /// <param name="player">The title owner.</param>
        /// <returns>The title value.</returns>
        public override string GetValue(GamePlayer source, GamePlayer player)
        {
            if (player.CraftingPrimarySkill == eCraftingSkill.NoCrafting || !player.CraftingSkills.ContainsKey(player.CraftingPrimarySkill))
            {
                return(string.Format(LanguageMgr.TryTranslateOrDefault(source, "!BasicCrafting!", "Crafting.Name.BasicCrafting")));
            }

            var craftingSkill = CraftingMgr.getSkillbyEnum(player.CraftingPrimarySkill);
            var profession    = craftingSkill as AbstractProfession;

            if (profession == null)
            {
                return(craftingSkill.Name);
            }

            return(profession.GetTitle(source, player.CraftingSkills[player.CraftingPrimarySkill]));
        }
コード例 #6
0
 protected static string TryTranslate(string value, GamePlayer source)
 {
     return(LanguageMgr.TryTranslateOrDefault(source, string.Format("!{0}!", value), value));
 }
コード例 #7
0
ファイル: Level20Title.cs プロジェクト: towbes/DOLSharp
 /// <summary>
 /// The title value, shown over player's head.
 /// </summary>
 /// <param name="source">The player looking.</param>
 /// <param name="player">The title owner.</param>
 /// <returns>The title value.</returns>
 public override string GetValue(GamePlayer source, GamePlayer player)
 {
     return(LanguageMgr.TryTranslateOrDefault(source, "!Level {0}!", "Titles.Level.Level20", player.Level));
 }
コード例 #8
0
ファイル: Level20Title.cs プロジェクト: towbes/DOLSharp
 /// <summary>
 /// The title description, shown in "Titles" window.
 /// </summary>
 /// <param name="player">The title owner.</param>
 /// <returns>The title description.</returns>
 public override string GetDescription(GamePlayer player)
 {
     return(LanguageMgr.TryTranslateOrDefault(player, "!Level 20+!", "Titles.Level.Level20Info"));
 }