Code cleanup

Reorganised imports
Removed redundant qualifiers
This commit is contained in:
bushtail
2023-08-19 15:07:23 +00:00
committed by Ryan
parent 0eca9521bc
commit 1b4e0aafaa
346 changed files with 2871 additions and 2886 deletions
@@ -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
@@ -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
}
@@ -25,7 +25,7 @@ class WardrobeHandler : OptionHandler() {
} else {
player.interfaceManager.open(Component(594))
}
return true;
return true
}
}
@@ -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,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) {
@@ -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.")
}
}
}