taoneill / war

War - Minecraft TDM & CTF for Bukkit
war.tommytony.com
MIT License
68 stars 152 forks source link

Question about inventory #546

Open brujah opened 12 years ago

brujah commented 12 years ago

Hi

First off thank you for a great plugin, keep it up!

My question is this. I have added admin shops to my arena (chestshop plugin) where players can buy some items to create armor, the idea is to help with lowering the huge bank accounts on the server and add more fun to the arena itself, but whenever they cap the flag, die the inventory always get reset.

Is there any way i can make it so that items purchased inside the arena stays in their inventory until they die?

taoneill commented 12 years ago

Hmm... there's no way to prevent the inventories from resetting during flag capture at the moment.

It really depends if it would fit with your server, but you could always try and setup the shop outside the warzone. Then use "/zonecfg playerloadoutasdefault:true", this way players will get the items they purchased before entering the warzone as their default loadout when respawning or returning the flag.

grinning commented 12 years ago

I don't like how plain messy the inventory reset code is. But to my knowledge each player has an index of some kind and it switches. This index corresponds to another data structure that holds the map. I never saw an Inventory Bukkit Class object in there. But, on the team side maybe there could be a data structure for purchased items and they would merge? But the unclear thing is whether the players would keep these items undefinently or until the war plugin shuts down. The other unclear thing is what shop plugin is it in the arena? Hopefully they have events going for like onPlayerBuy? JReflection is so slow for checking things of this sort.

On Wednesday, September 5, 2012, taoneill wrote:

Hmm... there's no way to prevent the inventories from resetting during flag capture at the moment.

It really depends if it would fit with your server, but you could always try and setup the shop outside the warzone. Then use "/zonecfg playerloadoutasdefault:true", this way players will get the items they purchased before entering the warzone as their default loadout when respawning or returning the flag.

— Reply to this email directly or view it on GitHubhttps://github.com/taoneill/war/issues/546#issuecomment-8307818.

brujah commented 12 years ago

taoneill: That would have to make me put shops in a place where players could go all the time and buy stuff, i kinda wanted to make the cost of the items related to the fact that they were only to be used in this game. But i see your point.

grinning: My idea was that the players but items in the spawn room, use them until the match/game is over/ends and then when all players spawn out and get their normal items back the purchased items is also removed. I use ChestShop (http://dev.bukkit.org/server-mods/chestshop/) which is pretty common i think