EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Fun with /ooc (https://www.eqemulator.org/forums/showthread.php?t=41519)

JimB_1958 09-20-2017 12:37 AM

Fun with /ooc
 
I have searched and have not found an answer to this.

I would like to have some fun with /ooc.

I would like to set a "word of the day" so as when players say that word in /ooc I can make something funky happen to them.

So far I have found nothing for pulling anything said in /ooc into a script.

Is it even possible?

Kingly_Krab 09-21-2017 07:59 PM

Check lines 785-1156 in zone/client.cpp.

Line 785 should look like this:
Code:

void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_skill, const char* orig_message, const char* targetname) {
Check line 873 for this:
Code:

switch(chan_num)
Lines 1054-1126 contain the lines where /say is parsed to Perl.
Code:

case 8: { /* Say */
    if(message[0] == COMMAND_CHAR) {
        if(command_dispatch(this, message) == -2) {
            if(parse->PlayerHasQuestSub(EVENT_COMMAND)) {
                int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0);
                if(i == 0 && !RuleB(Chat, SuppressCommandErrors)) {
                    Message(13, "Command '%s' not recognized.", message);
                }
            } else {
                if(!RuleB(Chat, SuppressCommandErrors))
                    Message(13, "Command '%s' not recognized.", message);
            }
        }
        break;
    }

#ifdef BOTS
    if (message[0] == BOT_COMMAND_CHAR) {
        if (bot_command_dispatch(this, message) == -2) {
            if (parse->PlayerHasQuestSub(EVENT_COMMAND)) {
                int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0);
                if (i == 0 && !RuleB(Chat, SuppressCommandErrors)) {
                    Message(13, "Bot command '%s' not recognized.", message);
                }
            }
            else {
                if (!RuleB(Chat, SuppressCommandErrors))
                    Message(13, "Bot command '%s' not recognized.", message);
            }
        }
        break;
    }
#endif

    Mob* sender = this;
    if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SE_VoiceGraft))
        sender = GetPet();

    entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
    parse->EventPlayer(EVENT_SAY, this, message, language);

    if (sender != this)
        break;

    if(quest_manager.ProximitySayInUse())
        entity_list.ProcessProximitySay(message, this, language);

    if (GetTarget() != 0 && GetTarget()->IsNPC() &&
        !IsInvisible(GetTarget())) {
        if(!GetTarget()->CastToNPC()->IsEngaged()) {
            CheckLDoNHail(GetTarget());
            CheckEmoteHail(GetTarget(), message);

            if(DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) <= RuleI(Range, Say)) {
                NPC *tar = GetTarget()->CastToNPC();
                parse->EventNPC(EVENT_SAY, tar->CastToNPC(), this, message, language);

                if(RuleB(TaskSystem, EnableTaskSystem)) {
                    if(UpdateTasksOnSpeakWith(tar->GetNPCTypeID())) {
                        tar->DoQuestPause(this);
                    }
                }
            }
        }
        else {
            if (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) <= RuleI(Range, Say)) {
                parse->EventNPC(EVENT_AGGRO_SAY, GetTarget()->CastToNPC(), this, message, language);
            }
        }

    }
    break;
}

You can just use that as an example and put it in the OOC part of the switch.


All times are GMT -4. The time now is 08:47 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.