Randomizing Wand preferences for Magic

Discussion in 'Spigot Plugin Help' started by cleardragonf, Jun 9, 2018.

  1. @NathanWolf Hi ok so I'm trying to get the wand's attributes to be randomized....they use to be pretty good.

    like it would

    spell: 1 10 15 20
    2 15 20 10

    This was how they use to be...so my question now is this still possible and if so how would I go about it?
     
    • Like Like x 1
  2. It is still possible, all the randomization stuff should still work, I just removed most of it in the default configs for 7.0 to simplify the process. So now you just get a spell for buying a spell, and mana increases on rankup.

    However the 6.0 configs are still available and should work. So, for example, look here:

    https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/6/paths.yml

    You'd have to set your paths up something like that, with the mana randomization in place.

    Then you can craft a wand like "wand(5)" (change the output of the wand recipe) and it will randomly upgrade the wand 5 times when giving it to the player upon crafting.
     
  3. and when you say change the output of the wand recipe?...which config is that in?
     
  4. crafting.yml you would put something like this:

    Code (Text):
    wand:
      output: wand(10)
     
  5. Ok...so here's what i have for the my configs...and they do not seem to be working...for giving a random number of spells when a player crafts a wand using a crafting table...suggestion? these are the only files i've changed.
     

    Attached Files:

  6. Change "wand" to "beginner" in paths.yml and I think you'll be good to go!

    The paths are beginner/student/apprentice/master/etc, each wand can be on any of these paths, so the paths have their own names.

    They inherit up though, so if you just change the beginner path that should be good enough.
     
  7. ok...so i do that in the paths...but still only missile appears...do i need to make a list of spells for it to randomize between?
     
  8. No, it will use the spell list already defined in the beginner path.

    Hm.. I thought I had tried this out, but I forgot that wands don't really contain spells anymore....

    I'm pretty sure this randomization format still works but I'll have to do some more involved testing and get back to you!
     
  9. perfect!!! thank you! Please let me know :D
     
  10. Ok so a couple things:

    1. There was a recent bug (in a debug message, of all things) that would cause randomizing a crafted wand to fail. You can grab a fix in his here dev build:

    Magic-7.6-SNAPSHOT.jar

    2. The idea of a randomized wand doesn't really fit with the new class-based system, since wands don't actually have spells on them anymore. So you'll need to modify the wand to not be class-based anymore. This would mean players lose their spells if you have players already...

    wands.yml:
    Code (Text):
    wand:
      class: ""
      path: beginner
      mana: 50
      mana_max: 50
      mana_regeneration: 5
     
  11. sweet....also...just for my information...what is the point behind the class system? what makes it so great? :D
     
  12. Most people want players to "know" spells and "learn" spells. This is contrary to how magic has always worked, it's been an item-based plugin. The class system lets people have it both ways.

    In other words, spells, mana and other progression info can be stored on the player, rather than on an item. Most people view this as safer, it's not a huge deal if a player somehow loses their wand.
     
  13. unless you want them to looose the spells upon their death ;)

    ok...so i've done the above and added load_default_wands: false to the config yaml...however still only getting the Missile spell for crafted wands.
     
  14. so barring....the ability to make this random...can i make it so that if the player dies any wands they make after start from the beginning? like missile?
     
  15. You don't want to turn off loading of default wands if you're using the config I gave, that modifies the base wand. This is what you want to do to disable the class system, there is no "reset on death" feature. I tested all of the configs, I got a randomized wand each time with 8-10 spells on it. I'm not sure why this wouldn't be working for you unless you have other customizations getting in the way.
     
  16. yea...i'll get some sleep them come back to it...i'll try restarting magic and changing the configs...thanks nathanwolf! :D
     
  17. ok...so here's my entire plugin config folder for magic...i'm still not getting random wands with anything besides missile
     

    Attached Files:

  18. You have "load_default_paths: false" in config.yml, which prevents the default paths from loading. The paths are used by wands when randomizing or progressing, so you do need to load those.

    You also have "load_default_crafting: false", which means nothing is craftable. You'll also want to turn that on assuming you want craftable wands.

    So basically delete your config.yml and it all works.

    If you want to turn off other crafting recipes you can disable them individually, or leave the defaults off but copy the entire wand recipe if you prefer.
     
  19. ok...soooo now.. i'm only getting 10 spells constantly...unless i change for example the number in the Wand: output: wand(10) to Wand: output: wand(20) then it moves to 20 spells....
     
  20. Looks like you found another bug.... fixed here:

    Magic-7.6-SNAPSHOT.jar

    Sorry, but you're dusting off some features that haven't been used in 2-3 years. :)

    That said, you don't need such a complex path config either, since you're not really enchanting there are no "levels" being spent, it's always going to use level 1. So you can reduce your path config to something like this:

    Code (Text):
    beginner:
        # Add spells to a wand
        spell_count:
            1: 100
            2: 50
            3: 25
            4: 1
    Which is hopefully a little easier for you to understand and tweak. It's progressively lower probability of getting more spells with each randomization.

    I feel like I should note that it's pretty easy to game this since you can see the # spells in the lore of the wand before you grab it off the workbench. There isn't a real fix for that other than to make your wand have custom lore that doesn't show the spell count.
     

Share This Page