Filled UniqueSets (Details Inside, Medium Task)

Discussion in 'Archived: Plugin Requests' started by tommyhoogstra, Sep 6, 2013.

  1. Offline

    tommyhoogstra

    Plugin category: Mechanics
    Suggested name: UniqueSets
    What I want: Currently on my server we are running 3 Important plugins for our players, these are
    http://dev.bukkit.org/bukkit-plugins/legendaryweapons
    http://dev.bukkit.org/bukkit-mods/enchantmentapi
    http://dev.bukkit.org/bukkit-plugins/enchantmentpack


    Basically, what I want is for when a player has a group of these "Enchanted Items" equipped. e.g. "Helmet Of God", "Chest Of Pain", "Pants of Cleansing", "Moon Boots" they will receive "special effects" such as e.g. Movement 2, or even the custom enchantments from the enchantment pack.

    On our server, we are currently setting up god sets, e.g. A god called Zerox (made up). And when a player has all 4 of zerox's Armour items equipped he will be able to use the set to full functionality, e.g. Applies tier 2 strength when hit by an enemy for (0.5 + 0.5 level) seconds which is a part of the enchantment pack plugin.

    I would like this to be configurable with just the set names, and the effects it gives.

    Functional Requirements: (Required to be in the plugin)
    To give a user effects based on the set of item names they are wearing Adjusting in the configuration.
    The ability to make new sets.
    Non Functional Requirements: (not required, but would like)
    Receive effects from the enchantment pack.
    Not being able to rename items in an anvil.
    Possibly more to come

    Ways to go about programming this: -Using an if statement or select case in an order as such (if player has equipped "Goditem1" and "Goditem2" and "Goditem3" and "Godltem4" then)
    {
    effect.apply(movement.5)
    effect.apply(strength.3) //customizable in config
    }

    This is how I would go about, but I am unaware of java syntax
    Ideas for commands: None
    Ideas for permissions:
    uniquesets.use - allows users to get the special effects


    When I'd like it by: As soon as possible, but the sooner the better, and the happier Ill be with you :)

    I also found this plugin: http://dev.bukkit.org/bukkit-plugins/armorset-effects/ Which is sort of what I want, but to work only with the items given name, in this case e.g. "Zerox Platelegs"
     
  2. Offline

    timtower Administrator Administrator Moderator

    tommyhoogstra likes this.
  3. Offline

    tommyhoogstra

    timtower Its different in many ways considering it has nothing to do with item names instead uses ID's

    Is this something you would be able to do?

    Thanks for replying
     
  4. Offline

    tommyhoogstra

    timtower
    How difficult would something like this be to make, compared to lets say your own plugin TimeLikeMe
     
  5. Offline

    timtower Administrator Administrator Moderator

    Well compared to TimeLikeMe difficult, compared to ShopLikeMe less difficult
     
  6. Offline

    tommyhoogstra

    timtower something you're willing to take on? I can see this getting used by others using the same legendary plugin.

    Thanks for the fast reply
     
  7. Offline

    timtower Administrator Administrator Moderator

    Don't know, also need to come up with a way to mark all of the items of a certain god etc
     
  8. Offline

    tommyhoogstra

    timtower wouldn't you just be able to match the items GIVEN name (probably sets the name to a string when using anvils, perhaps related) with a string?
    If it helps, I could actually show you on my server.

    Found something on another forum for Anvil Renaming
    Show Spoiler

    • @EventHandler(priority = EventPriority.MONITOR)
    • public void onInventoryClick(InventoryClickEvent e){
    • // check if the event has been cancelled by another plugin
    • if(!e.isCancelled()){
    • HumanEntity ent = e.getWhoClicked();
    • // not really necessary
    • if(ent instanceof Player){
    • Player player = (Player)ent;
    • Inventory inv = e.getInventory();
    • // see if the event is about an anvil
    • if(inv instanceof AnvilInventory){
    • InventoryView view = e.getView();
    • int rawSlot = e.getRawSlot();
    • // compare the raw slot with the inventory view to make sure we are talking about the upper inventory
    • if(rawSlot == view.convertSlot(rawSlot)){
    • /*
    • slot 0 = left item slot
    • slot 1 = right item slot
    • slot 2 = result item slot
    • see if the player clicked in the result item slot of the anvil inventory
    • */
    • if(rawSlot == 2){
    • /*
    • get the current item in the result slot
    • I think inv.getItem(rawSlot) would be possible too
    • */
    • ItemStack item = e.getCurrentItem();
    • // check if there is an item in the result slot
    • if(item != null){
    • ItemMeta meta = item.getItemMeta();
    • // it is possible that the item does not have meta data
    • if(meta != null){
    • // see whether the item is beeing renamed
    • if(meta.hasDisplayName()){
    • String displayName = meta.getDisplayName();
    • // do something
     
  9. Offline

    timtower Administrator Administrator Moderator

    tommyhoogstra It is not about getting the names but how do I see what items are used to combine a entire suit
     
  10. Offline

    tommyhoogstra

    timtower wouldn't there be like a PlayerHasEquipped method within bukkits package.
    I have little knowledge on java syntax.
     
  11. Offline

    timtower Administrator Administrator Moderator

    I know how to get the items, but not how you want to store the types, do you just want to check for a certain name or something?
     
  12. Offline

    tommyhoogstra

    That would work, the easiest way possible you can think of.
    timtower
    Even if you could clarify that more for me.

    Should look something like this in lets say C#
    Just checking that the player has each items given name, its pretty weird to explain :S
    Code:
    equipped "Goditem1" and "Goditem2" and "Goditem3" and "Godltem4" then)
    {
    effect.apply(movement.5)
    effect.apply(strength.3) //customizable in config
    }
    <Removed double post - Use edit button to edit your post - Necrodoom>
     
  13. Offline

    tommyhoogstra

    timtower
    Hi tim, would coloured item names affect developing this plugin in anyway.
    In the legendary config all the items start with "c4" to make the item name ingame dark Red

    Thanks
     
  14. Offline

    CeramicTitan

    Diablo drops is exactly what you want
     
  15. Offline

    tommyhoogstra

    I saw it and decided this one was better for what I wanted
     
  16. Offline

    tommyhoogstra

    Daily bump, anyone willing to take this on?
     
  17. Offline

    tommyhoogstra

    Daily Bump, currently attempting to learn java syntax through thenewboston.
    If anyone else would like to try this, let me know.

    timtower
    found something that may be of use
    hasDisplayName ()
    and
    getDisplayName ()
    You need HAS for GET to work, would that make this possible?
     
  18. Offline

    tommyhoogstra

    timtower
    Code:java
    1. @EventHandler
    2. public void onInventoryClose(InventoryCloseEvent event) {
    3. Player player = (Player) event.getView().getPlayer();
    4. ItemStack[] playerArmor = player.getInventory().getArmorContents();
    5. if((playerArmor[0] != null && playerArmor[0].getType() == Material.getMaterial("Zeroxes Moonlanders"))
    6. && (playerArmor[1] != null && playerArmor[1].getType() == Material.LEATHER_CHESTPLATE)
    7. && (playerArmor[2] != null && playerArmor[2].getType() == Material.LEATHER_LEGGINGS)
    8. && (playerArmor[3] != null && playerArmor[3].getType() == Material.LEATHER_BOOTS)
    9. )
    10. {
    11. player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE,4));
    12. player.sendMessage("You have equipped the Assassin class.");

    Hey tim, was doing more research and learning java itself, I thought maybe if you changed it to Material.getMaterial from Material.Item_ID

    Thoughts? I tried running this without the customisation and it doesn't seem to run the event, SO i have some work to do.
     
  19. Offline

    timtower Administrator Administrator Moderator

  20. Offline

    tommyhoogstra

    timtower
    package me.Hoogstra.Bukkit;

    import java.util.logging.Logger;

    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.inventory.InventoryCloseEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.potion.PotionEffect;
    import org.bukkit.potion.PotionEffectType;

    Other than that, I only started java 2 days ago, help me out :)
     
  21. Offline

    timtower Administrator Administrator Moderator

  22. Offline

    tommyhoogstra

    the event and its code or the import?
     
  23. Offline

    timtower Administrator Administrator Moderator

    That is not enabling it
    Code:java
    1. this.getServer().getPluginManager().registerEvent(this,this);

    And won't be offering more support here, this has turned into plugin development
     
  24. Offline

    tommyhoogstra

    Finished making this thanks to the development section.

    If you want details contact me.
     
  25. Offline

    timtower Administrator Administrator Moderator

    tommyhoogstra Please mark the thread as filled, top right corner, thread tools, edit thread
     

Share This Page