public static Type GetJobType(Enums.JobsIDEnums jobID) { if (Jobs.ContainsKey(jobID)) { return(Jobs[jobID]); } return(null); }
public static Job CreateNewJob(Enums.JobsIDEnums jobID) { Type jobType = GetJobType(jobID); if (jobType != null) { return((Job)Activator.CreateInstance(jobType, new object[2] { 0, 1 })); } else { return(null); } }
public static void LearnJob(Network.WorldClient client, Enums.JobsIDEnums jobType) { if (!client.Character.HaveJob(jobType)) { if (client.Character.Jobs.Count < 3) { var job = Game.Jobs.JobManager.CreateNewJob(jobType); client.Character.Jobs.Add(job); client.Action.RefreshCharacterJob(); } else { client.Action.SystemMessage("Vous possedez trop de metier pour en apprendre un nouveau !"); } } else { client.Action.SystemMessage("Vous connaissez deja ce métier !"); } }
public bool HaveJob(Enums.JobsIDEnums id) { return(this.Jobs.FindAll(x => x.JobID == (int)id).Count > 0); }