public static void AddExp(this ExpTarget target, int exp) { switch (target.TargetType()) { case ExpTargetType.Attribute: //Util.WriteToChat($"Add experience to attribute {target}"); Globals.Host.Actions.AddAttributeExperience(target.AsAttribute(), exp); break; case ExpTargetType.Vital: //Util.WriteToChat($"Add experience to vital {target}"); Globals.Host.Actions.AddVitalExperience(target.AsVital(), exp); break; case ExpTargetType.Specialized: case ExpTargetType.Trained: //Util.WriteToChat($"Add experience to skill {target}"); Globals.Host.Actions.AddSkillExperience(target.AsSkill(), exp); break; default: Util.WriteToChat($"Failed to add {exp} exp to {target.GetName()}"); break; } }
public static ExpTargetType TargetType(this ExpTarget target) { var enumVal = (int)target; if (enumVal >= ExpHelper.VITAL_OFFSET) { return(ExpTargetType.Vital); } if (enumVal >= ExpHelper.ATTRIBUTE_OFFSET) { return(ExpTargetType.Attribute); } //Determine skill train status switch (Globals.Host.Actions.SkillTrainLevel[target.AsSkill()]) { case 3: return(ExpTargetType.Specialized); case 2: return(ExpTargetType.Trained); case 1: return(ExpTargetType.Untrained); case 0: return(ExpTargetType.Unusable); } //Globals.Core.CharacterFilter.Skills[(CharFilterSkillType)target].Training; -- Throws errors with summoning throw new Exception("Unknown experience target type encountered."); }
public static int GetTimesLeveled(this ExpTarget target) { switch (target.TargetType()) { case ExpTargetType.Attribute: return(Globals.Host.Actions.AttributeClicks[target.AsAttribute()]); // // Globals.Host.Actions.VitalClicks case ExpTargetType.Vital: return(Globals.Host.Actions.VitalClicks[target.AsVital()]); break; case ExpTargetType.Trained: case ExpTargetType.Specialized: return(Globals.Host.Actions.SkillClicks[target.AsSkill()]); break; } return(-1); }