summaryrefslogtreecommitdiff
path: root/gamemode/processes.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/processes.lua')
-rw-r--r--gamemode/processes.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/gamemode/processes.lua b/gamemode/processes.lua
index d898271..b75db3b 100644
--- a/gamemode/processes.lua
+++ b/gamemode/processes.lua
@@ -804,26 +804,26 @@ function PROCESS:OnStop()
if ( !self.Owner.Resources['Baits'] or self.Owner.Resources['Baits'] < 1 ) then
self.Data.Chance = self.Data.Chance * 0.25
end
+ local fishables = {
+ {"Bass",999,2},
+ {"Trout",2,1.5},
+ {"Salmon",1.5,1.2},
+ {"Shark",1.2,1},
+ }
if ( num < self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) then
if ( self.Owner.Resources['Baits'] and self.Owner.Resources['Baits'] > 0 ) then
self.Owner:DecResource( "Baits", 1 )
end
- if ( num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 2 ) then
- self.Owner:IncResource( "Bass", 1 )
- self.Owner:SendMessage( "Bass ( 1x )", 3, Color( 10, 200, 10, 255 ) )
- elseif ( num >= ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 2 && num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 1.5 ) then
- self.Owner:IncResource( "Trout", 1 )
- self.Owner:SendMessage( "Trout ( 1x )", 3, Color( 10, 200, 10, 255 ) )
- elseif ( num >= ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 1.5 && num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 1.2 ) then
- self.Owner:IncResource( "Salmon", 1 )
- self.Owner:SendMessage( "Salmon ( 1x )", 3, Color( 10, 200, 10, 255 ) )
- elseif ( num >= ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 1.2 && num < self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) then
- self.Owner:IncResource( "Shark", 1 )
- self.Owner:SendMessage( "Shark ( 1x )", 3, Color( 10, 200, 10, 255 ) )
+ local sdc = self.Data.Chance + self.Owner:GetSkill("Fishing")
+ for k,v in pairs(fishables) do
+ if( (num >= (sdc/v[2])) and (num < (sdc/v[3])) ) then
+ self.Owner:IncResource(v[1],1)
+ self.Owner:SendMessage(v[1] .. "( 1x )", 3, Color(10,200,10,255))
+ break
+ end
end
-
self.Owner:IncXP( "Fishing", math.Clamp( math.Round( 250 / self.Owner:GetSkill( "Fishing" ) ), 1, 1000 ) )
self.Owner:EmitSound( Sound( "ambient/water/water_splash" .. math.random( 1, 3 ) .. ".wav" ) )
else