mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Compare commits
3 commits
d826e4bcce
...
8337670660
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8337670660 | ||
|
|
e4a465a082 | ||
|
|
ad5ad6333c |
4 changed files with 45 additions and 43 deletions
|
|
@ -11,6 +11,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.TeleportManager
|
import core.game.node.entity.player.link.TeleportManager
|
||||||
import core.game.node.item.Item
|
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.map.Location
|
import core.game.world.map.Location
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import core.game.world.update.flag.context.Graphics
|
import core.game.world.update.flag.context.Graphics
|
||||||
|
|
@ -238,35 +239,50 @@ enum class EnchantedJewellery(
|
||||||
if (!canTeleport(player, nextJewellery)) {
|
if (!canTeleport(player, nextJewellery)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
Pulser.submit(object : Pulse(0) {
|
val location = getLocation(buttonID)
|
||||||
private var count = 0
|
player.scripts.delay = GameWorld.ticks + 4
|
||||||
private var location = getLocation(buttonID)
|
queueScript(player, 0, QueueStrength.SOFT) { stage ->
|
||||||
override fun pulse(): Boolean {
|
when (stage) {
|
||||||
when (count) {
|
|
||||||
0 -> {
|
0 -> {
|
||||||
lock(player, 4)
|
lock(player, 4)
|
||||||
visualize(player, ANIMATION, GRAPHICS)
|
visualize(player, ANIMATION, GRAPHICS)
|
||||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||||
player.impactHandler.disabledTicks = 4
|
player.impactHandler.disabledTicks = 4
|
||||||
closeInterface(player)
|
closeInterface(player)
|
||||||
|
return@queueScript delayScript(player, 3)
|
||||||
}
|
}
|
||||||
3 -> {
|
1 -> {
|
||||||
teleport(player, location)
|
teleport(player, location)
|
||||||
resetAnimator(player)
|
resetAnimator(player)
|
||||||
|
unlock(player)
|
||||||
|
player.dispatch(TeleportEvent(TeleportManager.TeleportType.NORMAL, TeleportMethod.JEWELRY, item, location))
|
||||||
if (isLastItemIndex(itemIndex)) {
|
if (isLastItemIndex(itemIndex)) {
|
||||||
if (isCrumble) crumbleJewellery(player, item, isEquipped)
|
if (isSlayerRing(item)) {
|
||||||
|
if (isEquipped) {
|
||||||
|
// Remove it now, but only addItemOrDrop the gem after the teleport has procced
|
||||||
|
removeItem(player, item, Container.INVENTORY)
|
||||||
|
return@queueScript delayScript(player, 1)
|
||||||
|
}
|
||||||
|
// Not equipped -> can replace fluently
|
||||||
|
replaceSlot(player, item.slot, Item(Items.ENCHANTED_GEM_4155), item)
|
||||||
|
return@queueScript stopExecuting(player)
|
||||||
|
}
|
||||||
|
// Not slayer ring
|
||||||
|
if (isCrumble) {
|
||||||
|
val removeFrom = if (isEquipped) Container.EQUIPMENT else Container.INVENTORY
|
||||||
|
removeItem(player, item, removeFrom)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
replaceJewellery(player, item, nextJewellery, isEquipped)
|
replaceJewellery(player, item, nextJewellery, isEquipped)
|
||||||
}
|
}
|
||||||
unlock(player)
|
}
|
||||||
player.dispatch(TeleportEvent(TeleportManager.TeleportType.NORMAL, TeleportMethod.JEWELRY, item, location))
|
2 -> {
|
||||||
return true
|
addItemOrDrop(player, Items.ENCHANTED_GEM_4155)
|
||||||
|
sendMessage(player, "Your Ring of Slaying reverts back into a regular enchanted gem.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count += 1
|
return@queueScript stopExecuting(player)
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -278,21 +294,6 @@ enum class EnchantedJewellery(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun crumbleJewellery(player: Player, item: Item, isEquipped: Boolean) {
|
|
||||||
if (isEquipped) {
|
|
||||||
removeItem(player, item, Container.EQUIPMENT)
|
|
||||||
} else {
|
|
||||||
removeItem(player, item)
|
|
||||||
}
|
|
||||||
if (isSlayerRing(item)) {
|
|
||||||
queueScript(player, 1, QueueStrength.SOFT) {
|
|
||||||
addItemOrDrop(player, Items.ENCHANTED_GEM_4155)
|
|
||||||
sendMessage(player, "Your Ring of Slaying reverts back into a regular enchanted gem.")
|
|
||||||
return@queueScript stopExecuting(player)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun isSlayerRing(item: Item): Boolean {
|
private fun isSlayerRing(item: Item): Boolean {
|
||||||
return (item.id in RING_OF_SLAYING.ids)
|
return (item.id in RING_OF_SLAYING.ids)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class ShootingStar(var level: ShootingStarType = ShootingStarType.values().rando
|
||||||
"South-west Varrock mine" to Location.create(3176, 3362, 0), // South-west Varrock mine / Champion's Guild mine
|
"South-west Varrock mine" to Location.create(3176, 3362, 0), // South-west Varrock mine / Champion's Guild mine
|
||||||
"Varrock east bank" to Location.create(3259, 3407, 0), // Varrock east bank / Rune shop
|
"Varrock east bank" to Location.create(3259, 3407, 0), // Varrock east bank / Rune shop
|
||||||
"Lumbridge Swamp south-east mine" to Location.create(3227, 3150, 0), // Lumbridge Swamp south-east mine
|
"Lumbridge Swamp south-east mine" to Location.create(3227, 3150, 0), // Lumbridge Swamp south-east mine
|
||||||
//"Burgh de Rott bank" to Location.create(3500, 3219, 0), // Burgh de Rott bank (requires quest to enter)
|
"Burgh de Rott bank" to Location.create(3500, 3219, 0), // Burgh de Rott bank (requires quest to enter)
|
||||||
"Canifis Bank" to Location.create(3504, 3487, 0), // Canifis bank
|
"Canifis Bank" to Location.create(3504, 3487, 0), // Canifis bank
|
||||||
"Mos Le'Harmless bank" to Location.create(3687, 2969, 0), // Mos Le'Harmless bank (requires quest to enter but is currently accessible for Slayer)
|
"Mos Le'Harmless bank" to Location.create(3687, 2969, 0), // Mos Le'Harmless bank (requires quest to enter but is currently accessible for Slayer)
|
||||||
"Gnome stronghold Bank" to Location.create(2460, 3432, 0), // Gnome stronghold bank
|
"Gnome stronghold Bank" to Location.create(2460, 3432, 0), // Gnome stronghold bank
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com
|
||||||
fun teleportToStar(player: Player) {
|
fun teleportToStar(player: Player) {
|
||||||
val condition: (p: Player) -> Boolean = when (star.location.toLowerCase()) {
|
val condition: (p: Player) -> Boolean = when (star.location.toLowerCase()) {
|
||||||
"canifis bank" -> {p -> requireQuest(p, Quests.PRIEST_IN_PERIL, "to access this.")}
|
"canifis bank" -> {p -> requireQuest(p, Quests.PRIEST_IN_PERIL, "to access this.")}
|
||||||
//"burgh de rott bank" -> {p -> hasRequirement(p, Quests.IN_AID_OF_THE_MYREQUE)} //disabled: crash
|
"burgh de rott bank" -> {p -> hasRequirement(p, Quests.IN_AID_OF_THE_MYREQUE)}
|
||||||
"crafting guild" -> {p -> hasLevelStat(p, Skills.CRAFTING, 40)}
|
"crafting guild" -> {p -> hasLevelStat(p, Skills.CRAFTING, 40)}
|
||||||
"lletya bank" -> {p -> hasRequirement(p, Quests.MOURNINGS_END_PART_I)}
|
"lletya bank" -> {p -> hasRequirement(p, Quests.MOURNINGS_END_PART_I)}
|
||||||
"jatizso mine" -> {p -> hasRequirement(p, Quests.THE_FREMENNIK_ISLES)}
|
"jatizso mine" -> {p -> hasRequirement(p, Quests.THE_FREMENNIK_ISLES)}
|
||||||
|
|
@ -120,7 +120,7 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com
|
||||||
1 -> dialogue("WARNING: The star is located in the wilderness.").also { stage++ }
|
1 -> dialogue("WARNING: The star is located in the wilderness.").also { stage++ }
|
||||||
2 -> player.dialogueInterpreter.sendOptions("Teleport to the star?", "Yes", "No").also { stage++ }
|
2 -> player.dialogueInterpreter.sendOptions("Teleport to the star?", "Yes", "No").also { stage++ }
|
||||||
3 -> when (buttonID) {
|
3 -> when (buttonID) {
|
||||||
1 -> end().also { teleportToStar(player) }
|
1 -> teleportToStar(player)
|
||||||
2 -> end()
|
2 -> end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ public class TeleportManager {
|
||||||
if (teleportType != -1) {
|
if (teleportType != -1) {
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
Player p = (Player) entity;
|
Player p = (Player) entity;
|
||||||
|
p.scripts.setDelay(GameWorld.getTicks() + 12);
|
||||||
p.getDialogueInterpreter().close();
|
p.getDialogueInterpreter().close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue