mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
Replaced magic number -> Components
This commit is contained in:
parent
02a0c7f8e7
commit
7adbe80164
28 changed files with 88 additions and 62 deletions
|
|
@ -7,6 +7,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.node.item.GroundItemManager
|
import core.game.node.item.GroundItemManager
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.game.node.item.WeightedChanceItem
|
import core.game.node.item.WeightedChanceItem
|
||||||
|
import core.tools.Components
|
||||||
import core.tools.Items
|
import core.tools.Items
|
||||||
import core.tools.RandomFunction
|
import core.tools.RandomFunction
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
@ -89,7 +90,7 @@ object RewardChest {
|
||||||
rewards.add(RandomFunction.rollWeightedChanceTable(*DROP_TABLE))
|
rewards.add(RandomFunction.rollWeightedChanceTable(*DROP_TABLE))
|
||||||
}
|
}
|
||||||
InterfaceContainer.generateItems(player, rewards.toTypedArray(), arrayOf("Pog!","Examine"), 364, 4,3,4)
|
InterfaceContainer.generateItems(player, rewards.toTypedArray(), arrayOf("Pog!","Examine"), 364, 4,3,4)
|
||||||
player.interfaceManager.open(Component(364))
|
player.interfaceManager.open(Component(Components.trail_reward_364))
|
||||||
BossKillCounter.addtoBarrowsCount(player)
|
BossKillCounter.addtoBarrowsCount(player)
|
||||||
for(item in rewards){
|
for(item in rewards){
|
||||||
if(!player.inventory.add(item)){
|
if(!player.inventory.add(item)){
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@ import core.game.world.map.Location
|
||||||
import core.game.world.map.build.DynamicRegion
|
import core.game.world.map.build.DynamicRegion
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
import core.tools.Items
|
import core.tools.*
|
||||||
import core.tools.RandomFunction
|
|
||||||
import core.tools.secondsToTicks
|
|
||||||
import core.tools.ticksToSeconds
|
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
|
|
@ -28,8 +25,8 @@ import kotlin.random.Random
|
||||||
* Handles a fishing trawler session
|
* Handles a fishing trawler session
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
private const val OVERLAY_ID = 366
|
private const val OVERLAY_ID = Components.trawler_overlay_366
|
||||||
private const val TUTORIAL_ID = 368
|
private const val TUTORIAL_ID = Components.trawler_start_368
|
||||||
private val HOLE_X_COORDS = intArrayOf(29,30,31,32,33,34,35,36)
|
private val HOLE_X_COORDS = intArrayOf(29,30,31,32,33,34,35,36)
|
||||||
private const val HOLE_NORTH_Y = 26
|
private const val HOLE_NORTH_Y = 26
|
||||||
private const val HOLE_SOUTH_Y = 23
|
private const val HOLE_SOUTH_Y = 23
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import core.game.world.GameWorld
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.game.interaction.FOGRewardsInterface
|
import core.game.interaction.FOGRewardsInterface
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class ReggieDialogue(player: Player? = null) : DialoguePlugin(player){
|
class ReggieDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||||
|
|
@ -33,7 +34,7 @@ class ReggieDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||||
2 -> end()
|
2 -> end()
|
||||||
3 -> npc("Sure thing. My tokens are 1000 coins","each.").also { stage = 10 }
|
3 -> npc("Sure thing. My tokens are 1000 coins","each.").also { stage = 10 }
|
||||||
}
|
}
|
||||||
1 -> end().also { player.interfaceManager.open(Component(732)) }
|
1 -> end().also { player.interfaceManager.open(Component(Components.fog_reward_732)) }
|
||||||
|
|
||||||
//Buying tokens with config option set to true
|
//Buying tokens with config option set to true
|
||||||
10 -> player?.dialogueInterpreter?.sendOptions("How many?","50","100","250","500").also { stage++ }
|
10 -> player?.dialogueInterpreter?.sendOptions("How many?","50","100","250","500").also { stage++ }
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the prepare option for gnome battas
|
* Handles the prepare option for gnome battas
|
||||||
|
|
@ -22,7 +23,7 @@ class GnomeBattaPrepareHandler : OptionHandler() {
|
||||||
|
|
||||||
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
||||||
player ?: return false
|
player ?: return false
|
||||||
player.interfaceManager.open(Component(434))
|
player.interfaceManager.open(Component(Components.gnome_battas_434))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class GnomeBowlPrepareHandler : OptionHandler() {
|
class GnomeBowlPrepareHandler : OptionHandler() {
|
||||||
|
|
@ -18,7 +19,7 @@ class GnomeBowlPrepareHandler : OptionHandler() {
|
||||||
|
|
||||||
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
||||||
player ?: return false
|
player ?: return false
|
||||||
player.interfaceManager.open(Component(435))
|
player.interfaceManager.open(Component(Components.gnome_bowls_435))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the mix-cocktail option for the cocktail shaker
|
* Handles the mix-cocktail option for the cocktail shaker
|
||||||
|
|
@ -22,7 +23,7 @@ class CocktailShakerHandler : OptionHandler() {
|
||||||
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
||||||
player ?: return false
|
player ?: return false
|
||||||
node ?: return false
|
node ?: return false
|
||||||
player.interfaceManager.open(Component(436)) //Gnome cocktail interface
|
player.interfaceManager.open(Component(Components.gnome_cocktails_436)) //Gnome cocktail interface
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@ import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
private const val HALF_BAKED_CRUNCHY = 2201
|
private const val HALF_BAKED_CRUNCHY = 2201
|
||||||
private const val CRUNCHY_INTERFACE = 437
|
private const val CRUNCHY_INTERFACE = Components.gnome_crunchies_437
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the gnome crunchy interface
|
* Opens the gnome crunchy interface
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.system.task.Pulse
|
import core.game.system.task.Pulse
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
|
import core.tools.Components
|
||||||
import core.tools.RandomFunction
|
import core.tools.RandomFunction
|
||||||
|
|
||||||
class PlunderSession(val player: Player) {
|
class PlunderSession(val player: Player) {
|
||||||
|
|
@ -24,7 +25,7 @@ class PlunderSession(val player: Player) {
|
||||||
fun init(){
|
fun init(){
|
||||||
player.setAttribute("plunder-session",this)
|
player.setAttribute("plunder-session",this)
|
||||||
GameWorld.Pulser.submit(PlunderPulse(player))
|
GameWorld.Pulser.submit(PlunderPulse(player))
|
||||||
player.interfaceManager.openOverlay(Component(428))
|
player.interfaceManager.openOverlay(Component(Components.ntk_overlay_428))
|
||||||
isActive = true
|
isActive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import core.game.component.Component
|
||||||
import core.game.node.entity.npc.NPC
|
import core.game.node.entity.npc.NPC
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialogue for Asyff, the fancy dress shop owner
|
* Dialogue for Asyff, the fancy dress shop owner
|
||||||
|
|
@ -28,7 +29,7 @@ class AsyffDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||||
10 -> end().also { npc.openShop(player) }
|
10 -> end().also { npc.openShop(player) }
|
||||||
|
|
||||||
//Can you make clothing suitable for hunting
|
//Can you make clothing suitable for hunting
|
||||||
20 -> end().also { player.interfaceManager.open(Component(477)) }//Open custom fur clothing interface
|
20 -> end().also { player.interfaceManager.open(Component(Components.custom_fur_clothing_477)) }//Open custom fur clothing interface
|
||||||
|
|
||||||
//I think I might just leave the perusing for now, thanks.
|
//I think I might just leave the perusing for now, thanks.
|
||||||
30 -> end()
|
30 -> end()
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import core.game.node.item.Item
|
||||||
import core.net.packet.PacketRepository
|
import core.net.packet.PacketRepository
|
||||||
import core.net.packet.context.ChildPositionContext
|
import core.net.packet.context.ChildPositionContext
|
||||||
import core.net.packet.out.RepositionChild
|
import core.net.packet.out.RepositionChild
|
||||||
|
import core.tools.Components
|
||||||
import core.tools.StringUtils
|
import core.tools.StringUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -126,7 +127,7 @@ open class SkillDialogueHandler(
|
||||||
TWO_OPTION(303, 7, 2) {
|
TWO_OPTION(303, 7, 2) {
|
||||||
override fun display(player: Player, handler: SkillDialogueHandler) {
|
override fun display(player: Player, handler: SkillDialogueHandler) {
|
||||||
var item: Item
|
var item: Item
|
||||||
player.interfaceManager.openChatbox(306)
|
player.interfaceManager.openChatbox(Components.same_306)
|
||||||
for (i in handler.data.indices) {
|
for (i in handler.data.indices) {
|
||||||
item = handler.data[i] as Item
|
item = handler.data[i] as Item
|
||||||
player.packetDispatch.sendString("<br><br><br><br>" + handler.getName(item), 303, 7 + i)
|
player.packetDispatch.sendString("<br><br><br><br>" + handler.getName(item), 303, 7 + i)
|
||||||
|
|
@ -218,7 +219,7 @@ open class SkillDialogueHandler(
|
||||||
private val positions = arrayOf(intArrayOf(10, 30), intArrayOf(117, 10), intArrayOf(217, 20), intArrayOf(317, 15), intArrayOf(408, 15))
|
private val positions = arrayOf(intArrayOf(10, 30), intArrayOf(117, 10), intArrayOf(217, 20), intArrayOf(317, 15), intArrayOf(408, 15))
|
||||||
override fun display(player: Player, handler: SkillDialogueHandler) {
|
override fun display(player: Player, handler: SkillDialogueHandler) {
|
||||||
var item: Item
|
var item: Item
|
||||||
player.interfaceManager.openChatbox(306)
|
player.interfaceManager.openChatbox(Components.same_306)
|
||||||
for (i in handler.data.indices) {
|
for (i in handler.data.indices) {
|
||||||
item = handler.data[i] as Item
|
item = handler.data[i] as Item
|
||||||
player.packetDispatch.sendString("<br><br><br><br>" + handler.getName(item), 306, 10 + 4 * i)
|
player.packetDispatch.sendString("<br><br><br><br>" + handler.getName(item), 306, 10 + 4 * i)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.diary.DiaryType
|
import core.game.node.entity.player.link.diary.DiaryType
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thormac
|
* Thormac
|
||||||
|
|
@ -27,7 +28,7 @@ class ThormacDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
Items.SCORPION_CAGE_463
|
Items.SCORPION_CAGE_463
|
||||||
)
|
)
|
||||||
|
|
||||||
val COMPONENT = Component(332)
|
val COMPONENT = Component(Components.staff_enchanting_332)
|
||||||
|
|
||||||
override fun open(vararg args: Any?): Boolean {
|
override fun open(vararg args: Any?): Boolean {
|
||||||
val scorpionStage = try {
|
val scorpionStage = try {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import core.game.node.item.Item
|
||||||
import core.game.system.task.Pulse
|
import core.game.system.task.Pulse
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
class LarryHandler(player: Player? = null) : DialoguePlugin(player){
|
class LarryHandler(player: Player? = null) : DialoguePlugin(player){
|
||||||
override fun open(vararg args: Any?): Boolean {
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
|
@ -46,7 +47,7 @@ class LarryHandler(player: Player? = null) : DialoguePlugin(player){
|
||||||
1 -> player.inventory.add(Item(995, 6500 * player.getAttribute("phns:points",0))).also { player("Thanks!"); player.removeAttribute("phns:points");stage = 1000 }
|
1 -> player.inventory.add(Item(995, 6500 * player.getAttribute("phns:points",0))).also { player("Thanks!"); player.removeAttribute("phns:points");stage = 1000 }
|
||||||
2 -> {
|
2 -> {
|
||||||
player.setAttribute("caller",this)
|
player.setAttribute("caller",this)
|
||||||
player.interfaceManager.open(Component(134).setCloseEvent { player1: Player?, c: Component? ->
|
player.interfaceManager.open(Component(Components.stat_advancement_interface_134).setCloseEvent { player1: Player?, c: Component? ->
|
||||||
player.interfaceManager.openDefaultTabs()
|
player.interfaceManager.openDefaultTabs()
|
||||||
player.removeAttribute("lamp")
|
player.removeAttribute("lamp")
|
||||||
player.unlock()
|
player.unlock()
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import core.game.world.map.Direction
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
/**
|
/**
|
||||||
|
|
@ -37,7 +38,7 @@ class CaveRockHandler : OptionHandler() {
|
||||||
|
|
||||||
|
|
||||||
fun showRock(player: Player, model: Int){
|
fun showRock(player: Player, model: Int){
|
||||||
player.interfaceManager.open(Component(62))
|
player.interfaceManager.open(Component(Components.cave_goblin_markers_062))
|
||||||
player.packetDispatch.sendModelOnInterface(model,62,1,1)
|
player.packetDispatch.sendModelOnInterface(model,62,1,1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.system.task.Pulse
|
import core.game.system.task.Pulse
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small object for the goblin follow options
|
* Small object for the goblin follow options
|
||||||
|
|
@ -23,11 +24,11 @@ object GoblinFollower {
|
||||||
var counter = 0
|
var counter = 0
|
||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
when(counter++){
|
when(counter++){
|
||||||
0 -> player.lock().also { player.interfaceManager.open(Component(115)) }
|
0 -> player.lock().also { player.interfaceManager.open(Component(Components.fade_to_black_115)) }
|
||||||
3 -> player.properties.teleportLocation = location
|
3 -> player.properties.teleportLocation = location
|
||||||
4 -> {
|
4 -> {
|
||||||
player.interfaceManager.close(Component(115))
|
player.interfaceManager.close(Component(Components.fade_to_black_115))
|
||||||
player.interfaceManager.open(Component(170))
|
player.interfaceManager.open(Component(Components.fade_from_black_170))
|
||||||
}
|
}
|
||||||
6 -> player.unlock().also { player.interfaceManager.close(Component(170)); return true }
|
6 -> player.unlock().also { player.interfaceManager.close(Component(170)); return true }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
import core.tools.Items
|
import core.tools.Items
|
||||||
import core.game.content.dialogue.FacialExpression
|
import core.game.content.dialogue.FacialExpression
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
private val BOOK = Item(Items.GOBLIN_SYMBOL_BOOK_5009)
|
private val BOOK = Item(Items.GOBLIN_SYMBOL_BOOK_5009)
|
||||||
@Initializable
|
@Initializable
|
||||||
|
|
@ -36,8 +37,8 @@ class LostTribeOptionHandler : OptionHandler(){
|
||||||
player ?: return false
|
player ?: return false
|
||||||
node ?: return false
|
node ?: return false
|
||||||
when(node.id){
|
when(node.id){
|
||||||
5008 -> player.interfaceManager.open(Component(50))
|
5008 -> player.interfaceManager.open(Component(Components._brooch_050))
|
||||||
5009 -> player.interfaceManager.open(Component(183))
|
5009 -> player.interfaceManager.open(Component(Components.history_of_the_goblin_race_183))
|
||||||
6916 -> {
|
6916 -> {
|
||||||
if(!player.inventory.containsItem(BOOK) && !player.bank.containsItem(BOOK) && player.questRepository.getQuest("Lost Tribe").getStage(player) >= 41){
|
if(!player.inventory.containsItem(BOOK) && !player.bank.containsItem(BOOK) && player.questRepository.getQuest("Lost Tribe").getStage(player) >= 41){
|
||||||
player.dialogueInterpreter.sendDialogue("'A History of the Goblin Race.' This must be it.")
|
player.dialogueInterpreter.sendDialogue("'A History of the Goblin Race.' This must be it.")
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import core.game.world.map.Location
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
import core.game.content.dialogue.FacialExpression
|
import core.game.content.dialogue.FacialExpression
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class DwarvenBoatmanDialogue(player: Player? = null) : DialoguePlugin(player) {
|
class DwarvenBoatmanDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
@ -55,13 +56,13 @@ class travelPulse(val player: Player): Pulse(1){
|
||||||
var counter = 0
|
var counter = 0
|
||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
when(counter++){
|
when(counter++){
|
||||||
0 -> player.lock().also { player.interfaceManager.open(Component(115)) }
|
0 -> player.lock().also { player.interfaceManager.open(Component(Components.fade_to_black_115)) }
|
||||||
3 -> player.properties.teleportLocation = Location.create(2888, 10225, 0)
|
3 -> player.properties.teleportLocation = Location.create(2888, 10225, 0)
|
||||||
4 -> {
|
4 -> {
|
||||||
player.interfaceManager.close(Component(115))
|
player.interfaceManager.close(Component(Components.fade_to_black_115))
|
||||||
player.interfaceManager.open(Component(170))
|
player.interfaceManager.open(Component(Components.fade_from_black_170))
|
||||||
}
|
}
|
||||||
6 -> player.unlock().also { player.interfaceManager.close(Component(170)); player.setAttribute("/save:keldagrim-visited",true); return true }
|
6 -> player.unlock().also { player.interfaceManager.close(Component(Components.fade_from_black_170)); player.setAttribute("/save:keldagrim-visited",true); return true }
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import core.game.system.task.Pulse
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
import core.game.world.map.Direction
|
import core.game.world.map.Direction
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
object KeldagrimCartMethods {
|
object KeldagrimCartMethods {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|
@ -25,7 +26,7 @@ class TravelFromKeldagrimPulse(val player: Player, val dest: Location): Pulse(){
|
||||||
var counter = 0
|
var counter = 0
|
||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
when(counter++){
|
when(counter++){
|
||||||
0 -> player.lock().also { player.interfaceManager.open(Component(115)) }
|
0 -> player.lock().also { player.interfaceManager.open(Component(Components.fade_to_black_115)) }
|
||||||
4 -> {
|
4 -> {
|
||||||
player.properties.teleportLocation = Location.create(2911, 10171, 0)
|
player.properties.teleportLocation = Location.create(2911, 10171, 0)
|
||||||
player.appearance.rideCart(true)
|
player.appearance.rideCart(true)
|
||||||
|
|
@ -35,11 +36,11 @@ class TravelFromKeldagrimPulse(val player: Player, val dest: Location): Pulse(){
|
||||||
player.walkingQueue.addPath(2936, 10171)
|
player.walkingQueue.addPath(2936, 10171)
|
||||||
}
|
}
|
||||||
6 -> {
|
6 -> {
|
||||||
player.interfaceManager.close(Component(115))
|
player.interfaceManager.close(Component(Components.fade_to_black_115))
|
||||||
player.interfaceManager.open(Component(170))
|
player.interfaceManager.open(Component(Components.fade_from_black_170))
|
||||||
}
|
}
|
||||||
14 -> {
|
14 -> {
|
||||||
player.interfaceManager.open(Component(115))
|
player.interfaceManager.open(Component(Components.fade_to_black_115))
|
||||||
}
|
}
|
||||||
21 -> {
|
21 -> {
|
||||||
player.walkingQueue.reset()
|
player.walkingQueue.reset()
|
||||||
|
|
@ -47,12 +48,12 @@ class TravelFromKeldagrimPulse(val player: Player, val dest: Location): Pulse(){
|
||||||
player.appearance.rideCart(false)
|
player.appearance.rideCart(false)
|
||||||
}
|
}
|
||||||
23 -> {
|
23 -> {
|
||||||
player.interfaceManager.close(Component(115))
|
player.interfaceManager.close(Component(Components.fade_to_black_115))
|
||||||
player.interfaceManager.open(Component(170))
|
player.interfaceManager.open(Component(Components.fade_from_black_170))
|
||||||
}
|
}
|
||||||
25 -> {
|
25 -> {
|
||||||
player.unlock()
|
player.unlock()
|
||||||
player.interfaceManager.close(Component(170))
|
player.interfaceManager.close(Component(Components.fade_from_black_170))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
const val REINALD = 2194
|
const val REINALD = 2194
|
||||||
|
|
||||||
|
|
@ -21,7 +22,7 @@ class ReinaldDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||||
when(stage++){
|
when(stage++){
|
||||||
0 -> options("Yes, please!", "No, thanks.")
|
0 -> options("Yes, please!", "No, thanks.")
|
||||||
1 -> when(buttonId){
|
1 -> when(buttonId){
|
||||||
1 -> end().also { player.interfaceManager.open(Component(REINALD_COMPONENT_ID)) }
|
1 -> end().also { player.interfaceManager.open(Component(Components.Reinalds_Smithing_Emporium_593)) }
|
||||||
2 -> end()
|
2 -> end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -47,7 +48,7 @@ class ReinaldDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||||
@Initializable
|
@Initializable
|
||||||
class ReinaldOptionHandler : OptionHandler(){
|
class ReinaldOptionHandler : OptionHandler(){
|
||||||
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
||||||
player?.interfaceManager?.open(Component(REINALD_COMPONENT_ID))
|
player?.interfaceManager?.open(Component(Components.Reinalds_Smithing_Emporium_593))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import java.util.*
|
||||||
import core.game.component.InterfaceType
|
import core.game.component.InterfaceType
|
||||||
import core.game.container.access.BitregisterAssembler
|
import core.game.container.access.BitregisterAssembler
|
||||||
import core.game.system.SystemLogger
|
import core.game.system.SystemLogger
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,7 +64,7 @@ class PlayerGrandExchange(private val player: Player) : SavingModule {
|
||||||
player.bankPinManager.openType(4)
|
player.bankPinManager.openType(4)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
player.interfaceManager.open(Component(105)).closeEvent =
|
player.interfaceManager.open(Component(Components.stockmarket_105)).closeEvent =
|
||||||
CloseEvent { player, _ ->
|
CloseEvent { player, _ ->
|
||||||
temporaryOffer = null
|
temporaryOffer = null
|
||||||
player.packetDispatch.sendRunScript(571, "")
|
player.packetDispatch.sendRunScript(571, "")
|
||||||
|
|
@ -85,7 +86,7 @@ class PlayerGrandExchange(private val player: Player) : SavingModule {
|
||||||
player.bankPinManager.openType(3)
|
player.bankPinManager.openType(3)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
player.interfaceManager.openComponent(109)
|
player.interfaceManager.openComponent(Components.stockcollect_109)
|
||||||
player.packetDispatch.sendAccessMask(6, 18, 109, 0, 2)
|
player.packetDispatch.sendAccessMask(6, 18, 109, 0, 2)
|
||||||
player.packetDispatch.sendAccessMask(6, 23, 109, 0, 2)
|
player.packetDispatch.sendAccessMask(6, 23, 109, 0, 2)
|
||||||
player.packetDispatch.sendAccessMask(6, 28, 109, 0, 2)
|
player.packetDispatch.sendAccessMask(6, 28, 109, 0, 2)
|
||||||
|
|
@ -183,14 +184,14 @@ class PlayerGrandExchange(private val player: Player) : SavingModule {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
player.interfaceManager.open(Component(645)).closeEvent =
|
player.interfaceManager.open(Component(Components.exchange_itemsets_645)).closeEvent =
|
||||||
CloseEvent { player, _ ->
|
CloseEvent { player, _ ->
|
||||||
player.inventory.listeners.removeAt(1)
|
player.inventory.listeners.removeAt(1)
|
||||||
player.interfaceManager.closeSingleTab()
|
player.interfaceManager.closeSingleTab()
|
||||||
player.removeAttribute("container-key")
|
player.removeAttribute("container-key")
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
player.interfaceManager.openSingleTab(Component(644)).open(player)
|
player.interfaceManager.openSingleTab(Component(Components.exchange_sets_side_644)).open(player)
|
||||||
player.setAttribute(
|
player.setAttribute(
|
||||||
"container-key",
|
"container-key",
|
||||||
InterfaceContainer.generateItems(
|
InterfaceContainer.generateItems(
|
||||||
|
|
@ -638,7 +639,7 @@ class PlayerGrandExchange(private val player: Player) : SavingModule {
|
||||||
fun openSell(index: Int) {
|
fun openSell(index: Int) {
|
||||||
openedIndex = index
|
openedIndex = index
|
||||||
sendConfiguration(offers[index], true)
|
sendConfiguration(offers[index], true)
|
||||||
player.interfaceManager.openSingleTab(Component(107)).open(player)
|
player.interfaceManager.openSingleTab(Component(Components.stockside_107)).open(player)
|
||||||
player.packetDispatch.sendRunScript(
|
player.packetDispatch.sendRunScript(
|
||||||
149, "IviiiIsssss", "", "", "", "Examine", "Offer",
|
149, "IviiiIsssss", "", "", "", "Examine", "Offer",
|
||||||
-1, 0, 7, 4, 93, 7012370
|
-1, 0, 7, 4, 93, 7012370
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import core.game.node.entity.player.link.TeleportManager.TeleportType
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles interactions with fairy rings
|
* Handles interactions with fairy rings
|
||||||
|
|
@ -55,7 +56,7 @@ class FairyRingPlugin : OptionHandler() {
|
||||||
|
|
||||||
private fun openFairyRing(player: Player) {
|
private fun openFairyRing(player: Player) {
|
||||||
reset(player)
|
reset(player)
|
||||||
player.interfaceManager.openSingleTab(Component(735))
|
player.interfaceManager.openSingleTab(Component(Components.fr_travel_log_735))
|
||||||
player.interfaceManager.open(Component(734))
|
player.interfaceManager.open(Component(Components.fr_rings_734))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ import core.game.world.repository.Repository
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.game.system.command.Command
|
import core.game.system.command.Command
|
||||||
import core.game.system.command.sets.CommandSet
|
import core.game.system.command.sets.CommandSet
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class StatsCommandSet : CommandSet(Command.Privilege.STANDARD) {
|
class StatsCommandSet : CommandSet(Command.Privilege.STANDARD) {
|
||||||
|
|
@ -74,11 +75,11 @@ class StatsCommandSet : CommandSet(Command.Privilege.STANDARD) {
|
||||||
else -> sendLine(player,"",i)
|
else -> sendLine(player,"",i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.interfaceManager.open(Component(26))
|
player.interfaceManager.open(Component(Components.fancy_book_026))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendLine(player: Player, line: String, child: Int){
|
fun sendLine(player: Player, line: String, child: Int){
|
||||||
player.packetDispatch.sendString(line,26,child)
|
player.packetDispatch.sendString(line,Components.fancy_book_026,child)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun prepareInterface(player: Player,other: Player){
|
fun prepareInterface(player: Player,other: Player){
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class ShavingStandHandler : OptionHandler() {
|
class ShavingStandHandler : OptionHandler() {
|
||||||
|
|
@ -21,9 +22,9 @@ class ShavingStandHandler : OptionHandler() {
|
||||||
player ?: return false
|
player ?: return false
|
||||||
node ?: return false
|
node ?: return false
|
||||||
if(player.appearance.isMale){
|
if(player.appearance.isMale){
|
||||||
player.interfaceManager.open(Component(596))
|
player.interfaceManager.open(Component(Components.Hairdressers_salon_596))
|
||||||
} else {
|
} else {
|
||||||
player.interfaceManager.open(Component(592))
|
player.interfaceManager.open(Component(Components.Hairdressers_salon_592))
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class WardrobeHandler : OptionHandler() {
|
class WardrobeHandler : OptionHandler() {
|
||||||
|
|
@ -21,9 +22,9 @@ class WardrobeHandler : OptionHandler() {
|
||||||
player ?: return false
|
player ?: return false
|
||||||
node ?: return false
|
node ?: return false
|
||||||
if(player.appearance.isMale){
|
if(player.appearance.isMale){
|
||||||
player.interfaceManager.open(Component(591))
|
player.interfaceManager.open(Component(Components.Thessalias_Makeovers_591))
|
||||||
} else {
|
} else {
|
||||||
player.interfaceManager.open(Component(594))
|
player.interfaceManager.open(Component(Components.Thessalias_Makeovers_594))
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import core.plugin.PluginManager.definePlugin
|
||||||
import core.game.interaction.item.TeleTabsOptionPlugin
|
import core.game.interaction.item.TeleTabsOptionPlugin
|
||||||
import core.game.node.entity.skill.Skills
|
import core.game.node.entity.skill.Skills
|
||||||
import core.game.node.entity.skill.construction.Decoration
|
import core.game.node.entity.skill.construction.Decoration
|
||||||
|
import core.tools.Components
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the lectern
|
* Handles the lectern
|
||||||
|
|
@ -132,7 +133,7 @@ class LecternPlugin : OptionHandler() {
|
||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
when(counter++){
|
when(counter++){
|
||||||
0 -> player.animator.animate(Animation(3649)).also { player.lock() }
|
0 -> player.animator.animate(Animation(3649)).also { player.lock() }
|
||||||
8 -> player.interfaceManager.open(Component(400)).also { player.unlock(); return true }
|
8 -> player.interfaceManager.open(Component(Components.poh_magic_tablets_400)).also { player.unlock(); return true }
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import plugin.ai.general.scriptrepository.PlayerScripts
|
||||||
import plugin.ai.general.scriptrepository.Script
|
import plugin.ai.general.scriptrepository.Script
|
||||||
import core.game.system.command.Command
|
import core.game.system.command.Command
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
|
import core.tools.Components
|
||||||
import core.tools.stringtools.colorize
|
import core.tools.stringtools.colorize
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
|
|
@ -35,7 +36,7 @@ class BottingCommandSet : CommandSet(Command.Privilege.STANDARD) {
|
||||||
player.packetDispatch.sendString("<img=3> ::script ${script.identifier}",275,lineid++)
|
player.packetDispatch.sendString("<img=3> ::script ${script.identifier}",275,lineid++)
|
||||||
player.packetDispatch.sendString("<str> </str>",275,lineid++)
|
player.packetDispatch.sendString("<str> </str>",275,lineid++)
|
||||||
}
|
}
|
||||||
player.interfaceManager.open(Component(275))
|
player.interfaceManager.open(Component(Components.questjournal_scroll_275))
|
||||||
}
|
}
|
||||||
define("script"){player,args ->
|
define("script"){player,args ->
|
||||||
if(GameWorld.settings?.enabled_botting != true){
|
if(GameWorld.settings?.enabled_botting != true){
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import core.game.ge.OfferManager
|
||||||
import core.game.ge.OfferState
|
import core.game.ge.OfferState
|
||||||
import core.game.node.entity.skill.Skills
|
import core.game.node.entity.skill.Skills
|
||||||
import core.game.node.entity.state.newsys.states.FarmingState
|
import core.game.node.entity.state.newsys.states.FarmingState
|
||||||
|
import core.tools.Components
|
||||||
import core.tools.stringtools.colorize
|
import core.tools.stringtools.colorize
|
||||||
import java.awt.Toolkit
|
import java.awt.Toolkit
|
||||||
import java.awt.datatransfer.StringSelection
|
import java.awt.datatransfer.StringSelection
|
||||||
|
|
@ -96,11 +97,11 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
|
||||||
*/
|
*/
|
||||||
define("players", Command.Privilege.STANDARD){ player, _ ->
|
define("players", Command.Privilege.STANDARD){ player, _ ->
|
||||||
val rights = player.rights.ordinal
|
val rights = player.rights.ordinal
|
||||||
if (player!!.interfaceManager.isOpened && player.interfaceManager.opened.id != 275 || player.locks.isMovementLocked || player.locks.isTeleportLocked) {
|
if (player!!.interfaceManager.isOpened && player.interfaceManager.opened.id != Components.questjournal_scroll_275 || player.locks.isMovementLocked || player.locks.isTeleportLocked) {
|
||||||
player.sendMessage("Please finish what you're doing first.")
|
player.sendMessage("Please finish what you're doing first.")
|
||||||
return@define
|
return@define
|
||||||
}
|
}
|
||||||
player.interfaceManager.open(Component(275))
|
player.interfaceManager.open(Component(Components.questjournal_scroll_275))
|
||||||
var i = 0
|
var i = 0
|
||||||
while (i < 257) {
|
while (i < 257) {
|
||||||
player.packetDispatch.sendString("", 275, i)
|
player.packetDispatch.sendString("", 275, i)
|
||||||
|
|
@ -173,7 +174,7 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
|
||||||
else
|
else
|
||||||
player.packetDispatch.sendString("", 275, lineId++)
|
player.packetDispatch.sendString("", 275, lineId++)
|
||||||
}
|
}
|
||||||
player.interfaceManager.open(Component(275))
|
player.interfaceManager.open(Component(Components.questjournal_scroll_275))
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* ==================================================================================
|
* ==================================================================================
|
||||||
|
|
@ -185,13 +186,13 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
|
||||||
*/
|
*/
|
||||||
define("commands"){player,_ ->
|
define("commands"){player,_ ->
|
||||||
for (i in 0..310) {
|
for (i in 0..310) {
|
||||||
player.packetDispatch.sendString("", 275, i)
|
player.packetDispatch.sendString("", Components.questjournal_scroll_275, i)
|
||||||
}
|
}
|
||||||
var lineid = 11
|
var lineid = 11
|
||||||
player.packetDispatch.sendString("Commands",275,2)
|
player.packetDispatch.sendString("Commands",Components.questjournal_scroll_275,2)
|
||||||
for(line in CommandMapping.getNames())
|
for(line in CommandMapping.getNames())
|
||||||
player.packetDispatch.sendString(line,275,lineid++)
|
player.packetDispatch.sendString(line,Components.questjournal_scroll_275,lineid++)
|
||||||
player.interfaceManager.open(Component(275))
|
player.interfaceManager.open(Component(Components.questjournal_scroll_275))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -471,7 +471,7 @@ object Components {
|
||||||
const val salamander_attack_options_474 = 474
|
const val salamander_attack_options_474 = 474
|
||||||
const val chins_again_475 = 475
|
const val chins_again_475 = 475
|
||||||
const val salamanders_again_476 = 476
|
const val salamanders_again_476 = 476
|
||||||
const val custom_fur_clothingclothin_477 = 477
|
const val custom_fur_clothing_477 = 477
|
||||||
const val imp_release_negotiation_form_478 = 478
|
const val imp_release_negotiation_form_478 = 478
|
||||||
const val weird_tubes_bro_479 = 479
|
const val weird_tubes_bro_479 = 479
|
||||||
const val anma_rgb_480 = 480
|
const val anma_rgb_480 = 480
|
||||||
|
|
@ -706,6 +706,9 @@ object Components {
|
||||||
const val carpet_draughts_727 = 727
|
const val carpet_draughts_727 = 727
|
||||||
const val carpet_main_728 = 728
|
const val carpet_main_728 = 728
|
||||||
const val carpet_ticket_729 = 729
|
const val carpet_ticket_729 = 729
|
||||||
|
const val fog_reward_732 = 732
|
||||||
|
const val fr_travel_log_735 = 735
|
||||||
|
const val fr_rings_734 = 734
|
||||||
const val graphics_options_742 = 742
|
const val graphics_options_742 = 742
|
||||||
const val sound_options_743 = 743
|
const val sound_options_743 = 743
|
||||||
const val loginscreen_744 = 744
|
const val loginscreen_744 = 744
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import core.game.content.consumable.effects.HealingEffect
|
||||||
import core.game.ge.GrandExchangeOffer
|
import core.game.ge.GrandExchangeOffer
|
||||||
import core.game.ge.OfferManager
|
import core.game.ge.OfferManager
|
||||||
import core.game.node.entity.skill.Skills
|
import core.game.node.entity.skill.Skills
|
||||||
|
import core.tools.Components
|
||||||
import core.tools.stringtools.colorize
|
import core.tools.stringtools.colorize
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
|
|
@ -640,8 +641,8 @@ class ScriptAPI(private val bot: Player) {
|
||||||
|
|
||||||
class BottingOverlay(val player: Player){
|
class BottingOverlay(val player: Player){
|
||||||
fun init(){
|
fun init(){
|
||||||
player.interfaceManager.openOverlay(Component(195))
|
player.interfaceManager.openOverlay(Component(Components.enchantment_pizazz_points_195))
|
||||||
player.packetDispatch.sendInterfaceConfig(195,5,true)
|
player.packetDispatch.sendInterfaceConfig(Components.enchantment_pizazz_points_195,5,true)
|
||||||
}
|
}
|
||||||
fun setTitle(title: String){
|
fun setTitle(title: String){
|
||||||
player.packetDispatch.sendString(colorize("%B$title"),195,7)
|
player.packetDispatch.sendString(colorize("%B$title"),195,7)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue