public override bool TakeAction() { PlayerHeroLogic ph = new PlayerHeroLogic(); ph.SetUser(m_UserId).SetHero(m_RequestPacket.HeroType); PlayerPackageLogic pp = new PlayerPackageLogic(); pp.SetUser(m_UserId); if (!pp.DeductInventory(new ItemListItem() { Id = m_RequestPacket.ItemId, Count = 1 })) { ErrorCode = (int)ErrorType.RequireNotMet; ErrorInfo = "You have not enough item"; return(false); } int exp = int.Parse(CacheSet.ItemTable.GetData(m_RequestPacket.ItemId).FunctionParams); ph.AddSkillExp(m_RequestPacket.SkillIndex, exp); var hero = ph.GetHeroInfo(); m_ResponsePacket.HeroInfo = new PBLobbyHeroInfo() { Type = hero.HeroType }; m_ResponsePacket.HeroInfo.SkillExps.AddRange(hero.SkillExps); m_ResponsePacket.ItemInfo = new PBItemInfo() { Type = m_RequestPacket.ItemId, Count = pp.MyPackage.Inventories[m_RequestPacket.ItemId] }; return(true); }