Client mods

ClientMod and GPK installation through the Toolbox client interface.

ClientMod

A client modification belongs to a client interface rather than a particular game network connection. Export a ClientMod class; use network hooks and mod.game in NetworkMod.

Installing GPK files

During installation, the manager invokes the instance's install(installer). installer.gpk(fromPath, filename = null) resolves the source relative to the module folder and passes the GPK to the client interface. The second argument can override the destination filename.

module.exports.ClientMod = class ResourceMod {
    constructor(mod) {
        this.mod = mod;
    }

    install(installer) {
        installer.gpk('resources/example.gpk');
    }
};

The example assumes a compatible resources/example.gpk exists inside the module. Installation uses Toolbox's mechanism; do not overwrite original game resources manually from the constructor. install may be asynchronous: the manager awaits it and logs installation errors.

Other capabilities

The installer also exposes dll(filename), forwarding a local library to the client's DLL loading mechanism. This is native code requiring compatible architecture and APIs; ordinary resource changes only need GPK. ClientMod can use queryData and client information, while mod.globalMod accesses its own global component if exported.

Sources: bin/mod.js (ClientModInterface._install), node_modules/tera-client-interface/index.js.