Example #1
0
        private async Task OnUserDropMoneyRequest(IPacket packet)
        {
            packet.Decode <int>();
            var money = packet.Decode <int>();

            if (Field.Template.Limit.HasFlag(FieldOpt.DropLimit))
            {
                return;
            }

            await ModifyStats(s =>
            {
                if (s.Money < money)
                {
                    return;
                }
                var drop = new FieldDropMoney(money)
                {
                    Position = Position
                };

                s.Money -= money;
                Field.Enter(drop, () => drop.GetEnterFieldPacket(0x1, this));
            }, true);
        }
        private void OnUserDropMoneyRequest(InPacket packet)
        {
            packet.Decode <int>();
            var money = packet.Decode <int>();

            ModifyStats(s =>
            {
                if (s.Money < money)
                {
                    return;
                }
                var drop = new FieldDropMoney(money)
                {
                    X = X, Y = Y
                };

                s.Money -= money;
                Field.Enter(drop, () => drop.GetEnterFieldPacket(0x1, this));
            }, true);
        }