Skip to content
mtanksl edited this page Jun 23, 2024 · 6 revisions

Introduction

Before starting the server, all the classes that implement Script are loaded. This is when the pipeline order is set.

Example

Let's attach a new Command Handler to the pipeline.

public class PlayerSayScripts : Script
{
    public void Start()
    {
        Context.Server.CommandHandlers.AddCommandHandler(new DisplayMagicEffectHandler() );

        // The order is important
    }

    public void Stop()
    {
            
    }
}

Edit the file \mtanksl.OpenTibia.GameData\data\scripts\config.lua. The scripts are loaded according to this registration list order. If the script is not in this list, it is still loaded, but the order is not guaranteed.

scripts = {
    ...
    { filename = "OpenTibia.Game.Scripts.PlayerSayScripts" },
    ...
}