Jump to content
View in the app

A better way to browse. Learn more.

Shaiya.gg

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding more GM Commands

Hi, as the title says, is it possible to modify the game.exe and add more GM commands or commands for players to use just like /wings on and /wings off.

Featured Replies

yeah. pass the chat text to a function and create an argument vector. then, use the size() method to get the argument count. figure out how to check authorization client-side and server-side. i would check both and dc them if the server-side check fails.

 

i'm sure this could be better, but it's a simple enough example to get anyone started. the game.exe version is 0x16021200. if it's just an on/off command you can evaluate the whole string if you want.

 

#include <sstream>
#include <string>
#include <vector>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#include <include/main.h>
#include <include/util.h>
using namespace shaiya;

int command_handler(char* text)
{
   std::istringstream iss(text);
   std::vector<std::string> argv;

   for (std::string str; std::getline(iss, str, ' '); )
       argv.push_back(str);

   if (argv.empty())
       return 0;

   auto argc = argv.size();

   if (iss.str() == "/example on")
   {
       // do something
       return 0;
   }

   if (iss.str() == "/example off")
   {
       // do something
       return 0;
   }

   if (argv[0] == "/example")
   {
       if (argc != 2)
       {
           // wrong number of arguments
           return 0;
       }

       auto arg1 = argv[1];

       // do something
       return 0;
   }

   return 1;
}

unsigned u0x4867A6 = 0x4867A6;
unsigned u0x487532 = 0x487532;
void __declspec(naked) naked_0x4867A1()
{
   __asm
   {
       pushad

       push edi // text
       call command_handler
       add esp,0x4
       test eax,eax

       popad

       je _0x487532

       // original
       push 0x13D4
       jmp u0x4867A6

       _0x487532:
       jmp u0x487532
   }
}

void hook::chat()
{
   // command handler
   util::detour((void*)0x4867A1, naked_0x4867A1, 5);
}

  • Author
does this send a packet to the server as well? I am actually planning to add "/call" similar to EG but in EP4.5 to EP6 clients.

does this send a packet to the server as well? I am actually planning to add "/call" similar to EG but in EP4.5 to EP6 clients.

no. there's a typedef of the packet send function in my repo.

Create an account or sign in to comment

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.