Experience-Script
With the Experience-Script
exp.js
it's possible to customize when a pet will level up. As you can see at the file ending, the used language is JavaScript.- 1.
- 2.Set
LevelSystem.CalculationMode
toJavaScript
int theconfig.yml
. - 3.Edit the
exp.js
to your likings.
To make a fully functional exp-script that can be used by MyPet you have to implement the following method:
exp.js
function getExpByLevel(level, petType, worldGroup) {
var exp = 0;
return exp;
}
Examples:
Pet Type
World Group
exp.js
function getExpByLevel(level, petType, worldGroup) {
var exp = 10;
if(petType == "Cow") {
exp = 15;
}
return exp;
}
exp.js
function getExpByLevel(level, petType, worldGroup) {
var exp = 10;
if(worldGroup == "LuckyWorlds") {
exp = 20;
}
return exp;
}
To provide an easy method to debug your scripts the plugin adds a print method to the usable JavaScript functions.
print("message");
exp.js
// Level 2-16 cost 17 XP points each
// Level 17-31 cost 3 more XP points than the previous
// Level 32-∞ cost 7 more XP points than the previous
function getExpByLevel(level, petType, worldGroup) {
var exp = 0, i;
if (level > 31) {
exp = 887;
level -= 31;
for (i = 1; i < level; i++) {
exp += 62 + (i * 7);
}
return exp;
}
if (level > 17) {
exp = 272;
level -= 17;
for (i = 1; i <= level; i++) {
exp += 17 + (i * 3);
}
return exp;
}
return (level - 1) * 17;
}
Last modified 3mo ago