Skip to content

Your first hero

Wngui edited this page Mar 22, 2025 · 5 revisions

With all dependencies set up, let's create our first hero!

Inside the WarcraftPlugin directory, you'll find a CustomHeroes folder—any compatible C# files placed here, will automatically load into the plugin.

Dev-kit

  1. Download the HeroMaker folder from the repo: Download.
  2. Open HeroMaker.sln in Visual Studio.
  3. Configure the project: Double-click the project and update the highlighted path to your own. If CustomHeroes doesn't exist, create it. This ensures your hero files are copied to the correct location on build.
    image
  4. Use the example hero MonkeyDude.cs as a base, or create your own. Ensure the namespace remains WarcraftPlugin.Classes.

Hero Class Breakdown

public class MonkeyDude : WarcraftClass
{
    public override string DisplayName => "MonkeyMan";

    public override Color DefaultColor => Color.GreenYellow;

    public override List<IWarcraftAbility> Abilities => 
    [
        new WarcraftAbility("Banana Gun", "Shoots a barrage of bananas that explode on impact."),
        new WarcraftAbility("Monkey Agility", "Increases movement speed and evasion."),
        new WarcraftAbility("Primal Roar", "Emits a roar when killing an enemy that stuns nearby enemies."),
        new WarcraftCooldownAbility("Jungle Fury", "Temporarily increases attack speed and damage.", 60f)
    ];

    public override void Register()
    {
        HookEvent<EventPlayerSpawn>(PlayerSpawn);
        HookAbility(3, Ultimate);
    }

    private void PlayerSpawn(EventPlayerSpawn spawn)
    {
        Console.WriteLine("MonkeyMan has spawned!");
    }

    private void Ultimate()
    {
        Console.WriteLine("MonkeyMan used ultimate!");
    }
}
  • DisplayName – How the hero appears in menus and in-game.
  • DefaultColor – Defines hero-related colors in menus and models.
  • Abilities – Typically four abilities, each with a name, description, and optional cooldown.
  • Register() – Called when the hero is instantiated, mainly for registering hooks.

Test Your Hero

Modify an ability in MonkeyDude.cs, then build the solution to copy the file automatically.
Join the server, switch to MonkeyDude, and check if the skills menu reflects your changes!

Clone this wiki locally