Wizards ❱ Domination | CTF | TDM | icon

Wizards ❱ Domination | CTF | TDM | -----

Domination, CTF & TDM | Leaderboards | Classes or Kits | Special Effects/Systems | Mounts |



Class API Update
If you dont need the class API you don't need to update right now, there are structural changes to classes but nothing will change to performance or gameplay.
  • You can now create Classes using the API, see example below.
    • A quick note on this, you cannot use the class reload command when using the API to inject a new class, it will not register the class injected via API.
  • (Extra, QoL) After the game starts, players will take 0.5 of damage to prevent HealthBar showing 0.


Class names and Display names;

  • Please don't change the Original name (file name, shop name) of the already existing classes, the plugin needs to check for the Original name to handle the Shop.

How to create your own class, some notes

  1. Create a class with the name you want, extends by WizardClass and apply the default values.
  2. For the Developer to work with mana, I changed so you need to apply the mana usage of every class you create.
    1. Same for kit items.
Class example
Code (Text):
import com.floodeer.wizards.Wizards;
import com.floodeer.wizards.game.GamePlayer;
import com.floodeer.wizards.game.classes.WizardClass;
import com.floodeer.wizards.particles.ParticleEffect;
import com.floodeer.wizards.script.ScriptManager;
import com.floodeer.wizards.util.ItemFactory;
import com.floodeer.wizards.util.LocationUtils;
import com.floodeer.wizards.util.Util;
import org.bukkit.Location;
import org.bukkit.entity.Player;

import java.io.File;

public class Reaper extends WizardClass  {

    public Reaper(String name, File configFile) {
        super(name, configFile);
    }

    @Override
    public void give(Player player) {
        player.getInventory().addItem(ItemFactory.unbreakable(getWeapon()));
        player.getInventory().setHelmet(ItemFactory.unbreakable(getHelmet()));
        player.getInventory().setChestplate(ItemFactory.unbreakable(getChesplate()));
        player.getInventory().setLeggings(ItemFactory.unbreakable(getLeggings()));
        player.getInventory().setBoots(ItemFactory.unbreakable(getBoots()));
    }

    @Override
    public void onInteract(Player player) {
        GamePlayer gp = GamePlayer.get(player.getUniqueId());
        if (gp.getMana() < getManaCost()) { //Mana Manager
            if(!Wizards.get().getMessages().enoughMana.isEmpty())
                gp.getP().sendMessage(Util.colorString(Wizards.get().getMessages().enoughMana.replaceAll("%prefix%", Wizards.get().getMessages().prefix)));
            if(!Wizards.get().getOptions().enoughMana.isEmpty())
                Util.playSound(gp.getP(), Wizards.get().getOptions().enoughMana);
        } else {
            ScriptManager.run(gp, getScript()); //Script system, if enabled

            gp.setMana(gp.getMana() - getManaCost()); //Remove player mana

            //Skill start
            Location location = player.getLocation();

            //Skill Particle Effect
            LocationUtils.getCircle(location.clone().add(0.0D, 1.0D, 0.0D), 5.0D, 40).forEach(l -> {
                ParticleEffect.CRIT_MAGIC.display(0.0F, 0.0F, 0.0F, 0.1F, 3, l, 126);
                ParticleEffect.CLOUD.display(0.0F, 0.0F, 0.0F, 0.01F, 1, l, 126);
            });

            //Apply skill damage and effects
            Util.filterAreaDamage(player, getDamage(), location, getAreaDamage(), false, Wizards.get().getMessages().magic).forEach(target -> {
                ScriptManager.run(gp, GamePlayer.get(target), getTargetScript());
                GamePlayer targetgp = GamePlayer.get(target);
                targetgp.setMana(0);
                target.sendMessage(Util.colorString("&cYour mana has been devoured by &4" + player.getName() + "&c!"));
            });

            //Skill end
        }
    }
}
To tell Wizards that you have a class to add, add the following code to your onEnable

Code (Text):
 WizardClasses.injectClass(Reaper.class, "Reaper", "reaper.yml");
Where Reaper is the class that extends WizardClass, Reaper is the Original name and reaper.yml the class file name that will be generated so you can change it however you want.

After creating the class, you need to manually add to the shop.yml;
Code (Text):
reaper:
  item: 'DIAMOND_SWORD : 1'
  name: '&6Reaper Class'
  lore:
    - '&7Removes mana from'
    - '&7nearby players.'
  slot: 23
Where's everything you need from WizardClass
Code (Text):
 

   public String getOriginalName();
 
    public String getDisplayName();
 
    public List<String> getDescription();
 
    public int getPrice();
 
    public int getMaxDistance();
 
    public int getManaCost();

    public ItemStack getHelmet();
 
    public ItemStack getChesplate();
 
    public ItemStack getLeggings();
 
    public ItemStack getBoots();
 
    public ItemStack getWeapon();
 
    public double getDamage();
 
    public double getAreaDamage();
 
    public double getExplosionRadius();
 
    public List<String> getScript();
 
    public List<String> getTargetScript();
 
    public int getManaPerHit();

    public Collection<PotionEffect> getEffects();

    public List<ItemStack> getItems();
   
Everything from here is taken from your class.yml, you can, of course, ignore all of that and create the class however you want without interacting with the class file.

This updated changed how classes are handled, please do some small testing before updating.

New classes will keep coming via updates if you don't have a Developer.
----------, May 14, 2021
Resource Information
Author:
----------
Total Downloads: 135
First Release: Jul 7, 2018
Last Update: Dec 16, 2024
Category: ---------------
All-Time Rating:
20 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings