Build your own Magic

If yout want to Build your own Magic you can look at the Exemple Magic at GitHub: https:github.com/bluenova/TestMagic

The Main Class

The Magics Main Class have to Implement MagePlugin:

public class testmagic implements MagePlugin {

You will need 3 Functions:

public void setPluginManager(MagePluginManager manager) {

is called by the Main Plugin and gives you an Instance of the MagePluginManager.

public String getMagicName() {

is called by the Main Plugin and have to return the name of the Magic

public void loadPlugin() {

and

public void unloadPlugin() {

Are Called by the Main Plugin when it Loads/unloads.

Magic Classes

Magic Classes are Registered in the MagePluginManager

manager.registerMagic(<spellname>, <magicname>, <minlevel>, <needed basemana>, <object extending MagePluginEvent>, <eventtype>, <hidden>, <cooldown in ms>);

The Magics extends MagePluginEvent

public class snowwallmagic extends MagePluginEvent {

You have to Override the Call Functions for Eventhandling.

@Override
public boolean callPlayerInteractEvent(PlayerInteractEvent event, Integer level) {

Comments

Posts Quoted:
Reply
Clear All Quotes