summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-12-18 12:46:34 -0200
committerJesusaves <cpntb1@ymail.com>2018-12-18 12:46:34 -0200
commit5c4affefd601e6e869da7ae3f8f28eb9a24fb563 (patch)
tree15932001503e7779e57c81b954be9400ede622e8 /npc/functions
parent4eb9c2b59dfd77fd0b155dd25571ee5b1c9af658 (diff)
downloadserverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.tar.gz
serverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.tar.bz2
serverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.tar.xz
serverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.zip
Try a different implement
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/fishing.txt23
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));