From 4eb9c2b59dfd77fd0b155dd25571ee5b1c9af658 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 18 Dec 2018 12:29:09 -0200 Subject: Try a tweak on fishing to see if it works --- npc/functions/fishing.txt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'npc/functions/fishing.txt') diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt index e9d52d41f..f3942de79 100644 --- a/npc/functions/fishing.txt +++ b/npc/functions/fishing.txt @@ -52,10 +52,26 @@ OnPCLogoutEvent: end; } +// Syntax: fishing() +// Syntax: fishing ( COMMON, RARE, BAITS ) 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 + setarray .@common_fish, + CommonCarp; + } + + if (getarraysize(.@rare_fish) < 1 || .@rare_fish == 0) { + // default fishes + setarray .@rare_fish, + GrassCarp; + } + debugmes("[FISH] Initialized with %d common and %d rare fishes", getarraysize(.@common_fish), getarraysize(.@rare_fish)); .@npc$ = strnpcinfo(0); // the full name of the fishing spot @@ -105,22 +121,6 @@ function script fishing { .@fish_id = CommonCarp; // failsafe - .@common_fish=getvariableofnpc(.common_fish, .@npc$); - if (getarraysize(.@common_fish) < 1) - { - // default fishes - setarray .@common_fish, - CommonCarp; - } - - .@rare_fish=getvariableofnpc(.rare_fish, .@npc$); - if (getarraysize(.@rare_fish) < 1) - { - // default fishes - setarray .@rare_fish, - GrassCarp; - } - debugmes("[FISH] Initialized with %d common and %d rare fishes", getarraysize(.@common_fish), getarraysize(.@rare_fish)); if (getvariableofnpc(.bait_ids[0], .@npc$) < 1) { -- cgit v1.2.3-70-g09d2