当前位置:首页>>魔兽单机>>正文
一个简单的T端PVP获得头衔的脚本
2013-04-27 10:59:04 作者:网络 来源: 浏览次数:0
摘要:一个简单的T端PVP获得头衔的玩家脚本
1、下面的代码是一个角色代码。你需要加到你的Trinity 端的脚本库里面。

2、该代码的作用就是设置你PVP的杀人数量值来设置你可以获得的头衔ALLIANCE_TITLES 和HORDE_TITLES 分别设置头衔的ID,。

3、头衔的ID需要你到CharTitles.dbc里面去查询

 
#include "ScriptPCH.h"
 
const int ALLIANCE_TITLES[15] = {
    1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 126
};
const int HORDE_TITLES[15] = {
    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 127
};
const int HK_RANKS[15] = {
    100, 500, 1000, 2000, 4000, 5000, 6000, 8000, 10000, 15000,
    25000, 40000, 45000, 50000, 75000
};
 
class title_granter : public PlayerScript
{
    public:
        title_granter() : PlayerScript("title_granter") {}
 
        void OnPVPKill(Player* killer, Player* killed)
        {
            if (killer == NULL) return;
 
            uint32 hks = killer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS);
            for (int rank=0; rank < 15; rank++)
            {
                if (hks >= HK_RANKS[rank])
                    killer->SetTitle(sCharTitlesStore.LookupEntry(
                        (killer->GetTeam() == ALLIANCE ? ALLIANCE_TITLES
                            : HORDE_TITLES)[rank]));
            }
        }
};
 
void AddSC_title_granter()
{
    new title_granter();
}


点击下载完整代码


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度