PDA

View Full Version : [562] ClanChat with great Lootshare base



Mystic Flow
November 27th, 2010, 00:33
Well, I programmed this Clan chat system for my 484 but I added a few more things for 562. This works fine on 562 and the lootshare is epic, but I need a perfect calc formula but ehh it work

1. Make a new package in com/rs2hd/content called clans

Now add a class called ClanManager.java


package com.rs2hd.content.clans;

import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Map;

import com.rs2hd.event.Event;
import com.rs2hd.model.Player;
import com.rs2hd.model.World;
import com.rs2hd.util.Misc;
import com.rs2hd.util.XStreamUtil;
import com.rs2hd.util.log.Logger;
/**
* @author 'Mystic Flow
*/
public class ClanManager {

private Map<String, Clan> clans;

@SuppressWarnings("unchecked")
public ClanManager() {
Logger.getInstance().info("Loading clans....");
try {
clans = (HashMap<String, Clan>) XStreamUtil.getXStream().fromXML(new FileInputStream("data/clans.xml"));
} catch (Exception e) {
clans = new HashMap<String, Clan>();
}
for (Map.Entry<String, Clan> entries : clans.entrySet()) {
final Clan clan = entries.getValue();
clan.setTransient();
}
Logger.getInstance().info("Loaded " +clans.size()+ " clans.");
}

public Clan getClans(String s) {
return clans.get(Misc.formatPlayerNameForProtocol(s));
}
public Map<String, Clan> getClans() {
return clans;
}

public void createClan(Player p, String name) {
if (name.equals("") || name.length() < 0) {
return;
}
name = Misc.optimizeText(name);
String user = Misc.formatPlayerNameForProtocol(p.getUsername());
if (!clans.containsKey(user)) {
Clan clan = new Clan(user, name);
clans.put(Misc.formatPlayerNameForProtocol(p.getUs ername()), clan);
p.getActionSender().sendString(clan.getName(), 590, 32);
refresh(clan);
} else {
Clan clan = clans.get(user);
clan.setName(name);
p.getActionSender().sendString(clan.getName(), 590, 32);
refresh(clan);
}
}

public void joinClan(final Player p, final String user) {
p.getActionSender().sendMessage("Attempting to join channel...");
final Clan clan = clans.get(Misc.formatPlayerNameForProtocol(user));
if (clan == null) {
World.getWorld().registerEvent(new Event(500) {
@Override
public void execute() {
p.getActionSender().sendMessage("Then channel you tried to join does not exist.");
this.stop();
}
});
return;
}
World.getWorld().registerEvent(new Event(500) {
@Override
public void execute() {
if(clan.canJoin(p)) {
p.getSettings().setClanOwner(user);
clan.addMember(p);
refresh(clan);
p.getActionSender().sendConfig(1083, clan.isLootsharing() ? 1 : 0);
p.getActionSender().sendMessage("Now talking in the clan channel " +clan.getName());
p.getActionSender().sendMessage("To talk, start each line of chat with the / symbol.");
} else {
p.getActionSender().sendMessage("You don't have a high enough rank to join this channel.");
}
this.stop();
}
});
}
public void destroy(Player player, String username) {
Clan c = clans.get(Misc.formatPlayerNameForProtocol(usernam e));
if (c != null) {
for (Player p : c.getMembers()) {
if (p == null) {
continue;
}
ClanPacket.sendClanList(p, null);
}
}
clans.remove(username);
}
public void refresh(Clan clan) {
for (Player p : clan.getMembers()) {
if (p == null) {
continue;
}
ClanPacket.sendClanList(p, clan);
}
}
public void leaveClan(Player player) {
if (!player.getSettings().getClanOwner().equals("")) {
String name = Misc.formatPlayerNameForProtocol(player.getSetting s().getClanOwner());
Clan c = clans.get(name);
if(c != null) {
c.removeMember(player);
refresh(c);
ClanPacket.sendClanList(player, null);
}
}
player.getActionSender().sendConfig(1083, 0);
}
public void rankMember(Player player, String user, int rank) {
Clan c = clans.get(player.getUsername());
if (c == null) {
return;
}
c.rankUser(user, rank);
refresh(c);
}
public String getClanName(String user) {
Clan c = clans.get(user);
if (c == null) {
return "Chat disabled";
}
return c.getName();
}
public void sendClanMessage(Player player, String text) {
Clan c = clans.get(Misc.formatPlayerNameForProtocol(player. getSettings().getClanOwner()));
if (c == null) {
return;
}
for (Player pl : c.getMembers()) {
if (pl.getIndex() == player.getIndex()) {
continue;
}
ClanMessage.sendClanChatMessage(player, pl, c.getName(), c.getOwner(), text);
}
ClanMessage.sendClanChatMessage(player, null, c.getName(), c.getOwner(), text);
}

public void toggleLootshare(Player player) {
Clan c = clans.get(player.getUsername());
if(c != null) {
c.toggleLootshare();
} else {
player.getActionSender().sendMessage("You don't have a clan to active lootshare with.");
}
}
}


Clan.java


package com.rs2hd.content.clans;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.rs2hd.model.Player;
import com.rs2hd.util.Misc;
/**
* @author 'Mystic Flow
*/
public class Clan {

private String roomName;
private String roomOwner;
private int joinReq = 0;
private int talkReq = 0;
private int kickReq = 7;
private HashMap<String, Byte> ranks;
private transient List<Player> members;
private transient boolean lootsharing;

public Clan(String owner, String name) {
this.roomName = name;
this.roomOwner = owner;
setTransient();
}

public void setTransient() {
setLootsharing(false);
if(kickReq == 0) {
kickReq = 7;
}
if (members == null) {
this.members = new ArrayList<Player>();
}
if (ranks == null) {
this.ranks = new HashMap<String, Byte>();
}
}

public String getName() {
return roomName;
}
public String getOwner() {
return roomOwner;
}
public void rankUser(String name, int rank) {
if (!ranks.containsKey(name)) {
ranks.put(name, (byte) rank);
} else {
ranks.remove(name);
ranks.put(name, (byte) rank);
}
}

public Byte getRank(Player player) {
if (Misc.formatPlayerNameForProtocol(player.getUserna me()).equals(roomOwner)) {
return 7;
} else if (player.getRights() == 2) {
return 127;
} else if (ranks.containsKey(player.getUsername())) {
return ranks.get(player.getUsername());
}
return -1;
}

public boolean canJoin(Player player) {
byte rank = 0;
if(ranks.containsKey(player.getUsername())) {
rank = ranks.get(player.getUsername());
}
return rank >= joinReq;
}

public boolean canTalk(Player player) {
byte rank = 0;
if(ranks.containsKey(player.getUsername())) {
rank = ranks.get(player.getUsername());
}
return rank >= talkReq;
}

public void toggleLootshare() {
lootsharing = !lootsharing;
String message = "";
if(lootsharing) {
message = "Lootshare has been enabled.";
} else {
message = "Lootshare has been disabled.";
}
for(Player pl : members) {
pl.getActionSender().sendMessage(message);
pl.getActionSender().sendConfig(1083, lootsharing ? 1 : 0);
}
}
public void addMember(Player member) {
members.add(member);
}

public void setName(String name) {
this.roomName = name;
}

public List<Player> getMembers() {
return members;
}

public void removeMember(Player player) {
members.remove(player);
}

public HashMap<String, Byte> getRanks() {
return ranks;
}

public void setLootsharing(boolean lootsharing) {
this.lootsharing = lootsharing;
}

public boolean isLootsharing() {
return lootsharing;
}

public void setTalkReq(int talkReq) {
this.talkReq = talkReq;
}

public int getTalkReq() {
return talkReq;
}

public void setJoinReq(int joinReq) {
this.joinReq = joinReq;
}

public int getJoinReq() {
return joinReq;
}

public int getKickReq() {
return kickReq;
}
}


ClanPacket.java


package com.rs2hd.content.clans;

import com.rs2hd.model.Player;
import com.rs2hd.net.Packet.Size;
import com.rs2hd.packetbuilder.StaticPacketBuilder;
import com.rs2hd.util.Misc;
/**
* @author 'Mystic Flow
*/
public class ClanPacket {
public static void sendClanList(Player p, Clan clan) {
StaticPacketBuilder spb = new StaticPacketBuilder().setId(91).setSize(Size.Varia bleShort);
if (clan != null) {
spb.addString(Misc.upper2(clan.getOwner()).replace All("_", " ").trim());
spb.addByte((byte) 0);
spb.addLong(Misc.stringToLong(clan.getName()));
spb.addByte((byte) clan.getKickReq());
spb.addByte((byte) clan.getMembers().size());
for (Player pl : clan.getMembers()) {
spb.addByte((byte) 1);
spb.addString(Misc.upper2(pl.getUsername().replace All("_", " ").trim()));
spb.addShort(1);
spb.addByte((byte) 0);
spb.addByte(clan.getRank(pl));
spb.addString("Noszscape");
}
}
p.getSession().write(spb.toPacket());
}
}


ClanPacket.java


package com.rs2hd.content.clans;

import com.rs2hd.model.Player;
import com.rs2hd.net.Packet.Size;
import com.rs2hd.packetbuilder.StaticPacketBuilder;
import com.rs2hd.util.Misc;
/**
* @author 'Mystic Flow
*/
public class ClanPacket {
public static void sendClanList(Player p, Clan clan) {
StaticPacketBuilder spb = new StaticPacketBuilder().setId(91).setSize(Size.Varia bleShort);
if (clan != null) {
spb.addString(Misc.upper2(clan.getOwner()).replace All("_", " ").trim());
spb.addByte((byte) 0);
spb.addLong(Misc.stringToLong(clan.getName()));
spb.addByte((byte) clan.getKickReq());
spb.addByte((byte) clan.getMembers().size());
for (Player pl : clan.getMembers()) {
spb.addByte((byte) 1);
spb.addString(Misc.upper2(pl.getUsername().replace All("_", " ").trim()));
spb.addShort(1);
spb.addByte((byte) 0);
spb.addByte(clan.getRank(pl));
spb.addString("Noszscape");
}
}
p.getSession().write(spb.toPacket());
}
}


ClanMessage.java


package com.rs2hd.content.clans;

import com.rs2hd.model.Player;
import com.rs2hd.net.Packet.Size;
import com.rs2hd.packetbuilder.StaticPacketBuilder;
import com.rs2hd.util.Misc;
/**
* @author 'Mystic Flow
*/
public class ClanMessage {

public static int messageCounter = 1;
public static int id = 0;
// public static void sendClanChatMessage(Player from, Player pl, String roomName, String user, String message) {
// int messageCounter = getNextUniqueId();
// StaticPacketBuilder spb = new StaticPacketBuilder().setId(75).setSize(Size.Varia bleByte);
// spb.addByte((byte) 0);
// spb.addString(Misc.upper2(from.getUsername()).repl aceAll("_", " ").trim());
// spb.addLong(Misc.stringToLong(roomName));
// spb.addShort(Misc.random(0xffff));
// byte[] bytes = new byte[message.length() + 1];
// bytes[0] = (byte) message.length();
// Misc.encryptPlayerChat(bytes, 0, 1, message.length(), message.getBytes());
// spb.addBytes(new byte[]{(byte) ((messageCounter << 16) & 0xFF), (byte) ((messageCounter << 8) & 0xFF), (byte) (messageCounter & 0xFF)});
// spb.addByte((byte) from.getRights());
// spb.addShort(1);
// spb.addByte((byte) 0);
// spb.addBytes(bytes);
// if (pl != null)
// pl.getSession().write(spb.toPacket());
// else
// from.getSession().write(spb.toPacket());
// }
public static void sendClanChatMessage(Player from, Player pl, String roomName, String user, String message) {
int messageCounter = getNextUniqueId();
StaticPacketBuilder spb = new StaticPacketBuilder().setId(137).setSize(Size.Vari ableByte);
spb.addByte((byte) 0);
spb.addString(Misc.upper2(from.getUsername()).repl aceAll("_", " ").trim());
spb.addLong(Misc.stringToLong(roomName));
spb.addShort(Misc.random(0xffff));
byte[] bytes = new byte[256];
bytes[0] = (byte) message.length();
int len = Misc.encryptPlayerChat(bytes, 0, 1, message.length(), message.getBytes())+1;
spb.addBytes(new byte[]{(byte) ((messageCounter << 16) & 0xFF), (byte) ((messageCounter << 8) & 0xFF), (byte) (messageCounter & 0xFF)});
spb.addByte((byte) from.getRights());
spb.addBytes(bytes, 0, len);
if (pl != null)
pl.getSession().write(spb.toPacket());
else
from.getSession().write(spb.toPacket());
}



public static int getNextUniqueId() {
if (messageCounter >= 16000000) {
messageCounter = 0;
}
return messageCounter++;
}
}


ClanSave.java




package com.rs2hd.content.clans;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import com.rs2hd.event.Event;
import com.rs2hd.model.World;
import com.rs2hd.util.XStreamUtil;
import com.thoughtworks.xstream.XStream;
/**
* @author 'Mystic Flow
*/
public class ClanSave extends Event {
/**
* Save every 60 seconds..
*/
private final static int SAVE_TIME = 60000;

private XStream save = XStreamUtil.getXStream();

public ClanSave() {
super(SAVE_TIME);
}


@Override
public void execute() {
World.getWorld().getEngine().getWorkerThread().sub mit(new Runnable() {
public void run() {
try {
save.toXML(World.getWorld().getClanManager().getCl ans(), new FileOutputStream("data/clans.xml"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
});
}

}


Now in World.java add this where the global event's are registered



submit(new ClanSave());


You need to remember to import!

Add this in com\rs2hd\packethandler\



package com.rs2hd.packethandler;

import com.rs2hd.model.Player;
import com.rs2hd.model.World;
import com.rs2hd.net.Packet;
import com.rs2hd.util.Misc;
/**
*
* @author 'Mystic Flow
*/
public class ClanPacketHandler implements PacketHandler {

@Override
public void handlePacket(Player player, Packet packet) {
switch (packet.getId()) {
case 36: //Clan joining
String owner = "";
if(packet.remaining() > 0) {
owner = packet.readRS2String();
}
if (owner.length() > 0) {
World.getWorld().getClanManager().joinClan(player, owner);
} else {
World.getWorld().getClanManager().leaveClan(player );
player.getSettings().setClanOwner("");
}
break;
case 47://Ranking
String name = Misc.formatPlayerNameForProtocol(packet.readRS2Str ing());
final int rank = packet.readByteA();
World.getWorld().getClanManager().rankMember(playe r, name, rank);
break;
}
}

}


Go back to World.java and add this.

imports


import com.rs2hd.content.clans.*;

Now declare this


/**
* Our clan manager.
*/
private ClanManager clanManager;

under the construction (public World())


clanManager = new ClanManager();

Under the unregister method (unregister(Player p) {)


clanManager.leaveClan(p);

Then add this getter


public ClanManager getClanManager() {
return clanManager;
}

Go to Constants.java look for the static constructor and place this under the loop that resets sizes


PACKET_LENGTHS[36] = -1; // Join clan chat
PACKET_LENGTHS[47] = -1;//Clan
PACKET_LENGTHS[49] = 1;//Clan

In InputHandler.java add this


case 0: //enter clan name
String clan = string.replaceAll("_", " ");
p.getActionSender().sendString(Misc.checkString(cl an), 590, 22);
World.getWorld().getClanManager().createClan(p, clan);
break;
}


Make sure you have this method in Misc.java


public static String checkString(String l) {
char s[] = l.toCharArray();
int count = 0;
for (int i = 0; i < s.length; i++) {
char c = s[i];
if(c == '_') {
s[i] = ' ';
c = s[i];
}
if(count == 0) {
s[i] -= 0x20;
count = 1;
}
if (c == '.' || c == '!' || c == '?' || c == ' ') {
s[i+1] -= 0x20;
}
}
return new String(s, 0, s.length);
}

Make sure this is in PacketHandlers.java


ClanPacketHandler cc = new ClanPacketHandler();
handlers[47] = cc;
handlers[36] = cc;



In ActionButtonPacketHandler.java


case 589:
if (buttonId == 9) {
player.getActionSender().sendInterface(590);
player.getActionSender().sendString(World.getWorld ().getClanManager().getClanName(player.getUsername ()), 590, 22);
}
if(buttonId == 14) {
World.getWorld().getClanManager().toggleLootshare( player);
}
break;
case 590:
if (buttonId == 22) {
switch(packet.getId()) {
case 216:
player.getInputHandler().requestStringInput(player , 0, "Enter clan prefix:");
break;
case 19:
player.getActionSender().sendString("Chat disabled" , 590, 22);
break;
}
}
break;

Now add/replace this in NPC.java in the npcDied method


Clan clan = World.getWorld().getClanManager().getClans(p.getSe ttings().getClanOwner());
if(p.getEquipment().get(Equipment.SLOT_RING) != null) {
/*if (p.getEquipment().get(Equipment.SLOT_RING).getId() == 2572) {
int wealth = Misc.random(100);
if(wealth <= 60) {
wealthInc = true;
}
}
}*/
if(clan != null && clan.isLootsharing()) {
wealthInc = false;
}
//if(wealthInc) {
// ifDrop -= 3;
//}
if (ifDrop <= chance) {
World.getWorld().getItemManager().createDropGround Item(getLooter(p, item, amount, clan, getLocation()), this.getLocation(), dropId(item, amount));
npccanloot = false;
giveDrop = 0;
}

public Player getLooter(Player player, int id, int amount, Clan clan, Location location) {
Player done = player;
if(clan != null) {
if(clan.isLootsharing()) {
List<Player> playersGetLoot = new LinkedList<Player>();
int best = 0;
for(Player pl : clan.getMembers()) {
if(location.withinDistance(pl.getLocation(), 16)) {
if(!killerHits.containsKey(pl.getUsername())) {
continue;
}
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
if(damage > best) {
playersGetLoot.add(pl);
best = damage;
} else {
if(Misc.random(2) == 1) {
playersGetLoot.add(pl);
}
}
pl.getSettings().incChances();
if(pl.getSettings().getChances() < 0) {
pl.getSettings().setChances(0);
}
}
}
for(Player pl : playersGetLoot) {
if(Misc.random(2) == 1) {
done = pl;
for(int i = 0; i < 5; i++) {
pl.getSettings().decChances();
}
break;
}
}
}
}
if(clan != null && clan.isLootsharing()) {
done.getActionSender().sendMessage("<col=009900>You received: " + amount + " " + ItemDefinition.forId(id).getName());
for(final Player pl : clan.getMembers()) {
if(pl.getIndex() == done.getIndex()) {
continue;
}
if(location.withinDistance(pl.getLocation(), 16)) {
pl.getActionSender().sendMessage(done.getUsername( ) + " received: " + amount + " " + ItemDefinition.forId(id).getName());
World.getWorld().registerEvent(new Event(3000) {
public void execute() {
pl.getActionSender().sendMessage("Your chance of receiving loot has improved.");
this.stop();
}
});
}
}
}
return done;
}


Don't forget to import..

Add this in Settings.java


private transient String clanOwner;
private transient int chances;

public void setClanOwner(String owner) {
this.clanOwner = owner;
this.chances = 0;
}
public String getClanOwner() {
if(clanOwner == null) {
clanOwner = "";
}
return Misc.formatPlayerNameForProtocol(clanOwner);
}

public void incChances() {
chances++;
}

public void decChances() {
chances--;
}

public int getChances() {
return chances;
}

public void setChances(int i) {
this.chances = i;
}


And you're done, I will not be helping with errors, you might need a few things but ehh.

Steve
November 27th, 2010, 00:40
Not sure if battlezone has this, but u know he isn't gonna be happy. Good job.

Mystic Flow
November 27th, 2010, 00:41
Not sure if battlezone has this, but u know he isn't gonna be happy. Good job.

I was supposed to program it for him but I only did bank tabs for him =P

Cart
November 27th, 2010, 00:41
Not sure if battlezone has this, but u know he isn't gonna be happy. Good job.

inb4 Thread dedicated to Mystic?

Nice job, "Steven".

I was supposed to program it for him but I only did bank tabs for him =P

Inb4 Mystic sucks because he released stuff, and fucked up 562's.

Redcen1
November 27th, 2010, 00:41
Good Job.

Steve
November 27th, 2010, 00:42
I was supposed to program it for him but I only did bank tabs for him =P

You did bank tabs for him?

Mystic Flow
November 27th, 2010, 00:42
You did bank tabs for him?

Yeah, he payed me $110 :P

Steve
November 27th, 2010, 00:43
Yeah, he payed me $110 :P

Oh wow, $110... he said he did it. Didn't he try to buy a webclient from you too? I thought i heard that somewhere.

Mystic Flow
November 27th, 2010, 00:44
Oh wow, $110... he said he did it. Didn't he try to buy a webclient from you too? I thought i heard that somewhere.

He only wanted Clan chat and Bank tabs for $220, I only did bank tabs

Steve
November 27th, 2010, 00:45
He only wanted Clan chat and Bank tabs for $220, I only did bank tabs

That's ridiculous... That's why he's so mad, he wasted $110 lol.

Mystic Flow
November 27th, 2010, 00:47
That's ridiculous... That's why he's so mad, he wasted $110 lol.

Only the registered members can see the link.
Only the registered members can see the link.

Pretty much says it all :P

alboboy94
November 27th, 2010, 02:57
I was supposed to program it for him but I only did bank tabs for him =P

loollool you did it for him??

he was saying that the only people who can do bank tabs were him dkk and caelum :o

vanweele
November 27th, 2010, 04:22
i cannot figure this out...i've tried..
im using emberscape, there's shit in there already but yeah it's all mixed up. o.o

battlezone
November 27th, 2010, 04:23
lol i didnt pay you for tabs you cant even do tabs. well mabey you can.
i payed you $60 for clan chat and you scammed me kid. you never did shit for me.
i got all the videos of msm of you scamming me idk why i still have them but i do.

also i doubt this is the real mystic flow

battlezone
November 27th, 2010, 04:29
I was supposed to program it for him but I only did bank tabs for him =P

see you didnt do shit for me? wtf. you scammed me and now are lieing.

vanweele
November 27th, 2010, 04:35
lol i didnt pay you for tabs you cant even do tabs. well mabey you can.
i payed you $60 for clan chat and you scammed me kid. you never did shit for me.
i got all the videos of msm of you scamming me idk why i still have them but i do.

also i doubt this is the real mystic flow

yeah he also released this on the other forums but deal with it, shouldnt pay for codes, and 60 dollars for clan chat or whatever lmfao!
there was a clan chat base in snippets that works almost 100%...well it's decent you could do the work, stop flaming you flamed emily about tabs and now him, not our fualt you payed for some java codes.
l2leech atleast.

Emily
November 27th, 2010, 04:48
lol i didnt pay you for tabs you cant even do tabs. well mabey you can.
i payed you $60 for clan chat and you scammed me kid. you never did shit for me.
i got all the videos of msm of you scamming me idk why i still have them but i do.

also i doubt this is the real mystic flow

Its the real Mystic flow lol

vanweele
November 27th, 2010, 04:58
still cant figure out this guide putting it in emberscape.. doesnt make sence. :P

battlezone
November 27th, 2010, 04:59
Its the real Mystic flow lol

thats make its even worse. thats kid a 12 year old. hes a total fagget he scammed me for $60 bucks for no reason. then he says he scams me for $110 trying to act cool and says he did my bank tabs. its fucking bull shit

battlezone
November 27th, 2010, 05:01
yeah he also released this on the other forums but deal with it, shouldnt pay for codes, and 60 dollars for clan chat or whatever lmfao!
there was a clan chat base in snippets that works almost 100%...well it's decent you could do the work, stop flaming you flamed emily about tabs and now him, not our fualt you payed for some java codes.
l2leech atleast.

do you even know what your talking about? and l2leech? dont call me a leecher you cant code for shit. once agian im mad because he scammed me for $60 and said it was $110 and he did my tabs witch is bs.

and i got a good clan chat i wanted the lootshare he made dumb ass


still cant figure out this guide putting it in emberscape.. doesnt make sence. :P

and you tell me to l2leech? a 9 year old could put this in a server your truley are a dumb ass

Emily
November 27th, 2010, 05:01
thats make its even worse. thats kid a 12 year old. hes a total fagget he scammed me for $60 bucks for no reason. then he says he scams me for $110 trying to act cool and says he did my bank tabs. its fucking bull shit

He's 15 lol... and never pay for codes or anything over the internet, with people you don't know...

alboboy94
November 27th, 2010, 05:09
do you even know what your talking about? and l2leech? dont call me a leecher you cant code for shit. once agian im mad because he scammed me for $60 and said it was $110 and he did my tabs witch is bs.

and i got a good clan chat i wanted the lootshare he made dumb ass



and you tell me to l2leech? a 9 year old could put this in a server your truley are a dumb ass

yumad?

[I'm]_[Not]_[Caelum]
November 27th, 2010, 05:13
lol i didnt pay you for tabs you cant even do tabs. well mabey you can.
i payed you $60 for clan chat and you scammed me kid. you never did shit for me.
i got all the videos of msm of you scamming me idk why i still have them but i do.

also i doubt this is the real mystic flow

guess what you just received your clan chat.

tedhead2
November 27th, 2010, 05:39
@battlezone:

umadbro?

Half of your server is a leech -.-

Thanks mystic, i'm add this to my server.

vanweele
November 27th, 2010, 05:49
do you even know what your talking about? and l2leech? dont call me a leecher you cant code for shit. once agian im mad because he scammed me for $60 and said it was $110 and he did my tabs witch is bs.

and i got a good clan chat i wanted the lootshare he made dumb ass



and you tell me to l2leech? a 9 year old could put this in a server your truley are a dumb ass

for one i was suggesting you to learn how to leach, so thats minus one on you for not being a dumbass. (y)
for anotherthing a 9 year old knows better now to buy some crappy code that you'l leventaully get for free
another thing is "your trueley are a dumb ass" does not even make since. so who's 9 now.
another thing is you say he's 12 and your crying over something that he released.
and if you wanted lootshare how come you couldnt get it if a 9 year old can do it?
just wondering, dont get too mad..

battlezone
November 27th, 2010, 05:56
@battlezone:

umadbro?

Half of your server is a leech -.-

Thanks mystic, i'm add this to my server.

almost none of my server is leeched bro i started from a blank.


and yes im mad. everyone with a 562 that can code should be mad that there complety fucked.

battlezone
November 27th, 2010, 05:56
for one i was suggesting you to learn how to leach, so thats minus one on you for not being a dumbass. (y)
for anotherthing a 9 year old knows better now to buy some crappy code that you'l leventaully get for free
another thing is "your trueley are a dumb ass" does not even make since. so who's 9 now.
another thing is you say he's 12 and your crying over something that he released.
and if you wanted lootshare how come you couldnt get it if a 9 year old can do it?
just wondering, dont get too mad..

i said a 9 year old could use this tut and put it in a server.

sorry if im getting mad at everyone im just pissed at mystic and the fact 562s are fucked

battlezone
November 27th, 2010, 05:57
He's 15 lol... and never pay for codes or anything over the internet, with people you don't know...

i did know mystic a bit and he did alot of my good friend.

vanweele
November 27th, 2010, 05:57
almost none of my server is leeched bro i started from a blank.


and yes im mad. everyone with a 562 that can code should be mad that there complety fucked.

everyones fine.
your just PMSING
we all unserstand
no worrries, if anything your ****ed
your the one that paid for stuff.

alboboy94
November 27th, 2010, 05:59
its funny now cuz ur server is just as regular as a begginer's server lololololololol

vanweele
November 27th, 2010, 06:00
its funny now cuz ur server is just as regular as a begginer's server lololololololol

whats funnier is he basicly paid 60 dollars for a blank source.

alboboy94
November 27th, 2010, 06:01
also just let it go your gaining the rep as the retard of rsps.

vanweele
November 27th, 2010, 06:03
also just let it go your gaining the rep as the retard of rsps.

i thought i was bad at rsps.
but i see this guy, and i've only been learning java for about 2-3 weeks.and i have 5x what he has.

battlezone
November 27th, 2010, 06:10
its funny now cuz ur server is just as regular as a begginer's server lololololololol

who me? lol you kidding thats funny. any of the sources released i got atleast 100 more bosses full skills and training. fixed combat and clicking. fixed login null connections per ip. and alot more.

none of the sources are anything like mine. noszscape would have been beter but he ripped it so no biggie\



whats funnier is he basicly paid 60 dollars for a blank source.

are you on crack i payed $60 for lootshare 4 months ago.
and ive been coding for a year. i didnt pay for a source? man what are on
and youve been coding 2-3 weeks and you cant even copy+paste something in your source thats sad.


i think your jelous because i started with a blank source and acauly made my server. unlike you i didnt leech emberscape

vanweele
November 27th, 2010, 06:15
who me? lol you kidding thats funny. any of the sources released i got atleast 100 more bosses full skills and training. fixed combat and clicking. fixed login null connections per ip. and alot more.

none of the sources are anything like mine. noszscape would have been beter but he ripped it so no biggie\




are you on crack i payed $60 for lootshare 4 months ago.
and ive been coding for a year. i didnt pay for a source? man what are on
and youve been coding 2-3 weeks and you cant even copy+paste something in your source thats sad.


i think your jelous because i started with a blank source and acauly made my server. unlike you i didnt leech emberscape

well you thought wrong cause im by far jealoius of anything you own lmfao,
for one i can copy and paste and another thing is how are you calling me a leecher but then on the other hand sayng i cant copy and paste, make up your mind..
whats so good about yours? release it if it's so good, if your such a good coder show us, my source has login null, 1 click npc, 1 click player from distance and a lot of other things?
whats so diffrentt about your $60 beginner source.

Steve
November 27th, 2010, 06:17
battlezone wtf is wrong with you. It's a private server. And you probably DID pay him, and now your pissed that you wasted all that money.

battlezone
November 27th, 2010, 06:19
well you thought wrong cause im by far jealoius of anything you own lmfao,
for one i can copy and paste and another thing is how are you calling me a leecher but then on the other hand sayng i cant copy and paste, make up your mind..
whats so good about yours? release it if it's so good, if your such a good coder show us, my source has login null, 1 click npc, 1 click player from distance and a lot of other things?
whats so diffrentt about your $60 beginner source.

there agian with the $60 beginner source? what a re you on.

the blank source was free and it was over a year ago. and my server has so much more than any others. if it didnt why would i have so many players. and you dont have the login null fixed dont bs me.

1 click npc player is easy + you coded none of it at all.

battlezone
November 27th, 2010, 06:20
battlezone wtf is wrong with you. It's a private server. And you probably DID pay him, and now your pissed that you wasted all that money.

idk im mad 562s are ruined. and yes i payed him $60 for loot share and he scammed me.

im mad because this kid is calling me a leecher also when i made my source from a blank and started with emberscape that pisses me.

but idk why im mad really. im done fighting. if this kid wants to think im a leecher its w.e i gusse. im still confused why hes saying $60 for a beginner source thought

vanweele
November 27th, 2010, 06:21
idk im mad 562s are ruined. and yes i payed him $60 for loot share and he scammed me.

im mad because this kid is calling me a leecher also when i made my source from a blank and started with emberscape that pisses me.

but idk why im mad really. im done fighting. if this kid wants to think im a leecher its w.e i gusse. im still confused why hes saying $60 for a beginner source thought

i said basicly you paid for a source, nothings special about your source from any 562, most people have 5x what you have and paid nothing..so stfu and stop telling me 9 times what you mean and why your mad cause i already know, mater of fact whole rune locus knows okay kid?
now hush, no one cares about your issue, no ones gunna feel bad and give you 60 dollars, face it, it's released, if you'd read what i said about 4 times about 'you basicly paid..'
you'd understand, stop asking what im on, your the one most likely on anti depressents or aderall.

battlezone
November 27th, 2010, 06:23
i said basicly you paid for a source, nothings special about your source from any 562, most people have 5x what you have and paid nothing..

how did i pay for my source? i did it all my self. and as i said i payed $60 once and i got scammed. wtf are you talking about agian.

anyways im done fighting

alboboy94
November 27th, 2010, 06:23
just stop....... no point on this argument. go flirt with hutch or sumthing he's looking for a gay buttbuddy.

Steve
November 27th, 2010, 06:25
just stop....... no point on this argument. go flirt with hutch or sumthing he's looking for a gay buttbuddy.

Then I'm his man :troll:

vanweele
November 27th, 2010, 06:27
your retarded.
let me break it down.
you had a blank source..you coded it you say. that was $0.00 USD...<---coded pretty basic stuff, most 562's have, if you look around at 562's. you paid $60 for clanchat things, that was released for $0.00 USD.. so far you've spend 60 dollars, and i've spent none and have clanchat stuff, banktabs, following and a lot more other things, price = $0.00 time = 2 weeks, you say you've coded for a while, nothings special about your source pretty much maybe to you cause you say you coded it but if you released it it's just some other 562 to other people.

solutionx
November 27th, 2010, 06:27
battlezone has a good point but stop fighting everyone

solutionx
November 27th, 2010, 06:28
your retarded.
let me break it down.
you had a blank source..you coded it you say. that was $0.00 USD...<---coded pretty basic stuff, most 562's have, if you look around at 562's. you paid $60 for clanchat things, that was released for $0.00 USD.. so far you've spend 60 dollars, and i've spent none and have clanchat stuff, banktabs, following and a lot more other things, price = $0.00 time = 2 weeks, you say you've coded for a while, nothings special about your source pretty much maybe to you cause you say you coded it but if you released it it's just some other 562 to other people.

your dumb :troll: have you not read any of his messages. it was lootshare and he got scammed, and his server is really good dont hate if you have never played it

battlezone
November 27th, 2010, 06:28
your retarded.
let me break it down.
you had a blank source..you coded it you say. that was $0.00 USD...<---coded pretty basic stuff, most 562's have, if you look around at 562's. you paid $60 for clanchat things, that was released for $0.00 USD.. so far you've spend 60 dollars, and i've spent none and have clanchat stuff, banktabs, following and a lot more other things, price = $0.00 time = 2 weeks, you say you've coded for a while, nothings special about your source pretty much maybe to you cause you say you coded it but if you released it it's just some other 562 to other people.

wtf can you not read?

battlezone
November 27th, 2010, 06:33
your dumb :troll: have you not read any of his messages. it was lootshare and he got scammed, and his server is really good dont hate if you have never played it

thx for the support. cool sig howd you get it?

tedhead2
November 27th, 2010, 06:44
@battlezone:

Dude, What are YOU on?

Face it, you wasted money. You're server is nothing special. *pokes emberscape* that was x6 better then yours.

vanweele
November 27th, 2010, 06:48
@battlezone:

Dude, What are YOU on?

Face it, you wasted money. You're server is nothing special. *pokes emberscape* that was x6 better then yours.

^^^^
winnn
;D
anyways this guys ragefanatic lmfao.im done argueing with him, just happy theres a tut for this

Sunni
November 27th, 2010, 07:00
thats make its even worse. thats kid a 12 year old. hes a total fagget he scammed me for $60 bucks for no reason. then he says he scams me for $110 trying to act cool and says he did my bank tabs. its fucking bull shit

I hate to tell you, but you sound like your ten years because your immature. Also fagget, is faggot.

[I'm]_[Not]_[Caelum]
November 27th, 2010, 07:31
idk im mad 562s are ruined. and yes i payed him $60 for loot share and he scammed me.

im mad because this kid is calling me a leecher also when i made my source from a blank and started with emberscape that pisses me.

but idk why im mad really. im done fighting. if this kid wants to think im a leecher its w.e i gusse. im still confused why hes saying $60 for a beginner source thought

your server is shit for a years work

[I'm]_[Not]_[Caelum]
November 27th, 2010, 07:33
wtf can you not read?

grow up, theres no place for someone like you in this community, im glad you read this, now we wont have any problems son.

Monsta
November 27th, 2010, 07:50
^^^^
winnn
;D
anyways this guys ragefanatic lmfao.im done argueing with him, just happy theres a tut for this
Please stfu you look 9 and you have been coding for 2-3 weeks and you already think your untouchable and your not even making sense so please stfu there is no point of you posting if you don't even know whats going on.

Monsta
November 27th, 2010, 07:51
_[Not]_[Caelum];174988"]grow up, theres no place for someone like you in this community, im glad you read this, now we wont have any problems son.

Agreed..

apache ah64
November 27th, 2010, 11:03
lollllllllllllllllllllllllllllllllllllllllll

Mystic Flow
November 27th, 2010, 15:50
I did do the bank tabs for you battlescape kid :fp:, Here's the money you sent me for bank tabs..

Only the registered members can see the link.

apache ah64
November 27th, 2010, 16:15
omfg you did get that? bank tabs are so easy :S

tedhead2
November 27th, 2010, 19:32
omfg you did get that? bank tabs are so easy :S

^^^^

Win.

battlezone is to stupid/lazy to do it himself. he can only leeechh.

Acrylix
November 28th, 2010, 10:14
omfg you did get that? bank tabs are so easy :S
Duh theres a tut dumbarse

got some errors idk how to copy cmd on win 7

Only the registered members can see the link.

zant
November 28th, 2010, 14:44
omfg fuck this i get errors for evry file :@ and all about stupid imports and idk what i need to import shit tut

It is so easy you idiot look at the errors google it lolol

apache ah64
November 28th, 2010, 14:58
zant i got errors on evry page but dont worry ik you will scream becuz all you got is coded by me.... leecher :)

zant
November 28th, 2010, 14:59
lol no i never lecched idiot lol you need tut's i code you don't know what a public void is? please get a life.....

apache ah64
November 28th, 2010, 15:01
zant you dont know it but if we gonna flame eache other come do it on msn and not here?

zant
November 28th, 2010, 15:04
ugh you just log off idiot

apache ah64
November 28th, 2010, 15:05
know becuz i dont like it to flame eache other 24/7 but i only want to say your are a cock sucking fagg that like it to fuck wombat

zant
November 28th, 2010, 15:07
l0l your still mad at wombat for droping your 750mil?? i did that shit you idiot l0l i droped his 750mil on rs for getting my account locked

Kurdz
December 4th, 2010, 11:10
l0l your still mad at wombat for droping your 750mil?? i did that shit you idiot l0l i droped his 750mil on rs for getting my account locked

dude apache's a leacher no1 likes him, he thinks he was the first to discover runescape theme lawl...

apache ah64
December 4th, 2010, 11:12
that site is by me... chris did ask me to make that for project-ecko uhhh...

zant
December 5th, 2010, 02:12
u fucking lier i made that site

Acrylix
December 5th, 2010, 02:15
What site are you talking about?

zant
December 5th, 2010, 02:18
project-ecko.tkoscape.info i maded that site and he used WinHTTrack to leech it and change to his credits and hes rs site the email forums are mine

Acrylix
December 5th, 2010, 06:27
Well your both douches because physx made that...

apache ah64
December 5th, 2010, 19:19
zant you needed to read hes post before he changed it becuz i crashed project-ecko >.< becuz there are only noob staff and no its not your site but why did you leeche it then from my ftp? what is WinHTTrack? ik you used it on my site but what is it >.<

Stacx
December 5th, 2010, 19:35
do you even know what your talking about? and l2leech? dont call me a leecher you cant code for shit. once agian im mad because he scammed me for $60 and said it was $110 and he did my tabs witch is bs.

and i got a good clan chat i wanted the lootshare he made dumb ass



and you tell me to l2leech? a 9 year old could put this in a server your truley are a dumb ass

Despite the fact that you can't spell correctly, you tell us that we're kids. ._. no logic behind that imo

yaminub
January 22nd, 2011, 00:16
"Then add this getter"
Where is this, lol.

vanweele
January 22nd, 2011, 00:31
world.java

yaminub
January 22nd, 2011, 00:56
yeah... i figured that out...
I got one problem, no errors though. What do i put in chatpackethandler so i can talk in cc?

Cactaur
January 22nd, 2011, 01:08
Well this thread was EIGHT PAGES OF PURE PPPPPMMMSSINNNGGGG!!!!
just chill out its a rsps.

@Topic, Nicely done Ima try this later :D.

ipwnnubz123
February 22nd, 2011, 14:58
Compiling core...
src\com\rs2hd\model\World.java:166: cannot find symbol
symbol : method submit(com.rs2hd.content.clans.ClanSave)
location: class com.rs2hd.model.World
submit(new ClanSave());
^
src\com\rs2hd\model\NPC.java:119: cannot find symbol
symbol : variable ifDrop
location: class com.rs2hd.model.NPC
ifDrop -
= 3;
^
src\com\rs2hd\model\NPC.java:121: cannot find symbol
symbol : variable ifDrop
location: class com.rs2hd.model.NPC
if (ifDrop <= ch
ance) {
^
src\com\rs2hd\model\NPC.java:154: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.ge
tUsername())) {
^
src\com\rs2hd\model\NPC.java:157: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.g
etUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:157: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.g
etUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:157: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.g
etUsername()) + pl.getSettings().getChances();

^
src\com\rs2hd\model\Settings.java:23: cannot find symbol
symbol : variable Misc
location: class com.rs2hd.model.Settings
return Misc.formatPlayerNameForProtocol(clanOwner);
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method getEngine()
location: class com.rs2hd.model.World
World.getWorld().getEngine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
Compiling loginserver...




what did i do wrong? O.o

Pot Up
February 22nd, 2011, 15:01
And you're done, I will not be helping with errors, you might need a few things but ehh.
.......

Intensive Tony
February 22nd, 2011, 16:40
Got this:


Preparing...
Compiling Core...
src\com\rs2hd\model\World.java:73: <identifier> expected
clanManager = new Clanmanager();
^
src\com\rs2hd\model\World.java:73: cannot find symbol
symbol : class clanManager
location: class com.rs2hd.model.World
clanManager = new Clanmanager();
^
src\com\rs2hd\packethandler\PacketHandler.java:11: class ClanPacketHandler is pu
blic, should be declared in a file named ClanPacketHandler.java
public class ClanPacketHandler implements PacketHandler {
^
src\com\rs2hd\packethandler\WalkPacketHandler.java :15: cannot access com.rs2hd.p
ackethandler.PacketHandler
bad class file: src\com\rs2hd\packethandler\PacketHandler.java
file does not contain class com.rs2hd.packethandler.PacketHandler
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
public class WalkPacketHandler implements PacketHandler {
^

ipwnnubz123
February 22nd, 2011, 19:50
package com.rs2hd.model;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Random;
import java.util.HashMap;
import java.util.*;
import com.rs2hd.event.Event;
import com.rs2hd.model.NPCDrop.Drop;
import com.rs2hd.GameEngine;
import com.rs2hd.content.Combat.CombatType;
import com.rs2hd.content.DeathEvent;
import com.rs2hd.content.clans.Clan;
import com.rs2hd.model.Hits.Hit;
import com.rs2hd.util.Misc;
import com.rs2hd.io.XStreamPlayerLoader;

/**
* Represents a 'non-player' character in the game.
* @author Graham
*
*/
public class NPC extends Entity {
public int giveDrop = 0;
private transient boolean IsFamiliar = false;
public transient int AttackStyle = 0;
public transient int NPCCharges = 0;
public transient boolean UsingThis = false;
public transient int NPCDamage[] = new int[14];
public transient boolean npccanloot=false;
private transient NpcWalk NpcWalk;
public Item dropId(int id, int amt) {
return new Item(id, amt);
}
public void resetNpcDef() {
AttackStyle = 0;
NPCCharges = 0;
UsingThis = false;
NPCDamage = new int[14];
if (this.getId() == 8324) {
NPCCharges = 20;
}
}
public void npcDiedBones(Player p, int npcID) {
switch(npcID) {
case 115:
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(532, 1));
giveDrop = 0;
break;
case 50:
case 941:
if(getId() == 941) {
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(1753, 1));
giveDrop = 0;
}else{
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(1747, 1));
giveDrop = 0;
}
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(536, 1));
giveDrop = 0;
break;
default:
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(6729, 1));
giveDrop = 0;
break;
}
}
public void npcDied(Player p, int npcID) {
Random rand = new Random();
try {
BufferedReader in = new BufferedReader(new FileReader("data/npcdrops.cfg"));
String input;
int on = 0;
String[] splitEQL;
String[] splitCOM;
String[] splitDSH;
String[] splitCLN;
String[] splitSCL;
while ((input = in.readLine()) != null) {
splitEQL = null; splitEQL = null; splitDSH = null; splitCLN = null; splitSCL = null;
if (!input.startsWith("/") && input.contains("=") && input.contains(",") && input.contains("-") && input.contains(":")) {
try {
splitEQL = input.split("=");
if (Integer.parseInt(splitEQL[0]) == npcID) {
splitSCL = splitEQL[1].split(";");
int Wealth=0;
/*if (p.getEquipment().get(12).getDefinition().getId() == 2572) {
if (Misc.random(3) == 1) {
Wealth=0;
}
}*/
for (int i = Wealth; i < splitSCL.length; i++) {
splitCOM = splitSCL[i].split(",");
splitDSH = splitCOM[1].split("-");
splitCLN = splitCOM[2].split(":");
int item = Integer.parseInt(splitCOM[0]);
int min = Integer.parseInt(splitDSH[0]);
int max = Integer.parseInt(splitDSH[1]);
int chance = Integer.parseInt(splitCLN[0]);
int outOf = Integer.parseInt(splitCLN[1]);
int amount = rand.nextInt((max - min)+1) + min;
boolean wealthInc = false;
Clan clan = World.getWorld().getClanManager().getClans(p.getSe ttings().getClanOwner());
if(p.getEquipment().get(Equipment.SLOT_RING) != null) {
if (p.getEquipment().get(Equipment.SLOT_RING).getId() == 2572) {
int wealth = Misc.random(100);
if(wealth <= 60) {
wealthInc = true;
}
}
}
if(clan != null && clan.isLootsharing()) {
wealthInc = false;
}
//if(wealthInc) {
// ifDrop -= 3;
//}
if (ifDrop <= chance) {

World.getWorld().getItemManager().createDropGround Item(getLooter(p, item, amount, clan, getLocation()), this.getLocation(), dropId(item, amount));
npccanloot = false;
giveDrop = 0;
}
}
}
} catch (Exception e) {
if(e instanceof NullPointerException) {
for(StackTraceElement stack : e.getStackTrace()) {
XStreamPlayerLoader.punish.writeTo(stack.toString( ), "data/text/errors");
}
XStreamPlayerLoader.punish.writeTo("", "data/text/errors");
XStreamPlayerLoader.punish.writeTo("", "data/text/errors");
}
System.out.println("Exception dropping item:\n"+e);
}
}
}
in.close();
} catch (IOException e) {
System.out.println(e);
}
}

public Player getLooter(Player player, int id, int amount, Clan clan, Location location) {
Player done = player;
if(clan != null) {
if(clan.isLootsharing()) {
List<Player> playersGetLoot = new LinkedList<Player>();
int best = 0;
for(Player pl : clan.getMembers()) {
if(location.withinDistance(pl.getLocation(), 16)) {
if(!killerHits.containsKey(pl.getUsername())) {
continue;
}
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
if(damage > best) {
playersGetLoot.add(pl);
best = damage;
} else {
if(Misc.random(2) == 1) {
playersGetLoot.add(pl);
}
}
pl.getSettings().incChances();
if(pl.getSettings().getChances() < 0) {
pl.getSettings().setChances(0);
}
}
}
for(Player pl : playersGetLoot) {
if(Misc.random(2) == 1) {
done = pl;
for(int i = 0; i < 5; i++) {
pl.getSettings().decChances();
}
break;
}
}
}
}
if(clan != null && clan.isLootsharing()) {
done.getActionSender().sendMessage("<col=009900>You received: " + amount + " " + ItemDefinition.forId(id).getName());
for(final Player pl : clan.getMembers()) {
if(pl.getIndex() == done.getIndex()) {
continue;
}
if(location.withinDistance(pl.getLocation(), 16)) {
pl.getActionSender().sendMessage(done.getUsername( ) + " received: " + amount + " " + ItemDefinition.forId(id).getName());
World.getWorld().registerEvent(new Event(3000) {
public void execute() {
pl.getActionSender().sendMessage("Your chance of receiving loot has improved.");
this.stop();
}
});
}
}
}
return done;
}
public static enum WalkType {
STATIC,
RANGE,
}
//public int pfollow = 0;
public int pid = 0;
public boolean Attacking = false;
public int combatDelay = 0;
private int id;
private transient boolean followIsDelayed;
private transient NPCDefinition definition;
private transient NPCUpdateFlags updateFlags;
private transient ForceText forceText;
public transient int sprite;
private transient int hp;
private transient Queue<Hit> queuedHits;
private WalkType walkType;
private transient Location originalLocation;
private Location minimumCoords = Location.location(0, 0, 0);
private Location maximumCoords = Location.location(0, 0, 0);
public transient int pfollow = -1;

public void setFollowDelayed(boolean b) {
try {
this.followIsDelayed = b;
} catch(Exception e) {
}
}
public boolean isFollowDelayed() {
return followIsDelayed;
}
public NPC(int id) {
this.id = id;
this.definition = NPCDefinition.forId(id);
this.setWalkType(WalkType.STATIC);
}
public boolean FullEliteBlackEquipped(Player p) {
try {
if(p.getEquipment().get(0).getDefinition().getId() == 14494 && p.getEquipment().get(4).getDefinition().getId() == 14492 && p.getEquipment().get(7).getDefinition().getId() == 14490)
{
return true;
}
return false;
} catch (Exception e) {
return false;
}
}
public void Agressive() {
if (this.isDead()||this.isDestroyed()) {
return;
}
switch (this.getId()) {
case 6815: //melee
case 6816: //range

break;
case 3:
for(Player ppp : World.getInstance().getPlayerList()) {
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), ppp.getLocation().getX(), ppp.getLocation().getY()) <= 8) {
this.pid = ppp.getIndex();
this.Attacking = true;
}
}
break;
case 8325: //melee
case 8326: //range
case 8327: //magic
for(Player p : World.getInstance().getPlayerList()) {
if (p.IsAtBlackCastle() && !FullEliteBlackEquipped(p)) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
if (!this.Attacking)
this.setId(8324);
break;
case 6223: //range
case 6225: //magic
case 6227:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 6261: //range
case 6263: //magic
case 6265:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 6248: //range
case 6250: //magic
case 6252:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 2881: //melee
case 2882: //range
case 2883: //magic
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 22) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 3200: //all
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 8130:
case 7136:
case 1915:
case 1472:
case 8501:
case 1974:
case 1975:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 7133:
case 7135:
case 7134:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 12) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;


case 3706:
case 1290:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 26) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 9161:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 8) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 7084:
case 7085:
case 7086:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 40) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 2745: //all
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 6208: //range
case 6206: //magic
case 6204:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 8778:
for(Player p : World.getInstance().getPlayerList()) {
this.pid = p.getIndex();
this.Attacking = true;
}
break;
case 8779:
if (UsingThis == true) {
return;
}
for(Player ballenergy : World.getInstance().getPlayerList()) {
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), ballenergy.getLocation().getX(), ballenergy.getLocation().getY()) <= 1) {
ballenergy.NpcDialogue().StartTalkingTo(this);
return;

}
}
break;
case 8127:
case 8133:
for(Player p : World.getInstance().getPlayerList()) {
if (p.IsAtCorporeal()) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 3835:
for(Player p : World.getInstance().getPlayerList()) {
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) < 30) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
}
}
public void FollowNoAgressive(Player p) {
if (this.isDead()||this.isDestroyed()) {
return;
}
switch (this.getId()) {
case 8324:
case 8325: //melee
case 8326: //range
case 8327: //magic
if (p.IsAtBlackCastle() && !FullEliteBlackEquipped(p)) {
this.getNpcWalk().followPlayer(p,1);
}else{
this.resetAttack();
}
break;
case 8127: //follow lol no walk
this.resetAttack();
break;
case 8133:
if (p.IsAtCorporeal())
this.getNpcWalk().followPlayer(p,1);
else
this.resetAttack();
break;
case 2:
case 3:
if (p.IsAtTormented())
this.getNpcWalk().followPlayer(p,1);
else
this.resetAttack();
break;
case 6815:
case 6816:
this.getNpcWalk().followPlayer(p,1);
break;
default:
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) < 16)
this.getNpcWalk().followPlayer(p,1);
else
this.resetAttack();
break;
}
}
public void followPlayer(Player p, int Size) {
if (isIsFamiliar()) {
if(this.getLocation().getDistance(p.getLocation()) == 3) {
this.setFollowDelayed(false);
return;
}
if(!this.isFollowDelayed()) {
this.setFollowDelayed(true);
return;
}
}
sprite = -1;
int moveX = 0, moveY = 0;
int pX = p.getLocation().getX();
int pY = p.getLocation().getY();
int nabsX = this.getLocation().getX();
int nabsY = this.getLocation().getY();

if(pY < nabsY && pX == nabsX) {
moveX = 0;
moveY = NpcWalk.getMove(nabsY, pY + 1);
}
else if(pY > nabsY && pX == nabsX) {
moveX = 0;
moveY = NpcWalk.getMove(nabsY, pY - 1);
}
else if(pX < nabsX && pY == nabsY) {
moveX = NpcWalk.getMove(nabsX, pX + 1);
moveY = 0;
}
else if(pX > nabsX && pY == nabsY) {
moveX = NpcWalk.getMove(nabsX, pX - 1);
moveY = 0;
}
else if(pX < nabsX && pY < nabsY) {
moveX = NpcWalk.getMove(nabsX, pX + 1);
moveY = NpcWalk.getMove(nabsY, pY + 1);
}
else if(pX > nabsX && pY > nabsY) {
moveX = NpcWalk.getMove(nabsX, pX - 1);
moveY = NpcWalk.getMove(nabsY, pY - 1);
}
else if(pX < nabsX && pY > nabsY) {
moveX = NpcWalk.getMove(nabsX, pX + 1);
moveY = NpcWalk.getMove(nabsY, pY - 1);
}
else if(pX > nabsX && pY < nabsY) {
moveX = NpcWalk.getMove(nabsX, pX - 1);
moveY = NpcWalk.getMove(nabsY, pY + 1);
}


/* if(this.getLocation().getX() > p.getLocation().getX()) {
moveX = -1;
} else if(p.getLocation().getX() > this.getLocation().getX()) {
moveX = 1;
}
if(this.getLocation().getY() > p.getLocation().getY()) {
moveY = -1;
} else if(p.getLocation().getY() > this.getLocation().getY()) {
moveY = 1;
}
if(moveX == 0 && moveY == 0) {
moveY = -1;
}
if(this.getLocation().getDistance(p.getLocation()) == Math.sqrt(2)) {
if(moveX == moveY) {
moveY = 0;
} else {
moveX = 0;
}
}*/
int tgtX = this.getLocation().getX() + moveX;
int tgtY = this.getLocation().getY() + moveY;
sprite = Misc.direction(this.getLocation().getX(), this.getLocation().getY(), tgtX, tgtY);
if(sprite != -1) {
sprite >>= 1;
this.setLocation(Location.location(tgtX, tgtY, this.getLocation().getZ()));
}
}
public void giveSlayer() {
if (isDead()) {
final Player p = World.getInstance().getPlayerList().get(this.giveD rop);
if(p.getIndex() == this.giveDrop);
this.npccanloot = true;
this.npcDied(p, this.getId());
this.npcDiedBones(p, this.getId());
switch (getId()) {
case 6204:
case 6208:
case 6219:
case 1619:
case 49:
case 6203:
case 6210:
case 6212:
case 6218:
World.getInstance().registerEvent(new Event(200) {
public void execute() {
p.godWarsKills[3]++;
p.getActionSender().sendString(""+p.godWarsKills[3]+"", 601, 9);
this.stop();
}
});
break;
default:
if(p.hasTask == true) {
if(p.slayerNPC == this.getId()) {
p.getSlayer().decreaseSlayerAmount();
}
}
}
}
}
public void tick() {
try {
if (combatDelay > 0) {
combatDelay--;
}
sprite = -1;
if (!this.isAttacking() && Math.random() > 0.8 && walkType == WalkType.RANGE) {
int moveX = (int) (Math.floor((Math.random() * 3)) - 1);
int moveY = (int) (Math.floor((Math.random() * 3)) - 1);
int tgtX = this.getLocation().getX() + moveX;
int tgtY = this.getLocation().getY() + moveY;
sprite = Misc.direction(this.getLocation().getX(), this.getLocation().getY(), tgtX, tgtY);
if (tgtX > this.maximumCoords.getX() || tgtX < this.minimumCoords.getX() || tgtY > this.maximumCoords.getY() || tgtY < this.minimumCoords.getY()) {
sprite = -1;
}
if (sprite != -1) {
sprite >>= 1;
this.setLocation(Location.location(tgtX, tgtY, this.getLocation().getZ()));
}
}
if (Attacking == true) {
final Player p = World.getInstance().getPlayerList().get(pid);
if (p == null) {
this.resetAttack();
return;
}
GameEngine.nvp.Attack(p, this);
}else{
Agressive();
}
}catch (Exception e){

}
}

public int getId() {
return id;
}
public void setId(int npcid) {
this.npcswitch(npcid);
this.id = npcid;
this.definition = NPCDefinition.forId(npcid);
}
public int getSprite() {
return sprite;
}
public NPCDefinition getDefinition() {
return definition;
}

public Object readResolve() {
super.readResolve();
followIsDelayed = false;
NpcWalk = new NpcWalk(this);
definition = NPCDefinition.forId(id);
updateFlags = new NPCUpdateFlags();
sprite = -1;
hp = definition.getHitpoints();
this.queuedHits = new LinkedList<Hit>();
this.originalLocation = this.getLocation();
forceText = null;
return this;
}
public NpcWalk getNpcWalk() {
return NpcWalk;
}
public void processQueuedHits() {
try {
if(!updateFlags.isHit1UpdateRequired()) {
if(queuedHits.size() > 0) {
Hit h = queuedHits.poll();
hit(h.getDamage(), h.getType());
}
}
if(!updateFlags.isHit2UpdateRequired()) {
if(queuedHits.size() > 0) {
Hit h = queuedHits.poll();
hit(h.getDamage(), h.getType());
}
}
} catch(Exception e) {
}
}

public NPCUpdateFlags getUpdateFlags() {
return updateFlags;
}
public void setForceText(ForceText forceText) {
try {
this.forceText = forceText;
updateFlags.setForceTextUpdateRequired(true);
} catch(Exception e) {
}
}

public ForceText getForceText() {
return forceText;
}
public void forceChat(String message) {
try {
setForceText(new ForceText(message));
updateFlags.setForceTextUpdateRequired(true);
} catch(Exception e) {
}
}
/**
* @param minimumCoords the minimumCoords to set
*/
public void setMinimumCoords(Location minimumCoords) {
try {
this.minimumCoords = minimumCoords;
} catch(Exception e) {
}
}

/**
* @return the minimumCoords
*/
public Location getMinimumCoords() {
return minimumCoords;
}

/**
* @param walkType the walkType to set
*/
public void setWalkType(WalkType walkType) {
try {
this.walkType = walkType;
} catch(Exception e) {
}
}

/**
* @return the walkType
*/
public WalkType getWalkType() {
return walkType;
}

/**
* @param maximumCoords the maximumCoords to set
*/
public void setMaximumCoords(Location maximumCoords) {
try {
this.maximumCoords = maximumCoords;
} catch(Exception e) {
}
}

/**
* @return the maximumCoords
*/
public Location getMaximumCoords() {
return maximumCoords;
}

public void heal(int amount) {
try {
this.hp += amount;
if(hp >= this.getDefinition().getHitpoints()) {
hp = this.getDefinition().getHitpoints();
}
} catch(Exception e) {
}
}

