Jump to content
  • 0
Sign in to follow this  
Mr Torva

317PI Fishing

Question

OK so i've been messing around with the Fishing.java based off Impozzes/Erasedpkz/TorvaPkz and i cannot figure out why the fishing spots are turning towards me when i attempt to fish. It doesnt even start the animation to fish, nor does it catch fish at all. Here is what i got.
Fishing.java:
[code]package server.model.players.skills;

import server.Config;
import server.Server;
import server.util.Misc;
import server.event.Event;
import server.event.EventContainer;
import server.event.EventManager;
import server.model.objects.Objects;
import server.model.players.Client;

public class Fishing {

private Client c;
public Fishing(Client c) {
this.c = c;
}

public void FishingProcess() {
if (c.fishtimer > 0) {
c.fishtimer--;
}

if (c.fishing && c.getItems().freeSlots() <= 0) {
c.fishing = false;
c.sendMessage("Your inventory is full");
c.frame1();
}

if (c.fishing && c.fishtimer <= 0 && c.getItems().freeSlots() > 0) {
if (c.getItems().playerHasItem(c.fishitem)) {
if (c.playerLevel[10] >= c.fishreqt) {
if (c.fishitem == 307 && !c.getItems().playerHasItem(313)) {
c.sendMessage("You need bait to fish here!");
c.fishing = false;
} else if (c.fishitem == 309 && !c.getItems().playerHasItem(314)) {
c.sendMessage("You need feathers to fish here!");
c.fishing = false;
} else {
if (c.fishreq2 != 0 && c.playerLevel[10] >= c.fishreq2 && Misc.random(1) == 1) {
c.getItems().addItem(c.fishies2, 1);
c.getPA().addSkillXP(c.fishXP, 10);
} else {
c.getItems().addItem(c.fishies, 1);
c.getPA().addSkillXP(c.fishXP, 10);
}
if (c.fishitem == 307)
c.getPA().addSkillXP(c.fishXP, 10);
c.fishtimer = Misc.random(fishtime(c.fishies, c.fishreqt));
//c.sendMessage("You catch a " + c.getItems().getItemName(c.fishies).toLowerCase());
}
} else {
c.fishing = false;
c.sendMessage("You need a fishing level of " + c.fishreqt + " to fish for " + c.getItems().getItemName(c.fishies));
}
} else {
c.fishing = false;
c.sendMessage("You need a " + c.getItems().getItemName(c.fishitem) + " to fish " + c.getItems().getItemName(c.fishies));
}
}

if (c.fishing) {
c.startAnimation(c.fishemote);
//frame174(378, 3);
}
if (c.attemptingfish)
if(c.clickObjectType > 0 && c.goodDistance(c.objectX + c.objectXOffset, c.objectY + c.objectYOffset, c.getX(), c.getY(), c.objectDistance)) {
c.attemptingfish = false;
c.fishing = true;
}
}

public int fishtime(int fish, int req) {
int time = 10;
if (fish == 317) {//Shrimp 1
time = 10;
}
if (fish == 327) {//Sardine 5
time = 15;
}
if (fish == 355) {//Trout 20
time = 20;
}
if (fish == 341) {//Cods 23
time = 25;
}
if (fish == 349) {//Pike 25
time = 28;
}
if (fish == 359) {//Tuna 35
time = 30;
}
if (fish == 377) {//Lobsters 40
time = 35;
}
if (fish == 383) {//Sharks 79
time = 40;
}
if (fish == 389) {//Manta ray 85
time = 45;
}
int LevelXP = c.playerLevel[10] - req;
if (LevelXP > req / 3)
LevelXP = req / 3;
time -= LevelXP;
return time;
}
}[/code]
Actionhandler.java:
[code] public void firstClickNpc(int npcType) {
c.fishitem = -1;
c.clickNpcType = 0;
c.npcClickIndex = 0;
if (c.fishitem != -1) {
if (!c.getItems().playerHasItem(c.fishitem)) {
c.sendMessage("You need a " + c.getItems().getItemName(c.fishitem) + " to fish for " + c.getItems().getItemName(c.fishies));
c.fishing = false;
return;
}
if (c.getItems().freeSlots() == 0) {
c.sendMessage("Your inventory is full.");
c.fishing = false;
return;
}
if (c.playerFishing < c.fishreqt) {
c.sendMessage("You need a fishing level of " + c.fishreqt + " to fish here.");
c.fishing = false;
return;
}
c.fishtimer = c.getFishing().fishtime(c.fishies, c.fishreqt);
}
switch(npcType) {
case 706:
c.getDH().sendDialogues(9, npcType);
break;
case 1512:
c.getDH().sendDialogues(70, 4289);
break;
case 6794:
case 6873:
c.getDH().sendDialogues(75, 4289);
break;
case 946:
c.getDH().sendDialogues(20, npcType);
break;
case 316:
c.fishing = true;
c.fishXP = 350;
c.fishies = 317;
c.fishreqt = 0;
c.fishitem = 303;
c.fishemote = 621;
c.fishies2 = 0;
c.fishreq2 = 0;
break;
case 334:
c.fishing = true;
c.fishXP = 350;
c.fishies = 317;
c.fishreqt = 0;
c.fishitem = 303;
c.fishemote = 621;
c.fishies2 = 0;
c.fishreq2 = 0;
break;
case 324://cage-harpoon spot choice cage
c.fishing = true;
c.fishXP = 700;
c.fishies = 377;
c.fishreqt = 40;
c.fishitem = 301;
c.fishemote = 619;
c.fishies2 = 389;
c.fishreq2 = 81;
break;
case 325:
c.fishing = true;
c.fishXP = 2000;
c.fishies = 15272;
c.fishreqt = 40;
c.fishitem = 301;
c.fishemote = 619;
c.fishies2 = 15272;
c.fishreq2 = 99;
break;
case 320:
c.fishing = true;
c.fishXP = 2000;
c.fishies = 15272;
c.fishreqt = 40;
c.fishitem = 301;
c.fishemote = 619;
c.fishies2 = 15272;
c.fishreq2 = 95;
break;
case 326:
c.fishing = true;
c.fishXP = 600;
c.fishies = 341;
c.fishreqt = 23;
c.fishitem = 303;
c.fishemote = 621;
c.fishies2 = 363;
c.fishreq2 = 46;
break;
case 313:
c.fishing = true;
c.fishXP = 600;
c.fishies = 341;
c.fishreqt = 23;
c.fishitem = 303;
c.fishemote = 621;
c.fishies2 = 363;
c.fishreq2 = 46;
break;[/code]
[code] public void secondClickNpc(int npcType) {
c.fishitem = -1;
c.clickNpcType = 0;
c.npcClickIndex = 0;
if (c.fishitem != -1) {
if (!c.getItems().playerHasItem(c.fishitem)) {
c.sendMessage("You need a " + c.getItems().getItemName(c.fishitem) + " to fish for " + c.getItems().getItemName(c.fishies));
c.fishing = false;
return;
}
if (c.getItems().freeSlots() == 0) {
c. sendMessage("Your inventory is full.");
c.fishing = false;
return;
}
if (c.playerFishing < c.fishreqt) {
c.sendMessage("You need a fishing level of " + c.fishreqt + " to fish here.");
c.fishing = false;
return;
}
c.fishtimer = c.getFishing().fishtime(c.fishies, c.fishreqt);
}
switch(npcType) {
case 526:
c.getShops().openShop(14);
break;
case 527:
c.getShops().openShop(15);
break;
case 528:
c.getShops().openShop(16);
break;
case 1282:
c.getShops().openShop(7);
break;
case 8275:
c.getShops().openShop(48);
break;
case 333:
c.fishing = true;
c.fishXP = 650;
c.fishies = 359;
c.fishreqt = 35;
c.fishitem = 311;
c.fishemote = 618;
c.fishies2 = 371;
c.fishreq2 = 50;
break;
case 312:
c.fishing = true;
c.fishXP = 650;
c.fishies = 359;
c.fishreqt = 35;
c.fishitem = 311;
c.fishemote = 618;
c.fishies2 = 371;
c.fishreq2 = 50;
break;
case 324:
c.fishing = true;
c.fishXP = 650;
c.fishies = 359;
c.fishreqt = 35;
c.fishitem = 311;
c.fishemote = 618;
c.fishies2 = 371;
c.fishreq2 = 50;
break;
case 334:
c.fishing = true;
c.fishXP = 650;
c.fishies = 359;
c.fishreqt = 35;
c.fishitem = 311;
c.fishemote = 618;
c.fishies2 = 371;
c.fishreq2 = 50;
break;
case 316:
c.fishing = true;
c.fishXP = 630;
c.fishies = 327;
c.fishreqt = 5;
c.fishitem = 307;
c.fishemote = 622;
c.fishies2 = 345;
c.fishreq2 = 10;
break;
case 326:
c.fishing = true;
c.fishXP = 530;
c.fishies = 327;
c.fishreqt = 5;
c.fishitem = 307;
c.fishemote = 622;
c.fishies2 = 345;
c.fishreq2 = 10;
break;
case 331:
c.fishing = true;
c.fishXP = 770;
c.fishies = 349;
c.fishreqt = 25;
c.fishitem = 307;
c.fishemote = 622;
c.fishies2 = 0;
c.fishreq2 = 0;




case 313:
c.fishing = true;
c.fishXP = 1000;
c.fishies = 383;
c.fishreqt = 79;
c.fishitem = 311;
c.fishemote = 618;
c.fishies2 = 0;
c.fishreq2 = 0;
break;[/code]

Someone mind helping me get this going? Please.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Sign in to follow this  

×