From 1d428cad88a591b20adb06461749ed40e9dc9f0a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 1 Jul 2018 00:48:05 -0300 Subject: Bad order %%m --- npc/items/shovel.txt | 63 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'npc/items') 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)); - -} -- cgit v1.2.3-60-g2f50