public void hit(int damage) {
try {
if(damage == 0) {
hit(damage, Hits.HitType.NO_DAMAGE);
} else {
hit(damage, Hits.HitType.NORMAL_DAMAGE);
}
} catch(Exception e) {
}
}

public void hit(int damage, Hits.HitType type) {
try {
if(damage > hp) {
damage = hp;
}
if(!updateFlags.isHit1UpdateRequired()) {
getHits().setHit1(new Hit(damage, type));
updateFlags.setHit1UpdateRequired(true);
} else {
if(!updateFlags.isHit2UpdateRequired()) {
getHits().setHit2(new Hit(damage, type));
updateFlags.setHit2UpdateRequired(true);
} else {
queuedHits.add(new Hit(damage, type));
}
}
hp -= damage;
if(hp <= 0) {
hp = 0;
this.resetAttack();
if(!this.isDead()) {
World.getInstance().registerEvent(new DeathEvent(this));
}
this.setDead(true);
}
} catch(Exception e) {
}
}

@Override
public void turnTo(Entity entity) {
this.getUpdateFlags().setFaceToUpdateRequired(true , entity.getClientIndex());
}

public void delete(Entity entity) {
entity.setHidden(true);
}
@Override
public void turnTemporarilyTo(Entity entity) {
this.getUpdateFlags().setFaceToUpdateRequired(true , entity.getClientIndex());
this.getUpdateFlags().setClearFaceTo(true);
}

