Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
xp is easier to get
Browse files Browse the repository at this point in the history
  • Loading branch information
matievisthekat committed Jul 3, 2020
1 parent 225221c commit ac0e722
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/structures/base/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ class MsgExtension extends Message {
} else if (!this.author.currency.model) await this.author.currency.load();

if (!this.currencyXpCooldown.has(this.author.id)) {
const xpToAdd = this.client.util.randomInRange(5, 12);
const xpToAdd = this.client.util.randomInRange(20, 140);

await this.author.currency.addXp(xpToAdd);

this.currencyXpCooldown.add(this.author.id);
setTimeout(() => this.currencyXpCooldown.delete(this.author.id), 10000);
setTimeout(() => this.currencyXpCooldown.delete(this.author.id), 4000);

const currentLevel = this.author.currency.level;
const currentXp = this.author.currency.xp;
Expand Down
11 changes: 6 additions & 5 deletions src/structures/currency/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ module.exports = class User {
async update() {
if (!this.model) await this.load();

this.wallet = this.model.wallet;
this.bank = this.model.bank;
this.xp = this.model.economyXp;
this.level = this.model.economyLevel;
this.bankLimit = this.model.bankLimit;
this.wallet = Math.floor(this.model.wallet);
this.bank = Math.floor(this.model.bank);
this.xp = Math.floor(this.model.economyXp);
this.level = Math.floor(this.model.economyLevel);
this.bankLimit = Math.floor(this.model.bankLimit);

return this;
}
Expand Down Expand Up @@ -69,6 +69,7 @@ module.exports = class User {
if (!this.model) await this.load();

this.model.economyXp += amount;
this.model.bankLimit += Math.floor(amount / 6);

await this.model.save();

Expand Down

0 comments on commit ac0e722

Please sign in to comment.