From 5c4affefd601e6e869da7ae3f8f28eb9a24fb563 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 18 Dec 2018 12:46:34 -0200 Subject: Try a different implement --- npc/functions/fishing.txt | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt index f3942de79..113d4b9cf 100644 --- a/npc/functions/fishing.txt +++ b/npc/functions/fishing.txt @@ -53,23 +53,28 @@ OnPCLogoutEvent: } // Syntax: fishing() -// Syntax: fishing ( COMMON, RARE, BAITS ) +// Syntax: fishing ( OFFSET, COMMON FISHES, RARE FISHES ) +// OFFSET: How many fishes are common function script fishing { /////////////////////////////////////////// // Var initialization - .@common_fish=getarg(0, 0); - .@rare_fish=getarg(0, 0); - if (getarraysize(.@common_fish) < 1 || .@common_fish == 0) { - // default fishes + if (getarg(0, 0) == 0) { setarray .@common_fish, CommonCarp; - } - - if (getarraysize(.@rare_fish) < 1 || .@rare_fish == 0) { - // default fishes setarray .@rare_fish, GrassCarp; + } else { + .@i=0; + freeloop(true); + for (.@i=1; .@i < getargcount(); .@i++) { + if (.@i <= getarg(0)) { + .@common_fish[.@i-1]=getarg(.@i); + } else { + .@rare_fish[.@i-1-getarg(0)]=getarg(.@i); + } + }; + freeloop(false); } debugmes("[FISH] Initialized with %d common and %d rare fishes", getarraysize(.@common_fish), getarraysize(.@rare_fish)); -- cgit v1.2.3-60-g2f50