Filled Christmas Gifter

Discussion in 'Archived: Plugin Requests' started by lubby123, Dec 22, 2013.

  1. Offline

    lubby123

    Suggested Name: Christmas Gift

    Fun!

    What I want: Whenever a person does /christmas gift, they get a random item(s) defined in the config, they can use it (configurable in the config )once a day. With a configurable message in the config. (They only receive one of the items)

    OPTIONAL!
    When a person does /christmas gift, it says (Also configurable in the config) '&aAh! The &c&lGrinch&r &ahas stolen your gift!'

    Default config:
    Version 0.0.1 By: **** (You!)
    #How long after every /christmas gift after they can use it (In hours)
    christmas gift time: 24
    #Christmas gifts (-# how many)
    Christmas gifts:
    - diamond-10
    - diamond_sword-1
    #Grinch Message
    Grinch: '&aAh! The &c&lGrinch&r &ahas stolen your gift!'
    #The ratio of how times the grinch will steal presents (has to be out of 20)
    grinch-ratio: 1/20
    When I would like this by: Pls either before or at Christmas day, sorry if this is too much :\


    I hope someone can do something like this!
     
  2. Offline

    rfsantos1996

    I can do this (;

    /christimas gift - gives random item (given on config), and with a little chance, will steal one random item from player inventory?

    @EDIT: steal the gift, not a random slot..
     
  3. rfsantos1996 - I already did this for him with Skript :D took about 10 mins

    lubby123 - Here you go

    This can be done with Skript
    Code:
    options:
        cool-down: 86400 # Cooldown in seconds before players can use this command
        msg-cooldown: 24 hours # This can be anything, but should be equivilent to the cool-down option (86400 = 24 hours)
        reward-item: "10 diamond" # Reward for using this command
        steal-chance: 5% # Chance for the Grinch to steal your reward (5%  = 1/20)
        stolen-msg: &aAh! The &c&lGrinch&r &ahas stolen your gift! # message to send to player if the Grinch steals their reward
    variables:
        {Skript.%player%.cooldown} = 0
    command /christmas:
        description: Obtain the Standard PvP Kit
        usage: /christmas
        executable by: players
        aliases: /xmas
        trigger:
            if {Skript.%player%.cooldown} is less than or equal to 0:
                set {Skript.%player%.cooldown} to {@cool-down}
                give {@reward-item} to player
            else:
                message "&cYou may only use this command every &e{@msg-cooldown}"
                chance of {@steal-chance}:
                    remove {@reward-item} from player's inventory
                    message "{@stolen-msg}"
            else:
                message "&cYou may only use this command every {@msg-cooldown}"
    every 5 second:
        loop all players:
            remove 5 from {Skript.%loop-player%.cooldown}
    
     
  4. Offline

    rfsantos1996

    If you need a plugin (case you won't use Skript, I'm still working on it - no, i dont have anything else to do), tell me (;
    Very nice :confused: never saw Skript... seems like an easier way to do a lot of things...
     
  5. Skript does about 90% of the features on my server
     
  6. Offline

    lubby123

    I don't use skript, Idk what it does >.>
     
  7. Offline

    rfsantos1996

    I'm testing the plugin.. And its a way to program things on a server... Its a script, he tells what the server should do.
     
  8. Offline

    lubby123

    Ok, so, can I help test?
     
  9. So install the plugin... and add the script.

    What is there to test? The script is done. I already made it...

    Code:
    options:
        cool-down: 86400 # Cooldown in seconds before players can use this command
        msg-cooldown: 24 hours # This can be anything, but should be equivilent to the cool-down option (86400 = 24 hours)
        reward-item: "10 diamond" # Reward for using this command
        steal-chance: 5% # Chance for the Grinch to steal your reward (5%  = 1/20)
        stolen-msg: &aAh! The &c&lGrinch&r &ahas stolen your gift! # message to send to player if the Grinch steals their reward
    variables:
        {Skript.%player%.cooldown} = 0
    command /christmas:
        description: Obtain the Standard PvP Kit
        usage: /christmas
        executable by: players
        aliases: /xmas
        trigger:
            if {Skript.%player%.cooldown} is less than or equal to 0:
                set {Skript.%player%.cooldown} to {@cool-down}
                give {@reward-item} to player
            else:
                message "&cYou may only use this command every &e{@msg-cooldown}"
                chance of {@steal-chance}:
                    remove {@reward-item} from player's inventory
                    message "{@stolen-msg}"
            else:
                message "&cYou may only use this command every {@msg-cooldown}"
    every 5 second:
        loop all players:
            remove 5 from {Skript.%loop-player%.cooldown}
    
     
  10. Offline

    rfsantos1996

    Dont needed, its done.

    - Source: GitHub
    - Download: Dropbox
    - Permissions: christmas.get - allows you to receive the gift
    - Commands: /christmas to get the gift, /christmas (anything) to get the remaining itens (if your inventory is full)
    - Observations: added a chance of getting a item, if you need to change "chances", the whole thing should be 1.0, like:

    0.2 diamond_sword 3
    0.3 apple 2
    0.5 diamond 5
    ------------
    total of 1.0

    And the itens must be writed like this (not case sensitive)

    In case he didnt want to use the Skript, I was already making it, so I finished... Why not...
     
  11. Offline

    lubby123

    Hey! This is awesome!
    But............. It says itens... >.>
     
  12. Offline

    rfsantos1996

    Sorry, I'm brazilian and in portuguese, items = itens :/ I made a lang, so you can customize every player message

    I changed all "itens" on plugin, you can get the .jar on GitHub

    @EDIT: fixed a important bug: you can get items freely after the first cooldown. Download the new version here and it will be fixed (I tested the fix)
     
    Mineacer likes this.

Share This Page