diff options
Diffstat (limited to 'npc/functions/fishing.txt')
-rw-r--r-- | npc/functions/fishing.txt | 23 |
1 files changed, 14 insertions, 9 deletions
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)); |