public void Swap(Client client, SlotObject sobj1, SlotObject sobj2, bool all = false) { //Console.WriteLine("Swap called with {0} and {1}", sobj1.SlotId, sobj2.SlotId); InvSwapPacket invSwapPacket = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwapPacket.Time = client.Time; invSwapPacket.Position = client.PlayerData.Pos; invSwapPacket.SlotObject1 = sobj1; invSwapPacket.SlotObject2 = sobj2; client.SendToServer(invSwapPacket); if (all) { if (sobj1.SlotId < 11) { PluginUtils.Delay(600, () => { Swap(client, new SlotObject { ObjectId = client.ObjectId, SlotId = (byte)(sobj1.SlotId + 1), ObjectType = client.PlayerData.Slot[sobj1.SlotId + 1] }, new SlotObject { ObjectId = client.ObjectId, SlotId = (byte)(sobj1.SlotId + 9), ObjectType = client.PlayerData.BackPack[(sobj1.SlotId + 1) - 4] }, true); }); } } }
// Token: 0x060004A6 RID: 1190 RVA: 0x00019FB0 File Offset: 0x000181B0 public void InvSwap(InvSwapPacket invSwap) { if (!Settings.Default.EnableAutoLoot) { return; } if (invSwap.Time - this.Time >= 500) { if (invSwap.SlotObject1.objectId == this.client.ObjectId && invSwap.SlotObject1.SlotId < this.client.Player.Inventory.Length) { this._lastSlot = invSwap.SlotObject1.SlotId; this._lastItem = this.client.Player.Inventory[invSwap.SlotObject1.SlotId]; this.client.Player.Inventory[invSwap.SlotObject1.SlotId] = invSwap.SlotObject1.ObjectType; } else if (invSwap.SlotObject2.objectId == this.client.ObjectId) { if (invSwap.SlotObject2.SlotId < this.client.Player.Inventory.Length) { this._lastSlot = invSwap.SlotObject2.SlotId; this._lastItem = this.client.Player.Inventory[invSwap.SlotObject2.SlotId]; this.client.Player.Inventory[invSwap.SlotObject2.SlotId] = invSwap.SlotObject2.ObjectType; } } } else { invSwap.Send = false; Console.WriteLine("Canceled invswap!"); } this.Time = invSwap.Time; }
public void InventorySwap(RealmTime time, InvSwapPacket pkt) { // verify packet details if (!VerifyInvSwap(pkt)) { this.Client.SendPacket(new InvResultPacket { Result = 1 }); return; } // get target objects Entity en1 = Owner.GetEntity(pkt.Obj1.ObjectId); Entity en2 = Owner.GetEntity(pkt.Obj2.ObjectId); var con1 = en1 as IContainer; var con2 = en2 as IContainer; // get items Item item1 = con1.Inventory[pkt.Obj1.SlotId]; //TODO: locker Item item2 = con2.Inventory[pkt.Obj2.SlotId]; // swap items con1.Inventory[pkt.Obj1.SlotId] = item2; con2.Inventory[pkt.Obj2.SlotId] = item1; // check soulbound drop if (Publicbags.Contains(en1.ObjectType) && (item2 != null) && (item2.Soulbound || item2.Undead || item2.SUndead)) { DropBag(item2); con1.Inventory[pkt.Obj1.SlotId] = null; } if (Publicbags.Contains(en2.ObjectType) && (item1 != null) && (item1.Soulbound || item1.Undead || item1.SUndead)) { DropBag(item1); con2.Inventory[pkt.Obj2.SlotId] = null; } // update en1.UpdateCount++; en2.UpdateCount++; // update player if (en1 is Player || en2 is Player) { this.CalcBoost(); this.Client.Save(); this.Client.SendPacket(new InvResultPacket { Result = 0 }); } // log event (needs improvement) //Console.WriteLine("[InvSwap:" + nName + "] [" + en1.nName + "," + pkt.Obj1.SlotId + "," + ((item1 == null) ? "" : item1.ObjectId) + "] <-> " + // "[" + en2.nName + "," + pkt.Obj2.SlotId + "," + ((item2 == null) ? "" : item2.ObjectId) + "]"); }
/* * returns true if packet input is valid */ private bool VerifyInvSwap(InvSwapPacket pkt) { try { // get target objects Entity en1 = Owner.GetEntity(pkt.Obj1.ObjectId); Entity en2 = Owner.GetEntity(pkt.Obj2.ObjectId); // check to see if targets are valid if ((!(en1 is Player) && !(en1 is Container)) || (!(en2 is Player) && !(en2 is Container)) || // must be a player or container entity (en1 is Player && en1 != this) || (en2 is Player && en2 != this)) // if player, must be this player { Console.WriteLine("[invSwap:" + nName + "] Targets not valid (" + en1.nName + ", " + en2.nName + ")."); return(false); } if (en1 is Container && en2 is Container && en1 != en2) { Console.WriteLine("[invSwap:" + nName + "] Trade between two different containers detected."); return(false); } // check target distance (must be within 1 tile range) if (MathsUtils.DistSqr(this.X, this.Y, en1.X, en1.Y) > 1 || MathsUtils.DistSqr(this.X, this.Y, en2.X, en2.Y) > 1) { Console.WriteLine("[invSwap:" + nName + "] Target distance to far from player."); return(false); } // check trade items var con1 = en1 as IContainer; var con2 = en2 as IContainer; Item item1 = con1.Inventory[pkt.Obj1.SlotId]; //TODO: locker Item item2 = con2.Inventory[pkt.Obj2.SlotId]; if (!AuditItem(con2, item1, pkt.Obj2.SlotId) || !AuditItem(con1, item2, pkt.Obj1.SlotId)) { Console.WriteLine("[invSwap:" + nName + "] Invalid item swap."); return(false); } return(true); } catch (Exception e) { Console.WriteLine("[invSwap:" + nName + "] Invalid input."); return(false); } }
// Token: 0x060004B7 RID: 1207 RVA: 0x0001AEB0 File Offset: 0x000190B0 public void _ZHfjECn2B9JJHnVF67eBaO57JUp(InvSwapPacket invSwap) { if (invSwap.SlotObject1.objectId == this._W6Ov6AArxzTTDnCyBtZPqkqNaKf._7w6u8taiwfZruB2OdFEa2AmzJaA) { if (invSwap.SlotObject1.SlotId == 1) { this._T1pUOttbRRz7ku5YCPysaK7ODuE(invSwap.SlotObject2.ObjectType); } } if (invSwap.SlotObject2.objectId == this._W6Ov6AArxzTTDnCyBtZPqkqNaKf._7w6u8taiwfZruB2OdFEa2AmzJaA) { if (invSwap.SlotObject2.SlotId == 1) { this._T1pUOttbRRz7ku5YCPysaK7ODuE(invSwap.SlotObject1.ObjectType); } } }
public void InventorySwap(RealmTime time, InvSwapPacket pkt) { Entity en1 = Owner.GetEntity(pkt.Obj1.ObjectId); Entity en2 = Owner.GetEntity(pkt.Obj2.ObjectId); IContainer con1 = en1 as IContainer; IContainer con2 = en2 as IContainer; //TODO: locker Item item1 = con1.Inventory[pkt.Obj1.SlotId]; Item item2 = con2.Inventory[pkt.Obj2.SlotId]; if (!AuditItem(con2, item1, pkt.Obj2.SlotId) || !AuditItem(con1, item2, pkt.Obj1.SlotId)) { (en1 as Player).Client.SendPacket(new InvResultPacket() { Result = 1 }); } else { con1.Inventory[pkt.Obj1.SlotId] = item2; con2.Inventory[pkt.Obj2.SlotId] = item1; en1.UpdateCount++; en2.UpdateCount++; if (en1 is Player) { (en1 as Player).CalcBoost(); (en1 as Player).Client.SendPacket(new InvResultPacket() { Result = 0 }); } if (en2 is Player) { (en2 as Player).CalcBoost(); (en2 as Player).Client.SendPacket(new InvResultPacket() { Result = 0 }); } } }
// Token: 0x060004AA RID: 1194 RVA: 0x0001A418 File Offset: 0x00018618 private void InvSwap(int time, Location position, int objectId1, int itemType1, byte slotId1, int objectId2, int itemType2, byte slotId2, string itemName) { InvSwapPacket invSwapPacket = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwapPacket.Time = time; invSwapPacket.Position = position; invSwapPacket.SlotObject1 = new SlotObject { objectId = objectId1, ObjectType = itemType1, SlotId = (int)slotId1 }; invSwapPacket.SlotObject2 = new SlotObject { objectId = objectId2, ObjectType = itemType2, SlotId = (int)slotId2 }; this.Time = time; this.client.SendToServer(invSwapPacket); this.client.SendToClient("AutoLoot", "Looting " + itemName); }
public void MoveTo(int slot, Client client, bool ground = false, bool bag = false) { SlotObject slot1 = new SlotObject(); SlotObject slot2 = new SlotObject(); slot1.ObjectId = client.ObjectId; slot1.ObjectType = ObjectType; slot1.SlotId = (byte)Slot; if (!ground && !bag) { slot2.ObjectId = client.ObjectId; slot2.ObjectType = slot < 12 ? client.PlayerData.Slot[slot] : client.PlayerData.BackPack[slot - 11]; slot2.SlotId = (byte)slot; } else if (!ground && bag) { slot2.ObjectId = client.ObjectId; slot2.ObjectType = -1; slot2.SlotId = 1; } else { InvDropPacket dropPacket = (InvDropPacket)Packet.Create(PacketType.INVDROP); dropPacket.Slot = slot1; client.SendToServer(dropPacket); return; } InvSwapPacket swapPacket = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); swapPacket.Position = client.PlayerData.Pos; swapPacket.SlotObject1 = slot1; swapPacket.SlotObject2 = slot2; swapPacket.Time = client.Time; client.SendToServer(swapPacket); }
public void InventorySwap(RealmTime time, InvSwapPacket pkt) { var en1 = Owner.GetEntity(pkt.Obj1.ObjectId); var en2 = Owner.GetEntity(pkt.Obj2.ObjectId); var con1 = en1 as IContainer; var con2 = en2 as IContainer; //TODO: locker var item1 = con1.Inventory[pkt.Obj1.SlotId]; var item2 = con2.Inventory[pkt.Obj2.SlotId]; if (!AuditItem(con2, item1, pkt.Obj2.SlotId) || !AuditItem(con1, item2, pkt.Obj1.SlotId)) { (en1 as Player).Client.SendPacket(new InvResultPacket { Result = 1 }); } else { var publicbags = new List <short> { 0x0500, 0xffd, 0x0501 }; con1.Inventory[pkt.Obj1.SlotId] = item2; con2.Inventory[pkt.Obj2.SlotId] = item1; if (publicbags.Contains(en1.ObjectType) && (item2.Soulbound || item2.Undead || item2.SUndead)) { DropBag(item2); con1.Inventory[pkt.Obj1.SlotId] = null; } if (publicbags.Contains(en2.ObjectType) && (item1.Soulbound || item1.Undead || item1.SUndead)) { DropBag(item1); con2.Inventory[pkt.Obj2.SlotId] = null; } en1.UpdateCount++; en2.UpdateCount++; if (en1 is Player) { if (en1.Owner.Name == "Vault") { (en1 as Player).Client.Save(); } (en1 as Player).CalcBoost(); (en1 as Player).Client.SendPacket(new InvResultPacket { Result = 0 }); } if (en2 is Player) { if (en2.Owner.Name == "Vault") { (en2 as Player).Client.Save(); } (en2 as Player).CalcBoost(); (en2 as Player).Client.SendPacket(new InvResultPacket { Result = 0 }); } if (Owner is Vault) { if ((Owner as Vault).psr.Account.Name == psr.Account.Name) { return; } } if (!(en2 is Player)) { var con = en2 as Container; const string dir = @"logs"; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } using (var writer = new StreamWriter(@"logs\DropLog.log", true)) { writer.WriteLine(Name + " placed a " + item1.ObjectId + " in " + (Owner as Vault).psr.Account.Name + "'s vault" + (con.BagOwner != null ? " (Soulbound)" : "")); } } } }
private void OnMove(Client client, Packet packet) { if (!_states.ContainsKey(client)) { return; } LootState state = _states[client]; foreach (int bagId in state.LootBagItems.Keys) { float distance = state.LootBagLocations[bagId].DistanceTo(client.PlayerData.Pos); if (LootHelperConfig.Default.AutoLoot && Environment.TickCount - state.LastLoot > 900 && distance <= 1) { for (int bi = 0; bi < state.LootBagItems[bagId].Length; bi++) { if (state.LootBagItems[bagId][bi] == -1) { continue; } if (!LootHelperConfig.Default.AutoLootList.Contains(ReverseLookup(state.LootBagItems[bagId][bi]))) { continue; } state.LastLoot = Environment.TickCount; for (int i = 4; i < client.PlayerData.Slot.Length; i++) { if (client.PlayerData.Slot[i] == -1) { InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwap.Time = client.Time + 10; invSwap.Position = client.PlayerData.Pos; invSwap.SlotObject1 = new SlotObject(); invSwap.SlotObject1.ObjectId = bagId; invSwap.SlotObject1.SlotId = (byte)bi; invSwap.SlotObject1.ObjectType = state.LootBagItems[bagId][bi]; invSwap.SlotObject2 = new SlotObject(); invSwap.SlotObject2.ObjectId = client.ObjectId; invSwap.SlotObject2.SlotId = (byte)(i); invSwap.SlotObject2.ObjectType = -1; client.SendToServer(invSwap); break; } } } } if (LootHelperConfig.Default.LootNotifications && Environment.TickCount - state.LastNotif > 2000 && distance < 15) { state.LastNotif = Environment.TickCount; string message = ""; foreach (int item in state.LootBagItems[bagId]) { if (item != -1) { message += ReverseLookup(item) + "\\n"; } } if (message.Length > 3) { client.SendToClient(PluginUtils.CreateNotification( bagId, LootHelperConfig.Default.NotificationColor.ToArgb(), message)); } } } }
private static void OnInvSwap(Client client, InvSwapPacket packet) { //client.Self() }
public void InventorySwap(RealmTime time, InvSwapPacket pkt) { Entity en1 = Owner.GetEntity(pkt.Obj1.ObjectId); Entity en2 = Owner.GetEntity(pkt.Obj2.ObjectId); IContainer con1 = en1 as IContainer; IContainer con2 = en2 as IContainer; //TODO: locker Item item1 = con1.Inventory[pkt.Obj1.SlotId]; Item item2 = con2.Inventory[pkt.Obj2.SlotId]; if (!AuditItem(con2, item1, pkt.Obj2.SlotId) || !AuditItem(con1, item2, pkt.Obj1.SlotId)) { (en1 as Player).Client.SendPacket(new InvResultPacket() { Result = 1 }); } else { List <short> publicbags = new List <short>() { 0x0500, 0xffd }; con1.Inventory[pkt.Obj1.SlotId] = item2; con2.Inventory[pkt.Obj2.SlotId] = item1; if (publicbags.Contains(en1.ObjectType) && (item2.Soulbound || item2.Undead || item2.SUndead)) //debugger error here { DropBag(item2); con1.Inventory[pkt.Obj1.SlotId] = null; } if (publicbags.Contains(en2.ObjectType) && (item1.Soulbound || item1.Undead || item1.SUndead)) { DropBag(item1); con2.Inventory[pkt.Obj2.SlotId] = null; } en1.UpdateCount++; en2.UpdateCount++; if (en1 is Player) { if (en1.Owner.Name == "Vault") { (en1 as Player).Client.Save(); } (en1 as Player).CalcBoost(); (en1 as Player).Client.SendPacket(new InvResultPacket() { Result = 0 }); } if (en2 is Player) { if (en2.Owner.Name == "Vault") { (en2 as Player).Client.Save(); } (en2 as Player).CalcBoost(); (en2 as Player).Client.SendPacket(new InvResultPacket() { Result = 0 }); } } }
// Token: 0x06000232 RID: 562 RVA: 0x0000FDC0 File Offset: 0x0000DFC0 private void HandlePacket(Packet packet) { UpdatePacket updatePacket = packet as UpdatePacket; if (updatePacket != null) { this._objectTracker.Update(updatePacket); this.SafeWalk.Update(updatePacket); this._autoNexus.Update(updatePacket); this._fameHelper.Update(updatePacket); this._accuracyFarm.Update(updatePacket); this._antiLag.Update(updatePacket); this._autoLoot.Update(updatePacket); this._mapHack.Update(updatePacket); this._o3Helper.Update(updatePacket); this._showLHPot.Update(updatePacket); return; } NewTickPacket newTickPacket = packet as NewTickPacket; if (newTickPacket != null) { this._objectTracker.NewTick(newTickPacket); this._antiDebuffs.NewTick(newTickPacket); this._autoNexus.NewTick(newTickPacket); this._antiDdos.NewTick(); this._fameHelper.NewTick(newTickPacket); this._accuracyFarm.NewTick(newTickPacket); this._antiLag.NewTick(newTickPacket); this._o3Helper.NewTick(newTickPacket); this._autoNexus2.NewTick(newTickPacket); return; } MovePacket movePacket = packet as MovePacket; if (movePacket != null) { this.PreviousTime = movePacket._Nx46RcGIU0H1BCGWaJXjN1ieopt; this._objectTracker.move(movePacket); this._antiDebuffs.Move(movePacket); this._autoLoot.Move(movePacket); this.AntiAfk.move(movePacket); this._autoNexus.move(movePacket); this._autoNexus2.move(movePacket); return; } MapInfoPacket mapInfoPacket = packet as MapInfoPacket; if (mapInfoPacket != null) { Console.WriteLine("Client: Map is " + mapInfoPacket.Name); this._objectTracker.MapInfo(mapInfoPacket); this._autoNexus2.MapInfo(mapInfoPacket); this.SafeWalk.MapInfo(mapInfoPacket); this._autoNexus.MapInfo(mapInfoPacket); this._autoLoot.MapInfo(mapInfoPacket); this._fameHelper.MapInfo(); _accuracyFarm.MapInfo(); this._antiLag.MapInfo(mapInfoPacket); this._mapHack.MapInfo(mapInfoPacket); this._o3Helper.MapInfo(mapInfoPacket); this._showLHPot.MapInfo(mapInfoPacket); return; } PlayerTextPacket playerTextPacket = packet as PlayerTextPacket; if (playerTextPacket != null) { this._teleportTools.text(playerTextPacket); this._ipJoin.text(playerTextPacket); this._fameHelper._QrK9KtR4xguWgEYrBE9xnEwwcqd(playerTextPacket); this._antiLag.PlayerText(playerTextPacket); this._mapHack.text(playerTextPacket); this._autoNexus._QrK9KtR4xguWgEYrBE9xnEwwcqd(playerTextPacket); return; } _5Qyhf9ImNgkDzh4BmaDRKP646iH createSuccessPacket = packet as _5Qyhf9ImNgkDzh4BmaDRKP646iH; if (createSuccessPacket != null) { this.PlayerId = createSuccessPacket.ObjectId; this._objectTracker._1lYB9SyYVs1zUAIHgLGbUs7pmeb(); this._bazaarTimer.CreateSuccess(); this._autoNexus2._1lYB9SyYVs1zUAIHgLGbUs7pmeb(); return; } FailurePacket failurePacket = packet as FailurePacket; if (failurePacket != null) { Console.WriteLine(string.Format("Client: Got failure {0}, {1} ({2})", failurePacket.ErrorId, failurePacket.ErrorMessage, failurePacket.ErrorPlace)); return; } ReconnectPacket reconnectPacket = packet as ReconnectPacket; if (reconnectPacket != null) { this.Reconnect(reconnectPacket); return; } HelloPacket helloPacket = packet as HelloPacket; if (helloPacket != null) { this.Hello(helloPacket); return; } PlayerHitPacket playerHitPacket = packet as PlayerHitPacket; if (playerHitPacket != null) { this._autoNexus.PlayerHit(playerHitPacket); this._antiDebuffs.PlayerHit(playerHitPacket); return; } AoEPacket pqhqze9k9pObME2LmlIcbfEeSYS = packet as AoEPacket; if (pqhqze9k9pObME2LmlIcbfEeSYS != null) { this._autoNexus._M1PxW31jx87SGG4gvOYAwe86vjg(pqhqze9k9pObME2LmlIcbfEeSYS); this._antiDebuffs.AoE(pqhqze9k9pObME2LmlIcbfEeSYS); return; } AoEAckPacket x7UwVkbcYG7VnZWu4HCA8hCeQtS = packet as AoEAckPacket; if (x7UwVkbcYG7VnZWu4HCA8hCeQtS != null) { this._autoNexus._iKqf12lpU2ifSlxUxUegqEC5CVe(x7UwVkbcYG7VnZWu4HCA8hCeQtS); return; } GroundDamagePacket hllcDvAIxPBOvJZP4BFTFQUoryN = packet as GroundDamagePacket; if (hllcDvAIxPBOvJZP4BFTFQUoryN != null) { this._autoNexus._524YRDmz9HCOj575eu5oeD5ruJb(hllcDvAIxPBOvJZP4BFTFQUoryN); return; } _6lHFncsY9352Wg3pNnnFZ49g5xA 6lHFncsY9352Wg3pNnnFZ49g5xA = packet as QuestObjIdPacket; if (6lHFncsY9352Wg3pNnnFZ49g5xA != null) { this._teleportTools._FMTVFcTfzNRteqoB3XiUkaNps7l(6lHFncsY9352Wg3pNnnFZ49g5xA); return; } ShowEffectPacket showEffectPacket = packet as ShowEffectPacket; if (showEffectPacket != null) { this._antiLag.ShowEffect(showEffectPacket); this._autoNexus._1nwhQXngJ6rNjd7Ufx1bWeF0vhM(showEffectPacket); this._o3Helper._1nwhQXngJ6rNjd7Ufx1bWeF0vhM(showEffectPacket); return; } _4wU9AwmH67XtmNygsXuDz9DUXYm 4wU9AwmH67XtmNygsXuDz9DUXYm = packet as _4wU9AwmH67XtmNygsXuDz9DUXYm; if (4wU9AwmH67XtmNygsXuDz9DUXYm != null) { this._antiLag._Q1PiJQ99KBCJeLcZ0HOk3AUAjIP(4wU9AwmH67XtmNygsXuDz9DUXYm); return; } PlayerShootPacket fbqBESNaaIBpK5dNK9X5lWOOll = packet as PlayerShootPacket; if (fbqBESNaaIBpK5dNK9X5lWOOll != null) { this._autoNexus2.PlayerShoot(fbqBESNaaIBpK5dNK9X5lWOOll); return; } TextPacket cbwOjnzusZzuPkHfx7wuwePHqrf = packet as TextPacket; if (cbwOjnzusZzuPkHfx7wuwePHqrf != null) { this._antiSpam._IDtpCgDjmC1AQOcZCJSFNAYjlbH(cbwOjnzusZzuPkHfx7wuwePHqrf); this._antiLag.Text(cbwOjnzusZzuPkHfx7wuwePHqrf); this._o3Helper._IDtpCgDjmC1AQOcZCJSFNAYjlbH(cbwOjnzusZzuPkHfx7wuwePHqrf); return; } UseItemPacket lylWoxWrca2h31SiYiDb8gyQP0o = packet as UseItemPacket; if (lylWoxWrca2h31SiYiDb8gyQP0o != null) { this._autoNexus2.UseItem(lylWoxWrca2h31SiYiDb8gyQP0o); this._fameHelper.UseItem(lylWoxWrca2h31SiYiDb8gyQP0o); return; } EnemyShootPacket cbwrHXLbrCktla3qkqXNmNymbvH = packet as EnemyShootPacket; if (cbwrHXLbrCktla3qkqXNmNymbvH != null) { this._objectTracker._Qz49aY7UXgmnBNNMA6Q6IEQtadk(cbwrHXLbrCktla3qkqXNmNymbvH); return; } InvSwapPacket maJp2qic3r54gk5Eg1eeMowxvXh = packet as InvSwapPacket; if (maJp2qic3r54gk5Eg1eeMowxvXh != null) { this._autoLoot.InvSwap(maJp2qic3r54gk5Eg1eeMowxvXh); this._autoNexus._ZHfjECn2B9JJHnVF67eBaO57JUp(maJp2qic3r54gk5Eg1eeMowxvXh); return; } EscapePacket m74ADSrj0VfuNwRBO916gAw0Nu = packet as EscapePacket; if (m74ADSrj0VfuNwRBO916gAw0Nu != null) { this.Escape(m74ADSrj0VfuNwRBO916gAw0Nu); return; } InvitedToGuildPacket tJHGMoVf7DhHyQm8a6SCuL1cSWl = packet as InvitedToGuildPacket; if (tJHGMoVf7DhHyQm8a6SCuL1cSWl != null) { this._antiDdos.Invite(tJHGMoVf7DhHyQm8a6SCuL1cSWl); return; } TeleportPacket rvckmor8bw91EVaRfdwc25aHYbc = packet as TeleportPacket; if (rvckmor8bw91EVaRfdwc25aHYbc != null) { this._fameHelper.Teleport(rvckmor8bw91EVaRfdwc25aHYbc); this._accuracyFarm.Teleport(rvckmor8bw91EVaRfdwc25aHYbc); return; } _6UIiGxMChbVinHsvx5uqg8WrMRc 6UIiGxMChbVinHsvx5uqg8WrMRc = packet as InvResultPacket; if (6UIiGxMChbVinHsvx5uqg8WrMRc != null) { this._autoLoot._yOjSn1WKSXsXVziJpL1eH5gSoWg(6UIiGxMChbVinHsvx5uqg8WrMRc); return; } NotificationPacket zIBPB6zZVww7yGWtjJqRMmACh1q = packet as NotificationPacket; if (zIBPB6zZVww7yGWtjJqRMmACh1q != null) { this._autoNexus._4GSfC8bADOwIwOXLYze8EOUBQxJ(zIBPB6zZVww7yGWtjJqRMmACh1q); return; } AccountListPacket k4pBHmoGRyaE6dWf1FIvL0dcuzKA = packet as AccountListPacket; if (k4pBHmoGRyaE6dWf1FIvL0dcuzKA != null) { this._antiLag.AccountList(k4pBHmoGRyaE6dWf1FIvL0dcuzKA); return; } EditAccountListPacket co7ACSeK1WWaCGAPAqLaov37Wqdb = packet as EditAccountListPacket; if (co7ACSeK1WWaCGAPAqLaov37Wqdb != null) { this._antiLag.EditAccountList(co7ACSeK1WWaCGAPAqLaov37Wqdb); return; } _7k8aOfI7MhNrVnHioUXbsPAxkbm 7k8aOfI7MhNrVnHioUXbsPAxkbm = packet as EnemyHitPacket; if (7k8aOfI7MhNrVnHioUXbsPAxkbm != null) { this._o3Helper._9BgsXisaUbFFlj5HLRd76sERUUX(7k8aOfI7MhNrVnHioUXbsPAxkbm); return; } DeathPacket wOmvsGmaE1PheZ2fPjD9V16UEseb = packet as DeathPacket; if (wOmvsGmaE1PheZ2fPjD9V16UEseb != null) { this._autoNexus._qQsqaOxgCR9yg9ky7erATaKrgCC(wOmvsGmaE1PheZ2fPjD9V16UEseb); return; } }
private void inventorySwap(byte itemSlot) { if (DateTime.Now < lastSwapTime.AddSeconds(2)) { return; } lastSwapTime = DateTime.Now; hotswapping = true; byte equipSlotId = 0; if (_client.PlayerData.Slot[(int)itemSlot] == -1) { return; } switch (GameData.Items.ByID((ushort)_client.PlayerData.Slot[(int)itemSlot]).SlotType) { case 1: case 2: case 3: case 8: case 17: case 24: equipSlotId = 0; break; case 6: case 7: case 14: equipSlotId = 2; break; case 4: case 5: case 11: case 12: case 13: case 15: case 16: case 18: case 19: case 20: case 21: case 22: case 23: case 25: case 27: equipSlotId = 1; break; case 9: equipSlotId = 3; break; } InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwap.Time = _client.Time + 10; invSwap.Position = _client.PlayerData.Pos; invSwap.SlotObject1 = new SlotObject(); invSwap.SlotObject1.ObjectId = _client.ObjectId; invSwap.SlotObject1.SlotId = equipSlotId; invSwap.SlotObject1.ObjectType = _client.PlayerData.Slot[(int)equipSlotId]; invSwap.SlotObject2 = new SlotObject(); invSwap.SlotObject2.ObjectId = _client.ObjectId; invSwap.SlotObject2.SlotId = itemSlot; invSwap.SlotObject2.ObjectType = _client.PlayerData.Slot[(int)itemSlot]; _client.SendToServer(invSwap); PluginUtils.Delay(1000, () => { hotswapping = false; }); }
private void OnMove(Client client, Packet packet) { if (!_states.ContainsKey(client)) { return; } LootState state = _states[client]; foreach (int bagId in state.LootBagItems.Keys) { if (state.LootBagTypes[bagId] == null) { continue; } float distance = state.LootBagLocations[bagId].DistanceTo(client.PlayerData.Pos); if (LootHelperConfig.Default.LootBags.Contains(state.LootBagTypes[bagId], StringComparison.OrdinalIgnoreCase)) { if (LootHelperConfig.Default.AutoLoot && Environment.TickCount - state.LastLoot > LootHelperConfig.Default.LootSpeed && distance <= 1) { for (int bi = 0; bi < state.LootBagItems[bagId].Length; bi++) { if (state.LootBagItems[bagId][bi] == -1) { continue; } bool next = true; if (LootHelperConfig.Default.AutoLootList.Contains(ReverseLookup(state.LootBagItems[bagId][bi]))) { next = false; } else if (CheckLootTier(state.LootBagItems[bagId][bi])) { next = false; } if (next) { continue; } state.LastLoot = Environment.TickCount; if (state.LootBagItems[bagId][bi] == 2594 && client.PlayerData.HealthPotionCount < 6) { InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwap.Time = client.Time + 10; invSwap.Position = client.PlayerData.Pos; invSwap.SlotObject1 = new SlotObject(); invSwap.SlotObject1.ObjectId = bagId; invSwap.SlotObject1.SlotId = (byte)bi; invSwap.SlotObject1.ObjectType = (short)state.LootBagItems[bagId][bi]; invSwap.SlotObject2 = new SlotObject(); invSwap.SlotObject2.ObjectId = client.ObjectId; invSwap.SlotObject2.SlotId = (byte)(state.LootBagItems[bagId][bi] - 2340); invSwap.SlotObject2.ObjectType = -1; //state.LastLoot = Environment.TickCount; client.SendToServer(invSwap); continue; } else if (state.LootBagItems[bagId][bi] == 2595 && client.PlayerData.MagicPotionCount < 6) { InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwap.Time = client.Time + 10; invSwap.Position = client.PlayerData.Pos; invSwap.SlotObject1 = new SlotObject(); invSwap.SlotObject1.ObjectId = bagId; invSwap.SlotObject1.SlotId = (byte)bi; invSwap.SlotObject1.ObjectType = (short)state.LootBagItems[bagId][bi]; invSwap.SlotObject2 = new SlotObject(); invSwap.SlotObject2.ObjectId = client.ObjectId; invSwap.SlotObject2.SlotId = (byte)(state.LootBagItems[bagId][bi] - 2340); invSwap.SlotObject2.ObjectType = -1; //state.LastLoot = Environment.TickCount; client.SendToServer(invSwap); continue; } else { for (int i = 4; i < 20; i++) { if (i < 12) { if (client.PlayerData.Slot[i] == -1) { InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwap.Time = client.Time + 10; invSwap.Position = client.PlayerData.Pos; invSwap.SlotObject1 = new SlotObject(); invSwap.SlotObject1.ObjectId = bagId; invSwap.SlotObject1.SlotId = (byte)bi; invSwap.SlotObject1.ObjectType = state.LootBagItems[bagId][bi]; invSwap.SlotObject2 = new SlotObject(); invSwap.SlotObject2.ObjectId = client.ObjectId; invSwap.SlotObject2.SlotId = (byte)(i); invSwap.SlotObject2.ObjectType = -1; //state.LastLoot = Environment.TickCount; client.SendToServer(invSwap); continue; } } else { if (client.PlayerData.HasBackpack) { if (client.PlayerData.BackPack[i - 12] == -1) { InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP); invSwap.Time = client.Time + 10; invSwap.Position = client.PlayerData.Pos; invSwap.SlotObject1 = new SlotObject(); invSwap.SlotObject1.ObjectId = bagId; invSwap.SlotObject1.SlotId = (byte)bi; invSwap.SlotObject1.ObjectType = state.LootBagItems[bagId][bi]; invSwap.SlotObject2 = new SlotObject(); invSwap.SlotObject2.ObjectId = client.ObjectId; invSwap.SlotObject2.SlotId = (byte)(i); invSwap.SlotObject2.ObjectType = -1; //state.LastLoot = Environment.TickCount; client.SendToServer(invSwap); continue; } } } } } } } } if (LootHelperConfig.Default.NotifBags.Contains(state.LootBagTypes[bagId], StringComparison.OrdinalIgnoreCase)) { if (!state.BagLastNotif.ContainsKey(bagId)) { state.BagLastNotif.Add(bagId, 0); } if (LootHelperConfig.Default.LootNotifications && Environment.TickCount - state.BagLastNotif[bagId] > 2000 && distance < 15) { state.BagLastNotif[bagId] = Environment.TickCount; string message = ""; foreach (int item in state.LootBagItems[bagId]) { if (item != -1) { message += ReverseLookup(item) + "\\n"; } } if (message.Length > 3) { client.SendToClient(PluginUtils.CreateNotification(bagId, LootHelperConfig.Default.NotificationColor.ToArgb(), message)); } } } } }