xpShop
Link to the german overview of xpShop: klick here
General:
Players can buy, send, and sell experience points which can be used to enchant items. Also it can display the player's amount of XP. XP levels can be sold and bought with sign shops.
This plugin will automatically update itself if “autodownload” is set to true in the config file and will force an update if a bug is found! Macht es das auch, wenn autodownload auf false ist?
Players can send XP to each other across multiple servers. To use this feature, you need a database that can be accessed from each server. You then enter this database into each config file and set “usedbtomanageXP” to true.
You do not need MySQL, however, you can use MySQL to manage XP between one or more servers. To do this you must use the same MySQL Database on all of the servers.
COMMANDS for ADMINS that use the database:
/xpShop reset <player> - Resets the xp of that player in the database
/xpShop setXP <player> - Sets the xp of that player in the database
Features:
- players can fill glass-bottles with XP/EXP
- players can buy/sell XP/EXP using a command
- players can buy/sell XP/EXP-levels using a command
- players can look up their own amount of XP or XP-level.
- players can look up other players' amounts of XP or XP-levels.
- players can lookup their own XP/EXP-level amount
- players can lookup the XP/EXP-level amount of others
- players can send XP/EXP to other players.
- players can teleport themselves to an other player for XP/EXP.
- players can teleport players to themselves for XP/EXP.
- players can repair tools for xp.
- admin can repair tools for free.
- players can create safes to store XP/EXP in signs.
- players can create xpShops to sell and buy XP/EXP with sign. They work like SignShops.
- admins can create xpShop adminshops to sell and buy XP/EXP with sign.
- admins can set a player's amount of XP.
- admins can view the logs ingame. :) (/xpShop showdebug)
Planned features:
Installation instructions:
The language can be chosen and modified in the config.yml file.
To install the plugin, drop it into the plugin folder.
Economy System Dependencies | Permissions Dependencies |
---|---|
iConomy 5 | PermissionsEX |
iConomy 6 | BukkitPermissions |
Vault | GroupManager |
Register | bPermissions |
Links:
Link | Description |
---|---|
Wiki | The github wiki of xpShop |
SignShop Wiki | Explanation of the shop feature. |
xpShopSafe Wiki | Explanation of the safe feature. |
Commands and Permission nodes | A list of all commands and Permissions nodes: |
Source code + API | full code |
Default config | config.yml with comments |
GUI:
To edit the config while the server is running, type "xpShop gui" into the console.
Source code
Please ask before using the code, I am a friendly person :)
Sending of statistical data
This plugin uses mcstats.org to gather statistical data. The data is collected anonymously and ALL data is visible to everyone. Follow the link at the statistics banner and you'll see the collected data.
If you don't want any data to be sent, disable statistic sending in the Metrics folder/configuration.
Debug files and error reports
This plugin creates debug files to make the finding of errors easier for me. If a error occurs the plugin may report it to me. All error reports are visible on my tracker. Klick here.
You can modify /disable this behavior in the configuration file. Set senddebugfile to false if you don't want to send debugfiles to me.
Set senderrorreport to false if you don't want to send any debug/errors to me.
Seems to work fine now, good job :)
But permissions for infoxp (maybe other too) seem to be broken.
@Sepulzera
There are now a algarithm who causes no lags.
You could include an own algorithm for levels.
Take a look: http://www.minecraftwiki.net/wiki/Xp
So you can calculate the level a player reaches when adding / removing certain amount of xp. Then just set the player-level to this one.
This way you don't need to loop 1 million times.
Same goes for buylevel and selllevel. Just calculate how much xp it would need/take to reach this level, set this level and calculate the money stuff.
Here: https://github.com/munichBukkitCommunity/xpShop I cant set the level directly becaus there variable amounts between the level, so I must check the level all the time.
Can't you manipulate the players level directly?
Like "Player->Level = Player->Level + xpShop_buylevel" (yep, I don't have any clue about minecraft code :D, and java).
Ah and btw: I don't know what is causing such server "lags". But I would be really interested in this, maybe you can post some snippets or upload your code?^^
I could let the plugin wait after each level, I will implement it today.
@Sepulzera
That know I, but I cant do anything agianst it. Sorry.
The higher the value the bigger the lag.
Using /xpshop buylevel 50 leads to a read time out error for my server.
@Sepulzera
Now all should be fixed, but at my turn there are no lag. If you have some, I cant help at the moment. Bukkit knows the problem and will fix it!
/xpshop buylevel and /xpshop selllevel and /xpshop sell still leads to incredible lags.
Seems the command is executed various times, at least my chat is spammed with "[xpShop]Not enough money!", when I don't have enough.
And there seems to be a bug with the money.
When I have 1000 money and buy 2000xp from it ("moneytoxp: 2"), I'll finally have about " - 4000 " money.
@Sepulzera
There is a Fix, but on selling it rounds a bit, so there is a bit fewer, than on buying. May I can fix it too.
I try to set Xp to 0 and add Totalxp, lets see.
Huh?
Isn't there a way to manipulate the xp directly, instead of using a buggy vanilla command?
I do /Xp amount.
And /xp -amount.
That are vanilla commands.
That doesn't solve the issue at all.
The problem is that your algorithm is, sry, sh*t.
I assume you are checking how many xp it takes for a level up (lvl1 to lvl2 10xp), then you check how many xp he is buying (lets say 100) and then you are calculating how many level he will gain. As you got 10xp for 1 level he will get 10 level so.
Did you consider that levels have a quadratic function?
So the algorithm is shit.
It should be for 100xp: Lvl1 to Lvl2 10xp, 90 left. Lvl2 to lvl3 XXxp, 90-XX left.
You can set in the config the Xptomoney to 0.8 that should help at first. Im working on it.
A minecraft bug?
It doesn't matter, it makes this plugin absolutely useless!
@Sepulzera
@2+3: This is an Minecraft or Bukkit bug, I try to find a better solution, but it will take a lot of time.
Other problems should be fixed.
I don't want to create tons of tickets, but your plugin isn't working properly at all.
1. sell doesn't check for no left xp
2. buy doesn't work lineary (buying 1000 xp on lvl 1 will boost you to lvl 145, buying 1000 xp on lvl 2 just around lvl 50)
3. sell doesn't sell the same value as buy (probably related to 2.)
4. buylevel and selllevel leads to awful server spamming ("[INFO] 0") and lag
5. Having no permissions won't throw out a "no permission" warning. It just won't happen anything (at least denying the action like this is working, yay)
v1.3, CB1.0.1-R1
Created ticket concerning to pogprop's issue.