mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +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.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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user