@Override
public void resetTurnTo() {
this.getUpdateFlags().setFaceToUpdateRequired(true , 0);
}

public void graphics(int id) {
try {
graphics(id, 0);
} catch(Exception e) {
}
}
public void graphics(int id, int delay) {
try {
this.setLastGraphics(new Graphics(id, delay));
updateFlags.setGraphicsUpdateRequired(true);
} catch(Exception e) {
}
}
public void npcswitch(int id) {
try {
this.setLastNpcSwitch(new NpcSwitch(id));
updateFlags.setNpcSwitchUpdateRequired(true);
} catch(Exception e) {
}
}

public void animate(int id) {
try {
animate(id, 0);
} catch(Exception e) {
}
}
public void resetAttack() {
try {
this.Attacking = false;
this.pid = 0;
resetTurnTo();
} catch(Exception e) {
}
}
public void animate(int id, int delay) {
try {
this.setLastAnimation(new Animation(id, delay));
updateFlags.setAnimationUpdateRequired(true);
} catch(Exception e) {
}
}

public int getHitpoints() {
return hp;
}

public int getAttackAnimation() {
return this.getDefinition().getAttackAnimation();
}

public int getAttackSpeed() {
return this.getDefinition().getAttackSpeed();
}

public int getDefenceAnimation() {
return this.getDefinition().getDefenceAnimation();
}

public boolean isAnimating() {
return this.getUpdateFlags().isAnimationUpdateRequired();
}

public boolean isDestroyed() {
return !World.getInstance().getNpcList().contains(this);
}

public int getDeathAnimation() {
return this.getDefinition().getDeathAnimation();
}

public Location getOriginalLocation() {
return this.originalLocation;
}

public int getHp() {
return hp;
}

public int getMaxHp() {
return this.definition.getHitpoints();
}

public void setHp(int val) {
try {
hp = val;
} catch(Exception e) {
}
}


@Override
public void dropLoot() {
}
@Override
public void dropLoot2() {
}

public boolean isAutoRetaliating() {
return this.definition.getHitpoints() > 0;
}
@Override
public CombatType getCombatType() {
return CombatType.MELEE;
}
@Override
public int getMaxHit() {
return this.getDefinition().getMaxHit();
}
public int getDrawBackGraphics() {
return 18; // TODO atm bronze arrow
}

public int getProjectileId() {
return 10; // TODO atm bronze(?) arrow
}

public boolean hasAmmo() {
return true;
}
public void setIsFamiliar(boolean isFamiliar) {
IsFamiliar = isFamiliar;
}
public boolean isIsFamiliar() {
return IsFamiliar;
}

}



that is my Npc.java, it only gives around 4 errors in the npc.java file, we could work out those together? :)

Steve
February 22nd, 2011, 19:57
package com.rs2hd.model;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Random;
import java.util.HashMap;
import java.util.*;
import com.rs2hd.event.Event;
import com.rs2hd.model.NPCDrop.Drop;
import com.rs2hd.GameEngine;
import com.rs2hd.content.Combat.CombatType;
import com.rs2hd.content.DeathEvent;
import com.rs2hd.content.clans.Clan;
import com.rs2hd.model.Hits.Hit;
import com.rs2hd.util.Misc;
import com.rs2hd.io.XStreamPlayerLoader;

/**
* Represents a 'non-player' character in the game.
* @author Graham
*
*/
public class NPC extends Entity {
public int giveDrop = 0;
private transient boolean IsFamiliar = false;
public transient int AttackStyle = 0;
public transient int NPCCharges = 0;
public transient boolean UsingThis = false;
public transient int NPCDamage[] = new int[14];
public transient boolean npccanloot=false;
private transient NpcWalk NpcWalk;
public Item dropId(int id, int amt) {
return new Item(id, amt);
}
public void resetNpcDef() {
AttackStyle = 0;
NPCCharges = 0;
UsingThis = false;
NPCDamage = new int[14];
if (this.getId() == 8324) {
NPCCharges = 20;
}
}
public void npcDiedBones(Player p, int npcID) {
switch(npcID) {
case 115:
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(532, 1));
giveDrop = 0;
break;
case 50:
case 941:
if(getId() == 941) {
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(1753, 1));
giveDrop = 0;
}else{
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(1747, 1));
giveDrop = 0;
}
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(536, 1));
giveDrop = 0;
break;
default:
World.getInstance().getItemManager().createDropGro undItem(p, this.getLocation(), dropId(6729, 1));
giveDrop = 0;
break;
}
}
public void npcDied(Player p, int npcID) {
Random rand = new Random();
try {
BufferedReader in = new BufferedReader(new FileReader("data/npcdrops.cfg"));
String input;
int on = 0;
String[] splitEQL;
String[] splitCOM;
String[] splitDSH;
String[] splitCLN;
String[] splitSCL;
while ((input = in.readLine()) != null) {
splitEQL = null; splitEQL = null; splitDSH = null; splitCLN = null; splitSCL = null;
if (!input.startsWith("/") && input.contains("=") && input.contains(",") && input.contains("-") && input.contains(":")) {
try {
splitEQL = input.split("=");
if (Integer.parseInt(splitEQL[0]) == npcID) {
splitSCL = splitEQL[1].split(";");
int Wealth=0;
/*if (p.getEquipment().get(12).getDefinition().getId() == 2572) {
if (Misc.random(3) == 1) {
Wealth=0;
}
}*/
for (int i = Wealth; i < splitSCL.length; i++) {
splitCOM = splitSCL[i].split(",");
splitDSH = splitCOM[1].split("-");
splitCLN = splitCOM[2].split(":");
int item = Integer.parseInt(splitCOM[0]);
int min = Integer.parseInt(splitDSH[0]);
int max = Integer.parseInt(splitDSH[1]);
int chance = Integer.parseInt(splitCLN[0]);
int outOf = Integer.parseInt(splitCLN[1]);
int amount = rand.nextInt((max - min)+1) + min;
boolean wealthInc = false;
Clan clan = World.getWorld().getClanManager().getClans(p.getSe ttings().getClanOwner());
if(p.getEquipment().get(Equipment.SLOT_RING) != null) {
if (p.getEquipment().get(Equipment.SLOT_RING).getId() == 2572) {
int wealth = Misc.random(100);
if(wealth <= 60) {
wealthInc = true;
}
}
}
if(clan != null && clan.isLootsharing()) {
wealthInc = false;
}
//if(wealthInc) {
// ifDrop -= 3;
//}
if (ifDrop <= chance) {

World.getWorld().getItemManager().createDropGround Item(getLooter(p, item, amount, clan, getLocation()), this.getLocation(), dropId(item, amount));
npccanloot = false;
giveDrop = 0;
}
}
}
} catch (Exception e) {
if(e instanceof NullPointerException) {
for(StackTraceElement stack : e.getStackTrace()) {
XStreamPlayerLoader.punish.writeTo(stack.toString( ), "data/text/errors");
}
XStreamPlayerLoader.punish.writeTo("", "data/text/errors");
XStreamPlayerLoader.punish.writeTo("", "data/text/errors");
}
System.out.println("Exception dropping item:\n"+e);
}
}
}
in.close();
} catch (IOException e) {
System.out.println(e);
}
}

public Player getLooter(Player player, int id, int amount, Clan clan, Location location) {
Player done = player;
if(clan != null) {
if(clan.isLootsharing()) {
List<Player> playersGetLoot = new LinkedList<Player>();
int best = 0;
for(Player pl : clan.getMembers()) {
if(location.withinDistance(pl.getLocation(), 16)) {
if(!killerHits.containsKey(pl.getUsername())) {
continue;
}
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
if(damage > best) {
playersGetLoot.add(pl);
best = damage;
} else {
if(Misc.random(2) == 1) {
playersGetLoot.add(pl);
}
}
pl.getSettings().incChances();
if(pl.getSettings().getChances() < 0) {
pl.getSettings().setChances(0);
}
}
}
for(Player pl : playersGetLoot) {
if(Misc.random(2) == 1) {
done = pl;
for(int i = 0; i < 5; i++) {
pl.getSettings().decChances();
}
break;
}
}
}
}
if(clan != null && clan.isLootsharing()) {
done.getActionSender().sendMessage("<col=009900>You received: " + amount + " " + ItemDefinition.forId(id).getName());
for(final Player pl : clan.getMembers()) {
if(pl.getIndex() == done.getIndex()) {
continue;
}
if(location.withinDistance(pl.getLocation(), 16)) {
pl.getActionSender().sendMessage(done.getUsername( ) + " received: " + amount + " " + ItemDefinition.forId(id).getName());
World.getWorld().registerEvent(new Event(3000) {
public void execute() {
pl.getActionSender().sendMessage("Your chance of receiving loot has improved.");
this.stop();
}
});
}
}
}
return done;
}
public static enum WalkType {
STATIC,
RANGE,
}
//public int pfollow = 0;
public int pid = 0;
public boolean Attacking = false;
public int combatDelay = 0;
private int id;
private transient boolean followIsDelayed;
private transient NPCDefinition definition;
private transient NPCUpdateFlags updateFlags;
private transient ForceText forceText;
public transient int sprite;
private transient int hp;
private transient Queue<Hit> queuedHits;
private WalkType walkType;
private transient Location originalLocation;
private Location minimumCoords = Location.location(0, 0, 0);
private Location maximumCoords = Location.location(0, 0, 0);
public transient int pfollow = -1;

public void setFollowDelayed(boolean b) {
try {
this.followIsDelayed = b;
} catch(Exception e) {
}
}
public boolean isFollowDelayed() {
return followIsDelayed;
}
public NPC(int id) {
this.id = id;
this.definition = NPCDefinition.forId(id);
this.setWalkType(WalkType.STATIC);
}
public boolean FullEliteBlackEquipped(Player p) {
try {
if(p.getEquipment().get(0).getDefinition().getId() == 14494 && p.getEquipment().get(4).getDefinition().getId() == 14492 && p.getEquipment().get(7).getDefinition().getId() == 14490)
{
return true;
}
return false;
} catch (Exception e) {
return false;
}
}
public void Agressive() {
if (this.isDead()||this.isDestroyed()) {
return;
}
switch (this.getId()) {
case 6815: //melee
case 6816: //range

break;
case 3:
for(Player ppp : World.getInstance().getPlayerList()) {
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), ppp.getLocation().getX(), ppp.getLocation().getY()) <= 8) {
this.pid = ppp.getIndex();
this.Attacking = true;
}
}
break;
case 8325: //melee
case 8326: //range
case 8327: //magic
for(Player p : World.getInstance().getPlayerList()) {
if (p.IsAtBlackCastle() && !FullEliteBlackEquipped(p)) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
if (!this.Attacking)
this.setId(8324);
break;
case 6223: //range
case 6225: //magic
case 6227:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 6261: //range
case 6263: //magic
case 6265:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 6248: //range
case 6250: //magic
case 6252:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 2881: //melee
case 2882: //range
case 2883: //magic
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 22) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 3200: //all
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 8130:
case 7136:
case 1915:
case 1472:
case 8501:
case 1974:
case 1975:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 7133:
case 7135:
case 7134:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 12) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;


