public Merchant(Character character) { var look = character.Look.Clone(); look.AddSubLook(new SubActorLook(0, SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_MERCHANT_BAG, new ActorLook { BonesID = BAG_SKIN })); m_record = new WorldMapMerchantRecord { CharacterId = character.Id, AccountId = character.Account.Id, Name = character.Name, Map = character.Map, Cell = character.Cell.Id, Direction = (int)character.Direction, EntityLook = look, IsActive = true, MerchantSince = DateTime.Now, }; Bag = new MerchantBag(this, character.MerchantBag); Position = character.Position.Clone(); }
public Merchant(WorldMapMerchantRecord record) { m_record = record; Bag = new MerchantBag(this); if (record.Map == null) { throw new Exception(string.Format("Merchant's map({0}) not found", record.MapId)); } Position = new ObjectPosition( record.Map, record.Map.Cells[m_record.Cell], (DirectionsEnum)m_record.Direction); }