Inactive [RPG] PhatLoots v0.9.1 - Chests with randomly generated money/items [953]

Discussion in 'Inactive/Unsupported Plugins' started by Codisimus, Mar 19, 2011.

  1. Offline

    Codisimus

    This page will no longer be updated. Please follow this project at the Bukkit Dev Page

    PhatLoots - Chests with randomly generated money/items:
    Version: 0.9.1 (7/16/2011)
    Supports iConomy, BOSEconomy, Essentials, Permissions, LWC
    Download Page

    This plugin is a must for dungeons! Players open a linked chest and are rewarded with money (within a designated range) and randomly generated items that are predefined.

    Make a PhatLoot
    /loot make test
    Add some loot values
    /loot add test money 1 25 (looter will get 1-25 coins)
    /loot add test 322 1 10 (looter has 10% chance of getting a golden apple)
    Set a reset time
    /loot time test 1'6'45'30 (looter can loot the chest again after waiting
    1 day, 6 hours, 45 minutes, and 30 seconds.)
    Link a chest
    /loot link test (you must be targeting the chest you wish to link)

    Collective Loots allows you to setup a chest to give a certain amount (1 by default) of 'rare' items. So a chest may give the user a chance to loot a Gold Block (50%), Diamond Sword (30%), or Diamond ChestPlate (20%) yet the user will only get one of these items.

    Features:
    • Chests can give items, money, or both
    • Support for wools/dyes
    • Set different reward values for different chests.
    • Link multiple chests to one PhatLoot (this way you don't have to reenter all the items for every chest)
    • Player must wait a certain amount of time in order to loot the chest again (configurable)
    • Different reset times for each PhatLoot
    • AutoLoot option
    • Easily configure setting, loot values, reset times, and more
    • Make chests global (when looted by one person, everyone must wait to loot it again)
    • or user (each individual must wait the specified time between looting chests)
    • Uses iConomy, BOSEconomy or Essentials to give users money.
    • Uses LWC to auto protect PhatLoot chests (false by default)
    • Permissions to limit players from being rewarded and using commands
    • Included in CraftBukkitUpToDate for easy updating (make sure you come check the changelog if somthing is not working right)
    Save Files and Properties:
    Show Spoiler

    config.properties
    Code:
    #Tue Mar 29 14:04:05 EDT 2011
    // user - when a player loots a chest they must wait the specified time to loot again
    // global - when looted by one person, everyone must wait to loot it again (first person there gets the loot)
    DefaultResetType=user
    
    // if true, when you link a chest it will automatically make it public with LWC (so noone else can claim it)
    AutoLockPhatLootChestsWithLWC=false
    
    // default number of items you get from CollectiveLoots (only applies if CollectiveLoots is not blank)
    DefaultNumberOfCollectiveLootItemsRecieved=1
    
    // amount of time before the chest will reset "Days'Hours'Minutes'Seconds"
    // change to "never" in order for it to never reset
    DefaultResetTime=0'0'5'0
    
    phatloots.save
    Code:
    test1   // a list of all your Phat Loots by name
    test2
    
    test.properties
    Code:
    #Tue Mar 29 16:20:45 EDT 2011
    //the number of items you get from CollectiveLoots (only applies if CollectiveLoots is not blank)
    NumberOfCollectiveLootItemsRecieved=1
    
    // user - when a player loots a chest they must wait the specified time to loot again
    // global - when looted by one person, everyone must wait to loot it
    ResetType=user
    
    // list of linked chests (you should never have to edit this) "x,y,z,NameOfLooter,TimeLooted,_"
    Chests(RestrictedUsers)=-155,65,-93,Codisimus,88'16'13'16,_
    
    // "itemID,NumberOfItems,PercentOfLooting,_" Should add up to 100%
    CollectiveLoots=13,1,75,_14,1,10,_15,1,15,_
    
     // amount of time before the chest will reset "Days'Hours'Minutes'Seconds"
     // change to "never" in order for it to never reset
    ResetTime=0'0'0'20
    
    // "itemID,NumberOfItems,PercentOfLooting,_"
    IndividualLoots=money,0,2,_13,1,100,_14,1,23,_15,1,30,_
    


    Commands:
    • /loot make [Name] - Creates PhatLoot
    • /loot link [Name] - Links target chest with PhatLoot
    • /loot add coll[1-5] [Item] [Amount] [Percent] - Adds collective loot to target chest's PhatLoot
    • /loot add [Item] [Amount] [Percent] - Adds individual loot to target chest's PhatLoot
    • /loot add money [Low] [High] - Adds range of money that can be looted
    • /loot remove coll[1-5] [Item] [Amount] [Percent] - Removes collective loot from PhatLoot
    • /loot remove [Item] [Amount] [Percent] - Removes individual loot from PhatLoot
    • /loot unlink [Name] - Unlinks target chest with PhatLoot
    • /loot info [Name] - Lists info of PhatLoot
    • /loot name - Gives PhatLoot name of target chest
    • /loot reset [Name or all] - Resets PhatLoot restricted list
    • /loot delete [Name] - Deletes PhatLoot and unlinks chests
    • /loot list - Lists all PhatLoots
    Permission Nodes:
    • phatloots.use - Needed for group/player to receive loots
    • phatloots.info
    • phatloots.name
    • phatloots.make
    • phatloots.list
    • phatloots.admin.reset

    Changelog:
    Old Versions, ChangeLog, + Source can be found at Download Page
    Show Spoiler

    Version 0.9.1 (7/16/2011)
    • Added color support for all customizable messages
    • Fixed Collective loots
    Version 0.9 (6/26/2011)
    • Improved OP options
    • Updated Economy support
    • Added AutoLoot option
    • Improved add command
    • Added targeting chests for adding loot
    • Added item name support (rather than item ID)
    • Added saftey check so you can't add invalid loots
    Version 0.8.1 (6/13/2011)
    • Fixed OP permissions
    Version 0.8 (6/12/2011)
    • Cleaned up code/fixed errors
    • Added map support
    Version 0.7.4 (6/4/2011)
    • Cleaned up errors and added error messages
    Version 0.7.3 (6/3/2011)
    • Various fixes and code cleanup
    Version 0.7.2 (6/3/2011)
    • Added Essentials econ support
    Version 0.7.1 (5/4/2011)
    • Updated to iConomy 5
    • Few various fixes
    Version 0.7 (4/29/2011)
    • Fixed save/loss of data errors
    • Added support for wools/dyes
    • Fixed Double Chest errors
    • Added in game command for setting timer restriction
    • Added in game command for setting collective loots
    • Added option of multiple collective loots
    • Added option for setting resetType to Interval
    • Added prevention from looting out of ID-range items
    • Fixed delete command
    Version 0.6 (3/31/2011)
    • Fixed issue with users with "_" in name
    • Improved multiworld support
    • Fixed various bugs
    Version 0.5.1 (3/31/2011)
    • Fixed CollectiveLoots
    • Works with build #612
    Version 0.5 (3/30/2011)
    • Updated to craftbukkit build #602
    Version 0.4 (3/29/2011)
    • Redid save format
    • Added config file
    • Added double chest support
    • Added Collective loots
    • Added Auto protection using LWC (false by default)
    • Added a reset time ("Days'Hours'Minutes'Seconds" or "never") (0'0'5'0 by default)
    • Added global/user restriction (user by default)
    • Added antigrief feature, if chest is full PhatLoots will make room for new loot
    Version 0.3 (3/26/2011)
    • Added block protection for PhatLoot chests
    Version 0.2 (3/19/2011)
    • Fixed unknown command spamming chat
    • Fixed no Economy message spamming
    • added /loot info and /loot name (phatloots.info phateloots.name)
    Version 0.1 (3/18/2011)
    • Initial Release
     
  2. Offline

    X8105

    CRUD Beat me to it! Excellent idea, great "mines" think alike!
     
  3. Offline

    Codisimus

    Which idea are you talking about? lol or do you mean the plugin in general
     
  4. Offline

    KrypleFyte

    If I update to the newest version will I lose my loots I have already setup?
     
  5. Offline

    Codisimus

    what version are you on? You shouldn't lose anything but I would backup the files just in case
     
  6. Offline

    KrypleFyte

    ah version 0.7 I will backup and move to 0.9. Will 0.9 still work with Bukkit 860?
     
  7. Offline

    Codisimus

    yes it will
     
  8. Offline

    Jazy Lopez

    The collective loots aren't working... Why I use loot add coll1 328 5 10 it says coll1 is not a valid item, same with loot remove... Please fix :)

    EDIT: Just retested and found out that my old loots don't work either, as a matter of fact when I go to open it completely crashes the server... I really like this plugin, please fix asap :'(

    REEDIT: Only seems to crash when it has a collective loot...
     
  9. Offline

    Insanehero

    Hey, I'm wondering something. If I make a loot and set it to 4'00'00 will that be 4 hours?
     
  10. Offline

    Codisimus

    the correct format for four hours would be 0'4'0'0 but 0'4'00'00 should also work

    Ok I'll look at the codes and do some collective testing

    EDIT: Can I see the .properties file that contains a collective loot?
     
  11. Offline

    Jazy Lopez

    It would get erased on server crash... But the items were listed as Coll1=328,5,10,~328,4,10,~328,3,20,~328,2,20,~328,1,40,~

    And could you easily add a function to clean the chest when the loot is added :)
     
  12. Offline

    X8105

    a bit of both really, after watching the demo video... collaboration?
     
  13. Offline

    Codisimus

    I'm confused, is it still crashing?
    And I guess I should add that feature since it's been requested about 20 times already
     
  14. Offline

    Jazy Lopez

    Not with others, it was only with that phatloot, I remade it without the collective loots and it worked, but the other loots with collective loot work fine... :confused:
     
  15. Offline

    Codisimus

    And you've tried deleting and remaking it? (just in the .properties file erase all the data after Coll1=)
     
  16. Great idea for a plugin. Unfortunately, too buggy to add to our server right now. Two main bugs:

    Collective loots simply doesn't work, getting the following error after looting.
    Code:
    01:41:35 [SEVERE] Could not pass event PLAYER_INTERACT to PhatLoots
    java.lang.ArrayIndexOutOfBoundsException: 2
            at PhatLoots.PhatLoots.lootCollective(PhatLoots.java:247)
            at PhatLoots.PhatLoots.getLoot(PhatLoots.java:80)
            at PhatLoots.PhatLootsPlayerListener.onPlayerInteract(PhatLootsPlayerListener.java:349)
            at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:306)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:166)
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:213)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:552)
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    The chests generate an infinite supply of loots while this goes on! (Tested by removing all plugins apart from Permissions and iConomy, starting from a fresh config and re-adding by commands.)

    The .properties for the PhatLoots:
    Code:
    #Mon Jul 04 01:35:32 BST 2011
    Chests(RestrictedUsers)=Anvil,-79,46,-60,Droolio,185'1'32'12,~Anvil,-79,46,-56,Droolio,185'1'32'27,~
    ResetTime=0'0'0'30
    IndividualLoots=276,1,20,~277,1,20,~278,1,20,~279,1,20,~89,5,20,~money,10,25,~
    NumberOfCollectiveLootItemsRecieved=1
    ResetType=user
    Coll5=
    Coll4=
    Coll3=
    Coll2=
    Coll1=264,5,20,~,~79,20,20,~,~48,20,20,~,~337,64,20,~,~322,2,20,~,~
    
    Looks like too many ~ delimiters going into that last line?

    Secondly, /loot reset is corrupting the Chests field when there's more than two chests:
    Code:
    Chests(RestrictedUsers)=Anvil,-79,46,-60,Anvil,-79,46,-56,
    Pretty sure there's meant to be another ~ delimiter between those two. And because it's corrupted (encounters chest data instead of player), when you start looting chests, the server crashes. I've also found, under certain circumstances, hundreds of repeated entries for the same players on the Chests line. The data structure progressively seems to get worse the more it's read and written back. :(

    I'd love to look at the source, but the link is currently broken.
     
  17. Offline

    Codisimus

    @Drool
    I'll do some testing and make sure the link is back up

    EDIT: fixed link (it was .rar instead of .zip)
     
  18. Offline

    Insanehero

    I love this plugin so much, but I have one problem with it. I have a massive dungeon and at the end I have a treasure room, but how do I keep my players from logging out and then logging back in when the loot resets?
     
  19. Offline

    Codisimus

    I haven't found a way to fix that yet. perhaps try ButtonWarp as well?
     
  20. Offline

    Insanehero

    Does it warp them after they close the chest?
     
  21. Offline

    Codisimus

    does wut warp them?
     
  22. Offline

    GiantSponge

    I am getting a error but can't seam to find out why:

     
  23. Offline

    Insanehero

    It would be cool if you could make it so when they close a phatloot chest it warps them. Kinda like buttonwarp but using chests. That way at the end of a dungeon with a phatloot with really good treasure they can't log in after it resets.
     
  24. Offline

    Codisimus

    delete the line with "2t"

    I'll take that into consideration
     
  25. Offline

    Insanehero

    That would be awesome :D
     
  26. Offline

    Mighty

    is their a tutorial or wiki? because when i right click on a chest it doesnt give any loot and i added loot to it. i did the permissions for the .use and no one can loot it. anyone else having issues?
     
  27. Offline

    L24D

    @Codisimus
    Hmm, interesting... I get an error every time a chest is accessed...

    Code:
    2011-07-13 21:24:48 [SEVERE] Could not pass event PLAYER_INTERACT to PhatLoots
    java.lang.ArrayIndexOutOfBoundsException: 2
        at PhatLoots.PhatLoots.lootCollective(PhatLoots.java:247)
        at PhatLoots.PhatLoots.getLoot(PhatLoots.java:80)
        at PhatLoots.PhatLootsPlayerListener.onPlayerInteract(PhatLootsPlayerListener.java:349)
        at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:307)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:210)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:552)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    It still allows me to set items and such, there is one thing missing though, it needs the ability to set multiple items per chest... not just a percentage, in a choice of items.
    and a way to allow people to gain said items only once. it's spazzing, out dumping items in the chest, and throwing errors. :p
     
  28. Offline

    Kalais

    At startup:

    Code:
    13:34:39 [INFO] [PhatLoots] Load failed, saving turned off to prevent loss of da
    ta
    13:34:39 [SEVERE] java.lang.NumberFormatException: null
    13:34:39 [SEVERE]       at java.lang.Integer.parseInt(Unknown Source)
    13:34:39 [SEVERE]       at java.lang.Integer.parseInt(Unknown Source)
    13:34:39 [SEVERE]       at PhatLoots.SaveSystem.loadFromFile(SaveSystem.java:80)
    
    13:34:39 [SEVERE]       at PhatLoots.PhatLootsMain.onEnable(PhatLootsMain.java:5
    1)
    13:34:39 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug
    in.java:126)
    13:34:39 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(
    JavaPluginLoader.java:857)
    13:34:39 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si
    mplePluginManager.java:264)
    13:34:39 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe
    rver.java:151)
    13:34:39 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.enablePlugins(Craf
    tServer.java:136)
    13:34:39 [SEVERE]       at net.minecraft.server.MinecraftServer.e(MinecraftServe
    r.java:284)
    13:34:39 [SEVERE]       at net.minecraft.server.MinecraftServer.a(MinecraftServe
    r.java:271)
    13:34:39 [SEVERE]       at net.minecraft.server.MinecraftServer.init(MinecraftSe
    rver.java:148)
    13:34:39 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:335)
    13:34:39 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:422)
     
  29. Offline

    Codisimus

    @L24D
    @Kalais
    UPDATE!
    Fixed some errors and added color support.
     
  30. Offline

    L24D

    Coolio. going to give it a run then :D
    Thanks!
     
  31. Offline

    xeronut

    Neat plugin! This reminds me of the hidden treasures in Guild Wars: Nightfall. Ahh I miss that game..
     

Share This Page