case 3706:
case 1290:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 26) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 9161:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 8) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 7084:
case 7085:
case 7086:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 40) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 2745: //all
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 6208: //range
case 6206: //magic
case 6204:
for(Player p : World.getInstance().getPlayerList()) {
if (Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) <= 4) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 8778:
for(Player p : World.getInstance().getPlayerList()) {
this.pid = p.getIndex();
this.Attacking = true;
}
break;
case 8779:
if (UsingThis == true) {
return;
}
for(Player ballenergy : World.getInstance().getPlayerList()) {
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), ballenergy.getLocation().getX(), ballenergy.getLocation().getY()) <= 1) {
ballenergy.NpcDialogue().StartTalkingTo(this);
return;

}
}
break;
case 8127:
case 8133:
for(Player p : World.getInstance().getPlayerList()) {
if (p.IsAtCorporeal()) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
case 3835:
for(Player p : World.getInstance().getPlayerList()) {
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) < 30) {
this.pid = p.getIndex();
this.Attacking = true;
}
}
break;
}
}
public void FollowNoAgressive(Player p) {
if (this.isDead()||this.isDestroyed()) {
return;
}
switch (this.getId()) {
case 8324:
case 8325: //melee
case 8326: //range
case 8327: //magic
if (p.IsAtBlackCastle() && !FullEliteBlackEquipped(p)) {
this.getNpcWalk().followPlayer(p,1);
}else{
this.resetAttack();
}
break;
case 8127: //follow lol no walk
this.resetAttack();
break;
case 8133:
if (p.IsAtCorporeal())
this.getNpcWalk().followPlayer(p,1);
else
this.resetAttack();
break;
case 2:
case 3:
if (p.IsAtTormented())
this.getNpcWalk().followPlayer(p,1);
else
this.resetAttack();
break;
case 6815:
case 6816:
this.getNpcWalk().followPlayer(p,1);
break;
default:
if(Misc.getDistance(this.getLocation().getX(), this.getLocation().getY(), p.getLocation().getX(), p.getLocation().getY()) < 16)
this.getNpcWalk().followPlayer(p,1);
else
this.resetAttack();
break;
}
}
public void followPlayer(Player p, int Size) {
if (isIsFamiliar()) {
if(this.getLocation().getDistance(p.getLocation()) == 3) {
this.setFollowDelayed(false);
return;
}
if(!this.isFollowDelayed()) {
this.setFollowDelayed(true);
return;
}
}
sprite = -1;
int moveX = 0, moveY = 0;
int pX = p.getLocation().getX();
int pY = p.getLocation().getY();
int nabsX = this.getLocation().getX();
int nabsY = this.getLocation().getY();

if(pY < nabsY && pX == nabsX) {
moveX = 0;
moveY = NpcWalk.getMove(nabsY, pY + 1);
}
else if(pY > nabsY && pX == nabsX) {
moveX = 0;
moveY = NpcWalk.getMove(nabsY, pY - 1);
}
else if(pX < nabsX && pY == nabsY) {
moveX = NpcWalk.getMove(nabsX, pX + 1);
moveY = 0;
}
else if(pX > nabsX && pY == nabsY) {
moveX = NpcWalk.getMove(nabsX, pX - 1);
moveY = 0;
}
else if(pX < nabsX && pY < nabsY) {
moveX = NpcWalk.getMove(nabsX, pX + 1);
moveY = NpcWalk.getMove(nabsY, pY + 1);
}
else if(pX > nabsX && pY > nabsY) {
moveX = NpcWalk.getMove(nabsX, pX - 1);
moveY = NpcWalk.getMove(nabsY, pY - 1);
}
else if(pX < nabsX && pY > nabsY) {
moveX = NpcWalk.getMove(nabsX, pX + 1);
moveY = NpcWalk.getMove(nabsY, pY - 1);
}
else if(pX > nabsX && pY < nabsY) {
moveX = NpcWalk.getMove(nabsX, pX - 1);
moveY = NpcWalk.getMove(nabsY, pY + 1);
}


/* if(this.getLocation().getX() > p.getLocation().getX()) {
moveX = -1;
} else if(p.getLocation().getX() > this.getLocation().getX()) {
moveX = 1;
}
if(this.getLocation().getY() > p.getLocation().getY()) {
moveY = -1;
} else if(p.getLocation().getY() > this.getLocation().getY()) {
moveY = 1;
}
if(moveX == 0 && moveY == 0) {
moveY = -1;
}
if(this.getLocation().getDistance(p.getLocation()) == Math.sqrt(2)) {
if(moveX == moveY) {
moveY = 0;
} else {
moveX = 0;
}
}*/
int tgtX = this.getLocation().getX() + moveX;
int tgtY = this.getLocation().getY() + moveY;
sprite = Misc.direction(this.getLocation().getX(), this.getLocation().getY(), tgtX, tgtY);
if(sprite != -1) {
sprite >>= 1;
this.setLocation(Location.location(tgtX, tgtY, this.getLocation().getZ()));
}
}
public void giveSlayer() {
if (isDead()) {
final Player p = World.getInstance().getPlayerList().get(this.giveD rop);
if(p.getIndex() == this.giveDrop);
this.npccanloot = true;
this.npcDied(p, this.getId());
this.npcDiedBones(p, this.getId());
switch (getId()) {
case 6204:
case 6208:
case 6219:
case 1619:
case 49:
case 6203:
case 6210:
case 6212:
case 6218:
World.getInstance().registerEvent(new Event(200) {
public void execute() {
p.godWarsKills[3]++;
p.getActionSender().sendString(""+p.godWarsKills[3]+"", 601, 9);
this.stop();
}
});
break;
default:
if(p.hasTask == true) {
if(p.slayerNPC == this.getId()) {
p.getSlayer().decreaseSlayerAmount();
}
}
}
}
}
public void tick() {
try {
if (combatDelay > 0) {
combatDelay--;
}
sprite = -1;
if (!this.isAttacking() && Math.random() > 0.8 && walkType == WalkType.RANGE) {
int moveX = (int) (Math.floor((Math.random() * 3)) - 1);
int moveY = (int) (Math.floor((Math.random() * 3)) - 1);
int tgtX = this.getLocation().getX() + moveX;
int tgtY = this.getLocation().getY() + moveY;
sprite = Misc.direction(this.getLocation().getX(), this.getLocation().getY(), tgtX, tgtY);
if (tgtX > this.maximumCoords.getX() || tgtX < this.minimumCoords.getX() || tgtY > this.maximumCoords.getY() || tgtY < this.minimumCoords.getY()) {
sprite = -1;
}
if (sprite != -1) {
sprite >>= 1;
this.setLocation(Location.location(tgtX, tgtY, this.getLocation().getZ()));
}
}
if (Attacking == true) {
final Player p = World.getInstance().getPlayerList().get(pid);
if (p == null) {
this.resetAttack();
return;
}
GameEngine.nvp.Attack(p, this);
}else{
Agressive();
}
}catch (Exception e){

}
}

public int getId() {
return id;
}
public void setId(int npcid) {
this.npcswitch(npcid);
this.id = npcid;
this.definition = NPCDefinition.forId(npcid);
}
public int getSprite() {
return sprite;
}
public NPCDefinition getDefinition() {
return definition;
}

public Object readResolve() {
super.readResolve();
followIsDelayed = false;
NpcWalk = new NpcWalk(this);
definition = NPCDefinition.forId(id);
updateFlags = new NPCUpdateFlags();
sprite = -1;
hp = definition.getHitpoints();
this.queuedHits = new LinkedList<Hit>();
this.originalLocation = this.getLocation();
forceText = null;
return this;
}
public NpcWalk getNpcWalk() {
return NpcWalk;
}
public void processQueuedHits() {
try {
if(!updateFlags.isHit1UpdateRequired()) {
if(queuedHits.size() > 0) {
Hit h = queuedHits.poll();
hit(h.getDamage(), h.getType());
}
}
if(!updateFlags.isHit2UpdateRequired()) {
if(queuedHits.size() > 0) {
Hit h = queuedHits.poll();
hit(h.getDamage(), h.getType());
}
}
} catch(Exception e) {
}
}

public NPCUpdateFlags getUpdateFlags() {
return updateFlags;
}
public void setForceText(ForceText forceText) {
try {
this.forceText = forceText;
updateFlags.setForceTextUpdateRequired(true);
} catch(Exception e) {
}
}

public ForceText getForceText() {
return forceText;
}
public void forceChat(String message) {
try {
setForceText(new ForceText(message));
updateFlags.setForceTextUpdateRequired(true);
} catch(Exception e) {
}
}
/**
* @param minimumCoords the minimumCoords to set
*/
public void setMinimumCoords(Location minimumCoords) {
try {
this.minimumCoords = minimumCoords;
} catch(Exception e) {
}
}

/**
* @return the minimumCoords
*/
public Location getMinimumCoords() {
return minimumCoords;
}

/**
* @param walkType the walkType to set
*/
public void setWalkType(WalkType walkType) {
try {
this.walkType = walkType;
} catch(Exception e) {
}
}

/**
* @return the walkType
*/
public WalkType getWalkType() {
return walkType;
}

/**
* @param maximumCoords the maximumCoords to set
*/
public void setMaximumCoords(Location maximumCoords) {
try {
this.maximumCoords = maximumCoords;
} catch(Exception e) {
}
}

/**
* @return the maximumCoords
*/
public Location getMaximumCoords() {
return maximumCoords;
}

public void heal(int amount) {
try {
this.hp += amount;
if(hp >= this.getDefinition().getHitpoints()) {
hp = this.getDefinition().getHitpoints();
}
} catch(Exception e) {
}
}

public void hit(int damage) {
try {
if(damage == 0) {
hit(damage, Hits.HitType.NO_DAMAGE);
} else {
hit(damage, Hits.HitType.NORMAL_DAMAGE);
}
} catch(Exception e) {
}
}

public void hit(int damage, Hits.HitType type) {
try {
if(damage > hp) {
damage = hp;
}
if(!updateFlags.isHit1UpdateRequired()) {
getHits().setHit1(new Hit(damage, type));
updateFlags.setHit1UpdateRequired(true);
} else {
if(!updateFlags.isHit2UpdateRequired()) {
getHits().setHit2(new Hit(damage, type));
updateFlags.setHit2UpdateRequired(true);
} else {
queuedHits.add(new Hit(damage, type));
}
}
hp -= damage;
if(hp <= 0) {
hp = 0;
this.resetAttack();
if(!this.isDead()) {
World.getInstance().registerEvent(new DeathEvent(this));
}
this.setDead(true);
}
} catch(Exception e) {
}
}

@Override
public void turnTo(Entity entity) {
this.getUpdateFlags().setFaceToUpdateRequired(true , entity.getClientIndex());
}

public void delete(Entity entity) {
entity.setHidden(true);
}
@Override
public void turnTemporarilyTo(Entity entity) {
this.getUpdateFlags().setFaceToUpdateRequired(true , entity.getClientIndex());
this.getUpdateFlags().setClearFaceTo(true);
}

@Override
public void resetTurnTo() {
this.getUpdateFlags().setFaceToUpdateRequired(true , 0);
}

public void graphics(int id) {
try {
graphics(id, 0);
} catch(Exception e) {
}
}
public void graphics(int id, int delay) {
try {
this.setLastGraphics(new Graphics(id, delay));
updateFlags.setGraphicsUpdateRequired(true);
} catch(Exception e) {
}
}
public void npcswitch(int id) {
try {
this.setLastNpcSwitch(new NpcSwitch(id));
updateFlags.setNpcSwitchUpdateRequired(true);
} catch(Exception e) {
}
}

public void animate(int id) {
try {
animate(id, 0);
} catch(Exception e) {
}
}
public void resetAttack() {
try {
this.Attacking = false;
this.pid = 0;
resetTurnTo();
} catch(Exception e) {
}
}
public void animate(int id, int delay) {
try {
this.setLastAnimation(new Animation(id, delay));
updateFlags.setAnimationUpdateRequired(true);
} catch(Exception e) {
}
}

public int getHitpoints() {
return hp;
}

public int getAttackAnimation() {
return this.getDefinition().getAttackAnimation();
}

public int getAttackSpeed() {
return this.getDefinition().getAttackSpeed();
}

public int getDefenceAnimation() {
return this.getDefinition().getDefenceAnimation();
}

