Sup guys! I know the basics with Java, however i'm stuck right now I can't figure out how to type and code what I have in mind lol.
So let me explain quickly, I am editing ways to train Dungeoneering. I did arrays to separate npcs. I'll use Bathusfor example.
Code:
// This list contains ids of Bathus NPCs
final int BathusList[] = {10418, 10419, 10420, 10421, 10422, 10423};
// My whole function isn't there, but this code is located in NPC.java after "public void npcDied(Player p, int npcID) ", so you know where the npcID come from.
for (int i = 0; i < BathusList.length; i++) {
if (npcID == BathusList[i]) {
p.DungTokens += 20;
p.getSkills().addXp(Skills.DUNGEONEERING, 1);
p.sm("You have defeated a Bathus Forggoten Warrior and gained 20 Tokens.");
return;
}
}
Is there a way to make BathusList[] Return the XP gained and the number of "DungTokens" from each kill?
I'd like to do it another way than using a "Switch(npcID)" with cases for every npc, because it takes so much space and don't like it lol.
If you miss some infos or need me to explain myself another way, let me know I'd really appreciate your help guys!
Thanks in advance,
Alex