• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Trinity] Custom Event Master Commands

Ghostcrawler336

Epic Member
Script Details -
Script name - Event Commands
Script type - Custom Commands

Main Command
  • .em

Sub Commands -
  • .em reward - This command will give the selected target one event token & send a message.
  • .em reward1 - This command will give the selected target two event token & send a message.
  • .em reward2 - This command will give the selected target three event token & send a message.
  • .em freeze - This command will freeze the player inplace with the game master spell "Automation Root Spell"
  • .em unfreeze - This command will unaura the "Automation Root Spell" from .emfreeze.
  • .em port - This command will port the selected player to Stormwind or Orgrimmar based on faction.
  • .em learn - This command will allow event masters to learn spells per-set inside the script. "You can change them if you want to"
  • .em unlearn - This command will allow event masters to unlearn the spells they have learned from .em learn

FAQ -

How do I edit / add my own spells?

- This is really easy, if you want to edit the spells all you need to do is go to line 31 and you will see the first spell it will be named event_spell, just edit the number after = with the spell ID(s) you want. It will work the same with the other per-set spells.

How do I set my event token entry ID?

- This is really easy also, I tired to make the script as noob friendly as I could. First off you will need to make a event token or use one already ingame. Get the entry id by going ingame and looking it up or via the database. And after you got your entry ID you will need to open the script and go to line 27 where you will see " Event_Token = 1000," Just change 1000 to your token ID and don't forget to add , after the number!


If you need any help with this script, please reply to this thread and I'll be more then happy to help you.

Script - Script - Pastebin

Other Free Releases -
[Trinity] Ingame Support NPC - C++
[Trinity] Exchange NPC
[/CENTER]
 
Last edited:

Parranoia

Insane Member
For the event token commands you might consider something like this. I wrote this for the last server I was running. Basically it takes a number argument. If there isn't a number, it assumes 1. And in the script itself you can set a limit as to how many can be added at once. Also put in some logging of it which may be useful :)
Code:
static bool HandleEventTokenCommand(ChatHandler* handler, const char* args)
    {
        if (!*args)
            return false;

        uint32 eventToken = 43228;

        Player* player = handler->GetSession()->GetPlayer();
        Player* target = handler->getSelectedPlayer() ? handler->getSelectedPlayer() : player;

        char* ccount = strtok((char*) args, " ");
        int32 count = atoi(ccount);

        if (count == 0)
            count = 1;

        if (count <= 0)
            return false;
        if (count > 20)
            return false;

        sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) gave %i tokens to player %s (Account: %u)", player->GetName().c_str(), player->GetSession()->GetAccountId(), count, target->GetName().c_str(), target->GetSession()->GetAccountId());
    
        target->AddItem(eventToken, count);
        return true;
    }
 
Last edited:

Ghostcrawler336

Epic Member
For the event token commands you might consider something like this. I wrote this for the last server I was running
Code:
static bool HandleEventTokenCommand(ChatHandler* handler, const char* args)
    {
        if (!*args)
            return false;

        uint32 eventToken = 43228;

        Player* player = handler->GetSession()->GetPlayer();
        Player* target = handler->getSelectedPlayer() ? handler->getSelectedPlayer() : player;

        char* ccount = strtok((char*) args, " ");
        int32 count = atoi(ccount);

        if (count == 0)
            count = 1;

        if (count <= 0)
            return false;
        if (count > 20)
            return false;

        sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) gave %i tokens to player %s (Account: %u)", player->GetName().c_str(), player->GetSession()->GetAccountId(), count, target->GetName().c_str(), target->GetSession()->GetAccountId());
    
        target->AddItem(eventToken, count);
        return true;
    }

Ah thanks, that would be better to use. Other then the way I have it. :) I'll work on it once I can, currently on my friends laptop.
 
Top