public static bool ExpPatch2(ref Upgradeable __instance, ref int count) { if (__instance.GetType() == typeof(Character)) { Character c = __instance as Character; if (fixNpcExpWaste.Value && c.SkillTree.CurrentSkillTree == null) { // 没有修炼秘籍,加回全部经验 count = (int)(count / (1.0f - Game.PlayData.SkillExpDistributionRate)); } cacheCharacterLevel = c.Level; } return(true); // 继续执行提升等级 }
public static void ExpPatch3(ref Upgradeable __instance, ref int count) { if (__instance.GetType() == typeof(Character)) { Character c = __instance as Character; if (c.Level != cacheCharacterLevel && (fixInTeamExp.Value || !Game.Teammates.Contains(c.Id))) { // 队伍没有,或者在队成长开启 int num3 = c.Level - cacheCharacterLevel; NpcGrowingItem npcGrowingItem = Game.Data.Get <NpcGrowingItem>(c.Id); if (npcGrowingItem != null) { int num4 = (Game.PlayData.Difficulty == GameDifficulty.Master) ? 2 : 1; foreach (KeyValuePair <CharacterProperty, int> keyValuePair in npcGrowingItem.Property) { if (keyValuePair.Value > 0) { c.AddProperty(keyValuePair.Key, keyValuePair.Value * num3 * num4, false); } } } } } }