Exemplo n.º 1
0
 /// <summary>
 /// Allow the model to update any model specific things about changing professions
 /// <param name="character">The character who the defaults are for.</param>
 /// </summary>
 public virtual void UpdateProfessions(Character character)
 {
     #region Buffs related to Professions to Force Enable
     // Miners should always have this buff activated, others shouldn't have this buff
     if (character.HasProfession(Profession.Mining) & !character.ActiveBuffsContains("Toughness")) {
         character.ActiveBuffsAdd("Toughness");
     } else if (character.ActiveBuffsContains("Toughness") && !character.HasProfession(Profession.Mining)) {
         character.ActiveBuffs.Remove(Buff.GetBuffByName("Toughness"));
     }
     // Skinners should always have this buff activated, others shouldn't have this buff
     if (character.HasProfession(Profession.Skinning) & !character.ActiveBuffsContains("Master of Anatomy")) {
         character.ActiveBuffsAdd("Master of Anatomy");
     } else if (character.ActiveBuffsContains("Master of Anatomy") && !character.HasProfession(Profession.Skinning)) {
         character.ActiveBuffs.Remove(Buff.GetBuffByName("Master of Anatomy"));
     }
     // Herbalists should always have this buff activated, others shouldn't have this buff
     if (character.HasProfession(Profession.Herbalism) & !character.ActiveBuffsContains("Lifeblood")) {
         character.ActiveBuffsAdd("Lifeblood");
     } else if (character.ActiveBuffsContains("Lifeblood") && !character.HasProfession(Profession.Herbalism)) {
         character.ActiveBuffs.Remove(Buff.GetBuffByName("Lifeblood"));
     }
     // Engineers should always have this buff activated IF the Primary is
     if (character.HasProfession(Profession.Engineering))
     {
         List<String> list = new List<string>() {
             "Runic Mana Injector",
             "Runic Healing Injector",
         };
         foreach (String name in list)
         {
             if (character.ActiveBuffs.Contains(Buff.GetBuffByName(name)) &&
                 !character.ActiveBuffs.Contains(Buff.GetBuffByName(name + " (Engineer Bonus)")))
             {
                 character.ActiveBuffs.Add(Buff.GetBuffByName(name + " (Engineer Bonus)"));
             }
         }
     }
     // NOTE: Might do this again for Alchemy and Mixology but
     // there could be conflicts for different specialties,
     // need to investigate first
     #endregion
     for (int i = 0; i < character.CurrentGemmingTemplates.Count; i++)
     {
         if (character.CurrentGemmingTemplates[i].Group.Contains("Jewelcrafter"))
         {
             character.CurrentGemmingTemplates[i].Enabled = character.HasProfession(Profession.Jewelcrafting);
         }
         else if (character.CurrentGemmingTemplates[i].Group.Contains("Engineer"))
         {
             character.CurrentGemmingTemplates[i].Enabled = character.HasProfession(Profession.Engineering);
         }
     }
 }