public void InventoryDrop(RealmTime time, InvDropPacket pkt) { //TODO: locker again const short NORM_BAG = 0x0500; const short SOUL_BAG = 0x0503; Entity entity = Owner.GetEntity(pkt.Slot.ObjectId); IContainer con = entity as IContainer; if (con.Inventory[pkt.Slot.SlotId] == null) return; Item item = con.Inventory[pkt.Slot.SlotId]; con.Inventory[pkt.Slot.SlotId] = null; entity.UpdateCount++; Container container; if (item.Soulbound) { container = new Container(SOUL_BAG, 1000 * 60, true); container.BagOwner = AccountId; } else container = new Container(NORM_BAG, 1000 * 60, true); container.Inventory[0] = item; container.Move(entity.X + (float)((invRand.NextDouble() * 2 - 1) * 0.5), entity.Y + (float)((invRand.NextDouble() * 2 - 1) * 0.5)); container.Size = 75; Owner.EnterWorld(container); if (entity is Player) { (entity as Player).CalcBoost(); (entity as Player).Client.SendPacket(new InvResultPacket() { Result = 0 }); } }
public void InventoryDrop(RealmTime time, InvDropPacket pkt) { //TODO: locker again const short NORM_BAG = 0x0500; const short SOUL_BAG = 0x0503; const short PDEM_BAG = 0xffd; const short DEM_BAG = 0xffe; const short SDEM_BAG = 0xfff; var entity = Owner.GetEntity(pkt.Slot.ObjectId); var con = entity as IContainer; if (con.Inventory[pkt.Slot.SlotId] == null) return; if ((entity is Player) && (entity as Player).Decision == 1) { (entity as Player).Client.SendPacket(new InvResultPacket {Result = 1}); return; } var item = con.Inventory[pkt.Slot.SlotId]; con.Inventory[pkt.Slot.SlotId] = null; entity.UpdateCount++; Container container; if (item.Soulbound) { container = new Container(SOUL_BAG, 1000*60, true) {BagOwner = AccountId}; } else if (item.Undead) { container = new Container(DEM_BAG, 1000*60, true) {BagOwner = AccountId}; } else if (item.PUndead) { container = new Container(PDEM_BAG, 1000*60, true); } else if (item.SUndead) { container = new Container(SDEM_BAG, 1000*60, true) {BagOwner = AccountId}; } else { container = new Container(NORM_BAG, 1000*60, true); } var bagx = entity.X + (float) ((invRand.NextDouble()*2 - 1)*0.5); var bagy = entity.Y + (float) ((invRand.NextDouble()*2 - 1)*0.5); try { container.Inventory[0] = item; container.Move(bagx, bagy); container.Size = 75; Owner.EnterWorld(container); if (entity is Player) { (entity as Player).CalcBoost(); (entity as Player).Client.SendPacket(new InvResultPacket { Result = 0 }); (entity as Player).Client.Save(); } if (Owner is Vault) if ((Owner as Vault).psr.Account.Name == psr.Account.Name) return; const string dir = @"logs"; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } using (var writer = new StreamWriter(@"logs\DropLog.log", true)) { writer.WriteLine(Name + " dropped a " + item.ObjectId + (container.BagOwner != null ? " (Soulbound)" : "")); } } catch { Console.Out.WriteLine(Name + " just attempted to dupe."); } }
public void InventoryDrop(RealmTime time, InvDropPacket pkt) { //TODO: locker again const short NORM_BAG = 0x0500; const short SOUL_BAG = 0x0503; const short PDEM_BAG = 0xffd; const short DEM_BAG = 0xffe; const short SDEM_BAG = 0xfff; Entity entity = Owner.GetEntity(pkt.Slot.ObjectId); IContainer con = entity as IContainer; if (con.Inventory[pkt.Slot.SlotId] == null) return; if ((entity is Player) && (entity as Player).Decision == 1) { (entity as Player).Client.SendPacket(new InvResultPacket() { Result = 1 }); return; } Item item = con.Inventory[pkt.Slot.SlotId]; con.Inventory[pkt.Slot.SlotId] = null; entity.UpdateCount++; Container container; if (item.Soulbound) { container = new Container(SOUL_BAG, 1000 * 60, true); container.BagOwner = AccountId; } else if (item.Undead) { container = new Container(DEM_BAG, 1000 * 60, true); container.BagOwner = AccountId; } else if (item.PUndead) { container = new Container(PDEM_BAG, 1000 * 60, true); } else if (item.SUndead) { container = new Container(SDEM_BAG, 1000 * 60, true); container.BagOwner = AccountId; } else { container = new Container(NORM_BAG, 1000 * 60, true); } float bagx = entity.X + (float)((invRand.NextDouble() * 2 - 1) * 0.5); float bagy = entity.Y + (float)((invRand.NextDouble() * 2 - 1) * 0.5); try { container.Inventory[0] = item; container.Move(bagx, bagy); container.Size = 75; Owner.EnterWorld(container); if (entity is Player) { (entity as Player).CalcBoost(); (entity as Player).Client.SendPacket(new InvResultPacket() { Result = 0 }); (entity as Player).Client.Save(); } } catch { Console.Out.WriteLine(Name + " just attempted to dupe."); } }