예제 #1
0
파일: FloorItemSystem.cs 프로젝트: Pircs/Yi
        public static void Drop(YiObj owner, YiObj dropper, Item drop)
        {
            var floorItem = new FloorItem
            {
                Original = drop,
                Owner    = owner,
                MapId    = dropper.MapId,
                DropTime = DateTime.UtcNow,
                Jobs     = new List <Job>()
            };

            floorItem.UniqueId   = UniqueIdGenerator.GetNext(EntityType.FloorItem);
            floorItem.Location.X = dropper.Location.X;
            floorItem.Location.Y = dropper.Location.Y;
            QueueDrop(floorItem);
        }
예제 #2
0
파일: FloorItemSystem.cs 프로젝트: Pircs/Yi
        public static void DropMoney(YiObj owner, YiObj dropper, int amount)
        {
            var floorItem = new FloorItem
            {
                Original = ItemFactory.CreateMoney(amount),
                Owner    = owner is Player ? owner : null,
                MapId    = dropper.MapId,
                Amount   = amount,
                DropTime = DateTime.UtcNow,
                Jobs     = new List <Job>()
            };

            if (floorItem.Amount > 0 && dropper is Player powner)
            {
                powner.Money -= floorItem.Amount;
            }

            floorItem.UniqueId   = UniqueIdGenerator.GetNext(EntityType.FloorItem);
            floorItem.Location.X = dropper.Location.X;
            floorItem.Location.Y = dropper.Location.Y;
            QueueDrop(floorItem);
        }