mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Fixed the long missing Lumbridge Achivement Diary store-browsing task
This commit is contained in:
parent
7cded916c6
commit
7a2f91df3d
2 changed files with 24 additions and 18 deletions
|
|
@ -16,8 +16,9 @@ import rs09.game.Event
|
|||
import rs09.game.system.command.Privilege
|
||||
|
||||
private const val TASK_DRAYNOR_BANK = 15
|
||||
private const val TASK_LUMBRIDGE_GENERAL_STORE = 18
|
||||
|
||||
class DiaryEventHook : LoginListener, Commands {
|
||||
class DiaryEventHook : LoginListener {
|
||||
override fun login(player: Player) {
|
||||
player.hook(Event.ResourceProduced, DiaryGatherHooks)
|
||||
player.hook(Event.Teleport, DiaryTeleportHooks)
|
||||
|
|
@ -58,6 +59,15 @@ class DiaryEventHook : LoginListener, Commands {
|
|||
TASK_DRAYNOR_BANK
|
||||
)
|
||||
}
|
||||
|
||||
12850 -> if (event.component.id == Components.SHOP_TEMPLATE_620) {
|
||||
finishTask(
|
||||
entity,
|
||||
DiaryType.LUMBRIDGE,
|
||||
0,
|
||||
TASK_LUMBRIDGE_GENERAL_STORE
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -424,21 +434,4 @@ class DiaryEventHook : LoginListener, Commands {
|
|||
finishTask(entity, DiaryType.SEERS_VILLAGE, 1, 6)
|
||||
}
|
||||
}
|
||||
|
||||
override fun defineCommands() {
|
||||
define("cleardiary", Privilege.ADMIN) { player, _ ->
|
||||
// I know this sucks but it's only for debugging.
|
||||
// Please don't slap me, daddy.
|
||||
//
|
||||
for (type in DiaryType.values()) {
|
||||
val diary = player.achievementDiaryManager.getDiary(type)
|
||||
for (level in 0 until diary.levelStarted.size) {
|
||||
for (task in 0 until diary.taskCompleted[level].size) {
|
||||
diary.resetTask(player, level, task)
|
||||
}
|
||||
}
|
||||
}
|
||||
sendMessage(player, "All achievement diaries cleared successfully.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import core.cache.def.impl.Struct
|
|||
import core.game.node.entity.combat.ImpactHandler.HitsplatType
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.SpellBookManager
|
||||
import core.game.node.entity.player.link.diary.DiaryType
|
||||
import core.game.node.item.Item
|
||||
import core.net.packet.context.PlayerContext
|
||||
import core.net.packet.out.ResetInterface
|
||||
|
|
@ -38,6 +39,18 @@ class DevelopmentCommandSet : CommandSet(Privilege.ADMIN) {
|
|||
}
|
||||
}
|
||||
|
||||
define("cleardiary", Privilege.ADMIN) { player, _ ->
|
||||
for (type in DiaryType.values()) {
|
||||
val diary = player.achievementDiaryManager.getDiary(type)
|
||||
for (level in 0 until diary.levelStarted.size) {
|
||||
for (task in 0 until diary.taskCompleted[level].size) {
|
||||
diary.resetTask(player, level, task)
|
||||
}
|
||||
}
|
||||
}
|
||||
sendMessage(player, "All achievement diaries cleared successfully.")
|
||||
}
|
||||
|
||||
define("region") {player, args ->
|
||||
sendMessage(player, "Region ID: ${player.viewport.region.regionId}")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue