Replace a bunch of magic numbers & Fix Mackerel Spelling (#559)

* Convert Some NPCActions Magic Numbers

* IntelliJ Reformat NpcActions.java

* Convert Magic Numbers In Dye.java

* Convert More Magic Numbers In NpcActions.java

* Convert More NpcActions.java Magic Numbers

* Plugins: Replace Magic Numbers

* Skills: Cooking: Replaced all Item/Object Magic Numbers & Fixed Mackerel spelling

* Food: Fixed Mackerel spelling

* Skills: Fishing: Replace Magic Numbers

* Skills: Mining: Replace Magic Numbers

* IntelliJ Code Reformat Changed Files
This commit is contained in:
Josh Shippam
2023-01-30 00:11:12 +00:00
committed by GitHub
parent 15d6b9f35a
commit aab9cfe951
18 changed files with 2678 additions and 2754 deletions
@@ -4,6 +4,7 @@ import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ItemFirstClickEvent
import com.rs2.game.content.StaticItemList.YOYO
import com.rs2.game.players.Player
@@ -18,7 +19,7 @@ class ItemFirstClick : EventSubscriber<ItemFirstClickEvent> {
when(event.item) {
4079 -> player.startAnimation(1457) // yo-yo
YOYO -> player.startAnimation(1457)
}
@@ -4,6 +4,7 @@ import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ItemOnItemEvent
import com.rs2.game.content.StaticItemList.*
import com.rs2.game.players.Player
@SubscribesTo(ItemOnItemEvent::class)
@@ -15,9 +16,9 @@ class ItemOnItem : EventSubscriber<ItemOnItemEvent> {
player.packetSender.sendMessage("[ItemOnItem] - used: ${event.used} with: ${event.usedWith}")
}
if (event.used == 38 && event.usedWith == 590) {
player.itemAssistant.addItem(32, 1)
player.itemAssistant.deleteItem(38, 1)
if (event.used == BLACK_CANDLE && event.usedWith == TINDERBOX) {
player.itemAssistant.addItem(LIT_BLACK_CANDLE, 1)
player.itemAssistant.deleteItem(BLACK_CANDLE, 1)
}
}
@@ -4,6 +4,7 @@ import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ItemSecondClickEvent
import com.rs2.game.content.StaticItemList.YOYO
import com.rs2.game.players.Player
@SubscribesTo(ItemSecondClickEvent::class)
@@ -17,7 +18,7 @@ class ItemSecondClick : EventSubscriber<ItemSecondClickEvent> {
when(event.id) {
4079 -> player.startAnimation(1459) //yo-yo
YOYO -> player.startAnimation(1459)
}
@@ -4,6 +4,7 @@ import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ItemThirdClickEvent
import com.rs2.game.content.StaticItemList.YOYO
import com.rs2.game.players.Player
@SubscribesTo(ItemThirdClickEvent::class)
@@ -17,7 +18,7 @@ class ItemThirdClick : EventSubscriber<ItemThirdClickEvent> {
when(event.id) {
4079 -> player.startAnimation(1460) //yo-yo
YOYO -> player.startAnimation(1460)
}
@@ -1,11 +1,10 @@
package plugin.click.npc
import com.rs2.GameConstants
import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.NpcFirstClickEvent
import com.rs2.game.npcs.Npc
import com.rs2.game.content.StaticNpcList.*
import com.rs2.game.players.Player
import com.rs2.util.Misc
@@ -21,7 +20,7 @@ class NpcFirstClick : EventSubscriber<NpcFirstClickEvent> {
when(event.npc) {
1,2,3,4,5,6 -> if (Misc.random(10) <= 5) {
MAN,MAN_2,MAN_3,WOMAN,WOMAN_5,WOMAN_6 -> if (Misc.random(10) <= 5) {
player.dialogueHandler.sendDialogues(3869, player.npcType)
} else {
player.dialogueHandler.sendDialogues(3872, player.npcType)
@@ -6,6 +6,7 @@ import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ObjectFirstClickEvent
import com.rs2.game.content.skills.core.Mining
import com.rs2.game.players.Player
import com.rs2.world.clip.Region
@SubscribesTo(ObjectFirstClickEvent::class)
class ObjectFirstClick : EventSubscriber<ObjectFirstClickEvent> {
@@ -16,6 +17,10 @@ class ObjectFirstClick : EventSubscriber<ObjectFirstClickEvent> {
player.packetSender.sendMessage("[click= object], [type= first], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ]")
}
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
return
}
// if its a rock we can mine, mine it
if (Mining.rockExists(event.gameObject)) {
player.mining.startMining(player, event.gameObject, player.objectX, player.objectY, player.clickObjectType)
@@ -6,6 +6,7 @@ import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ObjectSecondClickEvent
import com.rs2.game.content.skills.thieving.Stalls
import com.rs2.game.players.Player
import com.rs2.world.clip.Region
@SubscribesTo(ObjectSecondClickEvent::class)
class ObjectSecondClick : EventSubscriber<ObjectSecondClickEvent> {
@@ -16,6 +17,10 @@ class ObjectSecondClick : EventSubscriber<ObjectSecondClickEvent> {
player.packetSender.sendMessage("[click= object], [type= second], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ]");
}
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
return
}
if (Stalls.isObject(event.gameObject)) {
Stalls.attemptStall(player, event.gameObject, player.objectX, player.objectY)
return
@@ -4,8 +4,10 @@ import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.ObjectThirdClickEvent
import com.rs2.game.content.StaticObjectList.IRON_LADDER_10177
import com.rs2.game.content.skills.thieving.Stalls
import com.rs2.game.players.Player
import com.rs2.world.clip.Region
@SubscribesTo(ObjectThirdClickEvent::class)
class ObjectThirdClick : EventSubscriber<ObjectThirdClickEvent> {
@@ -16,13 +18,17 @@ class ObjectThirdClick : EventSubscriber<ObjectThirdClickEvent> {
player.packetSender.sendMessage("[click= object], [type= third], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ], [PLUGIN]");
}
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
return
}
if (Stalls.isObject(event.gameObject)) {
Stalls.attemptStall(player, event.gameObject, player.objectX, player.objectY)
return
}
when (event.gameObject) {
10177 -> player.playerAssistant.movePlayer(1798, 4407, 3);
IRON_LADDER_10177 -> player.playerAssistant.movePlayer(1798, 4407, 3);
}
}
@@ -5,12 +5,13 @@ import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.NpcSecondClickEvent
import com.rs2.game.players.Player
import com.rs2.game.content.StaticNpcList.FADLI
@SubscribesTo(NpcSecondClickEvent::class)
class SecondClick : EventSubscriber<NpcSecondClickEvent> {
override fun subscribe(context: EventContext, player: Player, event: NpcSecondClickEvent) {
if (event.npc == 958) {
if (event.npc == FADLI) {
player.packetSender.openUpBank()
}
}
@@ -20,7 +20,7 @@ public class Food {
PINEAPPLE(2114, 2, "Pineapple", 0, "Food", false),
CHOCOLATE_BAR(1973, 2, "Chocolate Bar", 0, "Food", false),
Wine(1993, 11, "Wine", 1935, "Drink", false),
MACKERAL(355, 6, "Mackeral", 0, "Food", false),
MACKEREL(355, 6, "Mackerel", 0, "Food", false),
MANTA(391, 22, "Manta Ray", 0, "Food", false),
SHARK(385, 20, "Shark", 0, "Food", false),
LOBSTER(379, 12, "Lobster", 0, "Food", false),
@@ -1,10 +1,11 @@
package com.rs2.game.content.skills.cooking;
import java.security.SecureRandom;
import com.rs2.GameConstants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.StaticObjectList;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.content.randomevents.RandomEventHandler;
import com.rs2.game.content.skills.SkillHandler;
@@ -13,36 +14,38 @@ import com.rs2.game.items.ItemConstants;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
import java.security.SecureRandom;
public class Cooking extends SkillHandler {
private static SecureRandom cookingRandom = new SecureRandom(); // The random factor
private static enum CookingItems {
//raw, cooked, burnt, levelreq, exp, stopburn, stopburn w/gloves, name
SHRIMP(317, 315, 7954, 1, 30, 34, 30, "shrimp"),
SARDINE(327, 325, 369, 1, 40, 38, 38, "sardine"),
HERRING(345, 347, 357, 5, 50, 41, 41, "herring"),
TROUT(335, 333, 343, 15, 70, 50, 50, "trout"),
TUNA(359, 361, 367, 30, 100, 64, 63, "tuna"),
ANCHOVIES(321, 319, 323, 5, 45, 34, 34, "anchovies"),
RAW_BEEF(2132, 2142, 2146, 1, 30, 33, 33, "raw beef"),
RAW_RAT(2134, 2142, 2146, 1, 30, 33, 33, "raw rat meat"),
BURNT_MEAT(2142, 2146, 2146, 1, 1, 100, 100, "cooked meat"),
RAW_CHICKEN(2138, 2140, 2144, 1, 30, 33, 33, "raw chicken"),
RAW_BEAR_MEAT(2136, 2142, 2146, 1, 30, 33, 33, "raw bear meat"),
MACKERAL(353, 355, 357, 10, 60, 45, 45, "mackeral"),
SALMON(331, 329, 343, 25, 90, 58, 55, "salmon"),
UNCOOKED_BERRY_PIE(2321, 2325, 2329, 10, 78, 50, 50, "uncooked pie"),
PIKE(349, 351, 343, 20, 80, 59, 59, "pike"),
KARAMBWAN(3142, 3144, 3146, 1, 80, 20, 20, "karambwan"),
LOBSTER(377, 379, 381, 40, 120, 74, 68, "lobster"),
SWORDFISH(371, 373, 375, 50, 140, 86, 81, "swordfish"),
MONKFISH(7944, 7946, 7948, 62, 150, 92, 90, "monkfish"),
SHARK(383, 385, 387, 76, 210, 100, 94, "shark"),
SEA_TURTLE(395, 397, 399, 82, 211, 100, 100, "sea turtle"),
MANTA_RAY(389, 391, 393, 91, 216, 100, 100, "manta ray"),
SEAWEED(401, 1781, 1781, 1, 1, 1, 1, "sea weed"),
CURRY(2009, 2011, 2013, 60, 280, 74, 74, "curry");
SHRIMP(StaticItemList.RAW_SHRIMPS, StaticItemList.SHRIMPS, StaticItemList.BURNT_SHRIMP, 1, 30, 34, 30, "shrimp"),
SARDINE(StaticItemList.RAW_SARDINE, StaticItemList.SARDINE, StaticItemList.BURNT_FISH_369, 1, 40, 38, 38, "sardine"),
HERRING(StaticItemList.RAW_HERRING, StaticItemList.HERRING, StaticItemList.BURNT_FISH_357, 5, 50, 41, 41, "herring"),
TROUT(StaticItemList.RAW_TROUT, StaticItemList.TROUT, StaticItemList.BURNT_FISH_343, 15, 70, 50, 50, "trout"),
TUNA(StaticItemList.RAW_TUNA, StaticItemList.TUNA, StaticItemList.BURNT_FISH_367, 30, 100, 64, 63, "tuna"),
ANCHOVIES(StaticItemList.RAW_ANCHOVIES, StaticItemList.ANCHOVIES, StaticItemList.BURNT_FISH, 5, 45, 34, 34, "anchovies"),
RAW_BEEF(StaticItemList.RAW_BEEF, StaticItemList.COOKED_MEAT, StaticItemList.BURNT_MEAT, 1, 30, 33, 33, "raw beef"),
RAW_RAT(StaticItemList.RAW_RAT_MEAT, StaticItemList.COOKED_MEAT, StaticItemList.BURNT_MEAT, 1, 30, 33, 33, "raw rat meat"),
BURNT_MEAT(StaticItemList.COOKED_MEAT, StaticItemList.BURNT_MEAT, StaticItemList.BURNT_MEAT, 1, 1, 100, 100, "cooked meat"),
RAW_CHICKEN(StaticItemList.RAW_CHICKEN, StaticItemList.COOKED_CHICKEN, StaticItemList.BURNT_CHICKEN, 1, 30, 33, 33, "raw chicken"),
RAW_BEAR_MEAT(StaticItemList.RAW_BEAR_MEAT, StaticItemList.COOKED_MEAT, StaticItemList.BURNT_MEAT, 1, 30, 33, 33, "raw bear meat"),
MACKEREL(StaticItemList.RAW_MACKEREL, StaticItemList.MACKEREL, StaticItemList.BURNT_FISH_357, 10, 60, 45, 45, "mackerel"),
SALMON(StaticItemList.RAW_SALMON, StaticItemList.SALMON, StaticItemList.BURNT_FISH_343, 25, 90, 58, 55, "salmon"),
UNCOOKED_BERRY_PIE(StaticItemList.UNCOOKED_BERRY_PIE, StaticItemList.REDBERRY_PIE, StaticItemList.BURNT_PIE, 10, 78, 50, 50, "uncooked pie"),
PIKE(StaticItemList.RAW_PIKE, StaticItemList.PIKE, StaticItemList.BURNT_FISH_343, 20, 80, 59, 59, "pike"),
KARAMBWAN(StaticItemList.RAW_KARAMBWAN, StaticItemList.COOKED_KARAMBWAN, StaticItemList.COOKED_KARAMBWAN_3146, 1, 80, 20, 20, "karambwan"),
LOBSTER(StaticItemList.RAW_LOBSTER, StaticItemList.LOBSTER, StaticItemList.BURNT_LOBSTER, 40, 120, 74, 68, "lobster"),
SWORDFISH(StaticItemList.RAW_SWORDFISH, StaticItemList.SWORDFISH, StaticItemList.BURNT_SWORDFISH, 50, 140, 86, 81, "swordfish"),
MONKFISH(StaticItemList.RAW_MONKFISH, StaticItemList.MONKFISH, StaticItemList.BURNT_MONKFISH, 62, 150, 92, 90, "monkfish"),
SHARK(StaticItemList.RAW_SHARK, StaticItemList.SHARK, StaticItemList.BURNT_SHARK, 76, 210, 100, 94, "shark"),
SEA_TURTLE(StaticItemList.RAW_SEA_TURTLE, StaticItemList.SEA_TURTLE, StaticItemList.BURNT_SEA_TURTLE, 82, 211, 100, 100, "sea turtle"),
MANTA_RAY(StaticItemList.RAW_MANTA_RAY, StaticItemList.MANTA_RAY, StaticItemList.BURNT_MANTA_RAY, 91, 216, 100, 100, "manta ray"),
SEAWEED(StaticItemList.SEAWEED, StaticItemList.SODA_ASH, StaticItemList.SODA_ASH, 1, 1, 1, 1, "sea weed"),
CURRY(StaticItemList.UNCOOKED_CURRY, StaticItemList.CURRY, StaticItemList.BURNT_CURRY, 60, 280, 74, 74, "curry");
int rawItem, cookedItem, burntItem, levelReq, xp, stopBurn, stopBurnGloves;
String name;
@@ -100,11 +103,11 @@ public class Cooking extends SkillHandler {
}
public static void makeBreadOptions(Player c, int item) {
if (c.getItemAssistant().playerHasItem(1929) && c.getItemAssistant().playerHasItem(1933) && item == c.breadID) {
c.getItemAssistant().deleteItem(1929, 1);
c.getItemAssistant().deleteItem(1933, 1);
c.getItemAssistant().addItem(1925, 1);
c.getItemAssistant().addItem(1931, 1);
if (c.getItemAssistant().playerHasItem(StaticItemList.BUCKET_OF_WATER) && c.getItemAssistant().playerHasItem(StaticItemList.POT_OF_FLOUR) && item == c.breadID) {
c.getItemAssistant().deleteItem(StaticItemList.BUCKET_OF_WATER, 1);
c.getItemAssistant().deleteItem(StaticItemList.POT_OF_FLOUR, 1);
c.getItemAssistant().addItem(StaticItemList.BUCKET, 1);
c.getItemAssistant().addItem(StaticItemList.POT, 1);
c.getItemAssistant().addItem(item, 1);
c.getPacketSender().sendMessage("You mix the water and flour to make some " + ItemAssistant.getItemName(item) + ".");
}
@@ -203,7 +206,7 @@ public class Cooking extends SkillHandler {
player.doAmount = player.getItemAssistant().getItemAmount(itemId);
}
if (objectId > 0) {
player.startAnimation(objectId == 2732 ? 897 : 896);
player.startAnimation(objectId == StaticObjectList.FIRE ? 897 : 896);
}
CycleEventHandler.getSingleton().addEvent("cookingEvent".hashCode(), player, new CycleEvent() {
@Override
@@ -220,7 +223,7 @@ public class Cooking extends SkillHandler {
return;
}
boolean burn;
if (player.playerEquipment[ItemConstants.HANDS] == 775) {
if (player.playerEquipment[ItemConstants.HANDS] == StaticItemList.COOKING_GAUNTLETS) {
burn = !getSuccess(player, 3, item.getLevelReq(), item.getStopBurnGloves());
} else {
burn = !getSuccess(player, 3, item.getLevelReq(), item.getStopBurn());
@@ -255,7 +258,7 @@ public class Cooking extends SkillHandler {
}
if (player.doAmount > 0) {
if (objectId > 0) {
player.startAnimation(objectId == 2732 ? 897 : 896);
player.startAnimation(objectId == StaticObjectList.FIRE ? 897 : 896);
}
} else if (player.doAmount == 0) {
setCooking(player, false);
@@ -4,6 +4,8 @@ import com.rs2.GameConstants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.StaticObjectList;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.content.skills.SkillHandler;
import com.rs2.game.items.ItemAssistant;
@@ -14,8 +16,8 @@ public class CookingTutorialIsland extends SkillHandler {
public static void cookThisFood(Player p, int i, int object) {
switch (i) {
case 317:
cookFish(p, i, 30, 1, 323, 315, object);
case StaticItemList.RAW_SHRIMPS:
cookFish(p, i, 30, 1, StaticItemList.BURNT_FISH, StaticItemList.SHRIMPS, object);
break;
default:
p.getPacketSender().sendMessage("Nothing interesting happens.");
@@ -34,7 +36,7 @@ public class CookingTutorialIsland extends SkillHandler {
return;
}
int chance = c.playerLevel[GameConstants.COOKING];
if (c.playerEquipment[c.playerHands] == 775) {
if (c.playerEquipment[c.playerHands] == StaticItemList.COOKING_GAUNTLETS) {
chance = c.playerLevel[GameConstants.COOKING] + 8;
}
if (chance <= 0) {
@@ -90,10 +92,10 @@ public class CookingTutorialIsland extends SkillHandler {
c.stopPlayerSkill = true;
c.getPacketSender().closeAllWindows();
if (c.playerSkillProp[GameConstants.COOKING][5] > 0) {
// c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == 2732 ? 897 :
// c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.FIRE ? 897 :
// 896);
c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == 2732 ? 897
: c.playerSkillProp[GameConstants.COOKING][5] == 12269 ? 897 : 896);
c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.FIRE ? 897
: c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.STOVE_12269 ? 897 : 896);
if (GameConstants.SOUND) {
c.getPacketSender().sendSound(SoundList.COOK_ITEM, 100,
0);
@@ -162,7 +164,7 @@ public class CookingTutorialIsland extends SkillHandler {
if (c.playerSkillProp[GameConstants.COOKING][5] > 0) {
// c.getPacketSender().sendSound(357, 100, 1); //
// cook sound
c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == 2732 ? 897
c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.FIRE ? 897
: 896);
}
if (!c.stopPlayerSkill) {
@@ -1,13 +1,15 @@
package com.rs2.game.content.skills.cooking;
import java.util.HashMap;
import com.rs2.GameConstants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.items.ItemAssistant;
import com.rs2.game.players.Player;
import java.util.HashMap;
/**
* Created by IntelliJ IDEA. User: vayken Date: 23/12/11 Time: 20:42 To change
* this template use File | Settings | File Templates.
@@ -16,9 +18,9 @@ public class DairyChurn {
private static final int CHURN_ANIMATION = 894;
public static enum ChurnData {
CREAM(59238, new int[] { 1927 }, 2130, 21, 18), BUTTER(59239,
new int[] { 1927, 2130 }, 6697, 38, 40), CHEESE(59240,
new int[] { 1927, 2130, 6697 }, 1985, 48, 64);
CREAM(59238, new int[]{StaticItemList.BUCKET_OF_MILK}, StaticItemList.POT_OF_CREAM, 21, 18),
BUTTER(59239, new int[]{StaticItemList.BUCKET_OF_MILK, StaticItemList.POT_OF_CREAM}, StaticItemList.PAT_OF_BUTTER, 38, 40),
CHEESE(59240, new int[]{StaticItemList.BUCKET_OF_MILK, StaticItemList.POT_OF_CREAM, StaticItemList.PAT_OF_BUTTER}, StaticItemList.CHEESE, 48, 64);
private int buttonId;
private int[] used;
@@ -102,7 +104,7 @@ public class DairyChurn {
for (int i = 0; i < churnData.getUsed().length; i++)
player.getItemAssistant().deleteItem(churnData.getUsed()[i], 1);
player.getItemAssistant().addItem(churnData.getResult(), 1);
player.getItemAssistant().addItem(1925, 1);
player.getItemAssistant().addItem(StaticItemList.BUCKET, 1);
player.getPlayerAssistant().addSkillXP(churnData.getExperience(), GameConstants.COOKING);
}
@@ -1,13 +1,14 @@
package com.rs2.game.content.skills.cooking;
import java.util.HashMap;
import java.util.Map;
import com.rs2.GameConstants;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.randomevents.RandomEventHandler;
import com.rs2.game.content.skills.SkillHandler;
import com.rs2.game.players.Player;
import java.util.HashMap;
import java.util.Map;
public class Potatoes extends SkillHandler {
Player c;
@@ -19,9 +20,11 @@ public class Potatoes extends SkillHandler {
public enum PotatoMaking {
// first item, new item, xp, level required
// BUTTERED(6701, 6703, 6697, 95, 39),
CHILLI(7062, 7054, 165, 41), CHEESE(1985, 6705, 199, 47), EGG(7064,
7056, 195, 51), MUSHROOM(7066, 7058, 27, 64), TUNA(7068, 7060,
309, 68);
CHILLI(StaticItemList.CHILLI_CON_CARNE, StaticItemList.CHILLI_POTATO, 165, 41),
CHEESE(StaticItemList.CHEESE, StaticItemList.POTATO_WITH_CHEESE, 199, 47),
EGG(StaticItemList.EGG_AND_TOMATO, StaticItemList.EGG_POTATO, 195, 51),
MUSHROOM(StaticItemList.MUSHROOM__ONION, StaticItemList.MUSHROOM_POTATO, 27, 64),
TUNA(StaticItemList.TUNA_AND_CORN, StaticItemList.TUNA_POTATO, 309, 68);
/**
* Seperate integers for the id's.
@@ -79,7 +82,7 @@ public class Potatoes extends SkillHandler {
* @param id2
*/
public void handlePotato(int id1, int id2) {
makePotato(id1 == 6703 ? id2 : id1);
makePotato(id1 == StaticItemList.POTATO_WITH_BUTTER ? id2 : id1);
}
/**
@@ -100,7 +103,7 @@ public class Potatoes extends SkillHandler {
if (c.getItemAssistant().playerHasItem(potato.getIngredient(), 1)) {
if (c.playerLevel[GameConstants.COOKING] >= potato.getReq()) {
c.getItemAssistant().deleteItem(potato.getIngredient(), 1);
c.getItemAssistant().deleteItem(6703, 1);
c.getItemAssistant().deleteItem(StaticItemList.POTATO_WITH_BUTTER, 1);
c.getPacketSender().sendMessage("You put the topping on.");
c.getItemAssistant().addItem(potato.getNewPotatoID(), 1);
c.getPlayerAssistant().addSkillXP(potato.getXP(), GameConstants.COOKING);
@@ -11,6 +11,8 @@ import com.rs2.game.items.ItemAssistant;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
import static com.rs2.game.content.StaticItemList.*;
import static com.rs2.game.content.StaticNpcList.*;
public class Fishing extends SkillHandler {
@@ -32,24 +34,23 @@ public class Fishing extends SkillHandler {
// dataid, levelreq, item needed, bait, item recieved, exp,
// animation,
// secondfish, levelreq, secondexp
{ 1, 1, 303, -1, 317, 10, 621, 321, 15, 40 }, // SHRIMP + ANCHOVIES
{ 2, 5, 307, 313, 327, 20, 622, 345, 10, 30 }, // SARDINE + HERRING
{ 3, 16, 305, -1, 353, 20, 620, -1, -1, -1 }, // MACKEREL
{ 4, 20, 309, 314, 335, 50, 622, 331, 30, 70 }, // TROUT
{ 5, 23, 305, -1, 341, 45, 619, 363, 46, 100 }, // BASS + COD
{ 6, 25, 307, 313, 349, 60, 622, -1, -1, -1 }, // PIKE
{ 7, 35, 311, -1, 359, 80, 618, 371, 50, 100 }, // TUNA + SWORDIE
{ 8, 40, 301, -1, 377, 90, 619, -1, -1, -1 }, // LOBSTER
{ 9, 62, 303, -1, 7944, 120, 621, -1, -1, -1 }, // Monkfish
{ 10, 76, 311, -1, 383, 110, 618, -1, -1, -1 } // Shark
{1, 1, SMALL_FISHING_NET, -1, RAW_SHRIMPS, 10, 621, RAW_ANCHOVIES, 15, 40}, // SHRIMP + ANCHOVIES
{2, 5, FISHING_ROD, FISHING_BAIT, RAW_SARDINE, 20, 622, RAW_HERRING, 10, 30}, // SARDINE + HERRING
{3, 16, BIG_FISHING_NET, -1, RAW_MACKEREL, 20, 620, -1, -1, -1}, // MACKEREL
{4, 20, FLY_FISHING_ROD, FEATHER, RAW_TROUT, 50, 622, RAW_SALMON, 30, 70}, // TROUT + SALMON
{5, 23, BIG_FISHING_NET, -1, RAW_COD, 45, 619, RAW_BASS, 46, 100}, // BASS + COD
{6, 25, FISHING_ROD, FISHING_BAIT, RAW_PIKE, 60, 622, -1, -1, -1}, // PIKE
{7, 35, HARPOON, -1, RAW_TUNA, 80, 618, RAW_SWORDFISH, 50, 100}, // TUNA + SWORDFISH
{8, 40, LOBSTER_POT, -1, RAW_LOBSTER, 90, 619, -1, -1, -1}, // LOBSTER
{9, 62, SMALL_FISHING_NET, -1, RAW_MONKFISH, 120, 621, -1, -1, -1}, // MONKFISH
{10, 76, HARPOON, -1, RAW_SHARK, 110, 618, -1, -1, -1} // SHARK
};
private static String[][] messages = { { "You cast out your net." }, // SHRIMP
// +
// ANCHOVIES
{ "You cast out your line." }, // SARDINE + HERRING
{ "You start harpooning fish." }, // TUNA + SWORDIE
{ "You attempt to catch a lobster." }, // LOBSTER
private static String[][] messages = {
{"You cast out your net."}, // SHRIMP + ANCHOVIES
{"You cast out your line."}, // SARDINE + HERRING
{"You start harpooning fish."}, // TUNA + SWORDIE
{"You attempt to catch a lobster."}, // LOBSTER
};
private static void attemptdata(final Player c, final int npcId) {
@@ -267,9 +268,9 @@ public class Fishing extends SkillHandler {
c.getPacketSender()
.sendMessage(
"You catch "
+ (c.playerSkillProp[GameConstants.FISHING][1] == 321
|| c.playerSkillProp[GameConstants.FISHING][1] == 317
|| c.playerSkillProp[GameConstants.FISHING][1] == 7944 ? "some "
+ (c.playerSkillProp[GameConstants.FISHING][1] == RAW_ANCHOVIES
|| c.playerSkillProp[GameConstants.FISHING][1] == RAW_SHRIMPS
|| c.playerSkillProp[GameConstants.FISHING][1] == RAW_MONKFISH ? "some "
: "a ")
+ ItemAssistant
.getItemName(
@@ -347,10 +348,8 @@ public class Fishing extends SkillHandler {
public static boolean hasFishingEquipment(Player c, int equipment) {
if (!c.getItemAssistant().playerHasItem(equipment)) {
if (equipment == 311) {
if (!c.getItemAssistant().playerHasItem(311)
&& !c.getItemAssistant().playerHasItem(10129)
&& c.playerEquipment[3] != 10129) {
if (equipment == HARPOON) {
if (!c.getItemAssistant().playerHasItem(HARPOON)) {
c.getPacketSender().sendMessage(
"You need a "
+ ItemAssistant.getItemName(equipment)
@@ -443,87 +442,95 @@ public class Fishing extends SkillHandler {
switch (i) {
case 1:
switch (l) {
case 319:
case 329:
case 323:
case 325:
case 326:
case 327:
case 330:
case 332:
case 404:
case 316: // NET + BAIT
// NET + BAIT
case FISHING_SPOT_316:
case FISHING_SPOT_319:
case FISHING_SPOT_323:
case FISHING_SPOT_325:
case FISHING_SPOT_326:
case FISHING_SPOT_327:
case FISHING_SPOT_329:
case FISHING_SPOT_330:
case FISHING_SPOT_333:
case FISHING_SPOT_404:
Fishing.attemptdata(c, 1);
break;
case 334:
case 313: // NET + HARPOON
// NET + HARPOON
case FISHING_SPOT_313:
case FISHING_SPOT_334:
Fishing.attemptdata(c, 3);
break;
case 322: // NET + HARPOON
// NET + HARPOON
case FISHING_SPOT_322:
Fishing.attemptdata(c, 5);
break;
case 309: // LURE
case 310:
case 403:
case 311:
case 314:
case 315:
case 317:
case 318:
case 328:
case 331:
// LURE
case FISHING_SPOT_309:
case FISHING_SPOT_310:
case FISHING_SPOT_311:
case FISHING_SPOT_314:
case FISHING_SPOT_315:
case FISHING_SPOT_317:
case FISHING_SPOT_318:
case FISHING_SPOT_328:
case FISHING_SPOT_331:
case FISHING_SPOT_403:
Fishing.attemptdata(c, 4);
break;
case 1191:
case FISHING_SPOT_1191:
Fishing.attemptdata(c, 9);
break;
case 312:
case 321:
case 405:
case 324: // CAGE + HARPOON
// CAGE + HARPOON
case FISHING_SPOT_312:
case FISHING_SPOT_321:
case FISHING_SPOT_324:
case FISHING_SPOT_405:
Fishing.attemptdata(c, 8);
break;
}
break;
case 2:
switch (l) {
case 326:
case 327:
case 330:
case 332:
case 404:
case 316: // BAIT + NET
// BAIT + NET
case FISHING_SPOT_316:
case FISHING_SPOT_326:
case FISHING_SPOT_327:
case FISHING_SPOT_330:
case FISHING_SPOT_332:
case FISHING_SPOT_404:
Fishing.attemptdata(c, 2);
break;
case 319:
case 323:
case 325: // BAIT + NET
case FISHING_SPOT_319:
case FISHING_SPOT_323:
case FISHING_SPOT_325: // BAIT + NET
Fishing.attemptdata(c, 9);
break;
case 310:
case 311:
case 314:
case 315:
case 317:
case 318:
case 328:
case 329:
case 331:
case 403:
case 309: // BAIT + LURE
// BAIT + LURE
case FISHING_SPOT_309:
case FISHING_SPOT_310:
case FISHING_SPOT_311:
case FISHING_SPOT_314:
case FISHING_SPOT_315:
case FISHING_SPOT_317:
case FISHING_SPOT_318:
case FISHING_SPOT_328:
case FISHING_SPOT_329:
case FISHING_SPOT_331:
case FISHING_SPOT_403:
Fishing.attemptdata(c, 6);
break;
case 312:
case 321:
case 405:
case 1191:
case 324:// SWORDIES+TUNA-CAGE+HARPOON
// SWORDIES+TUNA-CAGE+HARPOON
case FISHING_SPOT_312:
case FISHING_SPOT_321:
case FISHING_SPOT_324:
case FISHING_SPOT_405:
case FISHING_SPOT_1191:
Fishing.attemptdata(c, 7);
break;
case 313:
case 322:
case 334: // NET+HARPOON
// NET+HARPOON
case FISHING_SPOT_313:
case FISHING_SPOT_322:
case FISHING_SPOT_334:
Fishing.attemptdata(c, 10);
break;
}
@@ -532,11 +539,11 @@ public class Fishing extends SkillHandler {
}
public static boolean fishingNPC(Player c, int npc) {
for (int i = 308; i < 335; i++) {
for (int i = MASTER_FISHER; i < NULL_335; i++) {
if (npc == i) {
return true;
}
if (npc == 1191) {
if (npc == FISHING_SPOT_1191) {
return true;
}
}
@@ -1,7 +1,11 @@
package com.rs2.game.content.skills.core;
import com.rs2.GameConstants;
import com.rs2.event.*;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.StaticObjectList;
import com.rs2.game.items.ItemAssistant;
import com.rs2.game.objects.Object;
import com.rs2.game.players.Player;
@@ -14,8 +18,8 @@ public class Mining {
/**
* Andrew (Mr Extremez)
*/
private static final int[] RANDOM_GEMS = {1617, 1619, 1621, 1623};
private static final int[] GLORIES = {1706, 1708, 1710, 1712};
private static final int[] RANDOM_GEMS = {StaticItemList.UNCUT_DIAMOND, StaticItemList.UNCUT_RUBY, StaticItemList.UNCUT_EMERALD, StaticItemList.UNCUT_SAPPHIRE};
private static final int[] GLORIES = {StaticItemList.AMULET_OF_GLORY1, StaticItemList.AMULET_OF_GLORY2, StaticItemList.AMULET_OF_GLORY3, StaticItemList.AMULET_OF_GLORY4};
public boolean giveGem(Player player) {
int chance = 256;
@@ -28,43 +32,43 @@ public class Mining {
}
public void obtainGem(Player player) {
int reward = RANDOM_GEMS[(int)(RANDOM_GEMS.length * Math.random())];
int reward = RANDOM_GEMS[(int) (RANDOM_GEMS.length * Math.random())];
player.getItemAssistant().addItem(reward, 1);
player.getPacketSender().sendMessage("You found an " + ItemAssistant.getItemName(reward) + ".");
}
public final int[][] Pick_Settings = {
{1265, 1, 1, 625}, //Bronze
{1267, 1, 2, 626}, //Iron
{1269, 6, 3, 627}, //Steel
{1273, 21, 4, 629}, //Mithril
{1271, 31, 5, 628}, //Addy
{1275, 41, 6, 624}, //Rune
{StaticItemList.BRONZE_PICKAXE, 1, 1, 625}, //Bronze
{StaticItemList.IRON_PICKAXE, 1, 2, 626}, //Iron
{StaticItemList.STEEL_PICKAXE, 6, 3, 627}, //Steel
{StaticItemList.MITHRIL_PICKAXE, 21, 4, 629}, //Mithril
{StaticItemList.ADAMANT_PICKAXE, 31, 5, 628}, //Addy
{StaticItemList.RUNE_PICKAXE, 41, 6, 624}, //Rune
};
public static enum gems {
OPAL(1625, 60),
JADE(1627, 30),
RED_TOPAZ(1629, 15),
SAPHIRE(1623, 9),
EMERALD(1621, 5),
RUBY(1619, 5),
DIAMOND(1617, 4);
OPAL(StaticItemList.UNCUT_OPAL, 60),
JADE(StaticItemList.UNCUT_JADE, 30),
RED_TOPAZ(StaticItemList.UNCUT_RED_TOPAZ, 15),
SAPHIRE(StaticItemList.UNCUT_SAPPHIRE, 9),
EMERALD(StaticItemList.UNCUT_EMERALD, 5),
RUBY(StaticItemList.UNCUT_RUBY, 5),
DIAMOND(StaticItemList.UNCUT_DIAMOND, 4);
public final int itemID;
public final int chance;
gems(int itemID, int chance){
gems(int itemID, int chance) {
this.itemID = itemID;
this.chance = chance;
}
public static int getRandom(){
public static int getRandom() {
final int maxChance = 128;
int random = (int) Math.floor(Math.random() * maxChance);
int index = 0;
for (gems gem: gems.values()){
for (gems gem : gems.values()) {
index += gem.chance;
if (index >= random)
return gem.itemID;
@@ -73,22 +77,23 @@ public class Mining {
}
}
//Rock ID's, Level Req, XP, mineTimer, respawnTimer, Ore ID's
public static enum rockData {
ESSENCE(new int[] { 2491 }, 1, 5, 2, 0, new int[] { 1436, 7936 }),
CLAY(new int[] { 2108, 2109, 11189, 11190, 11191, 9713, 9711, 14905, 14904 }, 1, 5, 1, 2, new int[] { 434 }),
COPPER(new int[] { 3042, 2091, 2090, 9708, 9709, 9710, 11960, 14906, 14907 }, 1, 18, 1, 4, new int[] { 436 }),
TIN(new int[] { 2094, 2095, 3043, 9716, 9714, 11958, 11957, 11959, 11933, 11934, 11935, 14903, 14902 }, 1, 18, 1, 4, new int[] { 438 }),
BLURITE(new int[] { 10574, 10583, 10584, 2110 }, 10, 20, 1, 42, new int[] { 668 }),
IRON(new int[] { 450, 2093, 2092, 9717, 9718, 9719, 11962, 11956, 11954, 14856, 14857, 14858, 14914, 14913 }, 15, 35, 2, 9, new int[] { 440 }),
SILVER(new int[] { 2101, 11186, 11187, 11188, 2100 }, 20, 40, 3, 100, new int[] { 442 }),
COAL(new int[] { 2096, 2097, 11963, 11964, 14850, 14851, 14852, 11930, 11931, 11932 }, 30, 50, 4, 50, new int[] { 453 }),
GOLD(new int[] { 2099, 2098, 11183, 11184, 11185, 9720, 9722 }, 40, 65, 6, 100, new int[] { 444 }),
MITHRIL(new int[] { 2103, 2102, 14853, 14854, 14855 }, 55, 80, 8, 200, new int[] { 447 }),
ADAMANT(new int[] { 2104, 2105, 14862, 14863, 14864 }, 70, 95, 10, 400, new int[] { 449 }),
RUNE(new int[] { 14859, 14860, 2106, 2107 }, 85, 125, 20, 1200, new int[] { 451 }),
GRANITE(new int[] { 10947 }, 45, 75, 10, 8, new int[] { 6979, 6981, 6983 }),
SANDSTONE(new int[] { 10946 }, 35, 60, 5, 8, new int[] { 6971, 6973, 6975, 6977 }),
GEM(new int[] {2111}, 40, 65, 6, 175, new int[] {});
ESSENCE(new int[]{StaticObjectList.RUNE_ESSENCE}, 1, 5, 2, 0, new int[]{StaticItemList.RUNE_ESSENCE, StaticItemList.PURE_ESSENCE}),
CLAY(new int[]{StaticObjectList.ROCKS_2108, StaticObjectList.ROCKS_2109, StaticObjectList.ROCKS_11189, StaticObjectList.ROCKS_11190, StaticObjectList.ROCKS_11191, StaticObjectList.ROCKS_9713, StaticObjectList.ROCKS_9711, StaticObjectList.ROCKS_14905, StaticObjectList.ROCKS_14904}, 1, 5, 1, 2, new int[]{StaticItemList.CLAY}),
COPPER(new int[]{StaticObjectList.ROCKS_3042, StaticObjectList.ROCKS_2091, StaticObjectList.ROCKS_2090, StaticObjectList.ROCKS_9708, StaticObjectList.ROCKS_9709, StaticObjectList.ROCKS_9710, StaticObjectList.ROCKS_11960, StaticObjectList.ROCKS_14906, StaticObjectList.ROCKS_14907}, 1, 18, 1, 4, new int[]{StaticItemList.COPPER_ORE}),
TIN(new int[]{StaticObjectList.ROCKS_2094, StaticObjectList.ROCKS_2095, StaticObjectList.ROCKS_3043, StaticObjectList.ROCKS_9716, StaticObjectList.ROCKS_9714, StaticObjectList.ROCKS_11958, StaticObjectList.ROCKS_11957, StaticObjectList.ROCKS_11959, StaticObjectList.ROCKS_11933, StaticObjectList.ROCKS_11934, StaticObjectList.ROCKS_11935, StaticObjectList.ROCKS_14903, StaticObjectList.ROCKS_14902}, 1, 18, 1, 4, new int[]{StaticItemList.TIN_ORE}),
BLURITE(new int[]{StaticObjectList.ROCKS_10583, StaticObjectList.ROCKS_10584, StaticObjectList.ROCKS_2110}, 10, 20, 1, 42, new int[]{StaticItemList.BLURITE_ORE}),
IRON(new int[]{StaticObjectList.ROCKS, StaticObjectList.ROCKS_2093, StaticObjectList.ROCKS_2092, StaticObjectList.ROCKS_9717, StaticObjectList.ROCKS_9718, StaticObjectList.ROCKS_9719, StaticObjectList.ROCKS_11962, StaticObjectList.ROCKS_11956, StaticObjectList.ROCKS_11954, StaticObjectList.ROCKS_14856, StaticObjectList.ROCKS_14857, StaticObjectList.ROCKS_14858, StaticObjectList.ROCKS_14914, StaticObjectList.ROCKS_14913}, 15, 35, 2, 9, new int[]{StaticItemList.IRON_ORE}),
SILVER(new int[]{StaticObjectList.ROCKS_2101, StaticObjectList.ROCKS_11186, StaticObjectList.ROCKS_11187, StaticObjectList.ROCKS_11188, StaticObjectList.ROCKS_2100}, 20, 40, 3, 100, new int[]{StaticItemList.SILVER_ORE}),
COAL(new int[]{StaticObjectList.ROCKS_2096, StaticObjectList.ROCKS_2097, StaticObjectList.ROCKS_11963, StaticObjectList.ROCKS_11964, StaticObjectList.ROCKS_14850, StaticObjectList.ROCKS_14851, StaticObjectList.ROCKS_14852, StaticObjectList.ROCKS_11930, StaticObjectList.ROCKS_11931, StaticObjectList.ROCKS_11932}, 30, 50, 4, 50, new int[]{StaticItemList.COAL}),
GOLD(new int[]{StaticObjectList.ROCKS_2099, StaticObjectList.ROCKS_2098, StaticObjectList.ROCKS_11183, StaticObjectList.ROCKS_11184, StaticObjectList.ROCKS_11185, StaticObjectList.ROCKS_9720, StaticObjectList.ROCKS_9722}, 40, 65, 6, 100, new int[]{StaticItemList.GOLD_ORE}),
MITHRIL(new int[]{StaticObjectList.ROCKS_2103, StaticObjectList.ROCKS_2102, StaticObjectList.ROCKS_14853, StaticObjectList.ROCKS_14854, StaticObjectList.ROCKS_14855}, 55, 80, 8, 200, new int[]{StaticItemList.MITHRIL_ORE}),
ADAMANT(new int[]{StaticObjectList.ROCKS_2104, StaticObjectList.ROCKS_2105, StaticObjectList.ROCKS_14862, StaticObjectList.ROCKS_14863, StaticObjectList.ROCKS_14864}, 70, 95, 10, 400, new int[]{StaticItemList.ADAMANTITE_ORE}),
RUNE(new int[]{StaticObjectList.ROCKS_14859, StaticObjectList.ROCKS_14860, StaticObjectList.ROCKS_2106, StaticObjectList.ROCKS_2107}, 85, 125, 20, 1200, new int[]{StaticItemList.RUNITE_ORE}),
GRANITE(new int[]{StaticObjectList.ROCKS_10947}, 45, 75, 10, 8, new int[]{StaticItemList.GRANITE_500G, StaticItemList.GRANITE_2KG, StaticItemList.GRANITE_5KG}),
SANDSTONE(new int[]{StaticObjectList.ROCKS_10946}, 35, 60, 5, 8, new int[]{StaticItemList.SANDSTONE_1KG, StaticItemList.SANDSTONE_2KG, StaticItemList.SANDSTONE_5KG, StaticItemList.SANDSTONE_10KG}),
GEM(new int[]{StaticObjectList.ROCKS_2111}, 40, 65, 6, 175, new int[]{});
private final int levelReq, mineTimer, respawnTimer, xp;
private final int[] oreIds;
@@ -141,7 +146,7 @@ public class Mining {
return oreIds;
}
public int getOre(int playerLevel){
public int getOre(int playerLevel) {
if (this == rockData.ESSENCE)
return playerLevel < 30 ? oreIds[0] : oreIds[1];
if (this == rockData.GEM)
@@ -243,9 +248,9 @@ public class Mining {
resetMining(player);
return;
}
if (player.getItemAssistant().playerHasItem(438)) {
if (player.getItemAssistant().playerHasItem(StaticItemList.TIN_ORE)) {
player.getPacketSender().createArrow(3086, 9501, player.getH(), 2);
player.getDialogueHandler().chatboxText("Now you have some tin ore you must need some copper ore, then", "you'll have all you need to create a bronze bar. As you did before", "riger click on the copper rock and select 'mine'.", "", "Mining");
player.getDialogueHandler().chatboxText("Now you have some tin ore you must need some copper ore, then", "you'll have all you need to create a bronze bar. As you did before", "right click on the copper rock and select 'mine'.", "", "Mining");
player.tutorialProgress = 18;
}
} else if (player.tutorialProgress == 18) {
@@ -254,7 +259,7 @@ public class Mining {
resetMining(player);
return;
}
if (player.getItemAssistant().playerHasItem(436)) {
if (player.getItemAssistant().playerHasItem(StaticItemList.COPPER_ORE)) {
player.getPacketSender().createArrow(3078, 9495, 0, 2);
player.getDialogueHandler().sendDialogues(3061, -1);
}
@@ -269,6 +274,7 @@ public class Mining {
startMining(player, objectID, objectX, objectY, type);
}
}
@Override
public void stop() {
player.getPacketSender().closeAllWindows();
@@ -292,18 +298,18 @@ public class Mining {
}
public int getTimer(rockData rock, int pick, int level) {
double timer = (int)((rock.getRequiredLevel() * 2) + 20 + Misc.random(20))-((Pick_Settings[pick][2] * (Pick_Settings[pick][2] * 0.75)) + level);
double timer = (int) ((rock.getRequiredLevel() * 2) + 20 + Misc.random(20)) - ((Pick_Settings[pick][2] * (Pick_Settings[pick][2] * 0.75)) + level);
if (timer < 2.0) {
return 2;
} else {
return (int)timer;
return (int) timer;
}
}
public void mineRock(int respawnTime, int x, int y, int type, int i) {
if (i != 2491) {
new Object(452, x, y, 0, type, 10, i, respawnTime);
Region.addObject(452, x, y, 0, 10, type, false);
if (i != StaticObjectList.RUNE_ESSENCE) {
new Object(StaticObjectList.ROCKS_452, x, y, 0, type, 10, i, respawnTime);
Region.addObject(StaticObjectList.ROCKS_452, x, y, 0, 10, type, false);
for (int t = 0; t < PlayerHandler.players.length; t++) {
if (PlayerHandler.players[t] != null) {
@@ -379,6 +385,7 @@ public class Mining {
player.getPacketSender().sendMessage("This rock contains " + itemName + ".");
container.stop();
}
@Override
public void stop() {
@@ -394,6 +401,7 @@ public class Mining {
c.getPacketSender().sendMessage("There is no ore left in this rock.");
container.stop();
}
@Override
public void stop() {
@@ -1,24 +1,27 @@
package com.rs2.game.items.impl;
import com.rs2.game.items.ItemData;
import com.rs2.GameConstants;
import com.rs2.game.items.ItemAssistant;
import com.rs2.game.items.ItemData;
import com.rs2.game.players.Player;
import static com.rs2.game.content.StaticItemList.*;
/**
* Dye.java
*
* @author Andrew (Mr Extremez)
*/
public enum Dye {
RED_CAPE(1763, 1007),
BLUE_CAPE(1767, 1021),
GREEN_CAPE(1771, 1027),
PINK_CAPE(6955, 6959),
ORANGE_CAPE(1769, 1031),
YELLOW_CAPE(1765, 1023),
PURPLE_CAPE(1773, 1029);
RED_CAPE(RED_DYE, CAPE),
BLUE_CAPE(BLUE_DYE, CAPE_1021),
GREEN_CAPE(GREEN_DYE, CAPE_1027),
PINK_CAPE(PINK_DYE, CAPE_6959),
ORANGE_CAPE(ORANGE_DYE, CAPE_1031),
YELLOW_CAPE(YELLOW_DYE, CAPE_1023),
PURPLE_CAPE(PURPLE_DYE, CAPE_1029);
int reward, itemUsed;
@@ -39,12 +42,12 @@ public enum Dye {
//red+blue = purple
public static final int[][] MAIL_DATA = {
{1769, 288, 286},
{1769, 287, 286},
{1767, 288, 287},
{1767, 286, 287},
{1767, 1765, 1771},
{1763, 1767, 1773}
{ORANGE_DYE, GOBLIN_MAIL, ORANGE_GOBLIN_MAIL},
{ORANGE_DYE, BLUE_GOBLIN_MAIL, ORANGE_GOBLIN_MAIL},
{BLUE_DYE, GOBLIN_MAIL, BLUE_GOBLIN_MAIL},
{BLUE_DYE, ORANGE_GOBLIN_MAIL, BLUE_GOBLIN_MAIL},
{BLUE_DYE, YELLOW_DYE, GREEN_DYE},
{RED_DYE, BLUE_DYE, PURPLE_DYE}
};
public static boolean blockDye(Player player, Dye dye, int itemUsed, int useWith) {
@@ -61,7 +64,7 @@ public enum Dye {
}
public static void dyeItem(Player player, int itemUsed, int useWith) {
for (Dye cape: Dye.values()) {
for (Dye cape : Dye.values()) {
if (blockDye(player, cape, itemUsed, useWith)) {
return;
}
File diff suppressed because it is too large Load Diff