summaryrefslogtreecommitdiff
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
parent4eb9c2b59dfd77fd0b155dd25571ee5b1c9af658 (diff)
downloadserverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.tar.gz
serverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.tar.bz2
serverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.tar.xz
serverdata-5c4affefd601e6e869da7ae3f8f28eb9a24fb563.zip
Try a different implement
-rw-r--r--npc/001-1/wateranimation.txt3
-rw-r--r--npc/functions/fishing.txt23
2 files changed, 16 insertions, 10 deletions
diff --git a/npc/001-1/wateranimation.txt b/npc/001-1/wateranimation.txt
index 6f65fb603..9673929a9 100644
--- a/npc/001-1/wateranimation.txt
+++ b/npc/001-1/wateranimation.txt
@@ -7,7 +7,8 @@
001-1,254,70,0 script #water_animation_aeros0 NPC_WATER_SPLASH,{
- fishing(.common_fish, .rare_fish); // begin or continue fishing
+ fishing(3, CommonCarp, Roach, Tench,
+ GrassCarp); // begin or continue fishing
close;
OnInit:
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));