zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    剑指offer编程题Java实现——面试题14调整数组顺序使奇数位于偶数之前
    剑指offer编程题Java实现——面试题13在O(1)时间内删除链表节点
    剑指offer编程题Java实现——面试题12相关题大数的加法、减法、乘法问题的实现
    剑指offer编程题Java实现——面试题12打印1到最大的n位数
    《深入理解JAVA虚拟机》——学习笔记
    剑指offer编程题Java实现——面试题11数值的整数次方
    剑指offer编程题Java实现——面试题10二进制中1的个数
    剑指offer编程题Java实现——面试题9斐波那契数列
    剑指offer编程题Java实现——面试题8旋转数组的最小数字
    mysql高可用集群——MHA架构
  • 原文地址:https://www.cnblogs.com/needly/p/3752576.html
Copyright © 2011-2022 走看看