Exemplo n.º 1
0
        public int GetJXP(NpcMonster monster, Group group)
        {
            int partySize = 1;
            double partyPenalty = 1d;

            if (group != null)
            {
                int levelSum = group.Characters.Sum(g => g.Character.Level);
                partySize = group.CharacterCount;
                partyPenalty = 12 / partySize / (double)levelSum;
            }

            // monster jobxp / penalty * rate
            int jobxp = (int)Math.Round(monster.JobXP * CharacterHelper.ExperiencePenalty(Level, monster.Level) * ServerManager.XPRate);

            // divide jobexp by multiplication of partyPenalty with level e.g. 57 * 0,014...
            if (partySize > 1 && group != null)
            {
                jobxp = (int)Math.Round(jobxp / (Level * partyPenalty));
            }

            return jobxp;
        }
Exemplo n.º 2
0
        public long GetXP(NpcMonster monster, Group group)
        {
            int partySize = 1;
            double partyPenalty = 1d;
            int levelDifference = Level - monster.Level;

            if (group != null)
            {
                int levelSum = group.Characters.Sum(g => g.Character.Level);
                partySize = group.CharacterCount;
                partyPenalty = 12 / partySize / (double)levelSum;
            }

            // xp calculation dependant on level difference
            long xpcalculation = levelDifference < 5 ? monster.XP : monster.XP / 3 * 2;

            // xp calculation / penalty * rate
            long xp = (long)Math.Round(xpcalculation * CharacterHelper.ExperiencePenalty(Level, monster.Level) * ServerManager.XPRate);

            // bonus percentage calculation for level 1 - 5 and difference of levels bigger or equal
            // to 4
            if (Level <= 5 && levelDifference < -4)
            {
                xp += xp / 2;
            }
            if (monster.Level >= 75)
            {
                xp *= 2;
            }

            // divide exp by multiplication of partyPenalty with level e.g. 57 * 0,014...
            if (partySize > 1 && group != null)
            {
                xp = (long)Math.Round(xp / (Level * partyPenalty));
            }

            return xp;
        }
Exemplo n.º 3
0
 public string GenerateFamilyMember(Group group)
 {
     string str = "gmbr 0";
     if (group != null)
     {
         foreach (ClientSession groupClientSession in group.Characters)
         {
             str +=
                 $" {groupClientSession.Character.CharacterId}|0|{groupClientSession.Character.Name}|{groupClientSession.Character.Level}|{groupClientSession.Character.Class}|0|0|{groupClientSession.Character.Gender}|0";
         }
     }
     return str;
 }