示例#1
0
 public static Type GetJobType(Enums.JobsIDEnums jobID)
 {
     if (Jobs.ContainsKey(jobID))
     {
         return(Jobs[jobID]);
     }
     return(null);
 }
示例#2
0
        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);
            }
        }
示例#3
0
        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 !");
            }
        }
示例#4
0
 public bool HaveJob(Enums.JobsIDEnums id)
 {
     return(this.Jobs.FindAll(x => x.JobID == (int)id).Count > 0);
 }