prontera, 150, 165, 0 script Fishing Hole 10065,{
Fish:
if(!isequipped(.rod) || countitem(.lure) == 0) {
dispbottom("[Fishing] You need a Rod and Lure.");
end;
}
specialeffect(EF_BUBBLE, "Fishing Hole");
soundeffect("fishingrod.wav", 0);
dispbottom("[Fishing] Casting...");
.@fishing_cast_time = .default_fishing_cast_time;
for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2)
if (isequipped(.fishing_items[.@i]))
.@fishing_cast_time += .fishing_items[.@i + 1];
progressbar("ffffff", .@fishing_cast_time);
delitem(.lure, 1);
.@pull = rand(1, 100);
.@catch = 0;
.@chance = 0;
for(.@i = 0; .@i < 3; .@i++) {
.@chance += .chances[.@i];
if(.@pull <= .@chance) {
switch(.@i) {
case 0:
.@catch = .rare_catches[rand(getarraysize(.rare_catches))];
mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00");
break;
case 1:
.@catch = .blueback;
mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff");
break;
case 2:
.@catch = .normal_catches[rand(getarraysize(.normal_catches))];
break;
}
break;
}
}
if(.@catch == 0) {
dispbottom("[Fishing] Nothing was caught...");
specialeffect2(EF_TEMP_FAIL);
if(.auto_fail == 1)
goto Fish;
end;
}
getitem(.@catch, 1);
specialeffect2(EF_TEMP_OK);
if(.auto == 1)
goto Fish;
end;
OnInit:
// Fishing rod
.rod = 2764;
// Fishing Lure
.lure = 2775;
// Auto-Fish
.auto = 1;
// Auto-Fish on Fail
.auto_fail = 1;
// Default Cast Time
.default_fishing_cast_time = 15;
// Chances for catch rareties: <rare>, <blueback>, <normal>
// All chances together can't exceed 100.
// If all chances sum up to 100, fishing doesn't fail.
setarray(.chances[0], 1, 5, 50);
// Fishing Items
setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1);
// Blueback
.blueback = 6096;
// Catches
setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624);
// Rare Catches
setarray(.rare_catches[0], 644, 603, 617);
}