MyPetORG / MyPet

🐕 Extensive pet plugin for Bukkit/Spigot
https://www.spigotmc.org/resources/mypet.12725/
GNU Lesser General Public License v3.0
181 stars 98 forks source link

Skilltree Requirements #1199

Open zerafox opened 5 years ago

zerafox commented 5 years ago

With the introduction of Inheritance introduced back into 3.0, it would be ideal to be able to restrict which Skilltrees can be selected due to the Inheritance for the player.

For example, I have created a Skilltree A that progress upwards to Skilltree A1 or Skilltree AA.

However, I do not want players who are on the Skilltree B to be able to select my Skilltrees A1 or Skilltrees AA without already being on Skilltree A.

Required Skilltree: Would require the pet already be on Skilltree A in order to choose A1 for example.

This would allow complex trees to go from something like this: A: Level Maximum 25. A1: Level Requirement 25 + Skilltree Requirement A AA: Level Requirement 25 + Skilltree Requirement A A2: Level Requirement 50 + Skilltree Requirement A1 A2A: Level Requirement 72 + Skilltree Requirement A2

scomans commented 5 years ago

I thought about this a bit more and having different requirements that can be combined would be a great feature.

Do you think I should make the current permissions you need for a skilltree to be selectable one of these requirements too? This way the permissions are optional and it would be a lot easier for simple servers to setup MyPet as I would remove the permission requirement completly for the default skilltrees.

zerafox commented 5 years ago

Yes, I think a permission requirement per tree should be included. If the permission isn't provided for the tree, it shouldn't be selectable/visible at all.

Removing the permissions needed for the packaged trees would be a lot easier on new users. Since it appears they forget it's a thing needed to include for players. :P

scomans commented 5 years ago

I meant that the permission is converted to the new requirement system which means if no permission requirement is set a permission is not needed and it's available for everyone (if all other requirements are met)

It will work like the LeashFlags.

scomans commented 5 years ago

Are there any requirements that come to your mind that I could add?

I have the following atm:

zerafox commented 5 years ago

I meant that the permission is converted to the new requirement system which means if no permission requirement is set a permission is not needed and it's available for everyone (if all other requirements are met)

It will work like the LeashFlags.

Of course.

Are there any requirements that come to your mind that I could add?

I have the following atm:

  • NoSkilltree
  • Permission (will replace the permission)
  • PetLevel (will replace RequiredLevel & MaxLevel)
  • PetType (not sure if it will replace MobTypes)
  • Skilltree

I think keeping PetType and MobType separate would be ideal? Though I am unsure how this would work in unison? I understand MobType are the Types can use the Skilltree in the first place, so what PetType would do as it's own thing, I cannot quite comprehend. I do think that MobType/PetType whatever you want to call it should be the first condition checked above all else. I will consider other possibilities and get back to you though. :P

scomans commented 5 years ago

PetType would be a duplicate to MobTypes so I will not add that as a requirement.

zerafox commented 5 years ago

Would the "NoSkilltree" prevent players from swapping to a "NoSkilltree" requirement Tree from swapping from say "SkillTree A" to "SkillTree B" if they were both set to have this requirement for selection?

What about a condition/requirement of "NotSkilltree" ? This can be in the form of a list.

With a system like mine, each pet is given a Tree originally. The basic Stats and abilities each Mob is given. For example a Knockback (a charge and push) for cows, a Sprint & Ride for Horses, etc; This assigned immediately on tame to the pet when the player tames/obtains the pet. From here, they can choose their skilltree to "train" their pet in. This would be were their Tree A, B, C which gives their pet unique boosts or skills according to their choice. However with a system like this it's impossible to use a "NoSkilltree" condition because the pet is automatically granted one on taming, which is the basic skills of the pet to begin with.

These skills still allow a pet to be ridden, carry a small amount of items and so-forth just having a particular pet-type. With a "NotSkilltree" system I can say "You cannot choose Skilltree B if the pet already knows Skilltree A or any variation of A" and force them to move along the B track or any other track I wanted them to be following.

scomans commented 5 years ago

NoSkilltree simply means that the skilltree cannot be selected if the pet already has a skilltree. This could be used for the initial skilltree selection. This also makes the ChooseOnce setting obsolete.

scomans commented 5 years ago

I implemented (24baa6ac684e7c5fd0c73af5c2fe8f2f7c38abbc) the requirements I mentioned above (except for the level requirement in the editor). It would be great if you could try them out and give me some feedback 🤗

scomans commented 5 years ago

I could also add some of the leashflags like Baby, Adult, Size and mcMMO-Skilllevel 🤔

zerafox commented 5 years ago

McMMO Skilllevel I could see, but requiring something like Adult/Baby may cause an issue should the player decide to obtain a baby then use the grow-up item after selecting the tree.