summaryrefslogtreecommitdiff
path: root/npc/items/shovel.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/items/shovel.txt')
-rw-r--r--npc/items/shovel.txt28
1 files changed, 20 insertions, 8 deletions
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt
index f01a0fcb..c6bc8224 100644
--- a/npc/items/shovel.txt
+++ b/npc/items/shovel.txt
@@ -1,5 +1,6 @@
// Evol scripts.
// Author:
+// Jesusalva
// Travolta
// Description:
// NPC to use shovel (dig, bury etc)
@@ -84,19 +85,30 @@
function Bury {
narrator S_FIRST_BLANK_LINE | S_LAST_BLANK_LINE, l("What would you like to bury?");
.@items$ = "";
- getinventorylist;
- for (.@i = 0; .@i < @inventorylist_count; .@i++)
+
+ mes("##B" + l("Drag and drop an item from your inventory.") + "##b");
+
+ .@id = requestitem();
+
+ // You cannot bury: Items you don't have, your shovel, Bound Items, and items which are not dropped by any mobs.
+ // The "item not dropped by any mob" is temporary, and should be replaced by "items with trade restrictions" later.
+ if (.@id < 1 || countitem(.@id) < 1 || .@id == IronShovel || checkbound(.@id) || !getiteminfo(.@id, ITEMINFO_MAXCHANCE))
{
- .@items$ = .@items$ + getitemname(@inventorylist_id[.@i]) + ":";
- debugmes getitemname(@inventorylist_id[.@i]);
+ @ShovelLastUsed = 0;
+ if (.@id == IronShovel || checkbound(.@id))
+ mes(col(l("You cannot bury this item!")));
+ else if (!getiteminfo(.@id, ITEMINFO_MAXCHANCE))
+ mes(col(l("This item is too precious, you cannot part with it!")));
+ else
+ mes(col(l("You give up.")));
+ return;
}
- .@idx = select(.@items$) - 1;
- .@id = @inventorylist_id[.@idx];
+
.@amount = 1;
- if (@inventorylist_amount[.@idx] > 1)
+ if (countitem(.@id) > 1)
{
narrator S_FIRST_BLANK_LINE | S_LAST_BLANK_LINE, l("Amount?");
- input .@amount, 1, @inventorylist_amount[.@idx];
+ input .@amount, 1, countitem(.@id);
}
getmapxy(.@map$, .@x, .@y, 0);