public void NotifyQuestItemRemoved(byte questIndex) { // when a free for all questitem is looted // all players will get notified of it being removed // (other questitems can be looted by each group member) // bit inefficient but isn't called often for (var i = 0; i < PlayersLooting.Count; ++i) { Player player = Global.ObjAccessor.FindPlayer(PlayersLooting[i]); if (player) { var pql = PlayerQuestItems.LookupByKey(player.GetGUID()); if (!pql.Empty()) { byte j; for (j = 0; j < pql.Count; ++j) { if (pql[j].index == questIndex) { break; } } if (j < pql.Count) { player.SendNotifyLootItemRemoved(GetGUID(), (byte)(items.Count + j)); } } } else { PlayersLooting.RemoveAt(i); } } }
public void NotifyMoneyRemoved() { // notify all players that are looting this that the money was removed for (var i = 0; i < PlayersLooting.Count; ++i) { Player player = Global.ObjAccessor.FindPlayer(PlayersLooting[i]); if (player != null) { player.SendNotifyLootMoneyRemoved(GetGUID()); } else { PlayersLooting.RemoveAt(i); } } }
public void NotifyItemRemoved(byte lootIndex) { // notify all players that are looting this that the item was removed // convert the index to the slot the player sees for (int i = 0; i < PlayersLooting.Count; ++i) { Player player = Global.ObjAccessor.FindPlayer(PlayersLooting[i]); if (player != null) { player.SendNotifyLootItemRemoved(GetGUID(), lootIndex); } else { PlayersLooting.RemoveAt(i); } } }