示例#1
0
    public void OnSelectTitle(stSelectTitlePropertyUserCmd_CS cmd)
    {
        //如果是玩家自己
        if (Client.ClientGlobal.Instance().IsMainPlayer(cmd.dwUserID))
        {
            this.WearTitleId = cmd.wdTitleID;

            TitleDataBase titleDataBase = GameTableManager.Instance.GetTableItem <TitleDataBase>(this.WearTitleId);
            if (titleDataBase != null)
            {
                TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Title_Commond_peidaichenghao, titleDataBase.strName);//佩戴称号{0}
            }
        }


        Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
        if (es != null)
        {
            //设置人物身上称号
            Client.IPlayer player = es.FindPlayer(cmd.dwUserID);
            if (player != null)
            {
                player.SetProp((int)PlayerProp.TitleId, (int)cmd.wdTitleID);
            }
        }


        //处理文字特效
        Client.stTitleWear data = new Client.stTitleWear {
            uid = cmd.dwUserID, titleId = cmd.wdTitleID
        };
        EventEngine.Instance().DispatchEvent((int)GameEventID.TITLE_WEAR, data);//抛出现在佩戴的称号
    }