Skip to content

Configuring Race Level Unlockables

Redned edited this page Mar 14, 2020 · 1 revision

Another part of PwingRaces that goes hand-in-hand with "unlocking" certain unlockables for skilltree elements is unlocking them for levels as well. Essentially, the way this system works for levels is very similar to that of unlocking them for skilltree elements. In order to keep this tutorial relatively short, it is highly recommended that you read the Configuring Race Skilltree Unlockables page before trying to get information here.

Starting off, we will be picking up from the Werewolf race that we worked on in the previous tutorial page linked above. Because most all the basic information you need to know is mentioned there, it won't be put here.

If you recall from the previous tutorial, you had to add a new section called elements. In this scenario, that is unneeded. Instead, you will be directly modifying the levels section depending on which level you want add unlockables to (refer to the levels section). Here is an example using the Werewolf race:

race:
    name: Werewolf
    max-level: 30
    skilltrees:
    - swordsmanship 28 # 28 is the slot it shows up in when you select the race from /race
    require-unlock: true
    gui:
        slot: 29
        icon:
            type: player_head
            owner: Werewolf
            display-name: "&cWerewolf &7| &aUnlocked"
            lore:
            - '&7At night, a dark curse falls upon'
            - '&7this race turning it into a vicious'
            - '&7werewolf!'
        icon-selected:
            type: player_head
            owner: Werewolf
            display-name: "&cWerewolf &7| &eSelected"
            lore:
            - '&7At night, a dark curse falls upon'
            - '&7this race turning it into a vicious'
            - '&7werewolf!'
            enchants:
            - unbreaking 1
            item-flags:
            - hide_enchants
        icon-locked:
            type: skeleton_skull
            display-name: "&c??? &7| &cLocked"
            lore:
            - '&7Defeat the Feral Lycan to'
            - '&7unlock this race.'
    levels:
        1: # The first level
            xp: 200 # How much experience you need to level up
            skillpoints: 1 # How many skillpoints you get for leveling up
        2: 
            xp: 250
            skillpoints: 1
            triggers:
                walkongrass: # Overrides the existing trigger if the player is level 2
                    trigger: block-relative down grass
                    delay: 2
                    run-passives:
                    - add-potion-effect speed 3 2
        3: 
            xp: 275 # You don't need to define skillpoints either, but you MUST 
define how much xp it takes for you to level up.
        4: 
            xp: 300
            skillpoints: 1
            triggers:
                healonsneak: # Overrides the existing trigger if the player is level 4
                    trigger: sneak
                    delay: 5
                    run-passives:
                    - give-health 20
        5:
            xp: 350
            skillpoints: 2
        # You can define as many levels as you want below
    attributes:
        generic-max-health: 25
        generic-armor: 5
        generic-attack-speed: 10
        max-mana: 250 # MagicSpells mana
    permissions:
    - essentials.sethome.multiple.werewolf
    - essentials.nick
    - essentials.tpa
    - ^essentials.tpahere # Add ^ before the permission to remove it
    - ^essentials.vanish 
    items:
        vampireknives:
            material: stone_sword
            display-name: "&4V&campire &4K&cnives"
            lore:
            - "&cRight-click to throw!"
        vampirefang: # You can define as many items as you want
            material: ghast_tear
            display-name: "&5V&dampire &4F&cang"
            enchantments:
            - sharpness 5
            item-flags:
            - HIDE_ENCHANTS
    triggers:
        walkongrass:
            trigger: block-relative down grass
            delay: 2
            run-passives:
            - add-potion-effect speed 2 2
        healonsneak:
            trigger: sneak
            delay: 10
            chance: 1
            run-passives:
            - give-health 20
    abilities:
        quickshot:
            ability-item: "bow|&2Q&auickshot &3B&bow"
            ability: QuickshotAbility
            cooldown: 0.5
            arrows: 1
            damage: 2
            spend-arrows: true
            required-permission: quickshot # (Is really pwingraces.ability.quickshot)
            override-default-action: true
    elements:
        swords1:
            attributes:
                generic-attack-damage: 1
        swords2:
            attributes:
                generic-attack-damage: 2
        swords3:
            abilities:
                throwswordability:
                    ability-item: "&4V&campire &4K&cnives"
                    ability: ThrowWeaponAbility
                    cooldown: 10
                    required-permission: vampire
                    hit-velocity: 1.5
                    damage: 10
                    speed: 1
                    max-duration: 100

And for the most part, this covers configuring unlockables with race levels. As this can be quite complicated, if you are still confused on levels, please feel free to reach out to us on Discord and we'll be happy to help you out.