[FUN/MECH] ElixirMod v1.00 - A Drink to Victory! [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Steeveeo, Jun 18, 2011.

  1. Offline

    Steeveeo

    ElixirMod - A Drink to Victory!
    Version: v1.00

    ElixirMod is my first plugin for Bukkit, and is tested and working under build 860. This plugin adds a few "simulated items" that users can toy with, which are listed in Features.
    The way this mod works is that a user holds an empty bowl in hand, right clicks, and if they have the proper ingredients, will give them a buff for a period of time. But if they are not careful, they could hurt themselves, as each drink racks up "Toxicity" which can hurt more than it helps.

    Features:
    • Works with Permissions 2.7.4 and equivalent (tested with Essentials Group Manager).
    • Every aspect of each Elixir is, or will be modifiable.
    • Several fun and useful Potions and Elixirs, see the Potion List below for details
    [​IMG] Download ElixirMod.jar
    [​IMG] Source Code

    Issues:
    Having issues with ElixirMod? Have a suggestion? Posting it here tends to get lost in chatter, instead:

    PermissionsBukkit Hotfix:
    When version 1.00 of ElixirMod came out, it did not support PermissionsBukkit. The fix for this is relatively simple, and just requires a quick edit to the ElixirMod.jar file. Make sure the server is off before attempting this, and then open ElixirMod.jar in something like 7zip, open "plugin.yml" and replace its content with the stuff in the following spoiler tag, save and make sure your archive program updated the file inside it, then run the server and enjoy ElixirMod on PermissionsBukkit (note, requires SuperPermsBridge):
    Show Spoiler

    Code:yaml
    1. name: ElixirMod
    2. main: me.steeveeo.ElixirMod.ElixirMod
    3. version: 1.00
    4. load: startup
    5. commands:
    6. elixir:
    7. description: Command container for all ElixirMod Admin commands.
    8. permissions:
    9. elixirmod.*:
    10. description: Gives access to all ElixirMod permissions.
    11. default: false
    12. children:
    13. elixirmod.command.*: true
    14. elixirmod.allpotions: true
    15. elixirmod.command.*:
    16. description: Gives access to all ElixirMod chat commands
    17. default: false
    18. children:
    19. elixirmod.command.gettox: true
    20. elixirmod.command.gettox.others: true
    21. elixirmod.command.settox: true
    22. elixirmod.command.settox.others: true
    23. elixirmod.command.reset: true
    24. elixirmod.command.reset.others: true
    25. elixirmod.command.givebuff: true
    26. elixirmod.command.takebuff: true
    27. elixirmod.allpotions:
    28. description: Grants access to all ElixirMod potions
    29. default: true
    30. children:
    31. elixirmod.cactusrum: true
    32. elixirmod.firetouch: true
    33. elixirmod.haste: true
    34. elixirmod.obbyskin: true
    35. elixirmod.wheatseedtea: true
    36. elixirmod.featherfall: true
    37. elixirmod.diversale: true
    38. elixirmod.frosttouch: true
    39. elixirmod.health: true
    40. elixirmod.dragonsdraught: true
    41. elixirmod.command.gettox:
    42. default: false
    43. elixirmod.command.gettox.others:
    44. default: false
    45. elixirmod.command.settox:
    46. default: false
    47. elixirmod.command.settox.others:
    48. default: false
    49. elixirmod.command.reset:
    50. default: false
    51. elixirmod.command.reset.others:
    52. default: false
    53. elixirmod.command.givebuff:
    54. default: false
    55. elixirmod.command.takebuff:
    56. default: false
    57. elixirmod.cactusrum:
    58. default: true
    59. elixirmod.firetouch:
    60. default: true
    61. elixirmod.haste:
    62. default: true
    63. elixirmod.obbyskin:
    64. default: true
    65. elixirmod.wheatseedtea:
    66. default: true
    67. elixirmod.featherfall:
    68. default: true
    69. elixirmod.diversale:
    70. default: true
    71. elixirmod.frosttouch:
    72. default: true
    73. elixirmod.health:
    74. default: true
    75. elixirmod.dragonsdraught:
    76. default: true



    Changelog:
    Note, when updating to or through any version with the "(Config Reinstall Required)" flag in the changelog, you must delete the ElixirMod folder in Plugins, then run the server to let the plugin regenerate the file.

    Version 1.00
    (Config Reinstall Required)
    • First off, a note. Many, many things changed, so this is not a complete list. Instead, just the main points of the changes made, nothing fine.
    • Complete rewrite of how potions work and act, systematically. Now uses a modular class-based system instead of the stupid CopyPasta I had going on in prior versions. YAY, it's now officially an Object Oriented Program! Derp.
    • Added some new stuff to the config files for existing potions.
    • Made the ability for Firetouch users to ignite Netherrack with rightclick. This casts a BLOCK_IGNITE_EVENT with the cause of FLINTANDSTEEL before igniting, so it can be canceled. Handy for region protection.
    • Added support for specifying the ENTIRE recipe within the config files. Syntax is as follows: "Item : Data * Amount,..." Specifically, Item is the type of inventory item to look for, Data is the datavalue associated with the item (use them for dyes, it's what I built it for), and amount is, well, the amount. 351:1*5,1*1 would be 5 Rose Red dye and 1 Stone, for example.
    • Added Diver's Ale. Costs 8 glowstone dust and 1 rose, gives 5 times the breath underwater.
    • Added Elixir of Frosttouch. Costs 4 Snowblocks and 1 waterbucket. 75% chance to stun a hit target for 3 seconds.
    • Added Health Potion (generic name HO!). Costs 1 brown mushroom, 1 red mushroom, and 1 milkbucket. Gives a half-heart per 1 second for 15 seconds.
    • Added Dragon's Draught. Costs 2 lavabuckets and 4 obsidian. Gives heat-damage immunity. Lava immunity is on by default, but is a toggle in the config for admins who don't like it.
    • Added a Chat Command system. Commands are as follows (player can be the * wildcard to select the entire server):
      • /elixir Prints out the help and usage
      • /elixir gettox[ player] Prints out your toxicity, or the specified player(s)
      • /elixir settox[ player] amount Sets the Toxicity variable on self or player(s).
      • /elixir givebuff player buffname Grants a buff by name to player(s).
      • /elixir takebuff player buffname Inverse of the above.
    • Got rid of some useless and unused events. All of the other events are handled in the potion objects now, and there's no need for a joiner event anymore.
    • Made the util.takeItemAmount() function check for data values as well as special behavior for bucket contents. If a potion recipe asks for, say, a lava bucket, this function will now replace the lava bucket with an empty one.
    Previous Versions (open)

    Version 0.75:
    Show Spoiler
    (Config Reinstall Required)
    • Removed "Plugin Enabled" from config, really didn't do anything and was a remnant from the config tutorial I based it on.
    • Fixed some pretty severe NullPointerError spam with the Elixir of Haste and some with Elixir of Obbyskin. This was due to reloading plugins making my hashtables reset. Now checks for null hashes before doing anything with them.
    • Added Elixir of Featherfall. Costs 16 feathers and negates fall damage for 2 minutes.
    • Added Elixir of Firetouch. Costs 16 netherrack and gives the user a 75% chance to ignite a target for 5 seconds. Currently ignites via any damage from a user, but can be configured to only work when unarmed.

    Version 0.66:
    Show Spoiler

    • Fixed Wheatseed Tea use check. Failed copypasta from Obsidian Skin made it check to see if the user had leather as well as the required ingredients.

    Version 0.65:
    Show Spoiler
    (Config Reinstall Required)
    • Added Elixir of Obsidian Skin - 50% damage reduction for 5 minutes, takes 1 obsidian and 8 leather.
    • Added Wheatseed Tea - 50% toxicity reduction, 25% buff reduction, 2 hearts health regen. Takes 16 seeds.
    • Reworked Toxicity system, will now cause damage over time if overtoxic.
    • Added in more options and renamed some entries on the Config file to make them more clear.
    • Added in the ability to toggle each Elixir in the Config file.

    Version 0.31
    Show Spoiler

    • Fixed a divide-by-zero error in Cactus Rum that enabled users to get infinite health by taking a second dose after the first wore off.

    Version 0.3
    Show Spoiler

    • Official Public Release.
    • Redid entire "Toxicity" system to work with multiple types of potion buffs.
    • Added in Elixir of Haste. Note, this is just a LITTLE bit out of whack, and admins might want to restrict this for now.

    Version 0.2
    Show Spoiler

    • Refactored the plugin to be called ElixirMod, as a brainstorm session with fellow players pushed me to expand this.
    • Added Config File support.
    • Added Permissions support.

    Version 0.1
    Show Spoiler

    • Plugin Created under the name CactusRum.
    • Got Cactus Rum working.


    List of Elixirs and Potions
    Show Spoiler

    • Cactus Rum - Requires 16 cactus. Does a default of 3 hearts of damage, then grants 3 minutes of health regen (1/2 heart every 3 seconds).
      • Permission Node: elixirmod.cactusrum
    • Elixir of Haste - Requires 16 sugar. Makes the drinker run much faster than normal. Currently not working 100% as intended, but still fun to play with.
      • Permission Node: elixirmod.haste
    • Elixir of Obsidian Skin - Requires 1 obsidian, 8 leather. Drinker gets 50% damage reduction for a default of 5 minutes.
      • Permission Node: elixirmod.obbyskin
    • Wheatseed Tea - Requires 16 seeds. Reduces toxicity by half, and for balance, reduces buff durations by 25%. Also restores 4 (2 hearts of) health.
      • Permission Node: elixirmod.wheatseedtea
    • Elixir of Featherfall - Requires 16 feathers. Negates fall damage while active for a default of 2 minutes.
      • Permission Node: elixirmod.featherfall
    • Elixir of Firetouch - Requires 16 netherrack. Default 75% chance to ignite mobs on-hit. Defaults to working with any damage, but configs allow the ability to limit it to unarmed only.
      • Permission Node: elixirmod.firetouch
    • Elixir of Frosttouch - Requires 4 snowblocks, 1 water bucket. 75% chance to stun a target for 3 seconds.
      • Permission Node: elixirmod.frosttouch
    • Diver's Ale - Requires 8 glowstone dust, 1 rose. Default 5 minutes of 5 times the breath underwater.
      • Permission Node: elixirmod.diversale
    • Health Potion - Requires 1 red mushroom, 1 brown mushroom, 1 milk bucket. Gives 1 half heart per 1 second for 15 seconds.
      • Permission Node: elixirmod.health
    • Dragon's Draught - Requires 2 lava buckets, 4 obsidian. Gives fire immunity for default 5 minutes. Lava immunity can be toggled.
      • Permission Node: elixirmod.dragonsdraught


    Admin Commands
    Show Spoiler

    Note, all <player> fields can be either a player's partial name, full name, or the * wildcard to select everyone in the server. Fields surrounded by [ ] are optional (in the case of <player>, if not specified, will act on the calling player).
    • /elixir - Prints out the help and usage for all ElixirMod commands.
    • /elixir gettox[ <player>] - Prints out the toxicity level over the maximum "safe" toxicity level (i.e., greater than the second number = damage over time from being toxic).
    • /elixir settox[ <player>] <amount> - Sets the toxicity level of a player.
    • /elixir givebuff <player> <buffname> - Gives a buff by potion name to a player. Bypasses the "Drink" function, so toxicity is not applied.
    • /elixir takebuff <player> <buffname> - Inverse of the above.


    Planned Potions
    Note, I am generally only a moderately original creator, and thus I can only come up with a finite number of ideas. New suggestions are always welcome!
    Show Spoiler
    (Subject to change due to new ideas and limits on possibility.)
    • Elixir of Stealth - Blocks mob targeting unless the user attacks.
    • Greater Potion of Invulnerability - Very expensive potion that would grant godmode to the user. By "expensive", I mean it. Probably as bad as a diamond version of a Golden Apple, but more likely a callback to the Yogscast's Mistral City ark with its ingredients. ;)
    • Elixir of Protection - Gives a stackable "over-shield" buff for some time that absorbs a flat amount of damage (possibly 5 for the default, might bump that up when I enter the balancing phase of the next version.
    • Potion of Blinding Strikes - Gives a chance to "blind" the target on-hit. This will not affect player visibility or mob targeting, but will make attacks have a high chance to miss.
    • Thornskin Brew - Returns about 30% of damage taken back to its source.
    • Dread Venom - Causes the next attack to poison the target, reducing damage output by half, blocking healing (or reducing it by half, if possible), and perhaps a light slow in future versions. The Health Potion would act as an antidote and resume healing as normal.


    Known Issues
    This is a list of all the bugs that I personally know about and am planning to fix in the next couple of versions.
    Show Spoiler

    • Elixir of Haste - Wildly uncontrollable, jumping impossible while hasting. This is due to Minecraft not having any way via stock functions to get what keys a player is pressing down, meaning that the only way to Haste is to throw the player in the direction he/she is looking. Sadly, this also means that it overrides the jump velocity, due to how movement is broadcast across the net. In order to jump in the current version, you need to stop speeding by holding "Sneak". I plan to fix this by adding BukkitContrib support in the next version (planned version 1.2). Those without BukkitContrib Client installed will still have to deal with the same crappy movement code, sadly.
    • Dragon's Draught - Sinking into lava and hitting the bottom of a pool more than 2-deep will cause damage. This is due to how Minecraft treats lava, which is more like Web than Water. The user actually takes fall damage while sinking, and I am not sure how to go about fixing this, other than some wildly extensive checks that might actually bring the server to its knees if I do it improperly.
    • Heroes plugin - Health-restoring potions do not work with this plugin, as Heroes completely rewrites how health works in Bukkit, and ElixirMod uses stock Bukkit health. No plans to write an interface for this.
     
    CJits and kahlilnc like this.
  2. Offline

    kahlilnc

    Server loves this plugin!!!
     
  3. Offline

    kahlilnc

    Hm could you make another version of this compatible with heroes?
     
  4. Offline

    Steeveeo

    Depends on what that mod already does. As far as I know, there shouldn't be any asset conflicts causing major meltdowns or anything, but interaction between mods would have to be written by a third party.

    What, exactly, do you mean when you say you want compatibility?
     
  5. Offline

    kahlilnc

    I mean it wont heal the hp on that plugin.
     
  6. Offline

    Steeveeo

    What does that plugin do? Completely modify how health works? All that my plugin does for HP regen is Player.setHealth(int). If, for some reason, that is intercepted, changed, or anything else, that is not within my project's scope.

    Please check for and post any errors you can find in your logs related to this issue. If it's actually an error, I can fix it.
     
  7. Offline

    kahlilnc

    http://forums.bukkit.org/threads/rp...es-skills-experience-damage-system-1000.27358
    There is there thread. It has its own hp system. So healing hearts does not effect the hp.

    Bacon and all other foods do though.

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

    Steeveeo

    Then that, indeed, is outside the scope of this project. The creator of that plugin would have to write an interface for the setHealth function in order to accept health changes from other plugins.

    To be clear, I will not be making a specific version of ElixirMod for each and every other RPG-esque plugin out there, as I am pretty sure that "Heroes" is not the only one that changes how health works. However, I will accept all bug and error reports in order to minimize the footprint of this plugin and reduce the amount of collisions between this and other plugins.
     
  9. I love this! And I'm oh so happy that you take suggestions towards potions!

    I'll just give some random shots and you say which is and which isn't possible and I'll see if I can base my next few potion suggestions towards that.

    Also just a quick question, would it be possible to make elixirs compatible with McMMO?
    Like a potion that gives increased XP for a few seconds?

     
  10. Offline

    Steeveeo

    I like your ideas, and any new elixir concepts are very welcome. I have been thinking about the mcMMO interface for a bit, but right now, I am constructing this as a stand-alone plugin. What is possible later on (say, version 1.4 perhaps), is to open up many of the functions as an API so other plugins can interface with it. When I do that, and I figure out just what mcMMO has open for other plugins to mess with, XP boost potions are quite possible. Also, with an API, others will be able to write up their own potions and stick them in from other plugins as well, so consider the API a planned feature.

    Now, let's see which of these I can and cannot do on the current system:

    Eh, possibly. The problem I see with this, though, is that with the way the Minecraft's water works, someone could go and screw up delicately placed waterfalls and such and just minge the hell out of stuff. If I could find a non-block way to make someone walk on water, this would totally be in my list, but for now, I'll have to decline.
    Haste doesn't actually modify speed at the moment, it forces it in a direction. When I get SpoutCraft (formerly BukkitContrib) support in, this will be possible. Consider this one "go for launch" as an idea, but on hold until I get the system for it up and running.
    See above.
    This sounds quite fun, actually. Consider this one on the list for the next version. Expect it to be renamed to something like "Potion of Blindness" or "Elixir of Blinding Strikes" or somesuch, as that sounds a little more accurate to it's effect.
    Liquid Thornmail? I like. Not only that, it is really easy under the system I have to implement. Expect this on in the next version.
    Minecraft already does this. Notch has even stated over Twitter that, "Hitting a mob while rushing now sends them flying. It's satisfying, and I'm giggling a bit."
    For sanity's sake, as well as server load, I think I am going to pass on this. I know it is possible, because of the Civilians mod and whatnot (that one hijacked the player class and spawned "Civilians" as named players), but getting them to follow and move with the user, while not making that horribly laggy on the server, is not within my skill level.
    Ehhh, maybe if I could find a way to make a custom light source, but, like the Water Walking idea, I want to stay away from having potion buffs edit blocks in the world.


    Again, thank you for the ideas, they are much appreciated, even if not all of them are possible!
     
  11. Offline

    sct

    Would it be possible to make it so you can use the elixirs ON other players? That would be amazing. Don't know if someone has mentioned this yet.
     
  12. Offline

    Steeveeo

    If you mean forcing them to drink a potion, that's not really a planned feature. However, there are potions that give buffs that can be used in PVP, like the Elixir of Firetouch.

    Also, tested on my server, ElixirMod appears to work in Bukkit build #1060.
     
  13. Offline

    sct

    Yeah basically one person holds the ingredients and bowl in their hand and then right clicks on another player giving them the buff. If it's a planned feature, that's awesome and I am looking forward to it!
     
  14. Offline

    Steeveeo

    Damnit, missed.

    That's supposed to be "not really a planned feature". As in, that sounds horrible in terms of balance to me.
     
  15. Offline

    Misoa

    oh.. ok sorry :s
     
  16. Offline

    SamieltheMDS


    Are there any known issues with compatibility? I ask because I can't seem to get this to work at all (and yes I have the ingredients and am right clicking with the empty bowl).
     
  17. Offline

    Steeveeo

    Well, first, why did you quote the entire first post?

    Secondly, check your console and/or log for errors in relation to this mod and post them here. The only compatibility issues that are known thusfar is the Heroes plugin, as that changes how health works completely and makes some restoration potions not work.
     
  18. Offline

    SamieltheMDS

    Well I'll admit that wasn't the best thing to do in quoting the entire thing like that. But either way the reason I ask is because I can't seem to get the pluggin to work at all, and no I don't have Heroes.
     
  19. Offline

    Steeveeo

    As I said, please post any errors in relation to this from your log. I can't do anything without an error or a bug description.
     
  20. Offline

    SamieltheMDS

    Alright then, I'll get back to you on that, and thanks for your help thus far.
     
  21. Offline

    BioRage

    If you were to make xp potions, can you do it for Heroes, imo Hero's is one of the biggest, and top rpg/classes plugin to date.
     
  22. Offline

    Steeveeo

    I'm going to be opening up a lot of the classes and functions in ElixirMod to make it into somewhat of an API. I myself most likely will not be making links to plugins, as this is supposed to be stand-alone. However, one could use the "API" for ElixirMod to make potions that do interface with said plugins.
     
  23. Offline

    Knifepoint

    Nice mod :). I was just thinking of an elixir of thunder that pushes back the mob and does x damage...?

    Also could you add something like /elixir recipes to show recipe list in game?
     
  24. Offline

    Steeveeo

    Thanks for the suggestions. I will be taking that idea for the chat command, that seems needed.

    The second one has already been suggested and answered before, though (in reference to 1.8):
     
  25. Offline

    ARR8

    Hi,
    I get an error whenever anyone right-clicks with a bowl. This was tested with a stack of cactus in my inventory. I am using BukkitPerms, but I am also OP, so I didn't add any nodes. I have the latest version of Spout.
    Code:
    2011-09-05 16:59:01 [SEVERE] Could not pass event PLAYER_INTERACT to ElixirMod
    java.lang.NoClassDefFoundError: com/nijiko/permissions/PermissionHandler
        at me.steeveeo.ElixirMod.ElixirModPlayerListener.onPlayerInteract(ElixirModPlayerListener.java:88)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:210)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:573)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:478)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:454)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Thanks in advance.
    EDIT: Thank you!
     
  26. Offline

    Steeveeo

    Ok, you and everyone else who has this issue, I've fixed it and have added the fix into the first post under "PermissionsBukkit Hotfix". Follow the instructions provided and you should be right as rain!

    Also, I have gotten the majority of the heavy lifting out of the way for ElixirMod v1.20, and am pressing myself to release it within the next week, but I make no guarantees due to college classes and life requirements. However, when it does come out, expect a utilization of a ton of new, fancy Spoutcraft features like HUD icons and improved movement for certain potions, as well as several new potions, many of which were suggested by the users themselves!
     
  27. Offline

    jlu

    1.9 is about potion, so i keep a regard on your plugin. :)
     
  28. Offline

    Steeveeo

    Eh?
     
  29. Offline

    jlu

    They're going to implant potions in game. It's a perfect release for your plugin.
     
  30. Offline

    Steeveeo

    Mind providing a link to this information? I can't seem to find anything on the subject.
     
  31. Offline

    jlu

Share This Page