예제 #1
0
        public void FDepositItem(InventoryType inventory, byte slot, ushort amount, byte newSlot, ref ItemInstance item,
                                 ref ItemInstance itemdest)
        {
            if (item == null || amount > item.Amount || amount <= 0 || !item.Item.IsTradable || item.IsBound)
            {
                return;
            }

            FamilyCharacter fhead =
                Owner.Family?.FamilyCharacters.FirstOrDefault(s => s.Authority == FamilyAuthority.Head);

            if (fhead == null)
            {
                return;
            }

            MoveItem(inventory, InventoryType.FamilyWareHouse, slot, amount, newSlot, out item, out itemdest);
            itemdest.CharacterId = fhead.CharacterId;
            DaoFactory.IteminstanceDao.InsertOrUpdate(itemdest);
            Owner.Session.SendPacket(item != null
                ? item.GenerateInventoryAdd()
                : UserInterfaceHelper.Instance.GenerateInventoryRemove(inventory, slot));

            if (itemdest == null)
            {
                return;
            }

            Owner.Session.SendPacket(itemdest.GenerateFStash());
            Owner.Family?.InsertFamilyLog(FamilyLogType.WareHouseAdded, Owner.Name,
                                          message: $"{itemdest.ItemVNum}|{amount}");
            DeleteById(itemdest.Id);
        }
예제 #2
0
        public static FamilyCharacter FromDTO(FamilyCharacterDTO familyCharacterDTO)
        {
            FamilyCharacter familyCharacter = new FamilyCharacter();

            familyCharacter.Authority         = familyCharacterDTO.Authority;
            familyCharacter.CharacterId       = familyCharacterDTO.CharacterId;
            familyCharacter.DailyMessage      = familyCharacterDTO.DailyMessage;
            familyCharacter.Experience        = familyCharacterDTO.Experience;
            familyCharacter.FamilyCharacterId = familyCharacterDTO.FamilyCharacterId;
            familyCharacter.FamilyId          = familyCharacterDTO.FamilyId;
            familyCharacter.Rank = familyCharacterDTO.Rank;

            return(familyCharacter);
        }
예제 #3
0
        private void OnOtherCharacterConnected(object sender, EventArgs e)
        {
            Tuple <long, string> loggedInCharacter = (Tuple <long, string>)sender;

            if (Character.IsFriendOfCharacter(loggedInCharacter.Item1))
            {
                if (Character != null && Character.CharacterId != loggedInCharacter.Item1)
                {
                    _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_LOGGED_IN"), loggedInCharacter.Item2), 10));
                    _client.SendPacket(Character.GenerateFinfo(loggedInCharacter.Item1, true));
                }
            }
            FamilyCharacter chara = Character.Family?.FamilyCharacters.FirstOrDefault(s => s.CharacterId == loggedInCharacter.Item1);

            if (chara != null && loggedInCharacter.Item1 != Character?.CharacterId)
            {
                _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_FAMILY_LOGGED_IN"), loggedInCharacter.Item2, Language.Instance.GetMessageFromKey(chara.Authority.ToString().ToUpper())), 10));
            }
        }