/// <summary> /// A player earns XP through natural progression, ie. kills and quests completed /// </summary> /// <param name="amount">The amount of XP being added</param> /// <param name="xpType">The source of XP being added</param> /// <param name="shareable">True if this XP can be shared with Fellowship</param> public void EarnXP(long amount, XpType xpType, ShareType shareType = ShareType.All) { //Console.WriteLine($"{Name}.EarnXP({amount}, {sharable}, {fixedAmount})"); // apply xp modifier var modifier = PropertyManager.GetDouble("xp_modifier").Item; var enchantment = EnchantmentManager.GetXPMod(); var m_amount = (long)Math.Round(amount * enchantment * modifier); if (m_amount < 0) { log.Warn($"{Name}.EarnXP({amount}, {shareType})"); log.Warn($"modifier: {modifier}, enchantment: {enchantment}, m_amount: {m_amount}"); return; } GrantXP(m_amount, xpType, shareType); }