public static void HandleBeautyVoucher(GameSession session, Item item) { if (item.Gender != session.Player.Gender) { return; } session.Send(CouponUsePacket.BeautyCoupon(session.FieldPlayer, item.Uid)); }
public static void HandleExpandCharacterSlot(GameSession session, Item item) { Account account = DatabaseManager.Accounts.FindById(session.Player.AccountId); if (account.CharacterSlots >= 11) // TODO: Move the max character slots (of all users) to a centralized location { session.Send(CouponUsePacket.MaxCharacterSlots()); return; } account.CharacterSlots++; DatabaseManager.Accounts.Update(account); session.Send(CouponUsePacket.CharacterSlotAdded()); InventoryController.Consume(session, item.Uid, 1); }
private static void HandleExpandCharacterSlot(GameSession session, Item item) { Account account = DatabaseManager.Accounts.FindById(session.Player.AccountId); int maxSlots = int.Parse(ConstantsMetadataStorage.GetConstant("MaxCharacterSlots")); if (account.CharacterSlots >= maxSlots) { session.Send(CouponUsePacket.MaxCharacterSlots()); return; } account.CharacterSlots++; DatabaseManager.Accounts.Update(account); session.Send(CouponUsePacket.CharacterSlotAdded()); session.Player.Inventory.ConsumeItem(session, item.Uid, 1); }