summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-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));