Jump to content

Key Combo + Skills + Mana


Recommended Posts

The files below can be used to create a Mana system that regerates 1% / s, and players can execute skills/magic (w/e u name them) by using different key combos (key combos are pressing certain keys in an order). Once a skill/spell has been execute, the mana of the player can go down to a certain level. Each skill requires different amount of mana, you should make your OP skills to take more mana than those of weaker ones for a fair combat/game system. 

Terms of service.
I made some simple skripts (a while ago) that can be integrated for your servers. If you know skript (You should because it's the easiest "language" to exist, feel free to re-edit this skript. But do not re-sell the entire file itself. You can import some of my functions to your own file and sell YOUR own file if some of my techniques were used, but please credit me by dropping my name or linking my profile, but your own file has to be modifed so it's not exact as mine. 

I think the files themselves should be depend only on Skript itself, although sound and particle might've been from an addon. I have forgotten as this was coded over months ago. 

The selector file contains the key actions, and key combos. 

The function is selector(player, keyAction) - Key action can be inputted as "L" for left click, "F" for swap toggle, "R" right click, "SN" sneak, and don't have J for JUMP action, it's buggy and wouldn't make sense in combat.

From selector(), it calls other functions like updateKeyAction(), if the key has been pressed more than 3 times, combos only require 3 key actions. updateKeyAction determines which keys were pressed and calls generateAction() which recognizes which keys were pressed and correlate to which spell.

The events at the end are necessary, but can be left the way there. 
If you want to add your own spells, or check out the pre-included skills, check skill.sk

Some key combo that I've added myself, and what skill they correlate to:
- F, Sneak, Sneak -> Tride Skill, Tride() function inside skill.sk
- Sneak, Sneak, F -> High/Double Jump

Oh, and you can also create skills for certain weapons. Line #70 and #73, use the same key combo except different weapons. If your level of understanding skript is high, you could also shorten line 70 and 73, for adding more items for the same key combo, etc.
If you press F, F, F while holding a pickaxe it will enable temporary X-ray, while for sword it will enable Mob X-ray. 

Please feel free to look inside mana.sk, selector.sk and skill.sk to get familar if you would like to integrate, modify, or use for ownself.

selector.sk skill.sk mana.sk

Edited by VoidWalker
Link to comment
Share on other sites

Due to limitation of bukkitAPI, skript can only recognize buttons such as left click, right click, F (switch off-hand), jump (PaperSpigot), Sneak (shift default), etc. 

There might be some bugs, or you may not like something that exist already. Feel free to learn and change for your ownself. I'm only dumping these files here because I believe someone else can take them to higher, someone who has more time than I do.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...