public void OnTimer(uint uTimerID) { if (uTimerID == m_uChangePlayerModelTimer) { stSkillChangeModel st = new stSkillChangeModel(); st.userID = GetID(); st.skillStatus = GetProp((int)PlayerProp.SkillStatus); EventEngine.Instance().DispatchEvent((int)GameEventID.SKILLSYSTEM_CHANGEMODEL, st); } }
void OnSuitEvent(int nEventID, object param) { if (nEventID == (int)GameEventID.PLAYER_LOGIN_SUCCESS) { // stOpSuitPropertyUserCmd_C cmd = new stOpSuitPropertyUserCmd_C(); // cmd.type = SuitOPType.SuitOPType_Login; // NetService.Instance.Send(cmd); } else if (nEventID == (int)GameEventID.LOGINSUCESSANDRECEIVEALLINFO) { InitShowDic(); stOpSuitPropertyUserCmd_C cmd = new stOpSuitPropertyUserCmd_C(); cmd.type = SuitOPType.SuitOPType_Login; NetService.Instance.Send(cmd); } else if (nEventID == (int)GameEventID.SKILLSYSTEM_CHANGEMODEL) { stSkillChangeModel st = (stSkillChangeModel)param; IEntitySystem es = ClientGlobal.Instance().GetEntitySystem(); if (es == null) { return; } IPlayer player = es.FindEntity <IPlayer>(st.userID); if (player == null) { return; } uint suitID = 0; if (!IsPlayerEquipCloth(player, out suitID)) { ChangeEquip ce = new ChangeEquip(); ce.nSuitID = (int)suitID; ce.pos = Client.EquipPos.EquipPos_Body; ce.nStateType = player.GetProp((int)PlayerProp.SkillStatus); if (this != null) {//EntityCommand_PlayAni PlayAni anim_param = new PlayAni(); anim_param.strAcionName = EntityAction.Stand; anim_param.fSpeed = 1; anim_param.nStartFrame = 0; player.SendMessage(EntityMessage.EntityCommand_PlayAni, anim_param); player.SendMessage(EntityMessage.EntityCommand_ChangeEquip, ce); } } } }