Exemple #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);//抛出现在佩戴的称号
    }
Exemple #2
0
    /// <summary>
    /// 用户请求佩戴某个title
    /// </summary>
    /// <param name="cmd"></param>
    public void ReqSelectTitle(uint titleId)
    {
        stSelectTitlePropertyUserCmd_CS cmd = new stSelectTitlePropertyUserCmd_CS();

        cmd.dwUserID  = ClientGlobal.Instance().MainPlayer.GetID();
        cmd.wdTitleID = titleId;
        NetService.Instance.Send(cmd);
    }
Exemple #3
0
 public void OnSelectTitle(stSelectTitlePropertyUserCmd_CS cmd)
 {
     DataManager.Manager <TitleManager>().OnSelectTitle(cmd);
 }