Jump to content

Pixeel

Members
  • Posts

    5
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Pixeel

  1. Hello all, I need some help writing a new command for make say something to character (like .npc say). I start to builds upon in my inspiration files "Player.cpp & Level1.ccp"

    This gives it

    bool ChatHandler::HandlePlayerSayCommand(const char* args)

    {

    if(!*args)

    return false;

    Player* pPlayer = getSelectedPlayer();

    if(!pPlayer)

    {

    SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);

    SetSentErrorMessage(true);

    return false;

    }

    pPlayer->PlayerSay(args, LANG_UNIVERSAL, 0);

    if(sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))

    sLog.outChat("[sAY] Player %s says (language %u): %s",

    GetName(), language, text.c_str());

    // Execute an emote is the last letter is "?" or "!"

    char lastchar = args[strlen(args) - 1];

    switch(lastchar)

    {

    case '?': m_session->GetPlayer( )->SetUInt32Value( UNIT_NPC_EMOTESTATE , EMOTE_ONESHOT_QUESTION ); break

    case '!': m_session->GetPlayer( )->SetUInt32Value( UNIT_NPC_EMOTESTATE , EMOTE_ONESHOT_EXCLAMATION ); break

    default: m_session->GetPlayer( )->SetUInt32Value( UNIT_NPC_EMOTESTATE , EMOTE_ONESHOT_TALK ); break

    }

    return true;

    }

    Can anyone help me to enrich this code and to make him able to work, please?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use