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:
Mr Extremez
2019-11-25 11:08:56 -06:00
committed by Daniel Ginovker
parent 3d1ae1b288
commit d876a923b9
379 changed files with 80684 additions and 83170 deletions
@@ -0,0 +1,209 @@
package com.rebotted.game.content.music;
import com.rebotted.game.players.Player;
import com.rebotted.util.Misc;
/**
* http://runescape.wikia.com/wiki/Music Good resource song id = 2 absx/64 = 1
* absy/64 = 0
*/
public class Music {
public static int[][] MUSIC_DATA = { // all the songs added
{ 50, 51, 2 },
{ 49, 51, 2 }, // Flour mill place
{ 48, 50, 3 },
{ 46, 56, 8 },
// {51, 60, 9},
{ 46, 50, 12 },
{ 31, 74, 16 },// mime event
// {46, 50, 49},
{ 52, 57, 14 }, { 47, 52, 15 }, { 45, 53, 18 }, { 45, 54, 18 },
{ 47, 50, 35 },
{ 50, 150, 139 },// harmony 2
{ 46, 54, 23 },// goblin village
// {47, 50, 36},
{ 51, 50, 36 }, { 47, 51, 49 }, { 51, 49, 50 }, { 44, 75, 52 },
{ 46, 53, 54 }, { 49, 54, 111 }, { 51, 60, 255 }, // scape sad
{ 45, 75, 57 }, { 47, 47, 62 },// Newbie Melody, Tutorial Island
// corrupted
{ 47, 48, 62 },// Newbie Melody, Tutorial Island
{ 48, 47, 62 },// Newbie Melody, Tutorial Island
{ 48, 48, 62 },// Newbie Melody, Tutorial Island
{ 48, 148, 144 },// underground, underground
{ 49, 48, 62 },// Newbie Melody, Tutorial Island
{ 50, 49, 64 }, { 49, 49, 64 }, { 46, 57, 355 }, // troubled
{ 43, 75, 52 },// Miracle Dance, Mind Altar
// {51, 48, 69}, // this song is currently corrupt! Do not play!
// {46, 52, 107}, // falador different
{ 46, 52, 72 }, // falador
{ 50, 50, 76 }, { 48, 49, 358 }, // Vision - wizard's tower
{ 46, 49, 92 },// karamja
{ 45, 49, 92 },// karamja diff region
{ 51, 54, 93 }, // Edgeville
{ 46, 55, 96 }, // this song is currently corrupt! Do not play!
// -seems
// fine
// {45, 49, 55},
{ 46, 60, 52 }, { 48, 54, 98 }, { 47, 49, 105 }, // tommorrow
{ 50, 52, 106 }, { 51, 51, 123 }, { 50, 53, 125 }, // Varrock But
// Laggyyyy
// {50, 53, 157}, //Varrock
{ 46, 51, 127 }, { 48, 53, 141 }, { 41, 75, 52 },// Down to Earth,
// Earth Altar
{ 42, 75, 52 },// Zealot, Water Altar
{ 48, 51, 151 }, { 51, 52, 157 }, { 51, 53, 157 }, { 52, 50, 47 },// duel
// arena
{ 52, 51, 122 }, // Duel Arena Hospital - Shine
{ 41, 40, 588 }, // Pest Control - In-game
{ 41, 41, 587 }, // Pest Control - Lobby
{ 40, 75, 52 },// Quest, Fire Altar
{ 55, 51, 380 },// Barrows
{ 50, 55, 169 }, { 49, 154, 144 }, // varrock sewers repeated
{ 50, 154, 144 }, // Varrock Sewers
{ 48, 154, 144 }, // EdgeVille dungeon
{ 48, 153, 144 }, // EdgeVilledungeon
{ 48, 150, 144 },// draynor sewers
{ 48, 151, 144 },// draynor sewers
{ 43, 43, 206 }, // monkey madness
{ 48, 55, 169 }, // Wilderness North of Edge
{ 38, 80, 469 }, // Tzhaar cave
{ 49, 57, 43 }, // wilderness 3 carrallanger
{ 42, 53, 184 }, { 49, 53, 175 }, { 50, 54, 177 }, { 42, 43, 9 },// anywhere
{ 43, 44, 9 },// anywhere again
{ 45, 42, 190 },// marooneed - crash island
{ 43, 42, 160 },// island life - works
{ 44, 49, 172 },// jungle island
{ 43, 50, 6 },// jolly r
{ 43, 49, 174 },// landlubber
{ 43, 50, 327 },// trawler
{ 42, 50, 115 },// jungly2
// {46, 49, 180},
// {45, 52, 186}, ARRIVAL CORRUPTED
{ 42, 54, 7 },// overture
{ 54, 54, 357 }, // village canfis center 3496 3489
// {0, 0, 282}, //Stillness myreque hideout
{ 53, 54, 48 }, // morytania path to Paterdomus
{ 54, 53, 347 }, // waterlogged south of canfis 3506, 3435
{ 45, 52, 72 }, { 40, 51, 191 },// knightly
{ 41, 51, 32 },// baroque
{ 40, 52, 152 }, // ballad of enchantment ardounge
{ 47, 54, 152 }, // ballad of enchantment edgeville prayer 3051 3490
{ 39, 75, 52 },// Heart and Mind, Body Altar
{ 47, 153, 325 },// Cave Background, Dwarven Mines
{ 46, 153, 325 },// Cave Background, Dwarven Mines
{ 47, 152, 325 },// Cave Background, Dwarven Mines
{ 49, 50, 327 }, { 39, 47, 83 },// big chords
{ 40, 48, 187 },// magic dance
{ 39, 48, 187 },// magic dance watchtower not sure if correct song
{ 45, 57, 185 }, // mad eadgar - doesn't play
// {40, 48, 153},//in the manor
{ 47, 53, 49 }, // Wander
{ 48, 52, 333 }, { 50, 56, 337 },
// {40, 74, 419},
{ 47, 56, 121 }, { 39, 49, 148 }, // emotion 2524, 3168
{ 39, 50, 17 }, // attack1 2515, 3230
{ 39, 54, 32 }, // voyage 2528, 3497
{ 39, 54, 82 }, // waterfall 2511, 3463
{ 40, 54, 319 }, // theme coal trucks
{ 38, 48, 80 }, // Soundscape, Castle Wars
{ 37, 148, 28 }, // Attack 5 - Castle Wars, Sara Portal
{ 43, 54, 60 }, // Lightwalk - Camelot
{ 44, 53, 119 }, // fishing catherby
{ 39, 54, 33 }, // gnome village coords = 2478, 3437
{ 38, 53, 329 }, // tree spirits
{ 38, 54, 126 }, // Gnome King
{ 37, 54, 130 }, // Gnome Ball plays a little bit out of region
// 2402,
// 3488
{ 40, 53, 328 }, // March
// {29, 81, 537},//Dogs of War - Stronghold of Security - Vault of
// War
// {31, 81, 558},//Food for Thought - Stronghold of Security -
// Catacomb
// of Famine
// {33, 82, 559},//Malady - Stronghold of Security - Pit of
// Pestilence
// {36, 81, 560},//Dance of Death - Stronghold of Security -
// Sepulchre
// of Death
{ 41, 58, 141 }, // Relleka Rock Crabs
{ 41, 53, 60 }, // Lasting - Range guild
{ 41, 54, 140 } // Talking forest
};
/**
* Checks how many areas we have loaded.
*
* @param c
* Client.
*/
public static void checkMusic(Player c) {
for (int[] aMUSIC_DATA : MUSIC_DATA) {
if (c.getX() / 64 == aMUSIC_DATA[0]
&& c.getY() / 64 == aMUSIC_DATA[1]/*
* && player . getPlayList (
* ) . auto
*/) {
if (c.getTemporary("CURRENT_SONG") == null
|| (Integer) c.getTemporary("CURRENT_SONG") != aMUSIC_DATA[2]) {
c.getPacketSender().sendMessage(
"@gre@Play Music Has Music:@bla@ " + aMUSIC_DATA[0]
+ " : " + aMUSIC_DATA[1]);
}
}
}
c.getPacketSender().sendMessage(
"@red@Play Music No Music:@bla@ " + c.getX() / 64 + " : "
+ c.getY() / 64);
}
/**
* Checks which song is played in which region.
*
* @param c
* the player.
*/
public static void playMusic(Player c) {
for (int[] aMUSIC_DATA : MUSIC_DATA) {
if (c.getX() / 64 == aMUSIC_DATA[0]
&& c.getY() / 64 == aMUSIC_DATA[1]/*
* && player .
* getPlayList ( ) .
* auto
*/) {
if (c.getTemporary("CURRENT_SONG") == null
|| (Integer) c.getTemporary("CURRENT_SONG") != aMUSIC_DATA[2]) {
c.getPlayList();
if (c.getPlayList().auto) {
c.addTemporary("CURRENT_SONG", aMUSIC_DATA[2]);
c.getPacketSender().sendSong(aMUSIC_DATA[2]);
}
int[] edgeVilleSongs = { 98, 111, 127, 157, 106 };
int toPlay = Misc.random(4);
if (aMUSIC_DATA[0] == 48 && aMUSIC_DATA[1] == 54) {
aMUSIC_DATA[2] = edgeVilleSongs[toPlay];
}
int[] karamjaSongs = { 327, 6 };
int songPlaying = Misc.random(1);
if (aMUSIC_DATA[0] == 43 && aMUSIC_DATA[1] == 50) {
aMUSIC_DATA[2] = karamjaSongs[songPlaying];
}
int[] waterfall = { 82, 32 };
int songToPlay = Misc.random(1);
if (aMUSIC_DATA[0] == 39 && aMUSIC_DATA[1] == 54) {
aMUSIC_DATA[2] = waterfall[songToPlay];
}
/*
* int[] battlefield = {148, 17}; int randomSong =
* Misc.random(1); if (aMUSIC_DATA[0] == 39 &&
* aMUSIC_DATA[1] == 50) { aMUSIC_DATA[2] =
* battlefield[randomSong]; }
*/
c.getPlayList().playSong(aMUSIC_DATA[2]);
}
}
}
}
}
@@ -0,0 +1,225 @@
package com.rebotted.game.content.music;
import java.util.HashMap;
import java.util.Map;
import com.rebotted.game.players.Player;
public class PlayList {
private final Player player;
@SuppressWarnings("unused")
private final int[] songs = { 2, 3, 12, 14, 9, 157, 76, 57, 419, 15, 18,
327, 125, 106, 123, 177, 169, 98, 141, 36, 50, 72, 186, 151, 35,
180, 105, 127, 62, 175, 54, 96, 8, 34, 1, 69, 537, 558, 559, 560,
93, 143, 337, 64, 85, 65, 158, 190, 325 };
@SuppressWarnings("unused")
private final int[] buttons = { 41, 155, 99, 167, 296, 105, 81, 123, 2,
170, 83, 59, 73, 63, 29, 24, 53, 71, 251, 28, 25, 66, 33, 171, 130,
40, 187, 113, 112, 135, 183, 86, 248, 168, 84, 61, 435, 436, 437,
434, 116, 253, 263, 47, 159, 108, 117, 199, 49 };
@SuppressWarnings("unused")
private final int[] configs = { 20, 21, 22, 23, 24, 25, 298, 311, 346, 414,
464, 598, 662, 721, 906, 1009 };
@SuppressWarnings("unused")
private final int[] values = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 };
public boolean[] unlocked = { false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false,
false, false, false, false, true, false, false, false, false,
false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false };
private final String[] names = { "Autumn Voyage", "Unknown Land",
"Long Way Home", "Witching", "Kingdom", "Medieval", "Harmony",
"Rune Essence", "Pheasant Peasant", "Workshop", "Horizon", "Dream",
"Garden", "Expanse", "Arabian 2", "Adventure", "Crystal Sword",
"Forever", "Barbarianism", "Arabian", "Al Kharid", "Fanfare",
"Arrival", "Start", "Sea Shanty 2", "Attention", "Tomorrow",
"Nightfall", "Newbie Melody", "Spirit", "Scape Soft",
"Inspiration", "Wildwood", "Wonder", "Iban", "Egypt",
"Dogs of War", "Food for Thought", "Malady", "Dance of Death",
"Parade", "Down To Earth", "Faithless", "Book Of Spells", "Vision",
"Miracle Dance", "Quest", "Heart and Mind", "Cave Background",
"Talking Forest" };
private boolean loop = false;
public boolean auto = true;
public PlayList(Player player2) {
player = player2;
}
private static enum Songs {
// action id, songid, ?, song number
AUTUMN_VOYAGE(16208, 2, 4304, 0), UNKNOWN_LAND(17066, 3, 4418, 1), LONG_WAY_HOME(
17010, 12, 4362, 2), WITCHING(17078, 14, 4430, 3), KINGDOM(
32243, 9, 8435, 4), MEDIEVAL(17016, 157, 4368, 5), HARMONY(
16248, 76, 4344, 6), RUNE_ESSENCE(17034, 57, 4386, 7), PHEASANT_PEASANT(
55108, 419, 14188, 8), WORKSHOP(17081, 15, 4433, 9), HORIZON(
16250, 18, 4346, 10), DREAM(35014, 327, 8974, 11), GARDEN(
16240, 125, 4336, 12), EXPANSE(16230, 106, 4326, 13), ARABIAN_2(
16196, 123, 4292, 14), ADVENTURE(16191, 177, 4287, 15), CRYSTAL_SWORD(
16220, 169, 4316, 16), FOREVER(16238, 98, 4334, 17), BARBARIANISM(
19000, 141, 4864, 18), ARABIAN(16195, 36, 4291, 19), AL_KHARID(
16192, 50, 4288, 20), FANFARE(16233, 72, 4329, 21), ARRIVAL(
16200, 186, 4296, 22),
// START(151, 23, 2097152, 23),
SEA_SHANTY_2(17041, 35, 4393, 24), ATTENTION(16207, 180, 4303, 25), TOMORROW(
24153, 105, 6297, 26), NIGHTFALL(17024, 127, 4376, 27), NEWBIE_MELODY(
17023, 62, 4375, 28), SPIRIT(17046, 175, 4398, 29), SCAPE_SOFT(
23100, 54, 5988, 30), INSPIRATION(16253, 96, 4349, 31), WILDWOOD(
27071, 278, 6983, 32), WONDER(17079, 34, 4431, 33), IBAN(16251,
1, 4347, 34), EGYPT(16228, 69, 4324, 35), PARADE(17027, 93,
4379, 40), DOWN_TO_EARTH(19015, 143, 4879, 41), FAITHLESS(
39145, 337, 346, 42), BOOK_OF_SPELLS(16214, 64, 4310, 43), VISION(
17070, 85, 4422, 44), MIRACLE_DANCE(17019, 65, 4371, 45), QUEST(
17028, 158, 4380, 46), HEART_AND_MIND(27033, 52, 6945, 47), // was
// 190
// changed
// to
// 52
CAVE_BACKGROUND(35012, 325, 8972, 48), TALKING_FOREST(17083, 140, 4435,
49);
private int songId;
private int buttonId;
private int childId;
private int arraySlot;
public int songId() {
return songId;
}
@SuppressWarnings("unused")
public int configId() {
return songId;
}
@SuppressWarnings("unused")
public int configNumber() {
return songId;
}
@SuppressWarnings("unused")
public int arraySlot() {
return arraySlot;
}
Songs(int buttonId, int songId, int childId, int arraySlot) {
this.buttonId = buttonId;
this.songId = songId;
this.childId = childId;
this.arraySlot = arraySlot;
}
private static Map<Integer, Songs> songs = new HashMap<Integer, Songs>();
static {
for (Songs songId : Songs.values()) {
songs.put(songId.songId(), songId);
}
}
public static Songs get(int id) {
return songs.get(id);
}
}
public void fixAllColors() {
for (int i = 0; i < 385; i++) {
if (Songs.get(i) != null) {
player.getPacketSender().sendColor(Songs.get(i).childId,
255 << 10 | 0 << 5 | 0);
if (unlocked[Songs.get(i).arraySlot]) {
updateList(Songs.get(i).childId);
}
}
}
}
public void playSong(int songID) {
// System.out.println("songId = "+songID);
try {
if (Songs.get(songID) == null) {
// player.sendMessage("This song has not yet been added to the playlist. - Song ID = "+songID);
if (auto) {
player.getPacketSender().sendFrame126("Song Unavailable!",
4439);
updateList(4439);
}
return;
}
if (!unlocked[Songs.get(songID).arraySlot]) {
player.getPacketSender().sendMessage(
"You have unlocked the song "
+ names[Songs.get(songID).arraySlot] + ".");
// System.out.println("You have unlocked the song " +
// names[Songs.get(songID).arraySlot]);
unlocked[Songs.get(songID).arraySlot] = true;
updateList(Songs.get(songID).childId);
player.getPacketSender().sendFrame126(
names[Songs.get(songID).arraySlot], 4439);
updateList(4439);
} else {
if (auto) {
player.getPacketSender().sendFrame126(
names[Songs.get(songID).arraySlot], 4439);
updateList(4439);
}
}
} catch (Exception e) {
System.out.println("Exception: " + e);
}
}
public void updateList(int id) {
player.getPacketSender().sendColor(id, 0 << 10 | 255 << 5 | 0);
}
public void handleButton(int button) {
if (button == 17023) {
return;
}
if (button == 9925) {
loop = !loop;
} else if (button == 6269) {
auto = true;
player.getPacketSender().sendConfig(18, 1);
} else if (button == 6270) {
auto = false;
player.getPacketSender().sendConfig(18, 0);
} else {
// System.out.println("button="+button);
int songId = -1;
for (int i = 0; i < 385; i++) {
if (Songs.get(i) != null) {
if (Songs.get(i).buttonId == button) {
songId = Songs.get(i).songId;
}
}
}
if (songId == -1) {
// player.getPacketDispatcher().sendMessage("That song is unavailable at this time.");
} else if (!unlocked[Songs.get(songId).arraySlot]) {
player.getPacketSender().sendMessage(
"You have to unlock that song first!");
} else {
auto = false;
player.getPacketSender().sendConfig(18, 0);
playSong(songId);
// System.out.println("sending music to ActionSender packet - song id = "+songId);
player.getPacketSender().sendSong(songId);
player.getPacketSender().sendFrame126(
names[Songs.get(songId).arraySlot], 4439);
updateList(4439);
}
}
}
}
@@ -0,0 +1,409 @@
package com.rebotted.game.content.music.sound;
import com.rebotted.GameEngine;
import com.rebotted.game.content.combat.magic.MagicData;
import com.rebotted.game.npcs.NpcHandler;
import com.rebotted.game.players.Player;
import com.rebotted.util.Misc;
/**
* CombatSounds
* @author Andrew (Mr Extremez)
*/
public class CombatSounds {
public static int getNpcAttackSounds(int NPCID) {
String npc = GetNpcName(NPCID).toLowerCase();
if (npc.contains("bat")) {
return 1;
}
if (npc.contains("cow")) {
return 4;
}
if (npc.contains("imp")) {
return 11;
}
if (npc.contains("rat")) {
return 17;
}
if (npc.contains("duck")) {
return 26;
}
if (npc.contains("wolf") || npc.contains("bear")) {
return 28;
}
if (npc.contains("dragon")) {
return 47;
}
if (npc.contains("ghost")) {
return 57;
}
if (npc.contains("goblin")) {
return 88;
}
if (npc.contains("skeleton") || npc.contains("demon")
|| npc.contains("ogre") || npc.contains("giant")
|| npc.contains("tz-") || npc.contains("jad")) {
return 48;
}
if (npc.contains("zombie")) {
return 1155;
}
if (npc.contains("man") || npc.contains("woman")
|| npc.contains("monk")) {
return 417;
}
return Misc.random(6) > 3 ? 398 : 394;
}
public static int getNpcBlockSound(int NPCID) {
String npc = GetNpcName(NPCID).toLowerCase();
if (npc.contains("bat")) {
return 7;
}
if (npc.contains("cow")) {
return 5;
}
if (npc.contains("imp")) {
return 11;
}
if (npc.contains("rat")) {
return 16;
}
if (npc.contains("duck")) {
return 24;
}
if (npc.contains("wolf") || npc.contains("bear")) {
return 34;
}
if (npc.contains("dragon")) {
return 45;
}
if (npc.contains("ghost")) {
return 53;
}
if (npc.contains("goblin")) {
return 87;
}
if (npc.contains("skeleton") || npc.contains("demon")
|| npc.contains("ogre") || npc.contains("giant")
|| npc.contains("tz-") || npc.contains("jad")) {
return 1154;
}
if (npc.contains("zombie")) {
return 1151;
}
if (npc.contains("man") && !npc.contains("woman")) {
return 816;
}
if (npc.contains("monk")) {
return 816;
}
if (!npc.contains("man") && npc.contains("woman")) {
return 818;
}
return 791;
}
public static int getNpcDeathSounds(int NPCID) {
String npc = GetNpcName(NPCID).toLowerCase();
if (npc.contains("bat")) {
return 7;
}
if (npc.contains("cow")) {
return 3;
}
if (npc.contains("imp")) {
return 9;
}
if (npc.contains("rat")) {
return 15;
}
if (npc.contains("duck")) {
return 25;
}
if (npc.contains("wolf") || npc.contains("bear")) {
return 35;
}
if (npc.contains("dragon")) {
return 44;
}
if (npc.contains("ghost")) {
return 60;
}
if (npc.contains("goblin")) {
return 125;
}
if (npc.contains("skeleton") || npc.contains("demon")
|| npc.contains("ogre") || npc.contains("giant")
|| npc.contains("tz-") || npc.contains("jad")) {
return 70;
}
if (npc.contains("zombie")) {
return 1140;
}
return 70;
}
public static String GetNpcName(int NpcID) {
return NpcHandler.NpcList[NpcID].npcName;
}
public static String getItemName(int ItemID) {
return GameEngine.itemHandler.ItemList[ItemID].itemName;
}
public static int getMagicSound(Player c, int spellId) {
return MagicData.MAGIC_SPELLS[spellId][16];
}
public static int getPlayerBlockSounds(Player c) {
int blockSound = 511;
if (c.playerEquipment[c.playerChest] == 2499
|| c.playerEquipment[c.playerChest] == 2501
|| c.playerEquipment[c.playerChest] == 2503
|| c.playerEquipment[c.playerChest] == 4746
|| c.playerEquipment[c.playerChest] == 4757
|| c.playerEquipment[c.playerChest] == 10330) {// Dragonhide
// sound
blockSound = 24;
} else if (c.playerEquipment[c.playerChest] == 10551 || // Torso
c.playerEquipment[c.playerChest] == 10438) {// 3rd age
blockSound = 32;// Weird sound
} else if (c.playerEquipment[c.playerChest] == 10338 || // 3rd age
c.playerEquipment[c.playerChest] == 7399 || // Enchanted
c.playerEquipment[c.playerChest] == 6107 || // Ghostly
c.playerEquipment[c.playerChest] == 4091 || // Mystic
c.playerEquipment[c.playerChest] == 4101 || // Mystic
c.playerEquipment[c.playerChest] == 4111 || // Mystic
c.playerEquipment[c.playerChest] == 1035 || // Zamorak
c.playerEquipment[c.playerChest] == 12971) {// Combat
blockSound = 14;// Robe sound
} else if (c.playerEquipment[c.playerShield] == 4224) {// Crystal Shield
blockSound = 30;// Crystal sound
} else if (c.playerEquipment[c.playerChest] == 1101
|| // Chains
c.playerEquipment[c.playerChest] == 1103
|| c.playerEquipment[c.playerChest] == 1105
|| c.playerEquipment[c.playerChest] == 1107
|| c.playerEquipment[c.playerChest] == 1109
|| c.playerEquipment[c.playerChest] == 1111
|| c.playerEquipment[c.playerChest] == 1113
|| c.playerEquipment[c.playerChest] == 1115
|| // Plates
c.playerEquipment[c.playerChest] == 1117
|| c.playerEquipment[c.playerChest] == 1119
|| c.playerEquipment[c.playerChest] == 1121
|| c.playerEquipment[c.playerChest] == 1123
|| c.playerEquipment[c.playerChest] == 1125
|| c.playerEquipment[c.playerChest] == 1127
|| c.playerEquipment[c.playerChest] == 4720
|| // Barrows armour
c.playerEquipment[c.playerChest] == 4728
|| c.playerEquipment[c.playerChest] == 4749
|| c.playerEquipment[c.playerChest] == 4712
|| c.playerEquipment[c.playerChest] == 11720
|| // Godwars armour
c.playerEquipment[c.playerChest] == 11724
|| c.playerEquipment[c.playerChest] == 3140
|| // Dragon
c.playerEquipment[c.playerChest] == 2615
|| // Fancy
c.playerEquipment[c.playerChest] == 2653
|| c.playerEquipment[c.playerChest] == 2661
|| c.playerEquipment[c.playerChest] == 2669
|| c.playerEquipment[c.playerChest] == 2623
|| c.playerEquipment[c.playerChest] == 3841
|| c.playerEquipment[c.playerChest] == 1127) {// Metal armour
// sound
blockSound = 15;
} else {
blockSound = 511;
}
return blockSound;
}
public static int getWeaponSounds(Player c) {
if (c.playerEquipment[c.playerWeapon] >= 1) {
String wep = getItemName(c.playerEquipment[c.playerWeapon])
.toLowerCase();
if (c.playerEquipment[c.playerWeapon] <= 0) {
switch (c.fightMode) {
case 0:
return 416;
case 2:
return 417;
case 1:
return 418;
}
}
if (c.playerEquipment[c.playerWeapon] == 4718) {// Dharok's
// Greataxe
return 1320;
}
if (c.playerEquipment[c.playerWeapon] == 4734) {// Karil's Crossbow
return 1081;
}
if (c.playerEquipment[c.playerWeapon] == 4747) {// Torag's Hammers
return 1330;
}
if (c.playerEquipment[c.playerWeapon] == 4710) {// Ahrim's Staff
return 2555;
}
if (c.playerEquipment[c.playerWeapon] == 4755) {// Verac's Flail
return 1323;
}
if (c.playerEquipment[c.playerWeapon] == 4726) {// Guthan's
// Warspear
return 2562;
}
if (c.playerEquipment[c.playerWeapon] == 772
|| c.playerEquipment[c.playerWeapon] == 1379
|| c.playerEquipment[c.playerWeapon] == 1381
|| c.playerEquipment[c.playerWeapon] == 1383
|| c.playerEquipment[c.playerWeapon] == 1385
|| c.playerEquipment[c.playerWeapon] == 1387
|| c.playerEquipment[c.playerWeapon] == 1389
|| c.playerEquipment[c.playerWeapon] == 1391
|| c.playerEquipment[c.playerWeapon] == 1393
|| c.playerEquipment[c.playerWeapon] == 1395
|| c.playerEquipment[c.playerWeapon] == 1397
|| c.playerEquipment[c.playerWeapon] == 1399
|| c.playerEquipment[c.playerWeapon] == 1401
|| c.playerEquipment[c.playerWeapon] == 1403
|| c.playerEquipment[c.playerWeapon] == 1405
|| c.playerEquipment[c.playerWeapon] == 1407
|| c.playerEquipment[c.playerWeapon] == 1409
|| c.playerEquipment[c.playerWeapon] == 9100) { // Staff
// wack
return 394;
}
if (c.playerEquipment[c.playerWeapon] == 839
|| c.playerEquipment[c.playerWeapon] == 841
|| c.playerEquipment[c.playerWeapon] == 843
|| c.playerEquipment[c.playerWeapon] == 845
|| c.playerEquipment[c.playerWeapon] == 847
|| c.playerEquipment[c.playerWeapon] == 849
|| c.playerEquipment[c.playerWeapon] == 851
|| c.playerEquipment[c.playerWeapon] == 853
|| c.playerEquipment[c.playerWeapon] == 855
|| c.playerEquipment[c.playerWeapon] == 857
|| c.playerEquipment[c.playerWeapon] == 859
|| c.playerEquipment[c.playerWeapon] == 861
|| c.playerEquipment[c.playerWeapon] == 4734
|| c.playerEquipment[c.playerWeapon] == 2023 // RuneC'Bow
|| c.playerEquipment[c.playerWeapon] == 4212
|| c.playerEquipment[c.playerWeapon] == 4214
|| c.playerEquipment[c.playerWeapon] == 4934
|| c.playerEquipment[c.playerWeapon] == 9104
|| c.playerEquipment[c.playerWeapon] == 9107) { // Bows/Crossbows
return 370;
}
if (c.playerEquipment[c.playerWeapon] == 1363
|| c.playerEquipment[c.playerWeapon] == 1365
|| c.playerEquipment[c.playerWeapon] == 1367
|| c.playerEquipment[c.playerWeapon] == 1369
|| c.playerEquipment[c.playerWeapon] == 1371
|| c.playerEquipment[c.playerWeapon] == 1373
|| c.playerEquipment[c.playerWeapon] == 1375
|| c.playerEquipment[c.playerWeapon] == 1377
|| c.playerEquipment[c.playerWeapon] == 1349
|| c.playerEquipment[c.playerWeapon] == 1351
|| c.playerEquipment[c.playerWeapon] == 1353
|| c.playerEquipment[c.playerWeapon] == 1355
|| c.playerEquipment[c.playerWeapon] == 1357
|| c.playerEquipment[c.playerWeapon] == 1359
|| c.playerEquipment[c.playerWeapon] == 1361
|| c.playerEquipment[c.playerWeapon] == 9109) { // BattleAxes/Axes
return 399;
}
if (c.playerEquipment[c.playerWeapon] == 4718
|| c.playerEquipment[c.playerWeapon] == 7808) { // Dharok
// GreatAxe
return 400;
}
if (c.playerEquipment[c.playerWeapon] == 6609
|| c.playerEquipment[c.playerWeapon] == 1307
|| c.playerEquipment[c.playerWeapon] == 1309
|| c.playerEquipment[c.playerWeapon] == 1311
|| c.playerEquipment[c.playerWeapon] == 1313
|| c.playerEquipment[c.playerWeapon] == 1315
|| c.playerEquipment[c.playerWeapon] == 1317
|| c.playerEquipment[c.playerWeapon] == 1319) { // 2h
return 425;
}
if (wep.contains("scimitar") || wep.contains("longsword")) {
return 396;
}
if (wep.contains("halberd")) {
return 420;
}
if (wep.contains("long")) {
return 396;
}
if (wep.contains("knife")) {
return 368;
}
if (wep.contains("javelin")) {
return 364;
}
if (c.playerEquipment[c.playerWeapon] == 9110) {
return 401;
}
if (c.playerEquipment[c.playerWeapon] == 4755) {
return 1059;
}
if (c.playerEquipment[c.playerWeapon] == 4153) {
return 1079;
}
if (c.playerEquipment[c.playerWeapon] == 9103) {
return 385;
}
if (c.playerEquipment[c.playerWeapon] == -1) { // fists
return 417;
}
if (c.playerEquipment[c.playerWeapon] == 2745
|| c.playerEquipment[c.playerWeapon] == 2746
|| c.playerEquipment[c.playerWeapon] == 2747
|| c.playerEquipment[c.playerWeapon] == 2748) { // Godswords
return 390;
}
if (c.playerEquipment[c.playerWeapon] == 4151) {
return 1080;
}
}
return 398;
}
public static int specialSounds(int id) {
if (id == 4151) {// whip
return 1081;
} else if (id == 5698 || id == 1231 || id == 1215) {// dds
return 793;
} else if (id == 1434) {// Mace
return 387;
} else if (id == 3204) {// halberd
return 420;
} else if (id == 4153) { // gmaul
return 1082;
} else if (id == 7158) { // d2h
return 426;
} else if (id == 4587) { // dscim
return 1305;
} else if (id == 1305) { // D Long
return 390;
} else if (id == 861 || id == 11235) { // MSB, Darkbow
return 386;
} else if (id == 1377) { // DBAxe
return 389;
}
return -1;
}
}
@@ -0,0 +1,111 @@
package com.rebotted.game.content.music.sound;
import com.rebotted.game.players.Player;
/**
* Sounds
* @author Andrew
*/
public class SoundList {
Player c;
public SoundList(Player player) {
this.c = player;
}
/**
* Skilling
*/
public static final int COOK_ITEM = 357;
public static final int MINING_ORE = 1331;
public static final int ANVIL = 468;
public static final int BONE_BURY = 380;
public static final int FIRE_LIGHT = 375, FIRE_SUCCESSFUL = 608, FIRST_ATTEMPT = 2584;
public static final int TREE_CUT_BEGIN = 471, TREE_CUTTING = 472, TREE_EMPTY = 473;
public static final int LEVEL_UP = 67;
public static final int FISHING = 289;// Cast out Net/Cage/Harpoon
public static final int START_FLY_FISHING = 377, FLY_FISHING = 378;
public static final int RUNECRAFTING = 481;
public static final int RAKE_WEEDS = 1323;// farming
public static final int SMELTING_ORE = 469;// smelting ore in furnace
public static final int SMITHING_ANVIL = 468;
public static final int STUNNED = 458;// stunned from thieving
public static final int PESTLE_MOTAR = 373;
public static final int PROSPECTING = 431;
public static final int CUT_GEM = 464;
/**
* Prayer
*/
// public static final int RECHARGE_PRAYER = 442;
// public static final int PROTECT_PRAYER = 444;
public static final int PROTECT_MELEE = 433;
public static final int PROTECT_MAGIC = 438;
public static final int PROTECT_RANGE = 444;
public static final int PROT_MAGE = 438;
public static final int NO_PRAY = 435;
public static final int PRAYER_TO_LOW = 447;
/**
* Magic
*/
public static final int MAGE_SPLASH = 193, MAGE_FAIL = 941;
public static final int TELEBLOCK_CAST = 1185, TELEBLOCK_HIT = 1183;
public static final int LOW_ALCHEMY = 224, HIGH_ALCHEMY = 223;
public static final int ICE_BLITZ = 1110;
public static final int TELEPORT = 202;
public static final int BLOOD_RUSH = 984, BLOOD_BITZ = 985;
public static final int ANCIENT_BLOOD = 986;
public static final int BLOOD_RUSH_SPLASH = 991;
public static final int WIND_STRIKE = 992;
public static final int SUPERHEAT = 217, SUPERHEAT_FAIL = 218;
public static final int BONES_TO_BANNAS = 227;
/**
* Combat
*/
public static final int SHOOT_ARROW = 370;
/**
* Click item
*/
public static final int FOOD_EAT = 317, DRINK = 334;
public static final int ITEM_PICKUP = 356, ITEM_DROP = 376;
/**
* Random Event
*/
public static final int EXPLODING_ROCK = 429, EXPLODING_ROCK_2 = 432;
public static final int KISS_FROG = 652;
/**
* Minigame
*/
public static final int DUEL_WON = 77, DUEL_LOST = 76;
/**
* Objects
*/
public static final int DITCH = 2462;
public static final int JUMPING_STONES = 455;
public static final int PICKABLE = 358;
public static final int SLASH_WEB = 237;
public static final int OPEN_DOOR = 326;
public static final int OPEN_GATE = 1328;
/**
* Items
*/
public static final int EMPTY = 334;
}