Ejemplo n.º 1
0
        public void AddJobXp(sbyte jobid, ulong amount)
        {
            var job = CharacterJobRecord.GetJob(Id, jobid);

            if (job.JobLevel == 200)
            {
                return;
            }
            var exp = ExperienceRecord.GetExperienceForLevel((uint)(job.JobLevel + 1));

            if (job.JobExp + amount >= exp)
            {
                job.JobLevel++;
                Client.Send(new JobLevelUpMessage(job.JobLevel, job.GetJobDescription()));
                if (job.JobLevel == 200)
                {
                    job.JobExp = exp;
                    RefreshJobs();
                    return;
                }
                AddJobXp(jobid, amount);
            }
            else
            {
                job.JobExp += amount;
            }
            SaveTask.UpdateElement(job);
            RefreshJobs();
        }
        public override void Ready(bool ready, ushort step)
        {
            var crafterLevel  = CharacterJobRecord.GetJob(Client.Character.Id, JobId).JobLevel;
            var currentRecipe = RecipeRecord.GetRecipe(CraftedItems, (ushort)SkillId);

            if (currentRecipe.IsNull())
            {
                Client.Send(new ExchangeCraftResultMessage((sbyte)CraftResultEnum.CRAFT_IMPOSSIBLE));
                return;
            }
            else if (currentRecipe.ResultLevel > crafterLevel)
            {
                Client.Character.Reply("Vous n'avez pas le niveau pour effectuer ce craft!");
                return;
            }
            ReplayEngine = new CraftReplayEngine(this, currentRecipe);
            ReplayEngine.Start();
        }