add utility functions

This commit is contained in:
2026-01-05 21:22:19 -05:00
parent 3b3ebf8e31
commit 48ba912d52
6 changed files with 57 additions and 19 deletions

View File

@@ -31,7 +31,22 @@
:if-exists :overwrite
:if-does-not-exist :create)))
(defun get-mobs-that-drop-item (item-id &optional (drop-ds (make-drop-data-source)) (mob-ds (make-mob-data-source)))
(loop for drop across (data drop-ds)
when (equal (href drop "ItemID") item-id)
append (loop for mob across (data mob-ds)
when (equal (parse-integer (href mob "mob" "mob_id"))
(href drop "DropperID"))
collect mob)))
(defun get-drops-by-item-name (item-name &optional (ds (make-drop-data-source)))
(loop for drop across (data ds)
when (string-equal (href drop "ItemName") item-name)
collect drop))
(comment
(defvar drops (make-drop-data-source "foo"))
(defvar drops (make-drop-data-source))
(get-drops-by-item-name "Blue Goldrunners")
(data (make-drop-data-source))
(refresh drops)
(reload drops))