diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-06-30 23:41:15 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-06-30 23:41:15 -0300 |
commit | e01b16bfa45a3bdf2ecd9b46cfc623f246c8c554 (patch) | |
tree | 94925e767de66a99d039bdf0a9c4d4866ae4cd22 /npc/items/shovel.txt | |
parent | 4e00bf7a88a9811c7ab431e16dba0e022b9fa7d6 (diff) | |
download | serverdata-e01b16bfa45a3bdf2ecd9b46cfc623f246c8c554.tar.gz serverdata-e01b16bfa45a3bdf2ecd9b46cfc623f246c8c554.tar.bz2 serverdata-e01b16bfa45a3bdf2ecd9b46cfc623f246c8c554.tar.xz serverdata-e01b16bfa45a3bdf2ecd9b46cfc623f246c8c554.zip |
Start fixing Shovel for use
Diffstat (limited to 'npc/items/shovel.txt')
-rw-r--r-- | npc/items/shovel.txt | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt index f01a0fcbe..f510d2f1b 100644 --- a/npc/items/shovel.txt +++ b/npc/items/shovel.txt @@ -1,6 +1,8 @@ +// TMW2 Script // Evol scripts. // Author: // Travolta +// Jesusalva // Description: // NPC to use shovel (dig, bury etc) @@ -44,7 +46,7 @@ function PlayerIsTired { .@tick = gettimetick(1); - .@playertick = .PlayerTiredTime - readparam(bStr); + .@playertick = .PlayerTiredTime - (readparam(bStr)/5); if (@ShovelLastUsed + max(4, .@playertick) > .@tick) { narrator S_FIRST_BLANK_LINE, @@ -84,19 +86,24 @@ 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++) - { - .@items$ = .@items$ + getitemname(@inventorylist_id[.@i]) + ":"; - debugmes getitemname(@inventorylist_id[.@i]); + + mes "##B" + l("Drag and drop an item from your inventory.") + "##b"; + + .@id = requestitem(); + + if (.@id < 1 || countitem(.@id) < 1 || .@id == IronShovel) { + if (.@id == IronShovel) + mesc l("Uh... You can't bury your own shovel!"); + else + mesc l("You give up."); + return -6; } - .@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); @@ -133,15 +140,13 @@ } OnUse: - if (!CheckDigLocation()) - { + if (!CheckDigLocation()) { message strcharinfo(0), l("I can't use the shovel here."); close; } narrator S_LAST_BLANK_LINE, - l("You hold the shovel in your hands."), - l("What are you going to do?"); + l("You hold the shovel in your hands. What are you going to do?"); .@action = select( l("Dig."), |