give random items to players.

Discussion in 'Archived: Plugin Requests' started by IdealIdeas, Aug 21, 2012.

  1. Offline

    IdealIdeas

    I use the Server Signs plugin and I would love to make signs give out random items to players.

    If you havent used server signs before its basically this, I can bind commands to signs and have either the server or player run those commands just by right clicking the signs.

    What I want:
    /give (player) Random (amount) , This picks a random item of all available items and gives the player a specified amount of said item.

    /give (player) allrandom (amount), whatever the amount is, the player gets 1 random item per amount. Example, /give idealideas allrandom 5 would give me 5 completely random items.

    So basically the top one gives me 1 random item where as the bottom one gives 1 random item per amount.

    I hope this is understandable.
     
  2. Offline

    Barinade

    Would a config setup like:

    items: 1,2,3,35:2,35:6

    Be acceptable?
    Where 35:2 would be purple wool and 35:6 would be pink. So data values.
     
  3. Offline

    Gunnerrrrr

    I have also been wanting a plugin like this.
     
  4. Offline

    IdealIdeas

    Well I would like it to randomize everything. It would be nice if it I did it once got some green wool then the 2nd time I do it, i got a potion of harming lvl 2 and so forth.

    So if im understanding you correctly, yes I would want items to randomly pick an item and if it has a damage value it would also pick what the damage value would be.

    It would also be interesting to see it give tools, weapons, armors and such be with random amounts of damage applied, and if possible it would roll a chance to give the tools, weapons, and armors with enchantments.

    In fact speaking of all this I have more commands I would like Ill list them all off including the 2 I already listed for sake of them not being everywhere.

    /give (player) Random (Amount), Picks an item or block at random then gives the player that amount.
    /give (player) AllRandom (Amount), Dependent on the amount it would give out a random item per amount.
    /give (player) RandomTool (Amount), Gives player random tool(s)
    /give (player) RandomArmor (Amount), Gives player random piece(s) of armor.
    /give (player) RandomWeapon (Amount), Gives player random weapon(s).
    /give (player) RandomBlock (Amount), Gives player random block(s).
    /give (player) RandomItem (Amount), Gives player random item(s)

    I would also like a config file that allows me to edit the chance a tool, weapon, or armor would be given enchanted abilities with 1, 2, 3, and 4 enchantments

    Im amazed there isnt one already, theres a plugin for nearly everything else though lol

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  5. Offline

    Gunnerrrrr

    yeah ikr lol
     
  6. Offline

    IdealIdeas

    You would think Essentials would obviously have this. It has everything else am I not right?
     
  7. Offline

    Gunnerrrrr

    I actually searched the essentials commands page before i came here XD, im thinking there must be something hard about it because it seems like one they would have.
     
  8. Offline

    IdealIdeas

    So is anyone up to the challenge?
     
  9. Offline

    MATT20DUDE

    There's Similar plugin Called InfChests but its for 1.2.5
     
  10. Offline

    Njol

    You could use Skript. Skript has an advanced aliases system which allows you to easily define collections of items, e.g. "pickaxe = wooden pickaxe, iron pickaxe, ..." which you can then use to either give a random item to the player with "give a pickaxe to the player". (There are hundreds of predefined aliases already present, e.g. collections like tools and armour, and at least an alias for every item)

    A simple /give command can be defined with this script:
    Code:
    command /give <player> <items>:
      permission: give
      trigger:
        give item-argument to player-argument
    
    You could then e.g. assign the command "/give <player> a pickaxe" to a sign to give players who click it a random pickaxe.

    You can even mix items directly in the command, e.g. "/give <player> 1 melon, 4 seeds or a flower".

    PS: You cannot yet use enchantments but I'm going to add basic enchantment support soon.
     
  11. Offline

    IdealIdeas

    While that works its too complicated, i would prefer it require no setup.
     
  12. Offline

    LexLaiden

    Skript is easy to use and its a good plugin.

    I won't even try to suggest VariableTriggers if you think Skript is to complicated.
     
  13. Offline

    IdealIdeas

    So im thinking of giving this plugin a go, but I like to have some reference materials. I have done some pretty basic programming in the past. If you consider TI Basic a programming language which is used in TI Graphics Calculators or even the Triggers portion of Starcraft 1's map editor, both of which I got VERY good at and self taught myself with reference materials.

    Really what im asking for is just a list of commands that work and what they do. I understand I could write commands and it will attempt to interpret what I want it to do, but with no real direction as to what does and what doesnt work it kinda scares me away a bit.

    So is there like a wikia or somewhere that can show me commands that do work?
     
  14. Offline

    SoTotallyToby

    I really don't get the point in giving random stuff. But lovely ideas here!
     
  15. Offline

    IdealIdeas

    You should of read the first thing I written.
    Its mostly for use with a plugin I used called Server Signs.

    Its simply to make a fun lottery type of sign that allows a player to spend some money, and try for an item and possibly save a bunch of money if they get the item they want.

    Ok heres an example.
    Sign offers 1 random item for a price of 100.
    Player spends the cash and gets a diamond (Which on my server could of costed him 2000 to buy which means he just saved 1900)

    Get what im after now?
     
  16. Offline

    SoTotallyToby

    Martyn should those Plugins.
     
  17. Offline

    Njol

    There's a documentation with lists of all possible conditions, effects, expressions and loops on my website: http://njol.ch/projects/skript/doc

    PS: giving a completely random item would require that you merge all items into one huge alias, especially since you want to have different potions etc. as well.

    I'm also quite good in TI Basic because programming on my calculator was the only thing I could do when I was bored in school =P
     
  18. Offline

    IdealIdeas

    I was working on a RPG type game where you could do alot and had a lot to offer.
    Players could fight random enemies that would use spells, attack, and use pots.
    Enemies would do things based on HP. Like if they had low HP they would use a health pot, but that wouldnt mean it would happen everytime. Plus they had limited health pots and if they didnt have any, they would fight.
    Players could buy weapons and armor and even enhance said items to be better and there was a whole lvl system for that.
    Enemies lvls would always be near your lvl and stats would be based off yours but with a chance the stat would be lower or higher.
    Multiple enemy names so it didnt feel like you fought the same enemy.
    There was buying of mana and health pots.
    Stat training
    A fully working GUI for the fighting
    I was even planning on a Player Vs Player mode where others could fight others.
    And so much more.
    The only downside to it was there wasnt any kind of wandering a terrain or anything, you chose what you wanted to do through menus like Craft, Enhance, Buy, Fight, ect....
    Sadly I couldnt finish the fight engine as it all took up more memory than my TI-84+ held. :/
    I rebuilt the game from scratch like 3 times and even though it got a little smaller each time it was still too big to run... I had the whole game run off of 2 programs as well in attempt to make it so when 1 was in use the other would be stored in the Flash ram but again, it was still too big :/
    It would of been an epic game.
     

Share This Page