private bool Proxy_ReceivedContainerOpenIncomingPacket(IncomingPacket packet) { if (Enabled && Looting && LootItems.Count > 0) { ContainerOpenPacket p = (ContainerOpenPacket)packet; Thread handler = new Thread(new ThreadStart(delegate() { AutoResetEvent ev = new AutoResetEvent(false); Thread thread = new Thread(new ThreadStart(delegate() { IsLooting = true; Core.Player.Stop(); Thread.Sleep(100); Loot(p.Id); })); thread.Priority = ThreadPriority.AboveNormal; thread.Start(); if (!ev.WaitOne(2000)) { thread.Abort(); } IsLooting = false; })); handler.Start(); } return(true); }
bool Proxy_ReceivedContainerOpenIncomingPacket(IncomingPacket packet) { if (_autoLoot && _lootItems.Count > 0) { ContainerOpenPacket p = (ContainerOpenPacket)packet; bool lootContainer = isLootContainer(p.Id); if (lootContainer && !Tibia.Constants.ItemLists.Container.ContainsKey(p.ItemId)) { Scheduler.AddTask(new Action(autoLoot), null, 200); } else if (!lootContainer) { p.Name = "Container " + (p.Id + 1); if (_autoLootWait == AutoLootWait_t.OPEN_NEW_LOOT_CONTAINER) { _autoLootWait = AutoLootWait_t.STOP; Scheduler.AddTask(new Action(autoLoot), null, 100); } } } return(true); }
private bool Proxy_ReceivedContainerOpenIncomingPacket(IncomingPacket packet) { if (OpenSmall) { ContainerOpenPacket p = (ContainerOpenPacket)packet; List <Item> items = p.Items; p.Items = new List <Item>(); p.Send(); p.Items = items; } return(true); }
public override void OnOpen(Player player) { base.OnOpen(player); ContainerOpenPacket pk = new ContainerOpenPacket(); pk.WindowId = this.Type; pk.Type = this.Type; InventoryHolder holder = this.Holder; pk.Position = new Vector3(holder.X, holder.Y, holder.Z); player.SendPacket(pk); }
public void SendContainerOpen(Container container, byte containerId) { NetworkMessage message = new NetworkMessage(); ContainerOpenPacket.Add( message, containerId, container.Info.SpriteId, "Container", container.Volume, container.Parent != null, container.Items ); Send(message); }
public override void OnOpen(Player player) { base.OnOpen(player); ContainerOpenPacket pk = new ContainerOpenPacket { WindowId = player.Inventory.OpendWindowId, Type = this.Type }; InventoryHolder holder = this.Holder; pk.Position = new BlockCoordinate3D((int)holder.X, (int)holder.Y, (int)holder.Z); player.SendPacket(pk); this.SendContents(player); }