楼主 世界聊天功能
Karlson,2008-03-25 00:14:17
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;
}
1
Page created in 0.1084 seconds width 3 queries.