public override bool TakeAction() { DTInstanceStory instanceData = CacheSet.InstanceStoryTable.GetData(m_RequestPacket.InstanceId); PlayerHeroLogic ph = new PlayerHeroLogic(); ph.SetUser(m_UserId).SetHero(instanceData.HeroId); if (ph.GetHeroInfo() == null) { ErrorCode = (int)ErrorType.RequireNotMet; ErrorInfo = "You can not enter this instance"; return(false); } PlayerStoryInstanceLogic ps = new PlayerStoryInstanceLogic(); ps.SetUser(m_UserId); CacheDictionary <int, int> dropItems = new CacheDictionary <int, int>(); foreach (int dropId in instanceData.DropIds) { var itemDict = ps.GetDropItems(dropId, m_RequestPacket.StarLevel); dropItems = GameUtils.MergeItemDict(dropItems, itemDict) as CacheDictionary <int, int>; } PlayerPackageLogic pp = new PlayerPackageLogic(); pp.SetUser(m_UserId); PBReceivedItems receivedItems; pp.GetItems(dropItems, ReceiveItemMethodType.CompleteInstance, out receivedItems); m_ResponsePacket.ReceivedItems = receivedItems; m_ResponsePacket.Count = ps.GetCount(); m_ResponsePacket.StarLevel = m_RequestPacket.StarLevel; return(true); }
public override bool TakeAction() { PlayerStoryInstanceLogic ps = new PlayerStoryInstanceLogic(); ps.SetUser(m_UserId); m_ResponsePacket.Count = ps.GetCount(); return(true); }