//===========================================
// Fishing Script Version 1.3
//
// Created By: Jeapordy
// Snippet Credit: d00d: Parsing the time
// zdev: Finding error with my sleep delays for night lures
// Instructions:
// Just fill in all variables you desire to use below,
// options for variables are documented in the
// comments preceding the variable declarations.
// take the time to fill in the SWITCH_FISHING_LOCATIONS
// function and you will fish for hours :) Also, you must
// start the script near the initial fishing location.
//===========================================
DEFINE_GLOBAL INT AttackSkillOne 260
DEFINE_GLOBAL INT AttackSkillTwo 190
//===========================================
// Set your debug level: 0 = None
// 1 = Normal Debug
// 2 = Normal + Fish Information
//===========================================
DEFINE_GLOBAL INT Debug 2
//===========================================
// Autopickup setting: 0 = None
// 1 = Server has autopickup
//===========================================
DEFINE_GLOBAL INT AUTOPICKUP 1
//===========================================
// Set your fishing pole: Baby Duck Rod (No Grade): 6529
// Albatross Rod (D Grade): 6530
// Pelican Rod (C Grade): 6531
// KingFisher Rod (B Grade): 6532
// Cygnus Pole (A Grade): 6533
// Triton Pole (S Grade): 6534
//
//===========================================
DEFINE_GLOBAL INT FishingPole 6534
//===========================================
// Set the grade of fish shots to use. Make sure this
// matches the grade of your defined fishing pole.
// No Grade: 6535
// D Grade: 6536
// C Grade: 6537
// B Grade: 6538
// A Grade: 6539
// S Grade: 6540
// Don't Use Soulshot: 0
//===========================================
DEFINE_GLOBAL INT FishShots 6540
//===========================================
// Set your regular lure: Green Colored Lure: 6520
// Purple Colored Lure: 6523
// Yellow Colored Lure: 6526
// Prize-Winning Fishing Lure: 8484
//===========================================
DEFINE_GLOBAL INT RegularLure 6526
//===========================================
// Select your night lure: Green Luminous Lure: 8506
// Purple Luminous Lure: 8509
// Yellow Luminous Lure: 8512
// Prize-Winning Night Fishing Lure: 8485
//
// If you don't wish to use night lures, leave it set to 0
//===========================================
DEFINE_GLOBAL INT NightLure 8512
//===========================================
// Set your desired weapon to fight mobs (You need to
// lookup the item ID yourself). For example an Elysian Axe
// (No SA) would be setup as follows:
//
// DEFINE_GLOBAL INT Weapon 164
//===========================================
DEFINE_GLOBAL INT Weapon 10220
DEFINE_GLOBAL INT Sheild 0
//===========================================
// Set the grade of soulshots to use when fighting mobs.
// Currently shots are only being used on skills
// Make sure this matches the grade of your defined weapon.
// No Grade: 1835
// D Grade: 1463
// C Grade: 1464
// B Grade: 1465
// A Grade: 1466
// S Grade: 1467
// Don't Use Soulshot: 0
//===========================================
DEFINE_GLOBAL INT SSGrade 1467
//===========================================
// Select X, Y, and Z coordinates of where you want to fish
// Make sure you start the script when the toon is near this
// location with no obstacles in the way, or the script will give
// you an error.
//===========================================
DEFINE_GLOBAL INT FishLocX 51586
DEFINE_GLOBAL INT FishLocY 184558
DEFINE_GLOBAL INT FishLocZ -3712
//===========================================
// Select X, Y, and Z coordinates of a point you can move to
// in order to face the correct direction to fish at your desired
// coordinates above in case you get misaligned while fighting
// a caught monster.
//===========================================
DEFINE_GLOBAL INT ResetLocX 51196
DEFINE_GLOBAL INT ResetLocY 184615
DEFINE_GLOBAL INT ResetLocZ -3472
//===========================================
// If you want your char to buff itself, set this variable to 1
// Otherwise leave it 0
//===========================================
DEFINE INT SELF_BUFFS 0
//===========================================
// Setup a maximum of 5 buffs to use, leave them ZERO if
// you are not using self buffs.
//===========================================
DEFINE_GLOBAL INT BUFF1 0
DEFINE_GLOBAL INT BUFF2 0
DEFINE_GLOBAL INT BUFF3 0
DEFINE_GLOBAL INT BUFF4 0
DEFINE_GLOBAL INT BUFF5 0
//===========================================
// Set the time you want to have your buff round duration
// For instance an SWS using Attack Aura will want 19,
// since the selfbuff lasts 20 minutes. A Dwarf would want 9
// since their buffs only last 10 minutes.
//===========================================
DEFINE_GLOBAL INT BuffRoundMinutes 0
//===========================================
// If any of your buffs require a target to use set this to 1
// Otherwise leave it 0
//===========================================
DEFINE_GLOBAL INT BuffNeedTarget 0
//======================================================
//===================================================================================================
//===================================================================================================
//=================== END OF USER EDITABLE VALUES
//=================== DO NOT EDIT BELOW THIS SECTION
//=================== UNLESS YOU KNOW WHAT YOU ARE DOING
//===================================================================================================
//===================================================================================================
// Verify user defined items above are in inventory, and verify you are within 400 range of the fishing location
DEFINE_GLOBAL INT MOVE_TO_RANGE 50
DEFINE INT RANGE_LIMIT 25
DEFINE INT ItmCnt 0
DEFINE_GLOBAL INT FISHING_SPOT 0
ITEM_COUNT ItmCnt "<&RegularLure&>"
IF ItmCnt == ZERO
PRINT_TEXT "You have none of the Regular Lures you defined in your inventory. Please check your script settings or restock."
CALL Error
END_SCRIPT
ENDIF
DELETE ItmCnt
DEFINE INT ItmCnt 0
ITEM_COUNT ItmCnt "<&FishingPole&>"
IF ItmCnt == ZERO
PRINT_TEXT "The fishing pole you specified in the script is not in your inventory."
CALL Error
END_SCRIPT
ENDIF
DELETE ItmCnt
IF NightLure != ZERO
DEFINE INT ItmCnt 0
ITEM_COUNT ItmCnt "<&NightLure&>"
IF ItmCnt == ZERO
PRINT_TEXT "You have none of the Night Lures you defined in your inventory. Please check your script settings or restock."
CALL Error
END_SCRIPT
ENDIF
DELETE ItmCnt
ENDIF
DEFINE INT ItmCnt ZERO
ITEM_COUNT ItmCnt "<&Weapon&>"
IF ItmCnt == ZERO
PRINT_TEXT "The weapon you specified in the script is not in your inventory."
CALL Error
END_SCRIPT
ENDIF
DELETE ItmCnt
IF SSGrade != ZERO
DEFINE INT ItmCnt 0
ITEM_COUNT ItmCnt "<&SSGrade&>"
IF ItmCnt == ZERO
PRINT_TEXT "You don't have the Soulshot you specified in your inventory. Please check your script settings or restock."
CALL Error
END_SCRIPT
ENDIF
DELETE ItmCnt
ENDIF
IF ((FishLocX == #i0) OR (FishLocY == #i0)) OR (FishLocZ == #i0)
PRINT_TEXT "One of your fishing or reset locations set to 0. Please check your script settings."
CALL Error
END_SCRIPT
ELSE
DEFINE INT Dist1 0
DEFINE INT Dist2 0
DISTANCE Dist1 FishLocX FishLocY FishLocZ CHAR_X CHAR_Y CHAR_Z
DISTANCE Dist2 ResetLocX ResetLocY ResetLocZ CHAR_X CHAR_Y CHAR_Z
IF (Dist1 > #i400) OR (Dist2 > #i400)
PRINT_TEXT "You are not starting close enough to the fishing location, please move your char closer, or check your script settings."
PRINT_TEXT "<&Dist1&>:<&Dist2&>"
END_SCRIPT
ENDIF
DELETE Dist1
DELETE Dist2
ENDIF
PRINT_TEXT "Script setting verification complete, setting necessary events and variables."
SET_EVENT "<&SCRIPTEVENT_SERVERPACKETEX&>" "<&SYSTEM_CURRENTFILE&>" Packet::ExFishingHpRegen 40
SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" Packet::SystemMessage 98
IF AUTOPICKUP != ZERO
SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" DropItem 22
ENDIF
SET_TARGETING TYPE ZERO
SET_TARGETING ALIVE ZERO
SET_TARGETING INBOX TWO
DEFINE_GLOBAL INT PumpReuse 0
DEFINE_GLOBAL INT ReelReuse 0
DEFINE_GLOBAL INT FishingStatus 0
DEFINE_GLOBAL INT Fails 0
DEFINE_GLOBAL INT _IsNight 2
DEFINE_GLOBAL INT ServerMinutes 0
DEFINE_GLOBAL INT ServerHours 0
DEFINE_GLOBAL INT TimeForBuffs 0
DEFINE_GLOBAL INT Lost 0
DEFINE_GLOBAL ARRAYLIST DroppedItems 0
PRINT_TEXT "Start Fishing..."
IF NightLure != ZERO
THREAD TimeKeeper
ENDIF
IF SELF_BUFFS == TRUE
THREAD Buffing
ENDIF
SLEEP 1000
IF (_IsNight == ONE) && (NightLure != ZERO)
USE_ITEM "<&NightLure&>"
ELSE
USE_ITEM "<&RegularLure&>"
ENDIF
WHILE ONE == ONE
SLEEP 4500
IF SELF_BUFFS == TRUE
IF TimeForBuffs == TRUE
JUMP_TO_LABEL TIMEOUT
ENDIF
ENDIF
IF Fails < #i3
IF FishingStatus == ZERO
IF CHAR_SITTING == SITTING
COMMAND "/sit"
ENDIF
USE_SKILL 1312
FishingStatus = ONE
SLEEP 2000
ENDIF
ELSE
PRINT_TEXT "You have failed to catch a fish 3 times in a row, let's move to another fishing hole."
IF FISHING_SPOT == #i0
FISHING_SPOT = #i1
ELSE
FISHING_SPOT = #i0
ENDIF
CALL SWITCH_FISHING_LOCATIONS
ENDIF
LABEL TIMEOUT
WEND
END_SCRIPT
// ==========================================
FUNCTION FS
SLEEP 2500
FishingStatus = #i2
RETURN VOID
// ==========================================
FUNCTION TimeKeeper
DEFINE INT Minutes 0
DEFINE DOUBLE SleepTime 0
DEFINE INT FirstRun 1
COMMAND "/time"
SLEEP 1000
Minutes = ServerHours * #i60
Minutes = Minutes + ServerMinutes
WHILE ONE == ONE
IF FirstRun == ONE
IF Minutes < #i360
SleepTime = #i360 - Minutes
SleepTime = SleepTime / #i6
SleepTime = SleepTime * #i1000
SleepTime = SleepTime * #i60
// IF Debug > ZERO
PRINT_TEXT "TimeKeeper: We just started and checked time. It is night, we need to sleep <&SleepTime&> milliseconds until day."
// ENDIF
SLEEP "<&SleepTime&>"
// IF Debug > ZERO
PRINT_TEXT "TimeKeeper: First Run End. It should be day time now, dump out to normal loop."
// ENDIF
FirstRun = ZERO
ELSE
SleepTime = #i1440 - Minutes
SleepTime = SleepTime / #i6
SleepTime = SleepTime * #i1000
SleepTime = SleepTime * #i60
// IF Debug > ZERO
PRINT_TEXT "TimeKeeper: We just started and checked time. It is day, we need to sleep <&SleepTime&> milliseconds until night."
// ENDIF
SLEEP "<&SleepTime&>"
// IF Debug > ZERO
PRINT_TEXT "TimeKeeper: First Run End. It should be night time now, dump out to normal loop."
// ENDIF
FirstRun = ZERO
ENDIF
ENDIF
IF _IsNight == ZERO
IF Debug > ZERO
PRINT_TEXT "TimeKeeper: It should be night time now, setting _IsNight = 1"
ENDIF
_IsNight = ONE
SLEEP 3600000
ELSE
IF _IsNight == ONE
IF Debug > ZERO
PRINT_TEXT "TimeKeeper: It should be day time now, setting _IsNight = 0"
ENDIF
_IsNight = ZERO
SLEEP 10800000
ELSE
IF Debug == ONE
PRINT_TEXT "Timekeeper: Somehow you got into the secondary tracking with _IsNight not 0 or 1"
ENDIF
ENDIF
ENDIF
WEND
RETURN VOID
//======================================================
FUNCTION Packet::SystemMessage
DEFINE INT p_SM_message_id 0
DEFINE INT p_SM_size 0
DEFINE INT p_SM_type 0
DEFINE STRING p_SM_string " "
DEFINE STRING SERVER_HOUR " "
DEFINE STRING SERVER_MIN " "
PACKET.READ_BYTE NULL
PACKET.READ_INT32 p_SM_message_id
PACKET.READ_INT32 p_SM_size
DEFINE INT TMP 0
DEFINE INT N 0
FOR Z 0 "<&p_SM_size&>" 1
N = N + #i1
PACKET.READ_INT32 p_SM_type
SWITCH p_SM_type
CASE #i0
PACKET.READ_STRING p_SM_string
SWITCH p_SM_message_id
CASE #i927
IF N == #i1
_IsNight = ZERO
SERVER_HOUR = p_SM_string
ServerHours = "#i<&SERVER_HOUR&>"
IF Debug > ZERO
PRINT_TEXT "SM: 927 fired, Setting _IsNight = 0"
ENDIF
ENDIF
IF N == #i2
SERVER_MIN = p_SM_string
ServerMinutes = "#i<&SERVER_MIN&>"
ENDIF
BREAK 1
CASE #i928
IF N == #i1
_IsNight = ONE
SERVER_HOUR = p_SM_string
ServerHours = "#i<&SERVER_HOUR&>"
IF Debug > ZERO
PRINT_TEXT "SM: 928 fired, setting _IsNight = 1"
ENDIF
ENDIF
IF N == #i2
SERVER_MIN = p_SM_string
ServerMinutes = "#i<&SERVER_MIN&>"
ENDIF
BREAK 1
ENDSWITCH
BREAK 1
ENDSWITCH
NEXT
SWITCH p_SM_message_id
CASE #i1449
IF Debug > ZERO
PRINT_TEXT "SM: 1449 Fish on! Delaying fighting the fish ~2.5 seconds to let animation appear on client (makes the bot seem more client-like)."
ENDIF
THREAD FS
BREAK 1
CASE #i1460
IF Debug > ZERO
PRINT_TEXT "SM: 1460 Reeling in line to stop fishing. Fish again unless we are fighting a mob"
ENDIF
IF FishingStatus != #i4
FishingStatus = ZERO
ENDIF
BREAK 1
CASE #i1469
IF Debug > ZERO
PRINT_TEXT "SM: 1469 You caught a fish. Reseting Fails to Zero"
ENDIF
Fails = ZERO
BREAK 1
CASE #i1453
IF Debug > ZERO
PRINT_TEXT "SM: 1453 Your pole isn't equipped. Attempting to equip it."
ENDIF
USE_ITEM "<&FishingPole&>"
SLEEP 1000
FishingStatus = ZERO
BREAK 1
CASE #i1450
IF Debug > ZERO
PRINT_TEXT "SM: 1450 You got a bite but lost the fish (shouldn't happen), incrementing Fails by 1."
ENDIF
Lost = Lost + ONE
BREAK 1
CASE #i1452
IF Debug > ZERO
PRINT_TEXT "SM: 1452 We got no bites, incrementing Fails by 1."
ENDIF
Fails = Fails + ONE
BREAK 1
CASE #i1454
IF Debug > ZERO
PRINT_TEXT "SM: 1454 You don't have any bait equipped. Attempting to equip time appropriate lure."
ENDIF
IF (_IsNight == ONE) && (NightLure != ZERO)
USE_ITEM "<&NightLure&>"
ELSE
USE_ITEM "<&RegularLure&>"
ENDIF
SLEEP 1000
FishingStatus = ZERO
BREAK 1
CASE #i1455
IF Debug > ZERO
PRINT_TEXT "SM: 1455 Why the fuck are you under water? Ending Script."
ENDIF
END_SCRIPT
BREAK 1
CASE #i1457
IF Debug > ZERO
PRINT_TEXT "SM: 1457 You aren't facing the water or something, Trying to re-align."
ENDIF
FishingStatus = ONE
CALL ReAlign
BREAK 1
CASE #i1459
IF Debug > ZERO
PRINT_TEXT "SM: 1459 You are out of bait. Please restock, script ending."
ENDIF
END_SCRIPT
BREAK 1
CASE #i1458
IF Debug > ZERO
PRINT_TEXT "SM: 1458 Fishing was cancelled. You probably have used fishing skill while fishing"
PRINT_TEXT "SM: 1458 this should not happen in this script, need to troubleshoot this. Stopping script."
ENDIF
END_SCRIPT
BREAK 1
CASE #i1655
IF Debug > ZERO
PRINT_TEXT "SM: 1655 You caught a monster, let's kill it before continuing."
ENDIF
FishingStatus = #i4
CALL KillMonster
BREAK 1
ENDSWITCH
RETURN VOID
//======================================================
FUNCTION KillMonster
IF Debug > ZERO
PRINT_TEXT "KillMonster: Start"
ENDIF
CANCEL_TARGET
SLEEP 1000
USE_ITEM "<&Weapon&>"
SLEEP 750
USE_ITEM "<&Sheild&>"
SLEEP 750
LABEL FALSE_ZERO_HP
TARGET_NEAREST
SLEEP 1000
PRINT_TEXT "Targeted: <&TARGET_NAME&> and it has <&TARGET_CUR_HP&>/<&TARGET_MAX_HP&> HP"
IF TARGET_NAME == NULL
JUMP_TO_LABEL FALSE_ZERO_HP
ENDIF
WHILE TARGET_CUR_HP > ZERO
IF AttackSkillOne != ZERO
USE_SKILL "<&AttackSkillOne&>"
SLEEP 2150
IF AttackSkillTwo != ZERO
IF TARGET_CUR_HP > ZERO
USE_SKILL "<&AttackSkillTwo&>"
ENDIF
ENDIF
SLEEP 1650
ENDIF
WEND
IF TARGET_CUR_HP > ZERO
JUMP_TO_LABEL FALSE_ZERO_HP
ENDIF
IF AUTOPICKUP != ONE
FOREACH A INT DroppedItems
TARGET "<&DroppedItems.A&>"
SLEEP 1000
NEXTEACH
DroppedItems.CLEAR
ENDIF
WHILE CHAR_CUR_HP < CHAR_MAX_HP
IF CHAR_SITTING == STANDING
IF DEBUG >= ONE
PRINT_TEXT "We are going to try sitting after fighting, hope the mob is dead"
ENDIF
COMMAND "/sit"
ENDIF
SLEEP 10000
WEND
SLEEP 1000
IF DEBUG >= ONE
PRINT_TEXT "Trying to stand up"
ENDIF
COMMAND "/stand"
SLEEP 2500
IF DEBUG >= ONE
PRINT_TEXT "Equipping fishing pole"
ENDIF
USE_ITEM "<&FishingPole&>"
SLEEP 500
IF DEBUG >= ONE
PRINT_TEXT "Equipping Lures"
ENDIF
IF (_IsNight == ONE) && (NightLure != ZERO)
USE_ITEM "<&NightLure&>"
ELSE
USE_ITEM "<&RegularLure&>"
ENDIF
SLEEP 1000
ReAlign
FishingStatus = ZERO
RETURN VOID
//======================================================
FUNCTION Buffing
IF Debug > ZERO
PRINT_TEXT "Buffing: Start"
ENDIF
DEFINE INT TempTimer 0
DEFINE INT HighTime 0
DEFINE INT LowTime 0
DEFINE INT RandTime 30000
TempTimer = BuffRoundMinutes * #i60000
HighTime = TempTimer + RandTime
LowTime = TempTimer - RandTime
WHILE ONE == ONE
TimeForBuffs = TRUE
WHILE FishingStatus != ZERO
IF Debug > ZERO
PRINT_TEXT "Buffing: Need to buff, waiting to be done fishing or fighting monster"
ENDIF
SLEEP 2000
WEND
IF BuffNeedTarget == TRUE
TARGET_SELF
SLEEP 750
ENDIF
SLEEP 500
IF BUFF1 != ZERO
USE_SKILL "<&BUFF1&>"
SLEEP 6000
ENDIF
IF BUFF2 != ZERO
USE_SKILL "<&BUFF2&>"
SLEEP 6000
ENDIF
IF BUFF3 != ZERO
USE_SKILL "<&BUFF3&>"
SLEEP 6000
ENDIF
IF BUFF4 != ZERO
USE_SKILL "<&BUFF4&>"
SLEEP 6000
ENDIF
IF BUFF5 != ZERO
USE_SKILL "<&BUFF5&>"
SLEEP 6000
ENDIF
CANCEL_TARGET
TimeForBuffs = FALSE
GET_RAND TempTimer "<&Lowtime&>" "<&HighTime&>"
IF Debug > ZERO
PRINT_TEXT "Buffing: Buff round finished, sleeping <&TempTimer&>"
ENDIF
SLEEP "<&TempTimer&>"
WEND
RETURN VOID
//======================================================
FUNCTION ReAlign
DEFINE INT Dist1 0
DEFINE INT Dist2 0
DISTANCE Dist1 FishLocX FishLocY FishLocZ CHAR_X CHAR_Y CHAR_Z
DISTANCE Dist2 ResetLocX ResetLocY ResetLocZ CHAR_X CHAR_Y CHAR_Z
IF (Dist1 > #i400) OR (Dist2 > #i400)
PRINT_TEXT "You are not starting close enough to the fishing location, please move your char closer, or check your script settings."
END_SCRIPT
ENDIF
DELETE Dist1
DELETE Dist2
IF Debug > ZERO
PRINT_TEXT "Moving to reset location"
ENDIF
MOVE_TO "<&ResetLocX&>" "<&ResetLocY&>" "<&ResetLocZ&>"
SLEEP 2000
IF Debug > ZERO
PRINT_TEXT "Moving to fishing location"
ENDIF
MOVE_TO "<&FishLocX&>" "<&FishLocY&>" "<&FishLocZ&>"
SLEEP 1000
FishingStatus = ZERO
RETURN VOID
//======================================================
FUNCTION Packet::ExFishingHpRegen
IF FishingStatus == #i2
DEFINE INT ActiveChar 0
DEFINE INT TimeRemaining 0
DEFINE INT FishHP 0
DEFINE INT HPRegenMode 0 // 0 = HP Steady (Fish Resting) | 1 = HP Increasing (Fish Fighting)
DEFINE INT HPBarColor 0 // 0 = Blue | 1 = Red (night time lures only)
PACKET.READ_BYTE NULL
PACKET.READ_INT16 NULL
PACKET.READ_INT32 ActiveChar
IF ActiveChar == CHAR_ID
PACKET.READ_INT32 TimeRemaining
PACKET.READ_INT32 FishHP
PACKET.READ_BYTE HPRegenMode
PACKET.READ_BYTE NULL
PACKET.READ_BYTE NULL
PACKET.READ_INT32 NULL
PACKET.READ_BYTE HPBarColor
IF HPRegenMode == ZERO
IF HPBarColor == ZERO
IF PumpReuse == ZERO
// PRINT_TEXT "Using Pumping: Mode:<&HPRegenMode&> HPBarColor:<&HPBarColor&>"
USE_SKILL 1313
SLEEP 25
USE_ITEM "<&FishShots&>"
PumpReuse = ONE
SLEEP 2000
PumpReuse = ZERO
ENDIF
ELSE
IF ReelReuse == ZERO
// PRINT_TEXT "Using Reeling: Mode:<&HPRegenMode&> HPBarColor:<&HPBarColor&>"
USE_SKILL 1314
SLEEP 25
USE_ITEM "<&FishShots&>"
ReelReuse = ONE
SLEEP 2000
ReelReuse = ZERO
ENDIF
ENDIF
ELSE
IF HPBarColor == ZERO
IF ReelReuse == ZERO
// PRINT_TEXT "Using Reeling: Mode:<&HPRegenMode&> HPBarColor:<&HPBarColor&>"
USE_SKILL 1314
SLEEP 25
USE_ITEM "<&FishShots&>"
ReelReuse = ONE
SLEEP 2000
ReelReuse = ZERO
ENDIF
ELSE
IF PumpReuse == ZERO
// PRINT_TEXT "Using Pumping: Mode:<&HPRegenMode&> HPBarColor:<&HPBarColor&>"
USE_SKILL 1313
SLEEP 25
USE_ITEM "<&FishShots&>"
PumpReuse = ONE
SLEEP 2000
PumpReuse = ZERO
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
RETURN VOID
//======================================================
FUNCTION DropItem
DEFINE INT charObjId 0
DEFINE INT DroppedObjId 0
PACKET.READ_BYTE NULL
PACKET.READ_INT32 charObjId
PACKET.READ_INT32 DroppedObjId
IF charObjId == TARGET_ID
DroppedItems.ADD "#i<&DroppedObjId&>"
ENDIF
RETURN VOID
//======================================================
FUNCTION PROXIMITY_MOVE 3 X Y Z
DEFINE INT TDIST ZERO
IF DEBUG == ONE
PRINT_TEXT "TDIST = <&tdist&>"
ENDIF
DISTANCE TDIST X Y Z CHAR_X CHAR_Y CHAR_Z
WHILE TDIST > MOVE_TO_RANGE
MOVE_TO "<&X&>" "<&Y&>" "<&Z&>"
SLEEP 750
DISTANCE TDIST X Y Z CHAR_X CHAR_Y CHAR_Z
IF DEBUG == ONE
PRINT_TEXT "TDIST = <&tdist&>"
ENDIF
WEND
RETURN VOID
// ======================================================
// This part should be self explainitory. Basically, setup your movement to
// each fishing spot from the other one, and define your fishing location and
// the reset position for each fishing location. Example usage:
// PROXIMITY_MOVE VOID #i2390 #i-23987 #i-3990
// =====================================================
FUNCTION SWITCH_FISHING_LOCATIONS
IF FISHING_SPOT == #i0
PRINT_TEXT "Moving to Fishing Hole #1"
PROXIMITY_MOVE VOID 3 #i82072 #i142406 #i-3745
FishLocX = #i
FishLocY = #i
FishLocZ = #i
ResetLocX = #i
ResetLocY = #i
ResetLocZ = #i
Fails = ZERO
ELSE
PRINT_TEXT "Moving to Fishing Hole #2"
PROXIMITY_MOVE VOID 3 # #i #i
FishLocX = #i
FishLocY = #i
FishLocZ = #i
ResetLocX = #i
ResetLocY = #i
ResetLocZ = #i
Fails = ZERO
ENDIF
RETURN VOID