mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 16:49:07 +00:00
Cleanup part 1 (#213)
* Clean up part 1 - Removed lots of dead code - Removed unncessary files not in use - Cleaned up small bits of code - Removed a few warnings - Server.java ---> GameEngine.java - Constants.java ---> GameConstants.java * Cape Dye Rewrote cape dying * Packaging - redone ----> com.rebotted * PacketSender/clean up - ActionSender ---> PacketSender - Moved many more packets to packetsender - Cleaned up more dead code * Merge Client/Player - Merged Client.java with Player.java (both were doing same thing so redundant to have both) - Removed some more dead code - Tidy a few small things up * Quests/more clean up - Removed more dead code - Made quests static in order to clean them up a bit * More cleanup - Removed some more of the dead quest code - Correcting naming of some of the shop variables
This commit is contained in:
committed by
Daniel Ginovker
parent
3d1ae1b288
commit
d876a923b9
@@ -0,0 +1,32 @@
|
||||
package com.rebotted.game.npcs.drops;
|
||||
|
||||
import com.rebotted.util.Misc;
|
||||
|
||||
public class ItemDrop {
|
||||
public int item_id, chance;
|
||||
public int[] amounts;
|
||||
|
||||
ItemDrop (int item_id, int[]amounts, int chance) {
|
||||
this.item_id = item_id;
|
||||
this.amounts = amounts;
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
ItemDrop (int item_id, int amount, int chance) {
|
||||
this.item_id = item_id;
|
||||
this.amounts = new int[]{amount, amount};
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
public int getChance(){
|
||||
return this.chance;
|
||||
}
|
||||
|
||||
public int getItemID(){
|
||||
return this.item_id;
|
||||
}
|
||||
|
||||
public int getAmount(){
|
||||
return Misc.random(this.amounts[0], this.amounts[1]);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,250 @@
|
||||
package com.rebotted.game.npcs.drops;
|
||||
|
||||
import com.rebotted.GameEngine;
|
||||
import com.rebotted.game.items.ItemList;
|
||||
import com.rebotted.util.Misc;
|
||||
|
||||
/**
|
||||
* Npc Drops Handler
|
||||
* @author Andrew (Mr Extremez)
|
||||
*/
|
||||
|
||||
public class NPCDropsHandler {
|
||||
|
||||
public static int // found on http://runescape.wikia.com/wiki/Drop_rate
|
||||
ALWAYS = 0,
|
||||
COINSRATE = 3,
|
||||
COMMON = 32,
|
||||
UNCOMMON = 64,
|
||||
RARE = 256,
|
||||
VERY_RARE = 512;
|
||||
|
||||
/**
|
||||
* Handles the npc drops for the npc names.
|
||||
*
|
||||
* @param NPCId
|
||||
* @return
|
||||
*/
|
||||
public static final ItemDrop[] NPC_DROPS(String npc, int NPCId) {
|
||||
if (npc.equals("man") || npc.equals("woman") || npc.equals("drunken_man")) {
|
||||
return NPCDrops.man;
|
||||
} else if (npc.equals("skeletal_wyvern")) {
|
||||
return NPCDrops.wyvern;
|
||||
} else if (npc.equals("dark_beast")) {
|
||||
return NPCDrops.darkbeast;
|
||||
} else if (npc.equals("shade")) {
|
||||
return NPCDrops.shade;
|
||||
} else if (npc.equals("watchman")) {
|
||||
return NPCDrops.watchman;
|
||||
} else if (npc.equals("river_troll")) {
|
||||
return NPCDrops.rivertroll;
|
||||
} else if (npc.equals("cave_crawler")) {
|
||||
return NPCDrops.cavecrawler;
|
||||
} else if (npc.equals("thief")) {
|
||||
return NPCDrops.thief;
|
||||
} else if (npc.equals("tzhaar-xil") || npc.equals("Tzhaar-Xil")) {
|
||||
return NPCDrops.tzhaarxil;
|
||||
} else if (npc.equals("tzhaar-ket") || npc.equals("Tzhaar-Ket")) {
|
||||
return NPCDrops.tzhaarket;
|
||||
} else if (npc.equals("tzhaar-hur") || npc.equals("Tzhaar-Hur")) {
|
||||
return NPCDrops.tzhaarhur;
|
||||
} else if (npc.equals("tzhaar-mej") || npc.equals("Tzhaar-Mej")) {
|
||||
return NPCDrops.tzhaarmej;
|
||||
} else if (npc.equals("tree_spirit")) {
|
||||
return NPCDrops.treespirit;
|
||||
} else if (npc.equals("unicorn")) {
|
||||
return NPCDrops.unicorn;
|
||||
} else if (npc.equals("evil_chicken")) {
|
||||
return NPCDrops.evilchicken;
|
||||
} else if (npc.equals("white_knight")) {
|
||||
return NPCDrops.whiteknight;
|
||||
} else if (npc.equals("black_knight")) {
|
||||
return NPCDrops.blackknight;
|
||||
} else if (npc.equals("bear")) {
|
||||
return NPCDrops.bear;
|
||||
} else if (npc.equals("jogre")) {
|
||||
return NPCDrops.jogre;
|
||||
} else if (npc.equals("ogre")) {
|
||||
return NPCDrops.ogre;
|
||||
} else if (npc.equals("chaos_druid")) {
|
||||
return NPCDrops.chaosdruid;
|
||||
} else if (npc.equals("jailer")) {
|
||||
return NPCDrops.jailer;
|
||||
} else if (npc.equals("fire_giant") || npc.equals("Fire_giant")) {
|
||||
return NPCDrops.firegiant;
|
||||
} else if (npc.equals("basilisk")) {
|
||||
return NPCDrops.basilisk;
|
||||
} else if (npc.equals("baby_blue_dragon") || npc.equals("baby_red_dragon") || npc.equals("baby_dragon")) {
|
||||
return NPCDrops.babybluedragon;
|
||||
} else if (npc.equals("red_dragon")) {
|
||||
return NPCDrops.reddragon;
|
||||
} else if (npc.equals("elf_warrior")) {
|
||||
return NPCDrops.elfwarrior;
|
||||
} else if (npc.equals("dagannoth")) {
|
||||
return NPCDrops.dagannoth;
|
||||
} else if (npc.equals("giant_mole")) {
|
||||
return NPCDrops.giantmole;
|
||||
} else if (npc.equals("dagannoth_supreme")) {
|
||||
return NPCDrops.dagannothsupereme;
|
||||
} else if (npc.equals("chaos_elemental")) {
|
||||
return NPCDrops.chaoselemental;
|
||||
} else if (npc.equals("dagannoth_prime")) {
|
||||
return NPCDrops.dagannothprime;
|
||||
} else if (npc.equals("dagannoth_rex")) {
|
||||
return NPCDrops.daggannothrex;
|
||||
} else if (npc.equals("monkey_guard")) {
|
||||
return NPCDrops.monkeyguard;
|
||||
} else if (npc.equals("monk")) {
|
||||
return NPCDrops.monk;
|
||||
} else if (npc.equals("abyssal_demon")) {
|
||||
return NPCDrops.abyssaldemon;
|
||||
} else if (npc.equals("pyrefiend")) {
|
||||
return NPCDrops.pyrefiend;
|
||||
} else if (npc.equals("aberrant_spectre")
|
||||
|| npc.equals("aberrant_specter")
|
||||
|| npc.equals("aberant_specter")) {
|
||||
return NPCDrops.abberantspectre;
|
||||
} else if (npc.equals("earth_warrior")) {
|
||||
return NPCDrops.earthwarrior;
|
||||
} else if (npc.equals("gargoyle")) {
|
||||
return NPCDrops.gargoyle;
|
||||
} else if (npc.equals("dust_devil") || npc.equals("dustdevil")) {
|
||||
return NPCDrops.dustdevil;
|
||||
} else if (npc.equals("cockatrice")) {
|
||||
return NPCDrops.cockatrice;
|
||||
} else if (npc.equals("infernal_mage")) {
|
||||
return NPCDrops.infernalmage;
|
||||
} else if (npc.equals("nechryael")) {
|
||||
return NPCDrops.nechryael;
|
||||
} else if (npc.equals("bloodveld")) {
|
||||
return NPCDrops.bloodveld;
|
||||
} else if (npc.equals("turoth")) {
|
||||
return NPCDrops.turoth;
|
||||
} else if (npc.equals("banshee")) {
|
||||
return NPCDrops.banshee;
|
||||
} else if (npc.equals("crawling_hand")) {
|
||||
return NPCDrops.crawlinghand;
|
||||
} else if (npc.equals("highwayman")) {
|
||||
return NPCDrops.highwayman;
|
||||
} else if (npc.equals("wild_dog") || npc.equals("battle_mage")) {
|
||||
return NPCDrops.alwaysbones;
|
||||
} else if (npc.equals("kalphite_queen")) {
|
||||
return NPCDrops.kalphitequeen;
|
||||
} else if (npc.equals("kalphite_worker")) {
|
||||
return NPCDrops.kalphiteworker;
|
||||
} else if (npc.equals("kalphite_soldier")) {
|
||||
return NPCDrops.kalphitesoldier;
|
||||
} else if (npc.equals("kalphite_guardian")) {
|
||||
return NPCDrops.kalphiteguardian;
|
||||
} else if (npc.equals("bat") || npc.equals("giant_bat")) {
|
||||
return NPCDrops.bat;
|
||||
} else if (npc.equals("bronze_dragon")) {
|
||||
return NPCDrops.bronzedragon;
|
||||
} else if (npc.equals("black_dragon")) {
|
||||
return NPCDrops.blackdragon;
|
||||
} else if (npc.equals("iron_dragon")) {
|
||||
return NPCDrops.irondragon;
|
||||
} else if (npc.equals("steel_dragon")) {
|
||||
return NPCDrops.steeldragon;
|
||||
} else if (npc.equals("moss_giant")) {
|
||||
return NPCDrops.mossgiant;
|
||||
} else if (npc.equals("greater_demon")) {
|
||||
return NPCDrops.greaterdemon;
|
||||
} else if (npc.equals("black_demon")) {
|
||||
return NPCDrops.blackdemon;
|
||||
} else if (npc.equals("dwarf")) {
|
||||
return NPCDrops.dwarf;
|
||||
} else if (npc.equals("jelly")) {
|
||||
return NPCDrops.jelly;
|
||||
} else if (npc.equals("rock_crab")) {
|
||||
return NPCDrops.rockcrab;
|
||||
} else if (npc.equals("rockslug")) {
|
||||
return NPCDrops.rockslug;
|
||||
} else if (npc.equals("king_black_dragon")) {
|
||||
return NPCDrops.kingblackdragon;
|
||||
} else if (npc.equals("green_dragon")) {
|
||||
return NPCDrops.greendragon;
|
||||
} else if (npc.equals("blue_dragon")) {
|
||||
return NPCDrops.bluedragon;
|
||||
} else if (npc.equals("goblin")) {
|
||||
return NPCDrops.goblin;
|
||||
} else if (npc.equals("lesser_demon") || npc.equals("Lesser_demon")
|
||||
|| npc.equals("lesserdemon")) {
|
||||
return NPCDrops.lesserdemon;
|
||||
} else if (npc.equals("guard") || npc.equals("jail_guard")) {
|
||||
return NPCDrops.guard;
|
||||
} else if (npc.equals("al-kharid_warrior")) {
|
||||
return NPCDrops.alkharidwarrior;
|
||||
} else if (npc.equals("ice_warrior")) {
|
||||
return NPCDrops.icewarrior;
|
||||
} else if (npc.equals("kurask")) {
|
||||
return NPCDrops.kurask;
|
||||
} else if (npc.equals("ice_giant")) {
|
||||
return NPCDrops.icegiant;
|
||||
} else if (npc.equals("hobgoblin")) {
|
||||
return NPCDrops.hobgoblin;
|
||||
} else if (npc.equals("pirate")) {
|
||||
return NPCDrops.pirate;
|
||||
} else if (npc.equals("zombie")) {
|
||||
return NPCDrops.zombie;
|
||||
} else if (npc.equals("skeleton")) {
|
||||
return NPCDrops.skeleton;
|
||||
} else if (npc.equals("deadly_red_spider")) {
|
||||
return NPCDrops.deadlyredspider;
|
||||
} else if (npc.equals("rat")) {
|
||||
return NPCDrops.rat;
|
||||
} else if (npc.equals("imp")) {
|
||||
return NPCDrops.imp;
|
||||
} else if (npc.equals("cow") || npc.equals("cow_calf")) {
|
||||
return NPCDrops.cow;
|
||||
} else if (npc.equals("chicken") || npc.equals("rooster")) {
|
||||
return NPCDrops.chicken;
|
||||
} else if (npc.equals("hill_giant")) {
|
||||
return NPCDrops.hillgiant;
|
||||
} else if (npc.equals("giant_rat")) {
|
||||
return NPCDrops.giantrat;
|
||||
} else if (npc.equals("dark_wizard")) {
|
||||
return NPCDrops.darkwizard;
|
||||
} else {
|
||||
return NPCDrops.DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item name
|
||||
*
|
||||
* @param ItemID
|
||||
* @return
|
||||
*/
|
||||
public static int i(String ItemName) {
|
||||
return getItemId(ItemName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Item name main method
|
||||
*
|
||||
* @param itemName
|
||||
* @return
|
||||
*/
|
||||
public static int getItemId(String itemName) {
|
||||
for (ItemList i : GameEngine.itemHandler.ItemList) {
|
||||
if (i != null) {
|
||||
if (i.itemName.equalsIgnoreCase(itemName)) {
|
||||
return i.itemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Misc.random in shorter form
|
||||
*
|
||||
* @param random
|
||||
* @return
|
||||
*/
|
||||
public static int r(int random) {
|
||||
return Misc.random(random);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user