// Token: 0x060004A5 RID: 1189 RVA: 0x00019E98 File Offset: 0x00018098 public void Update(UpdatePacket update) { if (this._lootQuest != -1 && update.Drops.Contains(this._lootQuest)) { this._lootQuest = -1; if (this._lastQuest != -1) { QuestObjIdPacket questObjIdPacket = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID); questObjIdPacket.ObjectId = this._lastQuest; this._lastQuest = -1; this.client.SendToClient(questObjIdPacket); } } if (Settings.Default.AutoLootBigBags) { foreach (Entity entity in update.NewObjs) { if (Enum.IsDefined(typeof(Bags), entity.ObjectType)) { foreach (StatData stat in entity.Status.Data) { if (StatsType.Id(stat.Id, StatsType.Size)) { stat.IntValue = 175; } } } } } }
// Token: 0x060004A8 RID: 1192 RVA: 0x0001A180 File Offset: 0x00018380 public void Move(MovePacket move) { if (Settings.Default.EnableAutoLoot && !this._inVault) { foreach (GameObject gameObject in this.client.Objects.Values.ToList <GameObject>()) { if (Enum.IsDefined(typeof(Bags), gameObject.ObjectType)) { byte b = 0; while ((int)b < gameObject.Inventory.Length) { int num = gameObject.Inventory[(int)b]; if (num != -1) { if (this.CheckLootTier((ushort)num)) { if (Settings.Default.AutoLootQuests) { QuestObjIdPacket questObjIdPacket = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID); questObjIdPacket.ObjectId = gameObject.ObjectId; questObjIdPacket._4jOLjW4f3NFdoiR8aTchgxYgk8f = new int[0]; this._lootQuest = gameObject.ObjectId; this.client.SendToClient(questObjIdPacket); } if (gameObject.ServerPosition.DistanceSquaredTo(move.NewPosition) <= 1.0) { if (move._Nx46RcGIU0H1BCGWaJXjN1ieopt - this.Time > 600) { this.PickupItem(move.NewPosition, move._Nx46RcGIU0H1BCGWaJXjN1ieopt, gameObject.ObjectId, num, b); } return; } } } b += 1; } } } return; } }
private void OnUpdate(Client client, Packet packet) { LootState state = _states[client]; UpdatePacket update = (UpdatePacket)packet; // New Objects foreach (Entity entity in update.NewObjs) { ushort type = entity.ObjectType; if (_desiredBags.Contains(type)) { if (LootHelperConfig.Default.LootQuests) { state.CustomQuest = entity.Status.ObjectId; QuestObjIdPacket questObjId = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID); questObjId.ObjectId = entity.Status.ObjectId; client.SendToClient(questObjId); } int bagId = entity.Status.ObjectId; if (!state.LootBagItems.ContainsKey(bagId)) { state.LootBagItems.Add(bagId, new int[] { -1, -1, -1, -1, -1, -1, -1, -1 }); } else { state.LootBagItems[bagId] = new int[] { -1, -1, -1, -1, -1, -1, -1, -1 } }; if (!state.LootBagLocations.ContainsKey(bagId)) { state.LootBagLocations.Add(bagId, entity.Status.Position); } else { state.LootBagLocations[bagId] = entity.Status.Position; } foreach (StatData statData in entity.Status.Data) { if (statData.Id >= 8 && statData.Id <= 15) { state.LootBagItems[bagId][statData.Id - 8] = statData.IntValue; } } } } // Removed Objects foreach (int drop in update.Drops) { if (drop == state.CustomQuest && state.OriginalQuest != -1) { QuestObjIdPacket questObjId = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID); questObjId.ObjectId = state.OriginalQuest; client.SendToClient(questObjId); state.OriginalQuest = -1; state.CustomQuest = -1; } if (state.LootBagItems.ContainsKey(drop)) { state.LootBagItems.Remove(drop); state.LootBagLocations.Remove(drop); } } }
// Token: 0x060004A4 RID: 1188 RVA: 0x00019E7C File Offset: 0x0001807C public void QuestObjId(QuestObjIdPacket questObjId) { this._lastQuest = questObjId.ObjectId; }
private void OnUpdate(Client client, Packet packet) { LootState state = _states[client]; UpdatePacket update = (UpdatePacket)packet; // New Objects foreach (Entity entity in update.NewObjs) { string type = BagTypeToString(entity.ObjectType); if (type == null) { continue; } if (LootHelperConfig.Default.LootBags.Contains(type, StringComparison.OrdinalIgnoreCase) || LootHelperConfig.Default.NotifBags.Contains(type, StringComparison.OrdinalIgnoreCase)) { if (LootHelperConfig.Default.QuestBags.Contains(type, StringComparison.OrdinalIgnoreCase)) { if (LootHelperConfig.Default.LootQuests) { state.CustomQuest = entity.Status.ObjectId; QuestObjIdPacket questObjId = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID); questObjId.ObjectId = entity.Status.ObjectId; client.SendToClient(questObjId); } } int bagId = entity.Status.ObjectId; // Set the bag type if (!state.LootBagTypes.ContainsKey(bagId)) { state.LootBagTypes.Add(bagId, type); } else { state.LootBagTypes[bagId] = type; } // Set the bag contents to empty if (!state.LootBagItems.ContainsKey(bagId)) { state.LootBagItems.Add(bagId, new int[] { -1, -1, -1, -1, -1, -1, -1, -1 }); } else { state.LootBagItems[bagId] = new int[] { -1, -1, -1, -1, -1, -1, -1, -1 } }; // Set the bag location if (!state.LootBagLocations.ContainsKey(bagId)) { state.LootBagLocations.Add(bagId, entity.Status.Position); } else { state.LootBagLocations[bagId] = entity.Status.Position; } // Fill in the bag contents foreach (StatData statData in entity.Status.Data) { if (statData.Id >= 8 && statData.Id <= 15) { state.LootBagItems[bagId][statData.Id - 8] = statData.IntValue; } } } } // Removed Objects foreach (int drop in update.Drops) { if (drop == state.CustomQuest && state.OriginalQuest != -1) { QuestObjIdPacket questObjId = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID); questObjId.ObjectId = state.OriginalQuest; client.SendToClient(questObjId); state.OriginalQuest = -1; state.CustomQuest = -1; } if (state.LootBagItems.ContainsKey(drop)) { state.LootBagItems.Remove(drop); state.LootBagLocations.Remove(drop); } } }
private void OnQuestObjId(Client client, QuestObjIdPacket p) => map?.ProcessPacket(p);