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.txt63
1 files changed, 32 insertions, 31 deletions
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt
index 8977ddfb8..be9daab1b 100644
--- a/npc/items/shovel.txt
+++ b/npc/items/shovel.txt
@@ -6,6 +6,38 @@
// Description:
// NPC to use shovel (dig, bury etc)
+// shovel_scriptItem( map, x, y, item, {amount} )
+function script shovel_scriptItem {
+ .@map$=getarg(0);
+ .@x=getarg(1);
+ .@y=getarg(2);
+ .@id=getarg(3);
+ .@amount=getarg(4,1);
+
+ .@wtc = getarraysize($@WBT_Random_id);
+ $@WBT_Random_id[.@wtc] = .@id;
+ $@WBT_Random_amount[.@wtc] = .@amount;
+ $@WBT_Random_map$[.@wtc] = .@map$;
+ $@WBT_Random_x[.@wtc] = .@x;
+ $@WBT_Random_y[.@wtc] = .@y;
+ debugmes "Buried"+.@amount+" "+getitemname(.@id);
+}
+
+// shovel_scatter( map, x1, y1, x2, y2, items_array, {amount} )
+function script shovel_scatter {
+ .@map$=getarg(0);
+ .@x1=getarg(1);
+ .@y1=getarg(2);
+ .@x2=getarg(3);
+ .@y2=getarg(4);
+ .@id=getarg(5);
+ .@amount=getarg(6,1);
+
+ for (.@i = 0; .@i < .@amount; .@i++)
+ shovel_scriptItem(.@map$, rand(.@x1,.@x2), rand(.@y1,.@y2), any_of(.@id));
+
+}
+
- script Shovel -1,{
function CheckDigLocation {
@@ -280,35 +312,4 @@ function script shovel_adddigrect {
return 1;
}
-// shovel_scriptItem( map, x, y, item, {amount} )
-function script shovel_scriptItem {
- .@map$=getarg(0);
- .@x=getarg(1);
- .@y=getarg(2);
- .@id=getarg(3);
- .@amount=getarg(4,1);
-
- .@wtc = getarraysize($@WBT_Random_id);
- $@WBT_Random_id[.@wtc] = .@id;
- $@WBT_Random_amount[.@wtc] = .@amount;
- $@WBT_Random_map$[.@wtc] = .@map$;
- $@WBT_Random_x[.@wtc] = .@x;
- $@WBT_Random_y[.@wtc] = .@y;
- debugmes "Buried"+.@amount+" "+getitemname(.@id);
-}
-
-// shovel_scatter( map, x1, y1, x2, y2, items_array, {amount} )
-function script shovel_scatter {
- .@map$=getarg(0);
- .@x1=getarg(1);
- .@y1=getarg(2);
- .@x2=getarg(3);
- .@y2=getarg(4);
- .@id=getarg(5);
- .@amount=getarg(6,1);
-
- for (.@i = 0; .@i < .@amount; .@i++)
- shovel_scriptItem(.@map$, rand(.@x1,.@x2), rand(.@y1,.@y2), any_of(.@id));
-
-}