Inactive [RP/PVP] RandomChest v1.0 - Bored of normal Hungergames' Maps? [1.4.5 - R0.3]

Discussion in 'Inactive/Unsupported Plugins' started by müsli1, Dec 7, 2012.

?

Is this plugin helpful?

  1. Yes, it's fine

    44.4%
  2. Yes, it's ok

    11.1%
  3. hm... :|

    22.2%
  4. No.

    0 vote(s)
    0.0%
  5. It's very bad

    22.2%
  1. Offline

    müsli1

    Suggested by: al3x74
    Installation:

    Unzip the .zip archive with winRAR or 7-Zip and drop all the files (two ;)) in the 'plugin' folder.
    How to use/Features:
    RandomChest generates a chest-field between to points:
    You can control the chest number and the size of the field.
    In the chests are random* items, so the Hungergames feeling is very well ;)

    *Not really 'random', you can customize the items in the config file like that:

    Code:
    wood_sword:
      min: 0
      max: 1
      probability: 2/7
    The '2/7' represent a mathematical break. You can use all natural breaks you want :)
    The 'min' value is the min amount of the appearing items.
    The 'max' value is the max amount of the appearing items.

    You can make the chest auto-refilling or auto-regenerating after a certain time (example: 1 week, 2 hours... 1 second :p)




    Commands:

    /rc autorefill [Field-Name] [time/delete] [ms,s,m,h,d,w] - Let the Field auto-refill after a time or delete the auto-refilling (ms = milliseconds, s = seconds, h = hours, d = days, w = weeks)
    /rc autoregenerate [Field-Name] [time/delete] [ms,s,m,h,d,w] - Let the Field auto-regenerate after a time or delete the auto-regenerating
    /rc addmanully/addmanu [Field-Name] - Add a special Chest to the field, this chest won't be regenerated but it gets refilled when the other Chests get refilled.
    /rc removemanually/removemanu [Field-Name] - Remove a special Chest from the field (Only the Chests that you selected with /rc addmanully/addmanu)
    /rc remove [Field-Name] - Remove a Chest-Field forever.
    /rc generate [Field-Name] [max x] [max z] [chest number] (chestrefill-type)- Generate a Chest-Field between your x and z coords and the coords you type in.
    The Chest Number represents the Chest-Number in the field. The chestrefill-type is the item-config used for this field**.
    /rc regenerate [Field-Name] (chestrefill-type) (chest number)- Regenerate a Chest-Field.
    /rc refill [Field-Name] (chestrefill-type) - Refill all chests in a Chest-Field. (With the specified chestrefill-type)
    /rc reload - Reload the Config-File
    Legend: (Can use) [Must use]

    Permissions:

    RandomChest.rc - States whether a player can use all commands


    NOTE: I've made only one Permission, because if you can generate fields you have to have the permissions to delete them.

    **Configuration:


    Code:
    chestconfig:
      types:
        default:
          wood_sword:
              min: 0
              max: 1
              probability: 2/7
            stone_sword:
              min: 0
              max: 1
              probability: 2/20
      exampletype:
        bedrock:
              min: 5
              max: 64
              probability: 1/1
    config:
      console-signals-by-regenerate: true
      console-signals-by-refill: true
    console-signals-by-regenerate - if this is 'true' the plugin will send a message to the console if a field got auto-regenerated
    console-signals-by-refill- if this is 'true' the plugin will send a message to the console if a field got auto-refilled
    chestconfig - configure out the items ;)
    types - the types that you can use in the commands (chestrefill-types) (example: type: hungergames - make them yourself)
    wood_sword - scroll up to features :p

    Changelog
    V1.0 - Release
    V1.0(.1) - Fixed the '1 hour = 6 minutes' bug


    To-do-List
      • Message to the console if a chest gets opened (configurable)
      • signal-configuration for single fields
    Known Bugs:
      • None
    I'm free for suggestions :) Hope you enjoy!
     

    Attached Files:

  2. Offline

    al3x74

    Just perfect ! This is exactly what I wanted !
     
  3. Offline

    Cammy_the_block

    Source Code?
     
  4. Offline

    al3x74

    Is that I can post it on French platforms ?
     
  5. Offline

    müsli1

    Yes, if you want :)
    That's no problem! ;)
     
  6. Offline

    müsli1

    At the moment, the source code is not published.. Maybe later ;)
    If you have any questions, just ask me
     
  7. Offline

    müsli1

    Important:
    I've found a little mistake in my plugin:
    1 hour would be 6 Minutes :'(

    Please download the new version with the fix: here
     

    Attached Files:

  8. Offline

    Cammy_the_block

    I mostly just wanted to see the proablity thing.
     
  9. Offline

    müsli1

    Ok, here it is: (For all those want to see the code lines,too :))

    Code:
    Random r = new Random();
    int min,max;
    min = getConfig().getInt("chestconfig.types." + chesttype + ".items." + item + ".min");
    max = getConfig().getInt("chestconfig.types." + chesttype + ".items." + item + ".max");
    int number = r.nextInt((max + 1) - min) + min;
    ItemStack stack = new ItemStack(Material.valueOf(item.toUpperCase()), number);
    String[] raw = getConfig().getString("chestconfig.types." + chesttype + ".items." + item + ".probability").split("/");
    int break1,break2;
                 
    break1 = Integer.valueOf(raw[0]);
    break2 = Integer.valueOf(raw[1]);
    int appear = r.nextInt(break2 - 1);
                 
    if(appear <= (break1 - 1)) {
        if(number!= 0) {
            inv.addItem(stack);
        }
    }
     
  10. Offline

    liubai01

    oh can i put it on chinese bbs? i think it is a good plugin. i can use it to make a game :> .i have found it for a long time QAQ l am moved my english is pour Ow :confused:kay ,thanks
     
  11. Offline

    müsli1

    Sorry, but I don't know the chinese bbs, so can you please tell me what that is, so I can answer the question? :)
     

Share This Page