• T端最新的将官员喊话/o修改为世界汉化的方法...


    很多朋友喜欢一种修改魔兽世界,世界喊话的方式,就是修改官员喊话频道
    
    以前最老的Mangos端的方式也是这种,就直接修改/o 官员喊话频道
    
    这个也是魔兽世界私服中常用到的方式之一
    
    
    1、首先找到ChatHandler.cpp 这个TrinityCore中的文件。然后找到case CHAT_MSG_OFFICER: (魔兽世界私服官员喊话部分)
    
    
    2、修改代码
    
    
    
    case CHAT_MSG_OFFICER:
            {
                if (GetPlayer()->GetGuildId())
                {
                    if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
                    {
                        sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
    
    
                        guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
                    }
                }
            } break;
     
     
    修改为下面的代码:
     
    case CHAT_MSG_OFFICER: 
            {
                char message[1024];
                switch(GetPlayer()->GetSession()->GetSecurity())
                {
                    case SEC_PLAYER: // normal player, non-vip
                        if (GetPlayer()->GetTeam()==ALLIANCE) {
                            snprintf(message, 1024, "|cff33CC00World |cffFF0000[Horde]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        if (GetPlayer()->GetTeam()==HORDE) {
                            snprintf(message, 1024, "|cff33CC00World |cffDC143C[Alliance]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        break;
                    case 1: // VIP
                        snprintf(message, 1024, "|cff33CC00World |cff87CEEB[World VIP]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        break;
    
    
                    case 2: // regular GM
                        if (GetPlayer()->isGameMaster()==TRUE)
                        {
                        snprintf(message, 1024, "|cff33CC00World |TInterface\ChatFrame\UI-ChatIcon-Blizz.blp:0:2:0:-3|t |cff6600AA[GM]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        {
                        if (GetPlayer()->isGameMaster()==FALSE)
                        if (GetPlayer()->GetTeam()==HORDE)
                        snprintf(message, 1024, "|cff33CC00World |cffFF0000[Horde]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                                            {
                        if (GetPlayer()->isGameMaster()==FALSE)
                        if (GetPlayer()->GetTeam()==ALLIANCE)
                        snprintf(message, 1024, "|cff33CC00World |cff0000FF[Alliance]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        break;
                        
                    case 3: // Head GM/SGM
                        if (GetPlayer()->isGameMaster()==TRUE)
                        {
                        snprintf(message, 1024, "|cff33CC00World |TInterface\ChatFrame\UI-ChatIcon-Blizz.blp:0:2:0:-3|t |cff6600AA[GM]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        {
                        if (GetPlayer()->isGameMaster()==FALSE)
                        if (GetPlayer()->GetTeam()==HORDE)
                        snprintf(message, 1024, "|cff33CC00World |cffFF0000[Horde]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        {
                        if (GetPlayer()->isGameMaster()==FALSE)
                        if (GetPlayer()->GetTeam()==ALLIANCE)
                        snprintf(message, 1024, "|cff33CC00World |cff0000FF[Alliance]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str());
                        }
                        break;
                        
                    case 4: // ADMIN
                        if (GetPlayer()->isGameMaster()==TRUE)
                        {
                        snprintf(message, 1024,  "|cff33CC00World |TInterface\ChatFrame\UI-ChatIcon-Blizz.blp:0:2:0:-3|t |cff6600AA[GM]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        {
                        if (GetPlayer()->isGameMaster()==FALSE)
                        if (GetPlayer()->GetTeam()==HORDE)
                        snprintf(message, 1024, "|cff33CC00World |cffFF0000[Horde]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        {
                        if (GetPlayer()->isGameMaster()==FALSE)
                        if (GetPlayer()->GetTeam()==ALLIANCE)
                        snprintf(message, 1024, "|cff33CC00World |cff0000FF[Alliance]|cff00CCEE[%s]:|cffFFFF00 %s", GetPlayer()->GetName().c_str(), msg.c_str());
                        }
                        break;
                                            
                }
                sWorld->SendGlobalText(message, NULL);
            } break;
    
    
    OK,就这样就完毕了!去编译一下,然后试试~~~ GOOD LUCK
  • 相关阅读:
    C#删除一个字符串数组中的空字符串
    .Net后台获取客户端信息
    Java Script
    ECMAScript闭包,ECMAScript对象
    Java Script函数、变量、对象
    JavaScript3
    JavaScript-2
    变量
    8.22收获
    html
  • 原文地址:https://www.cnblogs.com/needly/p/3752576.html
Copyright © 2020-2023  润新知