Code cleanup
Reorganised imports Removed redundant qualifiers
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
package content.global.activity.penguinhns
|
||||
|
||||
import org.json.simple.JSONObject
|
||||
import core.ServerStore
|
||||
import core.api.StartupListener
|
||||
import core.api.log
|
||||
import core.game.worldevents.PluginSet
|
||||
import core.game.worldevents.WorldEvent
|
||||
import core.game.world.GameWorld
|
||||
import core.plugin.ClassScanner
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
import org.json.simple.JSONObject
|
||||
|
||||
class PenguinHNSEvent : StartupListener {
|
||||
val manager = PenguinManager()
|
||||
|
||||
@@ -89,7 +89,7 @@ class ShootingStarMiningPulse(player: Player?, node: Scenery?, val star: Shootin
|
||||
if(bonusXp > 0) {
|
||||
val delta = Math.min(bonusXp, xp)
|
||||
player.incrementAttribute("/save:shooting-star:bonus-xp", (-delta).toInt())
|
||||
xp += delta;
|
||||
xp += delta
|
||||
if(player.getAttribute("shooting-star:bonus-xp", 0) <= 0) {
|
||||
player.sendMessage("You have obtained all of your bonus xp from the star.")
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ object DrillDemonUtils {
|
||||
setVarbit(player, tempOffsetList[i], tempList[i])
|
||||
}
|
||||
|
||||
player.dialogueInterpreter.sendDialogues(NPCs.SERGEANT_DAMIEN_2790, core.game.dialogue.FacialExpression.OLD_NORMAL,when(task){
|
||||
player.dialogueInterpreter.sendDialogues(NPCs.SERGEANT_DAMIEN_2790, FacialExpression.OLD_NORMAL,when(task){
|
||||
DD_SIGN_JOG -> "Get over there and jog in place!"
|
||||
DD_SIGN_JUMP -> "I need 40 jumping jacks stat!"
|
||||
DD_SIGN_PUSHUP -> "Get over there and give me 20 pushups!"
|
||||
|
||||
@@ -3,12 +3,12 @@ package content.global.ame.events.drilldemon
|
||||
import core.game.dialogue.DialoguePlugin
|
||||
import core.game.node.entity.player.Player
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.NPCs
|
||||
import core.tools.END_DIALOGUE
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class SeargentDamienDefaultPlugin(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
|
||||
class SeargentDamienDefaultPlugin(player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return SeargentDamienDefaultPlugin(player)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class EvilBobListeners : InteractionListener, MapArea {
|
||||
if (getAttribute(player!!, EvilBobUtils.attentiveNewSpot, false) || getAttribute(player!!, EvilBobUtils.eventComplete, false)) {
|
||||
sendDialogue(player, "You don't know if this is a good place to go fishing. Perhaps you should ask someone, like one of the human servants.")
|
||||
} else if (!inInventory(player, Items.SMALL_FISHING_NET_303)) {
|
||||
sendNPCDialogue(player, NPCs.SERVANT_2481, "You'll need a fishing net. There are plenty scattered around the beach.", FacialExpression.SAD);
|
||||
sendNPCDialogue(player, NPCs.SERVANT_2481, "You'll need a fishing net. There are plenty scattered around the beach.", FacialExpression.SAD)
|
||||
} else if (freeSlots(player) == 0) {
|
||||
sendDialogue(player, "You don't have enough space in your inventory.")
|
||||
} else if (getAttribute(player, EvilBobUtils.fishCaught, false)) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import core.tools.END_DIALOGUE
|
||||
class GenieDialogue : DialogueFile() {
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
val assigned = player!!.getAttribute("genie:item",0)
|
||||
npcl(core.game.dialogue.FacialExpression.NEUTRAL, "Ah, so you are there, ${player!!.name.capitalize()}. I'm so glad you summoned me. Please take this lamp and make your wish.")
|
||||
npcl(FacialExpression.NEUTRAL, "Ah, so you are there, ${player!!.name.capitalize()}. I'm so glad you summoned me. Please take this lamp and make your wish.")
|
||||
addItemOrDrop(player!!, assigned)
|
||||
AntiMacro.terminateEventNpc(player!!)
|
||||
stage = END_DIALOGUE
|
||||
|
||||
@@ -60,6 +60,6 @@ class MordautDialogue(val examComplete: Boolean, val questionCorrect: Boolean =
|
||||
}
|
||||
|
||||
override fun npc(vararg messages: String?): Component? {
|
||||
return super.npc(core.game.dialogue.FacialExpression.OLD_NORMAL,*messages)
|
||||
return super.npc(FacialExpression.OLD_NORMAL,*messages)
|
||||
}
|
||||
}
|
||||
@@ -582,7 +582,7 @@ class Adventurer(val style: CombatStyle): Script() {
|
||||
// At the Crumbling Wall in Falador
|
||||
ZoneBorders(2937,3356,2936,3353) to { it: Adventurer ->
|
||||
// Interact with the Crumbling Wall
|
||||
val wall = it.scriptAPI.getNearestNode("Crumbling wall", true);
|
||||
val wall = it.scriptAPI.getNearestNode("Crumbling wall", true)
|
||||
if (wall == null) {
|
||||
it.refresh()
|
||||
it.ticks = 0
|
||||
|
||||
@@ -155,7 +155,7 @@ class CannonballSmelter : Script() {
|
||||
val furnace = scriptAPI.getNearestNode(11666, true)
|
||||
scriptAPI.interact(bot, furnace, "smelt")
|
||||
// TODO: should bots use real interfaces?
|
||||
bot.pulseManager.run(SmeltingPulse(bot, null, Bar.STEEL, 9));
|
||||
bot.pulseManager.run(SmeltingPulse(bot, null, Bar.STEEL, 9))
|
||||
} else {
|
||||
state = State.SMELTING_CBALLS
|
||||
}
|
||||
@@ -273,6 +273,6 @@ class CannonballSmelter : Script() {
|
||||
skills.put(Skills.HITPOINTS,99)
|
||||
skills.put(Skills.DEFENCE,99)
|
||||
skills.put(Skills.SMITHING,35)
|
||||
quests.add("Dwarf Cannon");
|
||||
quests.add("Dwarf Cannon")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ class GenericSlayerBot : Script() {
|
||||
bot.inventory.clear()
|
||||
for(item in inventory)
|
||||
bot.inventory.add(item)
|
||||
scriptAPI.withdraw(org.rs09.consts.Items.LOBSTER_379,10)
|
||||
scriptAPI.withdraw(Items.LOBSTER_379,10)
|
||||
bot.fullRestore()
|
||||
|
||||
if(assignment.amount <= 0){
|
||||
|
||||
@@ -31,8 +31,8 @@ import core.game.node.entity.player.Player
|
||||
class BookInterface : InterfaceListener {
|
||||
|
||||
companion object {
|
||||
const val CALLBACK_ATTRIBUTE = "bookInterfaceCallback";
|
||||
const val CURRENT_PAGE_ATTRIBUTE = "bookInterfaceCurrentPage";
|
||||
const val CALLBACK_ATTRIBUTE = "bookInterfaceCallback"
|
||||
const val CURRENT_PAGE_ATTRIBUTE = "bookInterfaceCurrentPage"
|
||||
|
||||
/* These should be in org.rs09.consts.Components but currently are not. */
|
||||
const val FANCY_BOOK_26 = 26 // This is a 15-Lines per page book.
|
||||
@@ -45,13 +45,13 @@ class BookInterface : InterfaceListener {
|
||||
val FANCY_BOOK_3_49_LINE_IDS = arrayOf(6, 77, 78, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76)
|
||||
|
||||
/* Button IDs. [Left button, Right button, (opt)index button, ...(opt)click lines 1 to X] */
|
||||
val FANCY_BOOK_26_BUTTON_IDS = arrayOf(61, 63);
|
||||
val FANCY_BOOK_26_BUTTON_IDS = arrayOf(61, 63)
|
||||
val FANCY_BOOK_2_27_BUTTON_IDS = arrayOf(1, 3, 159, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158)
|
||||
val FANCY_BOOK_3_49_BUTTON_IDS = arrayOf(51, 53);
|
||||
val FANCY_BOOK_3_49_BUTTON_IDS = arrayOf(51, 53)
|
||||
|
||||
/* Image IDs. [...lines 1 to X] */
|
||||
val FANCY_BOOK_2_27_IMAGE_ENABLE_DRAW_IDS = arrayOf(9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97);
|
||||
val FANCY_BOOK_2_27_IMAGE_DRAW_IDS = arrayOf(10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98);
|
||||
val FANCY_BOOK_2_27_IMAGE_ENABLE_DRAW_IDS = arrayOf(9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97)
|
||||
val FANCY_BOOK_2_27_IMAGE_DRAW_IDS = arrayOf(10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98)
|
||||
|
||||
/** Opens the book interface. Call this only once in the defineListeners() at the start of opening a book. */
|
||||
fun openBook(player: Player, bookComponent: Int, displayCallback: (player: Player, pageNum: Int, buttonId: Int) -> Boolean) {
|
||||
@@ -72,29 +72,29 @@ class BookInterface : InterfaceListener {
|
||||
fun pageSetup(player: Player, bookComponent: Int, title: String, contents: Array<PageSet>, hasPagination: Boolean = true) {
|
||||
val currentPage = getAttribute(player, CURRENT_PAGE_ATTRIBUTE, 0)
|
||||
if (bookComponent == FANCY_BOOK_26) {
|
||||
clearBookLines(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS);
|
||||
clearButtons(player, FANCY_BOOK_26, FANCY_BOOK_26_BUTTON_IDS);
|
||||
setTitle(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS, title);
|
||||
clearBookLines(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS)
|
||||
clearButtons(player, FANCY_BOOK_26, FANCY_BOOK_26_BUTTON_IDS)
|
||||
setTitle(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS, title)
|
||||
if (hasPagination) {
|
||||
setPagination(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS, FANCY_BOOK_26_BUTTON_IDS, currentPage, contents.size, contents[currentPage].pages.size == 1)
|
||||
}
|
||||
setPageContent(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS, FANCY_BOOK_26_BUTTON_IDS, currentPage, contents);
|
||||
setPageContent(player, FANCY_BOOK_26, FANCY_BOOK_26_LINE_IDS, FANCY_BOOK_26_BUTTON_IDS, currentPage, contents)
|
||||
} else if (bookComponent == FANCY_BOOK_2_27) {
|
||||
clearBookLines(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS);
|
||||
clearButtons(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_BUTTON_IDS);
|
||||
setTitle(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS, title);
|
||||
clearBookLines(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS)
|
||||
clearButtons(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_BUTTON_IDS)
|
||||
setTitle(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS, title)
|
||||
if (hasPagination) {
|
||||
setPagination(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS, FANCY_BOOK_2_27_BUTTON_IDS, currentPage, contents.size, contents[currentPage].pages.size == 1)
|
||||
}
|
||||
setPageContent(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS, FANCY_BOOK_2_27_BUTTON_IDS, currentPage, contents);
|
||||
setPageContent(player, FANCY_BOOK_2_27, FANCY_BOOK_2_27_LINE_IDS, FANCY_BOOK_2_27_BUTTON_IDS, currentPage, contents)
|
||||
} else if (bookComponent == FANCY_BOOK_3_49) {
|
||||
clearBookLines(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS);
|
||||
clearButtons(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_BUTTON_IDS);
|
||||
setTitle(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS, title);
|
||||
clearBookLines(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS)
|
||||
clearButtons(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_BUTTON_IDS)
|
||||
setTitle(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS, title)
|
||||
if (hasPagination) {
|
||||
setPagination(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS, FANCY_BOOK_3_49_BUTTON_IDS, currentPage, contents.size, contents[currentPage].pages.size == 1)
|
||||
}
|
||||
setPageContent(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS, FANCY_BOOK_3_49_BUTTON_IDS, currentPage, contents);
|
||||
setPageContent(player, FANCY_BOOK_3_49, FANCY_BOOK_3_49_LINE_IDS, FANCY_BOOK_3_49_BUTTON_IDS, currentPage, contents)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class BookInterface : InterfaceListener {
|
||||
|
||||
/** Function to check if player read to the last page. For quest triggers. */
|
||||
fun isLastPage(pageNum: Int, totalPages: Int): Boolean {
|
||||
return pageNum == totalPages - 1;
|
||||
return pageNum == totalPages - 1
|
||||
}
|
||||
|
||||
/** PRIVATE: Increments the current page and invokes the callback function. */
|
||||
|
||||
@@ -144,7 +144,7 @@ class HairDresserInterface : ComponentPlugin(){
|
||||
}
|
||||
sendPlayerOnInterface(player, usedInterface, player_model_child)
|
||||
sendPlayerOnInterface(player, usedInterface, player_head_child)
|
||||
sendAnimationOnInterface(player, core.game.dialogue.FacialExpression.HAPPY.animationId, usedInterface, player_head_child)
|
||||
sendAnimationOnInterface(player, FacialExpression.HAPPY.animationId, usedInterface, player_head_child)
|
||||
player.toggleWardrobe(true)
|
||||
|
||||
component?.setCloseEvent{pl,_ ->
|
||||
|
||||
@@ -33,8 +33,8 @@ class MakeOverInterface : ComponentPlugin(){
|
||||
player.packetDispatch.sendNpcOnInterface(1,component.id, MALE_CHILD_ID)
|
||||
player.packetDispatch.sendNpcOnInterface(5,component.id, FEMALE_CHILD_ID)
|
||||
//Send chathead animations to interface
|
||||
player.packetDispatch.sendAnimationInterface(core.game.dialogue.FacialExpression.SILENT.animationId,component.id, MALE_CHILD_ID)
|
||||
player.packetDispatch.sendAnimationInterface(core.game.dialogue.FacialExpression.SILENT.animationId,component.id, FEMALE_CHILD_ID)
|
||||
player.packetDispatch.sendAnimationInterface(FacialExpression.SILENT.animationId,component.id, MALE_CHILD_ID)
|
||||
player.packetDispatch.sendAnimationInterface(FacialExpression.SILENT.animationId,component.id, FEMALE_CHILD_ID)
|
||||
|
||||
//Check for makeover voucher and then change interface text if it's there
|
||||
if(player.inventory.containsAtLeastOneItem(Items.MAKEOVER_VOUCHER_5606)){
|
||||
|
||||
@@ -34,7 +34,7 @@ object RulesAndInfo {
|
||||
val pin = getAttribute(player, "rules:pin", RandomFunction.random(1000,9999))
|
||||
setAttribute(player, "/save:rules:pin", pin)
|
||||
|
||||
var ln = setBaseRulesAndInfo(player);
|
||||
var ln = setBaseRulesAndInfo(player)
|
||||
|
||||
setInterfaceText(player, "<col=ffffff>If you agree to the above, type ::confirmrules $pin", 384, ln++)
|
||||
setInterfaceText(player, "", 384, ln)
|
||||
|
||||
@@ -24,7 +24,7 @@ class ScrollInterface {
|
||||
closeInterface(player) // Important: Close previous interfaces.
|
||||
if (scrollComponent == Components.MESSAGESCROLL_220) {
|
||||
openInterface(player, Components.MESSAGESCROLL_220)
|
||||
setPageContent(player, Components.MESSAGESCROLL_220, MESSAGESCROLL_220_LINE_IDS, contents);
|
||||
setPageContent(player, Components.MESSAGESCROLL_220, MESSAGESCROLL_220_LINE_IDS, contents)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,11 @@ class BankInterface : InterfaceListener {
|
||||
private const val OP_SET_TAB = 155
|
||||
private const val OP_COLLAPSE_TAB = 196
|
||||
|
||||
private const val THRESHOLD_TO_DISPLAY_EXACT_QUANTITY_ON_EXAMINE = 100000;
|
||||
private const val THRESHOLD_TO_DISPLAY_EXACT_QUANTITY_ON_EXAMINE = 100000
|
||||
}
|
||||
|
||||
private fun onBankInterfaceOpen(player: Player, component: Component): Boolean {
|
||||
player.bank.sendBankSpace();
|
||||
player.bank.sendBankSpace()
|
||||
|
||||
val settings = IfaceSettingsBuilder()
|
||||
.enableAllOptions()
|
||||
|
||||
@@ -73,7 +73,7 @@ class EnchantJewelleryTabListener : InteractionListener {
|
||||
addItem(player, product)
|
||||
playAudio(player, Audio(979), false)
|
||||
animate(player, 4069, true)
|
||||
break;
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ object SpadeDigListener {
|
||||
val listeners = HashMap<Location,(Player) -> Unit>()
|
||||
|
||||
fun registerListener(location: Location, method: (Player) -> Unit){
|
||||
listeners.putIfAbsent(location,method);
|
||||
listeners.putIfAbsent(location,method)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ class SalamanderSwingHandler(private var style: CombatStyle) : CombatSwingHandle
|
||||
if (entity is Player) {
|
||||
state.weapon = Weapon(entity.equipment[3])
|
||||
}
|
||||
if (state!!.weapon == null || !SalamanderSwingHandler.hasAmmo(entity, state)) {
|
||||
if (state!!.weapon == null || !hasAmmo(entity, state)) {
|
||||
entity!!.properties.combatPulse.stop()
|
||||
return -1
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class SalamanderSwingHandler(private var style: CombatStyle) : CombatSwingHandle
|
||||
return -1
|
||||
}
|
||||
if(state.estimatedHit > victim.skills.lifepoints) state.estimatedHit = victim.skills.lifepoints
|
||||
SalamanderSwingHandler.useAmmo(entity, state)
|
||||
useAmmo(entity, state)
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class CatOnArdougneCivilian: InteractionListener {
|
||||
player.familiarManager.removeDetails(used.id)
|
||||
removeItem(player,used,Container.INVENTORY)
|
||||
addItem(player,Items.DEATH_RUNE_560,100)
|
||||
return@onUseWith true;
|
||||
return@onUseWith true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class BarbarianOutpostCourse
|
||||
*/
|
||||
@JvmOverloads constructor(player: Player? = null) : AgilityCourse(player, 6, 46.2) {
|
||||
override fun createInstance(player: Player): AgilityCourse {
|
||||
return content.global.skill.agility.BarbarianOutpostCourse(player)
|
||||
return BarbarianOutpostCourse(player)
|
||||
}
|
||||
|
||||
override fun handle(player: Player, node: Node, option: String): Boolean {
|
||||
@@ -88,7 +88,7 @@ class BarbarianOutpostCourse
|
||||
sendMessage(player, "You cannot do that from here.")
|
||||
return
|
||||
}
|
||||
if (content.global.skill.agility.BarbarianOutpostCourse.Companion.ropeDelay > GameWorld.ticks) {
|
||||
if (ropeDelay > GameWorld.ticks) {
|
||||
sendMessage(player, "The rope is being used.")
|
||||
return
|
||||
}
|
||||
@@ -96,7 +96,7 @@ class BarbarianOutpostCourse
|
||||
AgilityHandler.fail(player, 0, Location.create(2549, 9951, 0), null, getHitAmount(player), "You slip and fall to the pit below.")
|
||||
return
|
||||
}
|
||||
content.global.skill.agility.BarbarianOutpostCourse.Companion.ropeDelay = GameWorld.ticks + 2
|
||||
ropeDelay = GameWorld.ticks + 2
|
||||
player.packetDispatch.sendSceneryAnimation(`object`, Animation.create(497), true)
|
||||
AgilityHandler.forceWalk(player, 0, player.location, Location.create(2551, 3549, 0), Animation.create(751), 50, 22.0, "You skillfully swing across.", 1)
|
||||
}
|
||||
@@ -176,7 +176,7 @@ class BarbarianOutpostCourse
|
||||
NPCDefinition.forId(385).handlers["option:pick-up"] = this
|
||||
NPCDefinition.forId(386).handlers["option:pick-up"] = this
|
||||
NPCDefinition.forId(387).handlers["option:pick-up"] = this
|
||||
ClassScanner.definePlugin(content.global.skill.agility.BarbarianOutpostCourse.BarbarianGuardDialogue())
|
||||
ClassScanner.definePlugin(BarbarianGuardDialogue())
|
||||
}
|
||||
|
||||
override fun getDestination(node: Node, n: Node): Location? {
|
||||
@@ -209,7 +209,7 @@ class BarbarianOutpostCourse
|
||||
constructor(player: Player?) : super(player) {}
|
||||
|
||||
override fun newInstance(player: Player): core.game.dialogue.DialoguePlugin {
|
||||
return content.global.skill.agility.BarbarianOutpostCourse.BarbarianGuardDialogue(player)
|
||||
return BarbarianGuardDialogue(player)
|
||||
}
|
||||
|
||||
override fun open(vararg args: Any): Boolean {
|
||||
|
||||
@@ -30,25 +30,25 @@ class GnomeStrongholdCourse
|
||||
val `object` = node as Scenery
|
||||
when (`object`.id) {
|
||||
2295 -> {
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[0]!!.sendChat("Okay get over that log, quick quick!")
|
||||
TRAINERS[0]!!.sendChat("Okay get over that log, quick quick!")
|
||||
sendMessage(player, "You walk carefully across the slippery log...")
|
||||
AgilityHandler.walk(player, 0, Location.create(2474, 3436, 0), Location.create(2474, 3429, 0), Animation.create(155), 7.5, "...You make it safely to the other side.")
|
||||
return true
|
||||
}
|
||||
2285 -> {
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[1]!!.sendChat("Move it, move it, move it!")
|
||||
TRAINERS[1]!!.sendChat("Move it, move it, move it!")
|
||||
sendMessage(player, "You climb the netting...")
|
||||
AgilityHandler.climb(player, 1, Animation.create(828), `object`.location.transform(0, -1, 1), 7.5, null)
|
||||
return true
|
||||
}
|
||||
35970 -> {
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[2]!!.sendChat("That's it - straight up.")
|
||||
TRAINERS[2]!!.sendChat("That's it - straight up.")
|
||||
sendMessage(player, "You climb the tree..")
|
||||
AgilityHandler.climb(player, 2, Animation.create(828), Location.create(2473, 3420, 2), 5.0, "...To the platform above.")
|
||||
return true
|
||||
}
|
||||
2312 -> {
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[3]!!.sendChat("Come on scaredy cat, get across that rope!")
|
||||
TRAINERS[3]!!.sendChat("Come on scaredy cat, get across that rope!")
|
||||
sendMessage(player, "You carefully cross the tightrope.")
|
||||
AgilityHandler.walk(player, 3, Location.create(2477, 3420, 2), Location.create(2483, 3420, 2), Animation.create(155), 7.5, null)
|
||||
return true
|
||||
@@ -63,7 +63,7 @@ class GnomeStrongholdCourse
|
||||
return true
|
||||
}
|
||||
2286 -> {
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[4]!!.sendChat("My Granny can move faster than you.")
|
||||
TRAINERS[4]!!.sendChat("My Granny can move faster than you.")
|
||||
player.faceLocation(player.location.transform(0, 2, 0))
|
||||
sendMessage(player, "You climb the netting...")
|
||||
AgilityHandler.climb(player, 5, Animation.create(828), player.location.transform(0, 2, 0), 7.5, null)
|
||||
@@ -76,11 +76,11 @@ class GnomeStrongholdCourse
|
||||
sendMessage(player, "You can't do that from here.")
|
||||
return true
|
||||
}
|
||||
if (content.global.skill.agility.GnomeStrongholdCourse.Companion.USED_PIPES[index] > GameWorld.ticks) {
|
||||
if (USED_PIPES[index] > GameWorld.ticks) {
|
||||
sendMessage(player, "The pipe is being used.")
|
||||
return true
|
||||
}
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.USED_PIPES[index] = GameWorld.ticks + 10
|
||||
USED_PIPES[index] = GameWorld.ticks + 10
|
||||
|
||||
player.lock()
|
||||
//Animations and force walking
|
||||
@@ -117,12 +117,12 @@ class GnomeStrongholdCourse
|
||||
}
|
||||
|
||||
override fun configure() {
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[0] = NPC.create(162, Location.create(2473, 3438, 0))
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[1] = NPC.create(162, Location.create(2478, 3426, 0))
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[2] = NPC.create(162, Location.create(2474, 3422, 1))
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[3] = NPC.create(162, Location.create(2472, 3419, 2))
|
||||
content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS[4] = NPC.create(162, Location.create(2489, 3425, 0))
|
||||
for (npc in content.global.skill.agility.GnomeStrongholdCourse.Companion.TRAINERS) {
|
||||
TRAINERS[0] = NPC.create(162, Location.create(2473, 3438, 0))
|
||||
TRAINERS[1] = NPC.create(162, Location.create(2478, 3426, 0))
|
||||
TRAINERS[2] = NPC.create(162, Location.create(2474, 3422, 1))
|
||||
TRAINERS[3] = NPC.create(162, Location.create(2472, 3419, 2))
|
||||
TRAINERS[4] = NPC.create(162, Location.create(2489, 3425, 0))
|
||||
for (npc in TRAINERS) {
|
||||
npc!!.init()
|
||||
npc.walkRadius = 3
|
||||
}
|
||||
@@ -139,7 +139,7 @@ class GnomeStrongholdCourse
|
||||
}
|
||||
|
||||
override fun createInstance(player: Player): AgilityCourse {
|
||||
return content.global.skill.agility.GnomeStrongholdCourse(player)
|
||||
return GnomeStrongholdCourse(player)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -153,7 +153,7 @@ class WildernessCourse
|
||||
sendMessage(player, "You cannot do that from here.")
|
||||
return
|
||||
}
|
||||
if (content.global.skill.agility.WildernessCourse.Companion.ropeDelay > GameWorld.ticks) {
|
||||
if (ropeDelay > GameWorld.ticks) {
|
||||
sendMessage(player, "The rope is being used.")
|
||||
return
|
||||
}
|
||||
@@ -161,7 +161,7 @@ class WildernessCourse
|
||||
AgilityHandler.fail(player, 0, Location.create(3005, 10357, 0), null, getHitAmount(player), "You slip and fall to the pit below.")
|
||||
return
|
||||
}
|
||||
content.global.skill.agility.WildernessCourse.Companion.ropeDelay = GameWorld.ticks + 2
|
||||
ropeDelay = GameWorld.ticks + 2
|
||||
player.packetDispatch.sendSceneryAnimation(`object`, Animation.create(497), true)
|
||||
AgilityHandler.forceWalk(player, 1, player.location, Location.create(3005, 3958, 0), Animation.create(751), 50, 20.0, "You skillfully swing across.", 1)
|
||||
}
|
||||
@@ -254,7 +254,7 @@ class WildernessCourse
|
||||
}
|
||||
|
||||
override fun createInstance(player: Player): AgilityCourse {
|
||||
return content.global.skill.agility.WildernessCourse(player)
|
||||
return WildernessCourse(player)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -42,16 +42,16 @@ class BasaltRockShortcut : AgilityShortcut {
|
||||
* 2522, 3600 R1, 3601, 3602 R2
|
||||
*/
|
||||
override fun newInstance(arg: Any?): Plugin<Any> {
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4550), 1, 0.0, "jump-to")) //Beach South*
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4551), 1, 0.0, "jump-across")) //Beach South Rock 1*
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4552), 1, 0.0, "jump-across")) //South Rock 2
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4553), 1, 0.0, "jump-across")) //South Rock 2 (other side)
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4554), 1, 0.0, "jump-across")) //Middle Rock 3
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4555), 1, 0.0, "jump-across")) //Middle Rock 3 (other side)
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4556), 1, 0.0, "jump-across")) //North Rock 4
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4557), 1, 0.0, "jump-across")) //North Rock 4 (other side)
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4558), 1, 0.0, "jump-across")) //Rocky Shore North Rock 5*
|
||||
configure(content.global.skill.agility.shortcuts.BasaltRockShortcut(intArrayOf(4559), 1, 0.0, "jump-to")) //Rocky Shore North*
|
||||
configure(BasaltRockShortcut(intArrayOf(4550), 1, 0.0, "jump-to")) //Beach South*
|
||||
configure(BasaltRockShortcut(intArrayOf(4551), 1, 0.0, "jump-across")) //Beach South Rock 1*
|
||||
configure(BasaltRockShortcut(intArrayOf(4552), 1, 0.0, "jump-across")) //South Rock 2
|
||||
configure(BasaltRockShortcut(intArrayOf(4553), 1, 0.0, "jump-across")) //South Rock 2 (other side)
|
||||
configure(BasaltRockShortcut(intArrayOf(4554), 1, 0.0, "jump-across")) //Middle Rock 3
|
||||
configure(BasaltRockShortcut(intArrayOf(4555), 1, 0.0, "jump-across")) //Middle Rock 3 (other side)
|
||||
configure(BasaltRockShortcut(intArrayOf(4556), 1, 0.0, "jump-across")) //North Rock 4
|
||||
configure(BasaltRockShortcut(intArrayOf(4557), 1, 0.0, "jump-across")) //North Rock 4 (other side)
|
||||
configure(BasaltRockShortcut(intArrayOf(4558), 1, 0.0, "jump-across")) //Rocky Shore North Rock 5*
|
||||
configure(BasaltRockShortcut(intArrayOf(4559), 1, 0.0, "jump-to")) //Rocky Shore North*
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package content.global.skill.construction
|
||||
|
||||
import content.global.skill.construction.BuildHotspot
|
||||
|
||||
/**
|
||||
* Represents a hotspot.
|
||||
* @author Emperor
|
||||
|
||||
+2
-2
@@ -39,11 +39,11 @@ class ConstructionDoorPlugin : OptionHandler() {
|
||||
|
||||
override fun handle(player: Player, node: Node, option: String): Boolean {
|
||||
val `object` = node as Scenery
|
||||
val second = core.game.global.action.DoorActionHandler.getSecondDoor(`object`, player)
|
||||
val second = DoorActionHandler.getSecondDoor(`object`, player)
|
||||
when (option) {
|
||||
"pick-lock", "force" -> return false //TODO
|
||||
}
|
||||
core.game.global.action.DoorActionHandler.open(`object`, second, getReplaceId(`object`), getReplaceId(second), true, 500, false)
|
||||
DoorActionHandler.open(`object`, second, getReplaceId(`object`), getReplaceId(second), true, 500, false)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class WardrobeHandler : OptionHandler() {
|
||||
} else {
|
||||
player.interfaceManager.open(Component(594))
|
||||
}
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -10,7 +10,7 @@ import core.plugin.Initializable
|
||||
* @author Ceikry
|
||||
*/
|
||||
@Initializable
|
||||
class PortalChamberDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) {
|
||||
class PortalChamberDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||
var portal = "none"
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
when(stage){
|
||||
@@ -41,7 +41,7 @@ class PortalChamberDialogue(player: Player? = null) : core.game.dialogue.Dialogu
|
||||
return true
|
||||
}
|
||||
|
||||
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return PortalChamberDialogue(player)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ package content.global.skill.construction.decoration.questhall
|
||||
|
||||
import core.api.teleport
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.audio.Audio;
|
||||
import core.game.node.entity.player.link.audio.Audio
|
||||
import core.game.system.task.Pulse
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.update.flag.context.Animation
|
||||
@@ -53,7 +53,7 @@ class MountedGlory : InteractionListener {
|
||||
1 -> {
|
||||
player.lock(5)
|
||||
player.visualize(Animation(714), Graphics(308, 100, 50))
|
||||
player.getAudioManager().send(Audio(200), true);
|
||||
player.getAudioManager().send(Audio(200), true)
|
||||
}
|
||||
4 -> player.animator.reset().also { teleport(player, TELEPORTS[int]) }
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class LecternPlugin : OptionHandler() {
|
||||
for (item in requiredItems) {
|
||||
val staff = MagicStaff.forId(item.id)
|
||||
if (staff != null && player.equipment.containsAtLeastOneItem(staff.staves)) {
|
||||
continue;
|
||||
continue
|
||||
}
|
||||
if (!player.inventory.containsItem(item)) {
|
||||
//TODO staffs
|
||||
@@ -171,7 +171,7 @@ class LecternPlugin : OptionHandler() {
|
||||
if (ttb != null && ttb.canMake(player)) {
|
||||
player.interfaceManager.close()
|
||||
var requiredItemsCountingStaves = ttb.requiredItems.filter({ item ->
|
||||
val staff = MagicStaff.forId(item.id);
|
||||
val staff = MagicStaff.forId(item.id)
|
||||
!(staff != null && player.equipment.containsAtLeastOneItem(staff.staves))
|
||||
}).toTypedArray()
|
||||
player.pulseManager.run(object : Pulse(1) {
|
||||
|
||||
+2
-2
@@ -57,8 +57,8 @@ class ArmourStand : UseWithHandler(494, 468, 496, 470, 498, 472, 500, 502, 474,
|
||||
return true
|
||||
}
|
||||
@Initializable
|
||||
class RepairDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player){
|
||||
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
|
||||
class RepairDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return RepairDialogue(player)
|
||||
}
|
||||
var item: Item? = null
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package content.global.skill.farming
|
||||
|
||||
import core.api.*
|
||||
import content.global.skill.farming.timers.Compost
|
||||
import core.api.getOrStartTimer
|
||||
import core.cache.def.impl.SceneryDefinition
|
||||
import core.cache.def.impl.VarbitDefinition
|
||||
import core.game.node.scenery.Scenery
|
||||
import core.game.node.entity.player.Player
|
||||
import content.global.skill.farming.timers.*
|
||||
import core.game.node.scenery.Scenery
|
||||
|
||||
enum class CompostBins(val varbit: Int) {
|
||||
FALADOR_COMPOST(740),
|
||||
|
||||
@@ -6,7 +6,7 @@ import core.game.interaction.OptionHandler
|
||||
import core.game.node.Node
|
||||
import content.global.skill.summoning.familiar.GiantEntNPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.audio.Audio;
|
||||
import core.game.node.entity.player.link.audio.Audio
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.node.item.Item
|
||||
import core.game.system.task.Pulse
|
||||
|
||||
@@ -10,10 +10,10 @@ import core.game.world.update.flag.context.Animation
|
||||
import core.plugin.Initializable
|
||||
|
||||
@Initializable
|
||||
class DigUpPatchDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) {
|
||||
class DigUpPatchDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||
var patch: Patch? = null
|
||||
|
||||
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return DigUpPatchDialogue(player)
|
||||
}
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl
|
||||
if(patch.type == PatchType.TREE) {
|
||||
// Willow branches
|
||||
if(harvestAmt < 6) {
|
||||
harvestAmt++;
|
||||
harvestAmt++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class CropGrowth : PersistTimer (500, "farming:crops", isSoft = true) {
|
||||
|
||||
//Sync the 5 minute run cycles with :05 on realtime clocks - authentic
|
||||
override fun getInitialRunDelay() : Int {
|
||||
val now = LocalTime.now();
|
||||
val now = LocalTime.now()
|
||||
val minsUntil5MinSync = 5 - (now.getMinute() % 5)
|
||||
val ticks = secondsToTicks (minsUntil5MinSync * 60)
|
||||
player.debug("[CropGrowth] Scheduled first growth cycle for $ticks ticks from now.")
|
||||
|
||||
@@ -2,8 +2,6 @@ package content.global.skill.gather
|
||||
|
||||
import content.global.skill.fishing.FishingSpot
|
||||
import content.global.skill.gather.fishing.FishingPulse
|
||||
import content.global.skill.gather.mining.MiningSkillPulse
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.node.Node
|
||||
import core.game.node.entity.npc.NPC
|
||||
|
||||
@@ -76,7 +76,7 @@ class MiningListener : InteractionListener {
|
||||
if(reward == Items.CLAY_434){
|
||||
val bracelet = getItemFromEquipment(player, EquipmentSlot.HANDS)
|
||||
if(bracelet != null && bracelet.id == Items.BRACELET_OF_CLAY_11074){
|
||||
var charges = player.getAttribute("jewellery-charges:bracelet-of-clay", 28);
|
||||
var charges = player.getAttribute("jewellery-charges:bracelet-of-clay", 28)
|
||||
charges--
|
||||
reward = Items.SOFT_CLAY_1761
|
||||
sendMessage(player, "Your bracelet of clay softens the clay for you.")
|
||||
|
||||
@@ -141,7 +141,7 @@ class MiningSkillPulse(private val player: Player, private val node: Node) : Pul
|
||||
if(reward == Items.CLAY_434){
|
||||
val bracelet = getItemFromEquipment(player, EquipmentSlot.HANDS)
|
||||
if(bracelet != null && bracelet.id == Items.BRACELET_OF_CLAY_11074){
|
||||
var charges = player.getAttribute("jewellery-charges:bracelet-of-clay", 28);
|
||||
var charges = player.getAttribute("jewellery-charges:bracelet-of-clay", 28)
|
||||
charges--
|
||||
reward = Items.SOFT_CLAY_1761
|
||||
sendMessage(player, "Your bracelet of clay softens the clay for you.")
|
||||
|
||||
@@ -7,7 +7,7 @@ import core.game.world.map.path.ClipMaskSupplier
|
||||
import core.game.node.entity.npc.*
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.SpellBookManager;
|
||||
import core.game.node.entity.player.link.SpellBookManager
|
||||
import core.game.node.item.Item
|
||||
import core.game.node.entity.combat.CombatStyle
|
||||
import content.global.skill.magic.spellconsts.Modern
|
||||
@@ -34,19 +34,19 @@ class ImplingBehavior : NPCBehavior (*Impling.getIds()) {
|
||||
}
|
||||
|
||||
override fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean) : Boolean {
|
||||
if (attacker !is Player) return false;
|
||||
if (attacker !is Player) return false
|
||||
|
||||
if (style != CombatStyle.MAGIC) {
|
||||
if (shouldSendMessage)
|
||||
sendMessage (attacker, "You can't do that.")
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
val spellBook = attacker.spellBookManager.spellBook
|
||||
if (spellBook != SpellBookManager.SpellBook.MODERN.interfaceId) {
|
||||
if (shouldSendMessage)
|
||||
sendMessage (attacker, "The impling is too fast for that.")
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
val spellId = attacker.properties.spell.spellId
|
||||
|
||||
@@ -172,7 +172,7 @@ enum class ImplingSpawnLocations (val type: ImplingSpawnTypes, vararg val locati
|
||||
|
||||
object ImplingClipper : ClipMaskSupplier {
|
||||
override fun getClippingFlag (z: Int, x: Int, y: Int) : Int {
|
||||
var flag = RegionManager.getClippingFlag(z, x, y);
|
||||
var flag = RegionManager.getClippingFlag(z, x, y)
|
||||
return flag and (RegionFlags.SOLID_TILE.inv()) and (RegionFlags.TILE_OBJECT.inv()) //Allow walking on water and flying over small objects, but keep all other tile flags the same.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
import core.api.*
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.CombatStyle
|
||||
import core.game.node.entity.impl.Animator.Priority;
|
||||
import core.game.node.entity.impl.Animator.Priority
|
||||
import core.game.node.entity.impl.ForceMovement
|
||||
import core.game.node.entity.npc.AbstractNPC
|
||||
import core.game.node.entity.player.Player
|
||||
@@ -167,7 +167,7 @@ class PitfallListeners : InteractionListener {
|
||||
return@setDest dst
|
||||
}
|
||||
on(PIT, IntType.SCENERY, "trap") { player, node ->
|
||||
val pit = node as Scenery;
|
||||
val pit = node as Scenery
|
||||
// TODO: check hunter level, remove logs
|
||||
if(player.skills.getLevel(Skills.HUNTER) < 31) {
|
||||
player.sendMessage("You need a hunter level of 31 to set a pitfall trap.")
|
||||
@@ -204,12 +204,12 @@ class PitfallListeners : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
on(SPIKED_PIT, IntType.SCENERY, "jump") { player, node ->
|
||||
val pit = node as Scenery;
|
||||
val pit = node as Scenery
|
||||
val src = player.getLocation()
|
||||
val dir = pitJumpSpots(pit.getLocation())!![src]
|
||||
if(dir != null) {
|
||||
val dst = src.transform(dir, 3)
|
||||
ForceMovement.run(player, src, dst, ForceMovement.WALK_ANIMATION, Animation(1603), dir, 16);
|
||||
ForceMovement.run(player, src, dst, ForceMovement.WALK_ANIMATION, Animation(1603), dir, 16)
|
||||
playAudio(player, getAudio(Sounds.HUNTING_JUMP_2635))
|
||||
val pitfall_npc: Entity? = player.getAttribute("pitfall_npc", null)
|
||||
if(pitfall_npc != null && pitfall_npc.getLocation().getDistance(src) < 3.0) {
|
||||
@@ -247,7 +247,7 @@ class PitfallListeners : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
on(SPIKED_PIT, IntType.SCENERY, "dismantle") { player, node ->
|
||||
val pit = node as Scenery;
|
||||
val pit = node as Scenery
|
||||
playAudio(player, getAudio(Sounds.HUNTING_TAKEBRANCHES_2649))
|
||||
player.removeAttribute("pitfall:timestamp:${pit.location.x}:${pit.location.y}")
|
||||
player.incrementAttribute("pitfall:count", -1)
|
||||
@@ -289,11 +289,11 @@ class PitfallListeners : InteractionListener {
|
||||
|
||||
fun lootCorpse(player: Player, pit: Scenery, xp: Double, goodFur: Int, badFur: Int) {
|
||||
if(player.inventory.freeSlots() < 2) {
|
||||
player.sendMessage("You don't have enough inventory space. You need 2 more free slots.");
|
||||
player.sendMessage("You don't have enough inventory space. You need 2 more free slots.")
|
||||
return
|
||||
}
|
||||
setPitState(player, pit.location, 0)
|
||||
player.getSkills().addExperience(Skills.HUNTER, xp, true);
|
||||
player.getSkills().addExperience(Skills.HUNTER, xp, true)
|
||||
player.inventory.add(Item(Items.BIG_BONES_532))
|
||||
playAudio(player, getAudio(Sounds.HUNTING_TAKEBRANCHES_2649))
|
||||
// TODO: what's the actual probability of tatty vs perfect fur?
|
||||
|
||||
@@ -87,7 +87,7 @@ class ModernListeners : SpellListener("modern"){
|
||||
|
||||
onCast(Modern.CAMELOT_TELEPORT, NONE){ player, _->
|
||||
requires(player,45, arrayOf(Item(Items.AIR_RUNE_556,5),Item(Items.LAW_RUNE_563)))
|
||||
player.achievementDiaryManager.finishTask(player, DiaryType.SEERS_VILLAGE, 1, 5);
|
||||
player.achievementDiaryManager.finishTask(player, DiaryType.SEERS_VILLAGE, 1, 5)
|
||||
sendTeleport(player,55.5, Location.create(2758, 3478, 0))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package content.global.skill.magic.modern
|
||||
|
||||
import core.api.*
|
||||
import org.json.simple.*
|
||||
import core.game.system.timer.*
|
||||
import core.api.getAudio
|
||||
import core.api.playAudio
|
||||
import core.api.sendMessage
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.system.timer.PersistTimer
|
||||
|
||||
class SpellCharge : PersistTimer (700, "magic:spellcharge") {
|
||||
override fun run (entity: Entity) : Boolean {
|
||||
|
||||
@@ -220,7 +220,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
|
||||
|
||||
override fun open(vararg args: Any?): Boolean {
|
||||
options("Air","Mind","Water","Earth","More...")
|
||||
stage = 0;
|
||||
stage = 0
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package content.global.skill.slayer
|
||||
|
||||
import content.global.handlers.item.equipment.special.DragonfireSwingHandler
|
||||
import core.api.EquipmentSlot
|
||||
import core.api.getItemFromEquipment
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.BattleState
|
||||
import core.game.node.entity.combat.CombatStyle
|
||||
import core.game.node.entity.combat.CombatSwingHandler
|
||||
import core.game.node.entity.combat.MultiSwingHandler
|
||||
@@ -12,10 +8,8 @@ import core.game.node.entity.combat.equipment.SwitchAttack
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.npc.NPCBehavior
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.prayer.PrayerType
|
||||
import core.game.world.update.flag.context.Animation
|
||||
import core.game.world.update.flag.context.Graphics
|
||||
import core.tools.RandomFunction
|
||||
import org.rs09.consts.Items
|
||||
|
||||
class SkeletalWyvernBehavior : NPCBehavior(*Tasks.SKELETAL_WYVERN.ids) {
|
||||
|
||||
@@ -19,34 +19,34 @@ class SummoningTabListener : InterfaceListener {
|
||||
player.getPacketDispatch().sendMessage("Your familiar is not a beast of burden.")
|
||||
return@on true
|
||||
}
|
||||
val beast = player.getFamiliarManager().getFamiliar() as BurdenBeast;
|
||||
val beast = player.getFamiliarManager().getFamiliar() as BurdenBeast
|
||||
if (beast.getContainer().isEmpty()) {
|
||||
player.getPacketDispatch().sendMessage("Your familiar is not carrying any items.")
|
||||
return@on true
|
||||
}
|
||||
beast.withdrawAll();
|
||||
beast.withdrawAll()
|
||||
return@on true
|
||||
}
|
||||
player.getPacketDispatch().sendMessage("You don't have a follower.");
|
||||
player.getPacketDispatch().sendMessage("You don't have a follower.")
|
||||
}
|
||||
53 -> {
|
||||
if (player.getFamiliarManager().hasFamiliar()) {
|
||||
if(opcode == 155) {
|
||||
// Dismiss familiar
|
||||
player.getDialogueInterpreter().open("dismiss_dial");
|
||||
player.getDialogueInterpreter().open("dismiss_dial")
|
||||
} else if(opcode == 196) {
|
||||
// Dismiss now
|
||||
player.getFamiliarManager().dismiss(false);
|
||||
player.getFamiliarManager().dismiss(false)
|
||||
}
|
||||
} else {
|
||||
player.getPacketDispatch().sendMessage("You don't have a follower.");
|
||||
player.getPacketDispatch().sendMessage("You don't have a follower.")
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
if (player.getFamiliarManager().hasFamiliar()) {
|
||||
player.getFamiliarManager().getFamiliar().executeSpecialMove(FamiliarSpecial(player));
|
||||
player.getFamiliarManager().getFamiliar().executeSpecialMove(FamiliarSpecial(player))
|
||||
} else {
|
||||
player.getPacketDispatch().sendMessage("You don't have a follower.");
|
||||
player.getPacketDispatch().sendMessage("You don't have a follower.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,21 +51,21 @@ object CanoeUtils {
|
||||
2 -> FROM_BARBARIAN.getOrDefault(destId,0)
|
||||
3 -> FROM_EDGE.getOrDefault(destId,0)
|
||||
4 -> FROM_WILDERNESS.getOrDefault(destId,0)
|
||||
else -> 0;
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
|
||||
fun getShapeAnimation(axe: SkillingTool): Animation{
|
||||
return when(axe){
|
||||
SkillingTool.BRONZE_AXE -> Animation(6744);
|
||||
SkillingTool.IRON_AXE -> Animation(6743);
|
||||
SkillingTool.STEEL_AXE -> Animation(6742);
|
||||
SkillingTool.BLACK_AXE -> Animation(6741);
|
||||
SkillingTool.MITHRIL_AXE -> Animation(6740);
|
||||
SkillingTool.ADAMANT_AXE -> Animation(6739);
|
||||
SkillingTool.RUNE_AXE -> Animation(6738);
|
||||
SkillingTool.DRAGON_AXE -> Animation(6745);
|
||||
else -> axe.animation;
|
||||
SkillingTool.BRONZE_AXE -> Animation(6744)
|
||||
SkillingTool.IRON_AXE -> Animation(6743)
|
||||
SkillingTool.STEEL_AXE -> Animation(6742)
|
||||
SkillingTool.BLACK_AXE -> Animation(6741)
|
||||
SkillingTool.MITHRIL_AXE -> Animation(6740)
|
||||
SkillingTool.ADAMANT_AXE -> Animation(6739)
|
||||
SkillingTool.RUNE_AXE -> Animation(6738)
|
||||
SkillingTool.DRAGON_AXE -> Animation(6745)
|
||||
else -> axe.animation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user