[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

    Ah! It all makes sense! I saw that your plugin was compatible with permissions but didn't realize it needed it. We currently don't run permissions so I think that is most likely what is causing our problem. This may be a very stupid question so sorry in advance(as I said, I know very little about java coding and how it all works), are there any lines i could add to the config file that would make casting spells remove the correct amount of ingredients? Or is downloading permissions the only way?
     
  3. Offline

    Lightzaver

    Could you add a kinda force field?
    Maybe when casted it forms a blue glowing orb around you.
    This can protect you from any mob or element although they would be expensive.
     
  4. Offline

    pr0f1x

    Released version 0.2!
    • Added a cooldown timer for each spell.
    • Configuration was changed to allow for cooldown.
    • If permissions is not installed then all players will pay for spells (Ops included).
    Note: If you are upgrading from 0.1 please be advised that the configuration file format has changed. See here.

    This was a bug in the code. I apologize :). Try version 0.2. In this version (if you don't use permissions) everyone must pay for spells (incuding ops). I know this might not be perfect but it's a pain to handle every condition in the code...

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

    LucidLethargy

    So I've been testing this plugin to go live on my server with portals as the mana, and for some reason it's not working properly. It requires the portals to use a reagent (in this case for my testing it was /reagent teleportspawn... although on a side note may I suggest making these commands not start with reagent?) and anyway, it would require the portals in the correct amount to use the command, but it would not take away the pieces after the command was used! I'm guessing this is a bug, so i'm hoping it may be fixable!

    I Love what your doing here, and can't wait to make this work!

    edit: May this be happening because I am an op? If this is the case, then the issue is more the fact that it requires me to have the materials (although for my server, i'm going to turn all of that off anyway, as I play the game with all my guys on their level.)
    ...which begs the next question: How do I make spells cost materials even for op's and admins? This is a little strange, I don't see any toggle in the config? I could turn it all off, but I do use permissions, and I do want to only allow access to some spells!
     
  6. Offline

    pr0f1x

    Thanks for the feedback. Have you tried v0.2? I cannot reproduce your problem with 0.2 unforunately... I am an op and I still must pay for spells...

    Can you give me any more information? Thanks!
     
  7. Offline

    LucidLethargy

    Oh very strange... I am using version 0.2, sorry for leaving that out of my last message! I did test it live on my server and others do have to pay for the actions, so it's not a huge deal, but I did just test it out a second ago on my CB740 server and it's still not charging me for the teleportation. It even states "Free!" after I acquire the required materials. If I do not have the portals required, it does still say I can't do anything though - it's just the second half that seems to not function as intended.

    Either way, i've been playing with this and designing my new magic system around it - very well done! I cannot wait for new spells, also I noticed "bolt" does a lot of damage without armor on, but with armor it seems to not deal much of anything... perhaps this is a bukkit mechanic, but it seems kind of silly :p

    Oh also... Spell suggestion:
    Just for now i'm wondering if you can bring a /sethome and /home command into things. perhaps a "setpoint" and "return" if that generic naming isn't appealing. Basically, i'm moving everything over to magic in order to make sense of the world, and I bet others would really appreciate the option as well! Either way, just a suggestion!
     
  8. Offline

    Garnith

    Just popping in my thanks for the plugin, man. I'm currently swapping our server across into something like a Neverwinter Nights clone; between this, Runecraft, and Heromagic, we should have enough of a spell selection choice to make wizards, sorcerers, priests and druids viable. Double-thanks for the cooldown on spell usage; its something that I intend to make heavy use of. And yet another thanks for the summon spell, cos now I can get to setting up Pale Master prestige class! :D Minor request: Some kind of damage reduction spell? Also, damage bonus? Perhaps against specific creatures? Not sure if its possible, but kinda need to beef up paladins at the moment, cos currently they are watered-down fighters.

    Anyway, thanks for the plugin, and keep up the good work!
     
  9. Offline

    pr0f1x

    Thanks for the reply! I'm not really fond of the summon spell since you can't currently change the AI of monsters (that I know if) to make them friendly... so they might end up attacking the summoner. If you like I can add in all the other monsters so they can be summoned as well.

    As for the damage reduction and boosting, it's something I've been thinking about but I don't see a really simple way of doing it so it might take some time. I like Bukkit a lot but documentation is something it lacks tremendously!
     
  10. Offline

    TechManDylan

    What about having the reagents in the 9 inventory slot, and use a red stone torch as the wand. So you would do a check on the 9th slot, and if its the heal reagent for instance then cast heal ,and remove the required amount. This is just a suggestion that way spells wouldn't be exactly spammy and they would to least have to swap an item to swap spell or you could do the last two slots and do left click and right click with a stick either or.
     
  11. Offline

    pr0f1x

    But then how do you recommend I handle spells with multiple reagents? It would suck to have to fill all your inventory slots with all the reagents every time you want to cast a spell.

    I really don't like the stick methods... I think they are just as slow as typing in a command. I am not a huge fan of the commands either but I think for now it's the fastest way to switch between a lot of spells. If Reagent ends up with 50 different spells then having a ton of wands and always having to switch around the materials would get really annoying I think...
     
  12. Offline

    TechManDylan

    Well I mean from my perspective I don't think people are going to be using all 50 spells at once you know. Also I only said the 9th or 8th slots so you have 7 open and thats kinda the cost of having magic so theres always that. Well maybe using one kind of reagent for multiple spells and making commands to turn them into mana like red mana for fire related spells and then still using the casting method you use to increase the amount of spells you can have overall. IDK I just like brainstorming ideas and trying to help lol.
     
  13. Offline

    pr0f1x

    Thanks for your feedback! There are so many suggestions so I don't really know what to do exactly... I'm hoping the Bukkit people will improve the API enough to be able to solve these problems. But for now all of these solutions feel wrong to me.
     
  14. Offline

    Brekkjern

    I think what you really want is some form of way to do abilities like in World Of Warcraft or any other RPG. Use the number buttons to use an ability. I wish it was possible :S
     
  15. Offline

    TechManDylan

    Is there a way to catch keys outside of the ones used in minecraft? maybe when the modding api is released?
     
  16. Offline

    pr0f1x

    It's not possible... at least not that I know of... I would really like to be able to do this. Like Ctrl-0 to 9, Shift-0 to 9, etc would choose the different spells... Maybe I'll look into the bukkit code and see if I can contribute something to it.
     
  17. Offline

    yoyo

    Why not sneak+mouse weel scrolls around the spells you have access. Then u swing the wand to cast them.
    Im pretty sure that is possible, afforess did this on his inventory plugin.
     
  18. Offline

    pr0f1x

    Very interesting! I will definitely look into this! Thanks.
     
  19. Offline

    Pinkpixels

    Thank you so much for the fast fix! It works perfectly now! Also, I'm really liking the addition of cool downs, it adds a nice balance. Great work!
     
  20. Would be great if the spell permission nodes could be reversed, perhaps with a config option, to be whitelist, not blacklist.
     
  21. Offline

    pr0f1x

    Isn't this already possible? I am not super good with Permissions but can you do something like '-reagent.spells.*' and then underneath it do 'reagent.spells.teleport'.

    This would black list all spells except teleport, essentially creating a whitelist? If permissions does NOT work like this then that is quite a shame...
     
  22. Offline

    Kainzo

    You can change the AI and control them - see Fullwall's source on monstertamer.
     
  23. Mmm you're right, I could grant a group the minus all.

    Still, it's the opposite of how it should be, ideally :p
     
  24. Offline

    min

    Item does not disappear
     
  25. Offline

    pr0f1x

    If you give me more information I can try and help. "Item does not disappear" doesn't help at all...
     
  26. Offline

    xDice

    could you make a fireball spell? like ghast shoot fireballs?
     
  27. Offline

    Garnith

    Hey, small request. I've recently added MagicSpells to the server, and the cycle-with-right-click, cast-with-left wand method is really quite handy. Think you could put something similar into Reagent? Preferably with a customizable wand item; as wooden stick is being used for MagicSpells, I'd like to stick Reagent on bone. :p
     
  28. Offline

    ValBGaming

    BUG REPORT

    Bukkit Version: 766
    Reagent Version: v0.2
    Configuration:
    Code:
    # Reagent Configuration
    # Spells: fire, bolt, precip, timebomb, teleport, teleportspawn, heal,
    #          arrowstorm, air, stonewall, firewall, skeleton, timetravel
    #
    # 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
    
    # List of spells. Configure each spells cost.
    spells:
      fire:
        cooldown: 15
        materials:
          wood: 10
          flint: 5
          coal: 5
      bolt:
        cooldown: 10
        materials:
          redstone: 10
          glass: 2
      precip:
        cooldown: 1800
        materials:
          diamond: 1
          water_bucket: 5
          redstone: 64
      heal:
        cooldown: 900
        materials:
          redstone: 10
          torch: 2
          paper: 4
      arrowstorm:
        cooldown: 30
        materials:
          stick: 5
          feather: 5
          flint: 5
      stonewall:
        cooldown: 60
        materials:
          stone: 20
          redstone: 20
      skeleton:
        cooldown: 120
        materials:
          bone: 20
          obsidian: 2
      firewall:
        cooldown: 60
        materials:
          wood: 20
          coal: 10
          flint: 10
      teleport:
        cooldown: 30
        materials:
          portal: 2
    Problem: I type in /reagent <spell> to activate the spell and then right click to use it, the spell casts perfectly fine. However, the items used to cast the spell do not disappear and remain in the players inventory. This occurs for all spells.

    Example: Type /reagent <spell>
    Right click around 15 blocks away
    Spell casts
    Reagents are still in inventory

    I would assume this is what min meant when he said:
     
  29. Offline

    pr0f1x

    Thanks for this. I am looking into it and I think I see the problem.
     
  30. Offline

    Flenix

    Hey,

    Looking at all the different suggestions for the wand, thought I'd throw in my idea:
    Right now, you select a spell and you right click to cast it right? then you have to select the spell again, to cast it again. Could you make it so we choose a wand (I like someone above would choose bone) then we command to select the spell and each time you right click, it casts? Obviously the cooldown is still in play, but it means you can keep moving in battle at least a little...

    A more advanced idea I had was an optional client-side mod, which would be able to take advantage of the keystrokes mentioned above (and even maybe add a tool bar to the corner showing which spell is selected) - it would just be an optional addon to make it easier but would be so useful, I'm sure most people would get it! Just depends on how hard a client mod is compared to a Bukkit plugin, I know with Bukkit a lot of the framework is already there... Personally I'd LOVE that though and I'd be happy to add a download mirror to our website so people have multiple places incase one place goes down or something (also then I can just tell our players to go on our site to get it, full credits to you on the site obviously)


    Finally, while I'm here:
    I got this mod because Spells is going down, it still works but its no longer supported (and in all honesty, this seems better anyway) - however, there are a number of spells that were in that plugin, that it would be nice to have in this one:
    -Fireball (suggested above somewhere) - A Ghast's fireball. Right now they are invisible on SMP anyway, but 1.6 is bringing the Nether in officially, so I assume they'd be fixed by that.
    Cost: 2 Netherrack, 1 Flint and Steel
    -Sandblast - crates a large block of sand that suffocates an enemy (gravel would be good too) - It was quite clever that it didn't erase blocks, just filled in air, but annoying because it stayed. If you added it, could you add an auto-undo after about 10 seconds too?
    Cost: 10 Sand
    - Mine - Instantly mines an ore vein, was a very useful spell...
    Cost: 1 Iron Ore? (something pickaxe-like but stackable...)
    - Recall - set a marker, and teleport back to it. Casting recall looking at a block would set the marker, casting it facing the sky would teleport to it.
    Cost: 1 Redstone Torch, 3 Redstone, 1 Compass. If possible maybe split the set and teleport to, the teleport to would be the same without a redstone torch
    - Cushion - Adds a temporary water pool, used for jumping into a hole
    Cost: 1 Bucket of Water
    - Tree - Spawns a tree at the target, pure n' simple. Use with the Fire spell... ;)
    Cost: 1 Sapling, 1 Bone Meal
    - Frost - Freezes an area, covering things in snow and turning water to ice.
    Cost: 5 Ice? how would the player get Ice though...
    - Peek - in the targeted area, stone and dirt would turn to glass letting you see through.
    Cost: 4 Glass


    If you were to add those in, I'm sure NathanWolf would let you look at his code if you asked nicely? The only things that'd need changing to it are sandblast needs that auto removal (which is already on Peek and Cushion) and Frost has a bug where it sometimes wipes out all the blocks on one level and overwrites them with snow...

    Sorry for the long post :D
     
  31. Offline

    Flenix

    Also its not charging me for reagents either, but i'm yet to try with a non-opped player
     

Share This Page