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
  • 相关阅读:
    2
    spring jdbcTemplate 基本使用
    Day38-数据库入门学习
    DAY37-Python入门学习-进程池与线程池、协程、gevent模块
    Python入门学习-DAY36-GIL全局解释器锁、死锁现象与递归锁、信号量、Event事件、线程queue
    Python入门学习-DAY35-线程
    Python入门学习-DAY34-开启进程的两种方法、join方法、进程之间内存空间互相隔离、进程对象其他相关的属性或方法、僵尸进程与孤儿进程、守护进程、互斥锁
    Python入门学习-DAY33-基于UDP的套接字、socketserver模块、进程简单介绍
    Python入门学习-DAY32-链接循环与通信循环,粘包问题,远程控制,文件上传与下载
    Python入门学习-DAY31-三次握手原理与四次挥手,socket
  • 原文地址:https://www.cnblogs.com/needly/p/3752576.html
Copyright © 2011-2022 走看看