Beispiel #1
0
        private static void AddXpMob(Client client, ulong pAddXp)
        {
            client.Character.Mob.Exp += (ulong)(pAddXp * P_39D.GetBonusXp(client.Character));

            //atualiza o xp do client
            client.Send(P_337.New(client));

            //trata as mensagens de level, 1/4, 2/4 e 3/4
            if (client.Character.Mob.BaseStatus.Level <= 399)
            {
                if (client.Character.Mob.Exp <= Rate.Exp_Mortal_Arch[client.Character.Mob.BaseStatus.Level])
                {
                    ulong vaLevelOrigem = client.Character.Mob.BaseStatus.Level == 0 ? 0 : Rate.Exp_Mortal_Arch[client.Character.Mob.BaseStatus.Level - 1];
                    ulong vaNextLevel   = Rate.Exp_Mortal_Arch[client.Character.Mob.BaseStatus.Level];

                    ulong diferenca = vaNextLevel - vaLevelOrigem;

                    ulong va1 = vaLevelOrigem + (diferenca / 4);
                    ulong va2 = vaLevelOrigem + ((diferenca / 4) * 2);
                    ulong va3 = vaLevelOrigem + ((diferenca / 4) * 3);

                    ulong xpAtual = client.Character.Mob.Exp;

                    if ((xpAtual >= va1 && xpAtual < va2))
                    {
                        client.Send(P_101.New("1/4 BONUS"));
                        client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                    }
                    else if ((xpAtual >= va2 && xpAtual <= va3))
                    {
                        client.Send(P_101.New("2/4 BONUS"));
                        client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                    }
                    else if ((xpAtual >= va3 && xpAtual <= vaNextLevel))
                    {
                        client.Send(P_101.New("3/4 BONUS"));
                        client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                    }
                }
                else
                {
                    Functions.GetCurrentScore(client, true);
                    client.Send(P_101.New("++++++ Level Up ++++++"));
                    client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                }
            }
        }
Beispiel #2
0
        public static P_337 New(Client client)
        {
            P_337 tmp = new P_337
            {
                Header      = SHeader.New(0x0337, Marshal.SizeOf <P_337>(), client.ClientId),
                CPoint      = client.Character.Mob.CPoint == 0 ? 0 : (uint)client.Character.Mob.Exp,
                Exp         = client.Character.Mob.Exp,
                Learn       = client.Character.Mob.LearnedSkill,
                StatusPoint = client.Character.Mob.StatusPoint,
                MasterPoint = client.Character.Mob.MasterPoint,
                GoldMob     = client.Character.Mob.Gold,
                SkillPoint  = client.Character.Mob.SkillPoint,
                Magic       = client.Character.Mob.MagicIncrement,
            };

            return(tmp);
        }