xp equation stabilized

master
Kit Kasune 4 years ago
parent eba7b53472
commit f661c2d65a
  1. 2
      commands/stats.js
  2. 2
      util/lxp/gainxp.js

@ -31,7 +31,7 @@ module.exports = {
.setTitle(`${u.displayName}${u.displayName.toLowerCase().endsWith('s') ? "'" : "'s"} Stats`) .setTitle(`${u.displayName}${u.displayName.toLowerCase().endsWith('s') ? "'" : "'s"} Stats`)
.setDescription("Local leveling stats") .setDescription("Local leveling stats")
.addField("Level", xp.level, true) .addField("Level", xp.level, true)
.addField("XP", `**${xp.xp}** of **${Math.ceil(100 + (((xp.level / 3) ** 1.4) * 1.4))}** needed to level up`, true) .addField("XP", `**${xp.xp}** of **${Math.ceil(100 + (((xp.level / 3) ** 2) * 2))}** needed to level up`, true)
.setThumbnail(client.users.cache.get(u.id).avatarURL({size: 2048})) .setThumbnail(client.users.cache.get(u.id).avatarURL({size: 2048}))
.setColor("c375f0") .setColor("c375f0")
.setFooter("Natsuki") .setFooter("Natsuki")

@ -6,7 +6,7 @@ module.exports = async (client, member, channel) => {
client.misc.cache.lxp.xp[channel.guild.id][member].xp += 10; client.misc.cache.lxp.xp[channel.guild.id][member].xp += 10;
let x = client.misc.cache.lxp.xp[channel.guild.id][member].level; let x = client.misc.cache.lxp.xp[channel.guild.id][member].level;
let max = Math.ceil(100 + (((x / 3) ** 1.4) * 1.4)); let max = Math.ceil(100 + (((x / 3) ** 2) * 2));
if (client.misc.cache.lxp.xp[channel.guild.id][member].xp > max) { if (client.misc.cache.lxp.xp[channel.guild.id][member].xp > max) {
client.misc.cache.lxp.xp[channel.guild.id][member].xp -= max; client.misc.cache.lxp.xp[channel.guild.id][member].xp -= max;

Loading…
Cancel
Save