[FUN] Reagent v0.4 - Give your players magic... at a price [953]

Discussion in 'Inactive/Unsupported Plugins' started by pr0f1x, Apr 30, 2011.

  1. Offline

    pr0f1x

    Reagent - Give your players magic... at a price!
    Version: v0.4

    A reagent is a "substance or compound that is added to a system in order to bring about a chemical reaction or is added to see if a reaction occurs."

    Reagent is a plugin for CraftBukkit servers that adds the ability for players to cast magic spells. What makes Reagent unique is that when a player casts a spell a configurable amount of materials are consumed. Of course, if the server administrator wishes they could make all spells free but I think that defeats the purpose.

    I wanted to create a magic system that had capability to restrict the usage of the spells as to not totally destroy the "Minecraftness" of the game. IMHO, making spells expensive to use makes them more interesting, makes them used less and keeps the immersion of Minecraft by using mined materials as a sort of "cost" to cast the spells.

    When using Reagent, players need to pay more attention to when they should cast a spell since the cost of casting could be quite substantial depending on how the server is configured.

    This is my first plugin and I made it because I thought it was a cool idea. I'm putting it here in the hopes someone else will enjoy it as well!

    Features:
    • Cast 16 different magic spells.
    • Magic spell costs are configurable via config file. Any combination of materials is possible.
    • Spells can be cast via an item or by command line.
    Links:
    Download v0.4
    Source Code
    More Information

    Usage:
    To use the plugin just use the /reagent <spell> command. For example, /reagent teleport would initialize the teleport spell if you have enough materials to do so. The materials will then be removed from your inventory and a message will be displayed telling you so.

    Once the spell is initialized, RIGHT clicking (depending on the spell) on a block will cast the spell.

    Known Problems:
    For some reason if you are empty handed Bukkit will not call the proper method to cast the spell beyond a certain distance. In order to cast spells over a larger distance than a few blocks, you must have something in your hand.

    Example:
    By default, in order to cast teleport, a player must have 8 redstone in their inventory...

    Current Spells:
    fire, bolt, storm, timebomb, teleport, teleportspawn, heal, arrowstorm, stonewall, firewall, skeleton, zombie, timetravel, megabolt, scan, tree

    Changelog:
    Version 0.4
    • It is now possible to cast spells using an item. (EXPERIMENTAL)
    Version 0.3
    • Fixed bug where sometimes the materials would not be consumed if you had multiple small stacks of the same material.
    • Removed the air spell. (Never worked)
    • Added 4 new spells.
    View Older Versions (open)

    Version 0.2
    • Spells now have a configurable cool down timer.
    • If not using permissions all players now must pay for spells. (Ops included)
    Version 0.1
    • Initial Release
     
    Noppoly, Pinkpixels and Calcifero like this.
  2. Offline

    Pinkpixels

    Snowballs ;)
     
  3. Offline

    Flenix

    Clever ;)

    @pr0f1x - any plans to use any of the suggestions above? OH and it was just me who got them free, I gave a player the Reagent Mage race group yesterday and it worked fine, so we are migrating over from Spells now :p
     
  4. Offline

    pr0f1x

    I'm still around. I'm having a hard time finding the time to work on Reagent and since I program all day at work it's hard to come home and program even more! :)

    Version 0.3
    • Fixed bug where sometimes the materials would not be consumed if you had multiple small stacks of the same material.
    • Removed the air spell. (Never worked)
    • Added 4 new spells.
    Not much I know, but at least some new stuff! I've done some testing with versions 740-798 but if anyone has any problems with the older versions I am sorry.

    For people upgrading I have change the name of the precip spell to storm. It was a stupid name to begin with... :p

    Enjoy.

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

    kahlilnc

  6. Offline

    DrBowe

    If I were to modify the source and add a feature that made it so right clicking with a book in your hand cycled through spells, what would be the chances that you'd throw it into the official version?

    Better yet, what are the chances you could add the feature yourself, as I'm currently working on my own first plug-in? xD
     
  7. Offline

    pr0f1x

    I'd probably add it in.
     
  8. Offline

    Kalemar

    Another spell which would be good is a "recall to me" spell like the tp admin command but it only teleports a player to your location (not anyone to anyone). This I believe would be a good spell to add as on my server (as an admin) I get asked to tp people quite a bit and I don't like doing it as it feels like cheating but if it was done as a spell and cost reagents then I feel it would work better.

    Hmm.. just thought about griefers... you would have to make it so the person being teleported agrees to it, either with a flag eg "/tpme yes" or they have to be holding something like a red torch perhaps.
     
  9. Offline

    pr0f1x

    Version 0.4

    • It is now possible to cast spells using an item. (EXPERIMENTAL)
    Please remember that this is a test of how well this works out. If you are paranoid about breaking stuff on your server please wait a bit before you start using this version.

    I would appreciate if anyone can test this out and let me know if you find any problems. I didn't have much time to test item casting very much.

    Item Usage

    Reagent can now be used with an item. Make sure you have the "item" configuration set in your config.yml file.
    1. Put your selected item in your hand.
    2. RIGHT click until you have cycled through and selected the spell you want to cast.
    3. LEFT click to initialize the spell.
    4. RIGHT click to cast the initialized spell.
    Thanks goes to DrBoweNur for giving me the motivation to do this. :)
     
  10. Offline

    Darkvoltage3

    can you program the spells in a wand or book or something? :oops:
     
  11. Offline

    ValBGaming

    BUG REPORT:

    Bukkit Version: 818
    Reagent Version: 0.4
    Leading up to error: I can cycle through spells perfectly with the cast item, but if I try to initialize a spell with the item when I'm missing the reagents for the spell I get this error in the console. I get it every time I try to initialize without the reagents.

    Error:
    Code:
    07:54:43 [SEVERE] Could not pass event PLAYER_INTERACT to Reagent
    java.lang.NullPointerException
            at net.hpxn.reagent.ReagentPlugin.hasMaterials(ReagentPlugin.java:198)
            at net.hpxn.reagent.ReagentPlugin.initializeSpell(ReagentPlugin.java:149
    )
            at net.hpxn.reagent.ReagentPlayerListener.onPlayerInteract(ReagentPlayer
    Listener.java:62)
            at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.ja
    va:299)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:310)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEven
    t(CraftEventFactory.java:162)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEven
    t(CraftEventFactory.java:133)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:791)
            at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:35)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
            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:401)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    And my config file...
    Code:
    # Reagent Configuration
    # Spells: fire, bolt, storm, timebomb, teleport, teleportspawn, heal,
    #         arrowstorm, stonewall, firewall, skeleton, zombie, timetravel,
    #         megabolt, scan, tree
    #
    # Info: https://github.com/pr0f1x/reagent
    
    # Broadcast to all players when someone casts a spell.
    broadcast: false
    
    # Give players hints on what materials they are missing.
    hint: true
    
    # Allow players to cast spells with the command line.
    command: false
    
    # Allow players to cast spells with an item.
    item: book
    
    # List of spells. Configure each spells cost.
    spells:
      tree:
        cooldown: 120
        bone: 1
        sapling: 1
      scan:
        cooldown: 60
        materials:
          compass: 1
          redstone: 20
          book: 1
      megabolt:
        cooldown: 900
        materials:
          redstone: 64
          diamond: 1
      zombie:
        cooldown: 120
        materials:
          pork: 20
          obsidian: 2
      fire:
        cooldown: 15
        materials:
          wood: 10
          flint: 5
          coal: 5
      bolt:
        cooldown: 10
        materials:
          redstone: 10
          glass: 2
      storm:
        cooldown: 1800
        materials:
          diamond: 1
          water_bucket: 5
          redstone: 64
      heal:
        cooldown: 900
        materials:
          redstone: 10
          torch: 2
          paper: 4
          sugar_cane: 2
      arrowstorm:
        cooldown: 30
        materials:
          stick: 5
          feather: 5
          flint: 5
      skeleton:
        cooldown: 120
        materials:
          bone: 20
          obsidian: 2
      firewall:
        cooldown: 60
        materials:
          wood: 20
          coal: 10
          flint: 10
      teleport:
        cooldown: 30
        materials:
          portal: 2
     
  12. Offline

    Darkvoltage3

    Alrite thanks for lIstening To me
    AlriTe
     
  13. Offline

    pr0f1x

    Could it be that you are tring to cast "tree"? The tree configuration is wrong due to an error on my part. You are missing the materials node under the tree spell. It should look like this:

    Code:
      tree:
        cooldown: 120
        materials:
          bone: 1
          sapling: 1
    
     
  14. Offline

    Darkvoltage3

    [is there anthing wrong with this cause i made it to where the spells are built into the stick and it keeps going into the book.] # Reagent Configuration
    # Spells: fire, bolt, storm, timebomb, teleport, teleportspawn, heal,
    # arrowstorm, stonewall, firewall, skeleton, zombie, timetravel,
    # megabolt, scan, tree
    #
    # Info: https://github.com/pr0f1x/reagent

    # Broadcast to all players when someone casts a spell.
    broadcast: false

    # Give players hints on what materials they are missing.
    hint: true

    # Allow players to cast spells with the command line.
    command: false

    # Allow players to cast spells with an item.
    item: stick

    # List of spells. Configure each spells cost.
    spells:
    tree:
    cooldown: 1
    materials:
    stick: 1
    scan:
    cooldown: 1
    materials:
    stick: 1
    megabolt:
    cooldown: 1
    materials:
    stick: 1
    fire:
    cooldown: 1
    materials:
    stick: 1
    storm:
    cooldown: 1
    materials:
    stick: 1
    teleport:
    cooldown: 60
    materials:
    stick: 1
    teleportspawn:
    cooldown: 60
    materials:
    stick: 1
    heal:
    cooldown: 60
    materials:
    stick: 1
    arrowstorm:
    cooldown: 1
    materials:
    stick: 1
    skeleton:
    cooldown: 1
    materials:
    stick: 1
    firewall:
    cooldown: 1
    materials:
    stick: 1
    timetravel:
    cooldown: 1
    materials:
    stick: 1
     
  15. Offline

    ValBGaming

    Thanks for pointing out the error on Tree, I was wondering why it wasn't working, but no I wasn't trying to cast tree, I was trying to cast teleport I think it was. But I dont seem to be getting the error anymore, it stopped soon after I posted the bug report.
     
  16. Offline

    Traditum

    Could you please provide a list of all the Permissions nodes that this plugin uses.

    Basically I want everyone, including admins to be charged when you cast a spell. There must be some permission that I can disable so that admins don't get spells for free...

    (and no turning off Permissions is not an option, I have to many plugins that require it...)
     
  17. Offline

    pr0f1x

    I know it's a pain. Can you show me what your permissions looks like? I am assuming you have just '*' on your admin group. What you can try is adding '-reagent.free' to your admin group. This should disable the free setting.

    Let me know if this helps.
     
  18. Offline

    Tommy

    EVERYTHING IS FREE

    please help

    confg:
    # Reagent Configuration
    # Spells: fire, bolt, storm, timebomb, teleport, teleportspawn, heal,
    # arrowstorm, stonewall, firewall, skeleton, zombie, timetravel,
    # megabolt, scan, tree
    #
    # Info: https://github.com/pr0f1x/reagent

    # Broadcast to all players when someone casts a spell.
    broadcast: false

    # Give players hints on what materials they are missing.
    hint: true

    # Allow players to cast spells with the command line.
    command: false

    # Allow players to cast spells with an item.
    item: stick

    # List of spells. Configure each spells cost.
    spells:
    tree:
    cooldown: 60
    materials:
    redstone: 7
    sapling: 1
    fire:
    cooldown: 5
    materials:
    redstone: 5
    bolt:
    cooldown: 5
    materials:
    redstone: 10
    storm:
    cooldown: 5
    materials:
    diamond: 1
    water_bucket: 1
    redstone: 5
    timebomb:
    cooldown: 30
    materials:
    redstone: 10
    teleport:
    cooldown: 5
    materials:
    redstone: 10
    teleportspawn:
    cooldown: 30
    materials:
    redstone: 5
    heal:
    cooldown: 30
    materials:
    redstone: 10
    arrowstorm:
    cooldown: 20
    materials:
    redstone: 1
    stonewall:
    cooldown: 30
    materials:
    redstone: 20
    skeleton:
    cooldown: 60
    materials:
    redstone: 20
    zombie:
    cooldown: 60
    materials:
    redstone: 15
    firewall:
    cooldown: 30
    materials:
    coal: 5
    redstone: 10
    timetravel:
    cooldown: 60
    materials:
    watch: 1
    diamond: 5
    redstone: 5
    megabolt:
    cooldown: 20
    materials:
    redstone: 20
    permissions
    groups:
    Default:
    default: true
    info:
    prefix: '&2'
    suffix: '&f'
    build: false
    permissions:
    - 'foo.bar'
    whitelist:
    default: false
    info:
    prefix: '&b'
    suffix: '&f'
    build: true
    inheritance:
    - Default
    permissions:
    - 'foo.bar'
    - 'lwc.protect'
    - 'lc.level.*'
    - 'wolfpound.use'
    - 'chaircraft.sit'
    - 'realshop.shop'
    - 'realshop.create'
    - 'realshop.sell'
    - 'realshop.buy'
    - 'realshop.xbuy'
    - 'realshop.xsell'
    - 'commandbook.who'
    - 'commandbook.spawn'
    - 'commandbook.msg'
    - 'commandbook.say'
    - 'commandbook.say.me'
    - 'stargate.use'
    - 'BananaCube.bypass'
    - 'commandSigns.use'
    - 'iConomy.payment'
    - 'reagent.spells.*'
    - '-reagent.free'
    Admins:
    default: false
    info:
    prefix: '&4'
    suffix: '&f'
    build: true
    permissions:
    - '*'
     
  19. Offline

    pr0f1x

    Free for who? Default players or admins or both?
     
  20. Offline

    Tommy

    both
     
  21. Offline

    ValBGaming

    This plugin is still being supported right? Would hate to see it disappear. :/
     
  22. Offline

    pr0f1x

    I am still around. Been playing too much minecraft instead of working on the plugin. :)
     
  23. Offline

    ValBGaming

    Makes sense. :p MineCraft is fun! :D

    However, it'd be awesome to see an update for this plugin, I find this plugin really fun to mess with. :)
     
  24. Offline

    pr0f1x

    What kind of update would you like? I haven't been doing a lot of the suggestions here because they would take too much time. But if you have any simple requests I would be glad to add them in.
     
  25. Offline

    ValBGaming

    How about something like a stun? Like it stuns all mobs and/or players in the immediate vicinity (Say, 5 blocks or so?) I could see it being very useful in PvP... Or if a Creeper is about to explode.

    Ill update this post if I can think of more.

    Oh and of course, updating it to CB#928 :p
     
  26. Offline

    alfskan

    please support personal spawn teleport XD
     
  27. Offline

    ValBGaming

    Hey pr0f1x, can this be updated to CB #953? I mean I'm not having any errors at the moment but I wouldn't want this plugin to go inactive... Its my favorite magic plugin. :)
     
  28. Offline

    pr0f1x

    Done. I've only tested it quickly on #953 but I don't think there will be any problems.
     
  29. Offline

    ValBGaming

    Thanks! :D
     
  30. Offline

    alfskan

    I set the wand as a book.

    and I wanna consume book when spell.

    so I cofing like this

    Code:
    book: 1
    but when I cast spell, book wasnt consumed.

    what is the problem?
     
  31. Offline

    pr0f1x

    I just tested this and I was unable to reproduce that problem. The book I was holding was consumed. But I did notice that when the book was consumed I was unable to cast the spell because I was no longer holding a book!

    Heh.
     

Share This Page