Index: ChatHandler.cpp===================================================================
--- ChatHandler.cpp (revision 113)
+++ ChatHandler.cpp (working copy)
@@ -28,6 +28,7 @@
#include "ChannelMgr.h"
#include "Group.h"
#include "Guild.h"
+#include "Config/ConfigEnv.h"//假人回化系统
#include "ObjectAccessor.h"
#include "ScriptCalls.h"
#include "Player.h"
@@ -190,7 +191,28 @@
Player *player = objmgr.GetPlayer(to.c_str());
uint32 tSecurity = GetSecurity();
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
- if(!player || tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers())
+ if(!player)
+ {
+ //GetPlayer()->Whisper(msg, lang,player->GetGUID());
+ std::string DummyPlayerAutoWhisper_1= sConfig.GetStringDefault("DummyPlayerAutoWhisper.1","");
+ std::string DummyPlayerAutoWhisper_2= sConfig.GetStringDefault("DummyPlayerAutoWhisper.2","");
+ std::string DummyPlayerAutoWhisper_3= sConfig.GetStringDefault("DummyPlayerAutoWhisper.3","");
+ std::string str ="";
+ switch ( rand()%3 )
+ {
+ case 0: str += DummyPlayerAutoWhisper_1;
+ break;
+ case 1: str += DummyPlayerAutoWhisper_2;
+ break;
+ case 2: str += DummyPlayerAutoWhisper_3;
+ break;
+ }
+ str += "|r";
+ sWorld.SendWorldTextCn(str.c_str(), NULL);
+ return;
+
+ }
+ if(tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers())
{
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
data<<to;
|