summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorjesusalva <cpntb1@ymail.com>2018-03-04 02:53:00 -0300
committerjesusalva <cpntb1@ymail.com>2018-03-04 02:53:00 -0300
commit5937179c89e5d47837353d0a0446e053c0ba3c94 (patch)
tree723675f66e304eb9f8edc41dfd63a8d08be02fbb /npc/functions
parent453aa4102404a6cff0c7ce9bb77aeba1b7c7160b (diff)
downloadserverdata-5937179c89e5d47837353d0a0446e053c0ba3c94.tar.gz
serverdata-5937179c89e5d47837353d0a0446e053c0ba3c94.tar.bz2
serverdata-5937179c89e5d47837353d0a0446e053c0ba3c94.tar.xz
serverdata-5937179c89e5d47837353d0a0446e053c0ba3c94.zip
Definitive fix of fishing.txt - it should be working as planned, @Crazyfefe
This includes rare fish, common fish, and the TODO's RNGs
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/fishing.txt31
1 files changed, 20 insertions, 11 deletions
diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt
index 077e806b0..f46d55811 100644
--- a/npc/functions/fishing.txt
+++ b/npc/functions/fishing.txt
@@ -4,6 +4,7 @@
// gumi
// omatt
// Travolta
+// Jesusalva
// Description:
// Fishing functions.
// Variable
@@ -102,11 +103,21 @@ function script fishing {
.@pull_rand_max = getvariableofnpc(.pull_rand_max, .@npc$);
.@pull_rand_max = (.@pull_rand_max ? .@pull_rand_max : 800);
- .@fish_id = getvariableofnpc(.common_fish, .@npc$);
- .@fish_id = (.@fish_id ? .@fish_id : CommonCarp);
+ .@fish_id = CommonCarp; // failsafe
- .@rare_id = getvariableofnpc(.rare_fish, .@npc$);
- .@rare_fish = (.@rare_fish ? .@rare_fish : GrassCarp);
+ if (getarraysize(.common_fish) < 1)
+ {
+ // default fishes
+ setarray .common_fish,
+ CommonCarp;
+ }
+
+ if (getarraysize(.rare_fish) < 1)
+ {
+ // default fishes
+ setarray .rare_fish,
+ GrassCarp;
+ }
.@rare_fish_chance = getvariableofnpc(.rare_fish_chance, .@npc$);
.@rare_fish_chance = (.@rare_fish_chance ? .@rare_fish_chance : 25);
@@ -185,15 +196,12 @@ function script fishing {
return -4;
}
- // RNG to obtain a rare fish
- // TODO: chance booster
- if (rand(.@rare_fish_chance) == 0)
+ // RNG to obtain a rare fish or common fish
+ if (rand(.@rare_fish_chance) < getvariableofnpc(.bait_ids[@bait_d+1], .@npc$))
{
- // TODO: rare fish array
- .@fish_id = .@rare_id;
+ .@fish_id = .rare_fish[rand(getarraysize(.rare_fish))];
} else {
- // TODO: else common fish array
- .@fish_id = .@rare_id;
+ .@fish_id = .common_fish[rand(getarraysize(.common_fish))];
}
// RNG to obtain a fish
@@ -258,6 +266,7 @@ function script fishing {
if (getvariableofnpc(.bait_ids[.@i], .@npc$) == .@bait)
{
.@bait_c = true;
+ @bait_d = .@i;
break;
}
}