A fishing script for use in an XtremeWorlds Game.
XtremeWorlds is a free 2D MMORPG Maker engine. This script is a fishing skill script that will allow you to catch fish, get exp, and level up.
Put this in Sub UseItem
X = GetPlayerX(Index)
Y = GetPlayerY(Index)
Map = GetPlayerMap(Index)
If ItemNum = 2 Then ‘ The fishing pole
If Map = 2 And X = 6 And Y = 9 Then ‘ The spot on the map.
Call FishingSkill(Index)
End If
End If
Put this some where not in a Sub
Sub FishingSkill(Index)
FishingLevel=GetVar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingLevel”)
FishingExp=GetVar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingExp”)
FishingTNL=GetVar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingTNL”)
If FishingLevel =”" Then FishingLevel = 1
If FishingExp =”" Then FishingExp = 0
If FishingTNL =”" Then FishingTNL = 100
FishingLevel = Int(FishingLevel)
FishingExp = Int(FishingExp)
FishingTNL = Int(FishingTNL)
MaxFishingLevel = 99 ‘ The max level
If FishingLevel <= 10 Then
Catch = Rand(2,1)
If Catch = 1 Then ‘ failure
Call PlayerMsg(Index, “You fail to catch a fish.”, C_WHITE)
End If
If Catch = 2 Then ‘ success
Call PlayerMsg(Index, “You catch some shrimp.”, C_WHITE)
Call GiveItem(Index, 2, 1)
FishingExp = FishingExp + 10
If FishingExp => FishingTNL And FishingLevel < MaxFishingLevel Then
FishingExp = FishingExp – FishingTNL
FishingTNL = Int(FishingTNL * 1.4)
FishingLevel = FishingLevel + 1
Call PlayerMsg(Index,”You are now Fishing Level “&FishingLevel&” !”,C_BRIGHTCYAN)
End If
End If
End If
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingLevel”,”"&FishingLevel)
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingExp”,”"&FishingExp)
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingTNL”,”"&FishingTNL)
If FishingLevel > 10 And FishingLevel <= 20 Then
Catch = Rand(5,1)
If Catch = 1 or Catch = 2 Then ’ Failure
Call PlayerMsg(Index, “You fail to catch a fish.”, C_WHITE)
End If
If Catch = 3 Then ‘ success
Call PlayerMsg(Index, “You catch a tuna.”, C_WHITE)
Call GiveItem(Index, 7, 1)
FishingExp = FishingExp + 20
If FishingExp => FishingTNL And FishingLevel < MaxFishingLevel Then
FishingExp = FishingExp – FishingTNL
FishingTNL = Int(FishingTNL * 1.4)
FishingLevel = FishingLevel + 1
Call PlayerMsg(Index,”You are now Fishing Level “&FishingLevel&” !”,C_BRIGHTCYAN)
End If
End If
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingLevel”,”"&FishingLevel)
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingExp”,”"&FishingExp)
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingTNL”,”"&FishingTNL)
If Catch = 4 Then
Call PlayerMsg(Index, “You catch a herring.”, C_WHITE)
Call GiveItem(Index, 8, 1)
FishingExp = FishingExp + 20
If FishingExp => FishingTNL And FishingLevel < MaxFishingLevel Then
FishingExp = FishingExp – FishingTNL
FishingTNL = Int(FishingTNL * 1.4)
FishingLevel = FishingLevel + 1
Call PlayerMsg(Index,”You are now Fishing Level “&FishingLevel&” !”,C_BRIGHTCYAN)
End If
End If
End If
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingLevel”,”"&FishingLevel)
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingExp”,”"&FishingExp)
Call Putvar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingTNL”,”"&FishingTNL)
End Sub
And Put this under Select Case Parse
Case “/fishing”
FishingLevel=GetVar(”skillset.ini”, ConvertToString(GetPlayerLogin(Index))&”_”&ConvertToString(GetPlayerName(Index)), “FishingLevel”)
Call PlayerMsg(Index,”Your Fishing Level is “&FishingLevel&” !”,C_BRIGHTCYAN)
This last part allows you to type /fishing in the game to find out what your fishing level is.









