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