Here's my woodcutting class;
Code:
package server.model.players.skills;
import java.io.*;
import server.model.players.Client;
import server.util.Misc;
import server.model.objects.*;
import server.*;
import server.util.*;
import server.model.players.*;
public class Woodcutting {
public Woodcutting(Client c)
{
Client = c;
}
public void cutTree(Client c, String treeName, String message,
int lvlReq, int XPamount, int item, int itemAmount) {
if(c.playerLevel[8] >= lvlReq) {
c.lastAction = System.currentTimeMillis();
c.sendMessage("You chop the tree. Some how gain some money?");
c.getItems().addItem(item, itemAmount);
c.getPA().addSkillXP(XPamount, 8);
c.getPA().refreshSkill(8);
Objects stump = new Objects(1343, c.objectX, c.objectY, 0, -1, 10, 0);
Server.objectHandler.addObject(stump);
Server.objectHandler.placeObject(stump);
Objects tree = new Objects(c.objectId, c.objectX, c.objectY, 0, -1, 10, 10);
Server.objectHandler.addObject(tree);
}
else if(c.playerLevel[17] < lvlReq) {
c.sendMessage("You need a woodcutting level of "+lvlReq+" to cut this tree.");
}
}
}
Here's my tree code.
Code:
case 1276: // tree example
case 1278:
c.getWoodcut().cutTree(c, "Tree", "You chop the tree. Some how gain some money?", 1, 1000, 995, 1500);
break;
I've added this to Client.java
Code:
import server.model.players.skills.Woodcutting;
Code:
public Woodcutting Woodcutting = new Woodcutting(this);
Code:
public Woodcutting getWoodcut() {
return Woodcutting;
}
Thieving class;
Code:
package server.model.players.skills;
import server.model.players.Client;
import server.util.Misc;
public class Thieving {
public Client client;
public int actionInterval;
public void stoleStall(Client c, String stallName, String message,
int lvlReq, int XPamount, int item, int itemAmount,
int emote) {
if(System.currentTimeMillis() - c.lastAction < actionInterval) return;
if(c.playerLevel[17] >= lvlReq) {
c.lastAction = System.currentTimeMillis();
c.startAnimation(emote);
c.sendMessage("You take from the stall..");
c.sendMessage(message);
c.getItems().addItem(item, itemAmount);
c.getPA().addSkillXP(XPamount, 17);
c.getPA().refreshSkill(17);
}
else if(c.playerLevel[17] < lvlReq) {
c.sendMessage("You need a theiving level of "+lvlReq+" to theif from this stall.");
}
}
public Thieving(Client c)
{
client = c;
}
public void npcGotRobed(Client c, String NPCNAME, int item,
int amount, int exp, int req) {
if(c.playerLevel[17] < req) {
c.sendMessage("You need at least "+req+" thieving to thieve this "+NPCNAME+".");
return;
}
if(System.currentTimeMillis() - c.lastAction < actionInterval) return;
if(Misc.random(3) == 1) {
c.sendMessage("You fail to pickpocket the "+NPCNAME+"..");
c.stillgfx(348, c.absY, c.absX);
c.startAnimation(881);
c.lastAction = System.currentTimeMillis();
return;
}
c.lastAction = System.currentTimeMillis();
c.getPA().addSkillXP(exp*c.playerLevel[17], 17);
c.getPA().refreshSkill(17);
c.getItems().addItem(item, amount);
c.startAnimation(881);
c.sendMessage("You pickpocket the "+NPCNAME+".");
}
}
Error i get;
Code:
.\server\model\players\skills\Woodcutting.java:17: cannot find symbol
symbol : variable Client
location: class server.model.players.skills.Woodcutting
Client = c;
^
1 error
Press any key to continue . . .