//------------------------------------------------------------------------------------------------------- /** * @brief 变身还原 * @param */ public override void Restore(object param) { if (param != null) { Client.ChangeBody changeParam = (Client.ChangeBody)param; m_ChangeEventHandler = changeParam.callback; m_ChangeParam = changeParam.param; } m_bChange = true; CreateEntityView(m_Data); //解决变身回来后会播放一个无关动作的问题 PlayAni anim_param = new PlayAni(); anim_param.strAcionName = EntityAction.Stand; anim_param.fSpeed = 1; anim_param.nStartFrame = 0; anim_param.nLoop = -1; anim_param.fBlendTime = 0.1f; SendMessage(EntityMessage.EntityCommand_PlayAni, anim_param); Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.ENTITYSYSTEM_RESTORE, new Client.stPlayerChange() { status = 2, uid = GetID() }); }
void ChangePetBody(uint suitID, uint petID) { PetDataManager pm = DataManager.Manager <PetDataManager>(); if (pm != null) { //if (pm.CurFightingPet != 0) { IEntitySystem es = ClientGlobal.Instance().GetEntitySystem(); if (es != null) { INPC npc = es.FindNPC(petID); if (npc != null) { if (suitID != 0) { SuitDataBase sdb = GameTableManager.Instance.GetTableItem <SuitDataBase>(suitID, 1); if (sdb != null) { Client.ChangeBody cb = new Client.ChangeBody(); cb.resId = (int)sdb.resid; cb.modleScale = sdb.sceneModleScale; npc.SendMessage(EntityMessage.EntityCommand_Change, cb); } } else { npc.SendMessage(EntityMessage.EntityCommand_Restore); } } } } } }
public override void Restore(object param) { if (param != null) { Client.ChangeBody changeParam = (Client.ChangeBody)param; m_ChangeEventHandler = changeParam.callback; m_ChangeParam = changeParam.param; } m_bChangeRestore = true; CreateEntityView(m_Data); //解决变身回来后会播放一个无关动作的问题 PlayAni anim_param = new PlayAni(); anim_param.strAcionName = EntityAction.Stand; anim_param.fSpeed = 1; anim_param.nStartFrame = 0; anim_param.nLoop = -1; anim_param.fBlendTime = 0.1f; SendMessage(EntityMessage.EntityCommand_PlayAni, anim_param); }