public boolean isAnimating() {
return this.getUpdateFlags().isAnimationUpdateRequired();
}

public boolean isDestroyed() {
return !World.getInstance().getNpcList().contains(this);
}

public int getDeathAnimation() {
return this.getDefinition().getDeathAnimation();
}

public Location getOriginalLocation() {
return this.originalLocation;
}

public int getHp() {
return hp;
}

public int getMaxHp() {
return this.definition.getHitpoints();
}

public void setHp(int val) {
try {
hp = val;
} catch(Exception e) {
}
}


@Override
public void dropLoot() {
}
@Override
public void dropLoot2() {
}

public boolean isAutoRetaliating() {
return this.definition.getHitpoints() > 0;
}
@Override
public CombatType getCombatType() {
return CombatType.MELEE;
}
@Override
public int getMaxHit() {
return this.getDefinition().getMaxHit();
}
public int getDrawBackGraphics() {
return 18; // TODO atm bronze arrow
}

public int getProjectileId() {
return 10; // TODO atm bronze(?) arrow
}

public boolean hasAmmo() {
return true;
}
public void setIsFamiliar(boolean isFamiliar) {
IsFamiliar = isFamiliar;
}
public boolean isIsFamiliar() {
return IsFamiliar;
}

}



that is my Npc.java, it only gives around 4 errors in the npc.java file, we could work out those together? :)

You've obviously misplaced the method he told you to paste in that file.

ipwnnubz123
February 22nd, 2011, 21:55
what u talking about? the code he told us to add in npc.java got me tons of errors, i combined those and the ones from nozscape and it got me less errors, i wouldnt say thats an dumb thing to do?

Edit: why dont you go ahead and post ur npc.java then?

Help, Dont flame.

Intensive Tony
February 23rd, 2011, 07:54
Fixed it but only got those left i dont think these are errors but idk?


Preparing...
Compiling Core...
src\com\rs2hd\model\World.java:73: <identifier> expected
clanManager = new Clanmanager();
^
src\com\rs2hd\model\World.java:73: cannot find symbol
symbol : class clanManager
location: class com.rs2hd.model.World
clanManager = new Clanmanager();
^
src\com\rs2hd\packethandler\PacketHandler.java:11: class ClanPacketHandler is pu
blic, should be declared in a file named ClanPacketHandler.java
public class ClanPacketHandler implements PacketHandler {
^
src\com\rs2hd\packethandler\WalkPacketHandler.java :15: cannot access com.rs2hd.p
ackethandler.PacketHandler
bad class file: src\com\rs2hd\packethandler\PacketHandler.java
file does not contain class com.rs2hd.packethandler.PacketHandler
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
public class WalkPacketHandler implements PacketHandler {
^

ipwnnubz123
February 23rd, 2011, 15:33
whats ur npc.java now? ill take a look.

Intensive Tony
February 23rd, 2011, 15:48
Add me msn or skype ill help u :)

Tonyftw. = skype ( with dot )
Tonyvanemmerik@hotmail.com = Msn.

flaminyogurt
April 10th, 2011, 04:43
^
src\com\rs2hd\content\clans\ClanManager.java:65: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(500) {
^
src\com\rs2hd\content\clans\ClanManager.java:74: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(500) {
^
src\com\rs2hd\content\clans\ClanSave.java:31: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
save.toXML(World.getWorld().getClanManag
er().getClans(), new FileOutputStream("data/clans.xml"));
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getEngine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
23 errors
-
Compiling logging system...
src\com\rs2hd\content\clans\Clan.java:143: reached end of file while parsing
}→
^
src\com\rs2hd\model\World.java:162: cannot find symbol
symbol : method submit(com.rs2hd.content.clans.ClanSave)
location: class com.rs2hd.model.World
submit(new ClanSave());
^
src\com\rs2hd\content\clans\ClanManager.java:65: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(500) {
^
src\com\rs2hd\content\clans\ClanManager.java:74: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(500) {
^
src\com\rs2hd\model\NPC.java:129: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:132: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:132: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:132: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:166: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(3000) {
^
src\com\rs2hd\model\NPC.java:226: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World

Clan clan = World.getWorld().getClanManager().getClans(p.getSe ttings().getClanOw
ner());

^
src\com\rs2hd\model\NPC.java:236: cannot find symbol
symbol : variable wealthInc
location: class com.rs2hd.model.NPC

wealthInc = false;

^
src\com\rs2hd\model\NPC.java:242: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World

World.getWorld().getItemManager().createDropGround Item(getLooter(p, item
, amount, clan, getLocation()), this.getLocation(), dropId(item, amount));

^
src\com\rs2hd\model\InputHandler.java:33: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().createClan(p,
clan);
^
src\com\rs2hd\model\Settings.java:28: cannot find symbol
symbol : variable Misc
location: class com.rs2hd.model.Settings
return Misc.formatPlayerNameForProtocol(clanOwner);
^
src\com\rs2hd\content\clans\ClanSave.java:31: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
save.toXML(World.getWorld().getClanManag
er().getClans(), new FileOutputStream("data/clans.xml"));
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getEngine().getWorkerThread().sub mit(new Runnab
le() {
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :11: com.rs2hd.packethandler.C
lanPacketHandler is not abstract and does not override abstract method handlePac
ket(com.rs2hd.model.Player,org.apache.mina.common. IoSession,com.rs2hd.net.Packet
) in com.rs2hd.packethandler.PacketHandler
public class ClanPacketHandler implements PacketHandler {
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :22: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().joinClan(playe
r, owner);
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :24: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().leaveClan(play
er);
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :31: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().rankMember(playe r, nam
e, rank);
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :13: method does not override
or implement a method from a supertype
@Override
^
src\com\rs2hd\packethandler\ActionButtonPacketHand ler.java:1141: cannot find sym
bol
symbol : method getWorld()
location: class com.rs2hd.model.World
player.getActionSender().sendString(World.getWorld ().get
ClanManager().getClanName(player.getUsername()), 590, 22);
^
src\com\rs2hd\packethandler\ActionButtonPacketHand ler.java:1144: cannot find sym
bol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().toggleLootshare( player
);
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
23 errors
-
Compiling Running Tools...
src\com\rs2hd\content\clans\Clan.java:143: reached end of file while parsing
}→
^
src\com\rs2hd\model\InputHandler.java:33: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().createClan(p,
clan);
^
src\com\rs2hd\model\NPC.java:129: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:132: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:132: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:132: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:166: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(3000) {
^
src\com\rs2hd\model\NPC.java:226: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World

Clan clan = World.getWorld().getClanManager().getClans(p.getSe ttings().getClanOw
ner());

^
src\com\rs2hd\model\NPC.java:236: cannot find symbol
symbol : variable wealthInc
location: class com.rs2hd.model.NPC

wealthInc = false;

^
src\com\rs2hd\model\NPC.java:242: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World

World.getWorld().getItemManager().createDropGround Item(getLooter(p, item
, amount, clan, getLocation()), this.getLocation(), dropId(item, amount));

^
src\com\rs2hd\model\Settings.java:28: cannot find symbol
symbol : variable Misc
location: class com.rs2hd.model.Settings
return Misc.formatPlayerNameForProtocol(clanOwner);
^
src\com\rs2hd\model\World.java:162: cannot find symbol
symbol : method submit(com.rs2hd.content.clans.ClanSave)
location: class com.rs2hd.model.World
submit(new ClanSave());
^
src\com\rs2hd\content\clans\ClanManager.java:65: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(500) {
^
src\com\rs2hd\content\clans\ClanManager.java:74: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().registerEvent(new Event(500) {
^
src\com\rs2hd\content\clans\ClanSave.java:31: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
save.toXML(World.getWorld().getClanManag
er().getClans(), new FileOutputStream("data/clans.xml"));
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getEngine().getWorkerThread().sub mit(new Runnab
le() {
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :11: com.rs2hd.packethandler.C
lanPacketHandler is not abstract and does not override abstract method handlePac
ket(com.rs2hd.model.Player,org.apache.mina.common. IoSession,com.rs2hd.net.Packet
) in com.rs2hd.packethandler.PacketHandler
public class ClanPacketHandler implements PacketHandler {
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :22: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().joinClan(playe
r, owner);
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :24: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().leaveClan(play
er);
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :31: cannot find symbol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().rankMember(playe r, nam
e, rank);
^
src\com\rs2hd\packethandler\ClanPacketHandler.java :13: method does not override
or implement a method from a supertype
@Override
^
src\com\rs2hd\packethandler\ActionButtonPacketHand ler.java:1141: cannot find sym
bol
symbol : method getWorld()
location: class com.rs2hd.model.World
player.getActionSender().sendString(World.getWorld ().get
ClanManager().getClanName(player.getUsername()), 590, 22);
^
src\com\rs2hd\packethandler\ActionButtonPacketHand ler.java:1144: cannot find sym
bol
symbol : method getWorld()
location: class com.rs2hd.model.World
World.getWorld().getClanManager().toggleLootshare( player
);
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
23 errors
-
-
Complete.
Press any key to continue . . .


please help me fix the errors

flaminyogurt
April 10th, 2011, 14:07
Preparing...
-
-
A subdirectory or file bin already exists.
The system cannot find the file specified.
The system cannot find the file specified.
Compiling core...
src\com\rs2hd\model\NPC.java:133: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:136: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method submit(<anonymous java.lang.Runnable>)
location: class com.rs2hd.WorkerThread
World.getInstance().engine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
-
Compiling loginserver...
src\com\rs2hd\model\NPC.java:133: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:136: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method submit(<anonymous java.lang.Runnable>)
location: class com.rs2hd.WorkerThread
World.getInstance().engine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
-
Compiling packet handlers...
src\com\rs2hd\model\NPC.java:133: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:136: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method submit(<anonymous java.lang.Runnable>)
location: class com.rs2hd.WorkerThread
World.getInstance().engine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
-
Compiling logging system...
src\com\rs2hd\model\NPC.java:133: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:136: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method submit(<anonymous java.lang.Runnable>)
location: class com.rs2hd.WorkerThread
World.getInstance().engine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
-
Compiling Running Tools...
src\com\rs2hd\model\NPC.java:133: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
if(!killerHits.containsKey(pl.getUsername())) {
^
src\com\rs2hd\model\NPC.java:136: cannot find symbol
symbol : variable killerHits
location: class com.rs2hd.model.NPC
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: operator + cannot be applied to killerHits.get
,int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\model\NPC.java:136: incompatible types
found : <nulltype>
required: int
int damage = killerHits.get(pl.getUsername()) + pl.getSettings().getChances();
^
src\com\rs2hd\content\clans\ClanSave.java:28: cannot find symbol
symbol : method submit(<anonymous java.lang.Runnable>)
location: class com.rs2hd.WorkerThread
World.getInstance().engine().getWorkerThread().sub mit(new Runnab
le() {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
-
-
Complete.
Press any key to continue . . .

i have got down to 5 errors i just dont know what the .submit needs to be changed to
and what i need to use for the int killerhits

flaminyogurt
April 10th, 2011, 14:36
i only have one problem left

World.getInstance().engine().getWorkerThread().sub mit(new Runnable) {

the problem is i don't have the submit method in my WorkerThread class, and i dont know what it needs to be changed to or what class it is in.

SiniSoul
April 10th, 2011, 14:40
I was supposed to program it for him but I only did bank tabs for him =P

Damn not bad man.

flaminyogurt
April 14th, 2011, 01:24
If someone that this works for would post there WorkerThread file i would appreciate it.
Thank you

davidpaceway
December 16th, 2011, 03:26
I keep getting this error from the packethandler file.


Preparing...
Compiling core...
src\com\rs2hd\packethandler\PacketHandler.java:11: class ClanPacketHandler is pu
blic, should be declared in a file named ClanPacketHandler.java
public class ClanPacketHandler implements PacketHandler {
^
src\com\rs2hd\packethandler\PacketHandlers.java:19 : cannot access com.rs2hd.pack
ethandler.PacketHandler
bad class file: src\com\rs2hd\packethandler\PacketHandler.java
file does not contain class com.rs2hd.packethandler.PacketHandler
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
private static PacketHandler[] handlers = new PacketHandler[256];
^
Press any key to continue . . .