空间广告
在线情况
楼主
  • 头像
  • 级别
    • 积分0
    • 经验0
    • 文章0
    • 注册0
    世界聊天功能
    Chat.cpp
             { "setvalue",    SEC_ADMINISTRATOR, &ChatHandler::HandleSetValue,                "",   NULL },
             { "getvalue",    SEC_ADMINISTRATOR, &ChatHandler::HandleGetValue,                "",   NULL },
             { "Mod32Value",  SEC_ADMINISTRATOR, &ChatHandler::HandleMod32Value,              "",   NULL },
       //世界聊天
             { "sj",   SEC_PLAYER,   &ChatHandler::HandleWorldCast,              "",   NULL },
             { NULL,          0, NULL,                                        "",   NULL }
         };
    ----------------------------------------------------------分割线--------------------------------------------------------------------
    Chat.h
             bool HandleRemoveQuest(const char * args);
             bool HandleSaveAllCommand(const char* args);
             bool HandleGetItemState(const char * args);
        //世界聊天
        bool HandleWorldCast(const char* args);
             Player*   getSelectedPlayer();
             Creature* getSelectedCreature();
             Unit*     getSelectedUnit();
    ----------------------------------------------------------分割线--------------------------------------------------------------------
    Level0.cpp  最后一行
             SendSysMessage(LANG_BAD_VALUE);
         return true;
    }
      bool ChatHandler::HandleWorldCast(const char* args)
      {
       if(!*args||m_session->GetPlayer()->GetMoney()<10000)
        return false;
       std::string str ="[涓栫晫棰戦亾][|cffff0000";//"|cfff0ff00[世界频道][|r"
       str +=m_session->GetPlayerName();
       str +="|r]:";
       str += args;
       sWorld.SendWorldText(str.c_str(), NULL);
       m_session->GetPlayer()->ModifyMoney(int32(-10000));
       m_session->GetPlayer()->GetSession()->SendNotification("涓栫晫棰戦亾骞挎挱宸茬粡鍙戦 侊紝鎵彇璐圭敤");//世界频道广播已经发送,扣取费用一金币!
       return true;
      }
    风之帝国感谢您的参与
    loading...
    loading...
    loading...
    loading...
    loading...
    loading...
    loading...
    回复帖子 注意: *为必填项
    *验证信息 用户名 密码 注册新用户
    *帖子名称
    内容(最大50K)




    其它选项 Alt+S快速提交
     


    Powered by LeadBBS 9.1 licence.
    Page created in 0.2344 seconds with 7 queries.