mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
added give levels methods
This commit is contained in:
parent
875a95b412
commit
f6396e6406
@ -305,6 +305,13 @@ public class PlayerData {
|
|||||||
getStats().updateAll();
|
getStats().updateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void giveLevels(int value) {
|
||||||
|
int total = 0;
|
||||||
|
while (value-- > 0)
|
||||||
|
total += MMOCore.plugin.configManager.getNeededExperience(getLevel() + value + 1);
|
||||||
|
giveExperience(total);
|
||||||
|
}
|
||||||
|
|
||||||
public void setExperience(int value) {
|
public void setExperience(int value) {
|
||||||
experience = Math.max(0, value);
|
experience = Math.max(0, value);
|
||||||
refreshVanillaExp(MMOCore.plugin.configManager.getNeededExperience(getLevel() + 1));
|
refreshVanillaExp(MMOCore.plugin.configManager.getNeededExperience(getLevel() + 1));
|
||||||
|
@ -70,6 +70,13 @@ public class Professions {
|
|||||||
level.put(profession.getId(), value);
|
level.put(profession.getId(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void giveLevels(Profession profession, int value) {
|
||||||
|
int total = 0, level = getLevel(profession);
|
||||||
|
while (value-- > 0)
|
||||||
|
total += MMOCore.plugin.configManager.getNeededExperience(level + value + 1);
|
||||||
|
giveExperience(profession, total);
|
||||||
|
}
|
||||||
|
|
||||||
public void giveExperience(Profession profession, int value) {
|
public void giveExperience(Profession profession, int value) {
|
||||||
giveExperience(profession, value, null);
|
giveExperience(profession, value, null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user