Fixed bug preventing The Fremennik Trials lyre concert being marked as completed
This commit is contained in:
+13
-9
@@ -22,6 +22,7 @@ import core.game.interaction.IntType
|
|||||||
import core.game.system.config.ItemConfigParser
|
import core.game.system.config.ItemConfigParser
|
||||||
import core.game.world.GameWorld.Pulser
|
import core.game.world.GameWorld.Pulser
|
||||||
import content.data.Quests
|
import content.data.Quests
|
||||||
|
import core.game.interaction.QueueStrength
|
||||||
|
|
||||||
class TFTInteractionListeners : InteractionListener {
|
class TFTInteractionListeners : InteractionListener {
|
||||||
|
|
||||||
@@ -155,7 +156,7 @@ class TFTInteractionListeners : InteractionListener {
|
|||||||
sendNPCDialogue(player,1278,"Yeah you're good to go through. Olaf tells me you're some kind of outerlander bard here on tour. I doubt you're worse than Olaf is.")
|
sendNPCDialogue(player,1278,"Yeah you're good to go through. Olaf tells me you're some kind of outerlander bard here on tour. I doubt you're worse than Olaf is.")
|
||||||
core.game.global.action.DoorActionHandler.handleAutowalkDoor(player,door.asScenery())
|
core.game.global.action.DoorActionHandler.handleAutowalkDoor(player,door.asScenery())
|
||||||
}
|
}
|
||||||
getAttribute(player,"lyreConcertPlayed",false) -> {
|
getAttribute(player,"lyreConcertPlayed",false) || isQuestComplete(player, Quests.THE_FREMENNIK_TRIALS) -> {
|
||||||
core.game.global.action.DoorActionHandler.handleAutowalkDoor(player,door.asScenery())
|
core.game.global.action.DoorActionHandler.handleAutowalkDoor(player,door.asScenery())
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
@@ -167,7 +168,7 @@ class TFTInteractionListeners : InteractionListener {
|
|||||||
|
|
||||||
on(LYRE_IDs, IntType.ITEM, "play"){ player, lyre ->
|
on(LYRE_IDs, IntType.ITEM, "play"){ player, lyre ->
|
||||||
if(getAttribute(player,"onStage",false) && !getAttribute(player,"lyreConcertPlayed",false)){
|
if(getAttribute(player,"onStage",false) && !getAttribute(player,"lyreConcertPlayed",false)){
|
||||||
Pulser.submit(LyreConcertPulse(player,lyre.id))
|
playLyreConcert(player, lyre.id)
|
||||||
} else if(getQuestStage(player, Quests.THE_FREMENNIK_TRIALS) < 20 || !isQuestComplete(player, Quests.THE_FREMENNIK_TRIALS)){
|
} else if(getQuestStage(player, Quests.THE_FREMENNIK_TRIALS) < 20 || !isQuestComplete(player, Quests.THE_FREMENNIK_TRIALS)){
|
||||||
sendMessage(player,"You lack the knowledge to play this.")
|
sendMessage(player,"You lack the knowledge to play this.")
|
||||||
} else if(LYRE_IDs.isLast(lyre.id)){
|
} else if(LYRE_IDs.isLast(lyre.id)){
|
||||||
@@ -353,7 +354,7 @@ class TFTInteractionListeners : InteractionListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LyreConcertPulse(val player: Player, val Lyre: Int) : Pulse(){
|
fun playLyreConcert(player: Player, lyre: Int) {
|
||||||
val GENERIC_LYRICS = arrayOf(
|
val GENERIC_LYRICS = arrayOf(
|
||||||
"${player.username?.capitalize()} is my name,",
|
"${player.username?.capitalize()} is my name,",
|
||||||
"I haven't much to say",
|
"I haven't much to say",
|
||||||
@@ -378,7 +379,6 @@ class TFTInteractionListeners : InteractionListener {
|
|||||||
"I will simply tell you this:",
|
"I will simply tell you this:",
|
||||||
"I've joined the Legends' Guild!"
|
"I've joined the Legends' Guild!"
|
||||||
)
|
)
|
||||||
var counter = 0
|
|
||||||
val questPoints = getQuestPoints(player)
|
val questPoints = getQuestPoints(player)
|
||||||
val champGuild = player.achievementDiaryManager?.hasCompletedTask(DiaryType.VARROCK, 1, 1)?: false
|
val champGuild = player.achievementDiaryManager?.hasCompletedTask(DiaryType.VARROCK, 1, 1)?: false
|
||||||
val legGuild = questPoints >= 111
|
val legGuild = questPoints >= 111
|
||||||
@@ -401,15 +401,17 @@ class TFTInteractionListeners : InteractionListener {
|
|||||||
else -> GENERIC_LYRICS
|
else -> GENERIC_LYRICS
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pulse(): Boolean {
|
queueScript(player, 0, QueueStrength.SOFT) { stage ->
|
||||||
when(counter++){
|
when (stage) {
|
||||||
0 -> {
|
0 -> {
|
||||||
player.lock()
|
player.lock()
|
||||||
animate(player,1318,true)
|
animate(player,1318,true)
|
||||||
|
return@queueScript delayScript(player, 1)
|
||||||
}
|
}
|
||||||
2 -> {
|
2 -> {
|
||||||
animate(player,1320,true)
|
animate(player,1320,true)
|
||||||
player.musicPlayer.play(MusicEntry.forId(165))
|
player.musicPlayer.play(MusicEntry.forId(165))
|
||||||
|
return@queueScript delayScript(player, 1)
|
||||||
}
|
}
|
||||||
4 -> {
|
4 -> {
|
||||||
animate(player,1320,true)
|
animate(player,1320,true)
|
||||||
@@ -433,13 +435,15 @@ class TFTInteractionListeners : InteractionListener {
|
|||||||
}
|
}
|
||||||
14 ->{
|
14 ->{
|
||||||
setAttribute(player,"/save:lyreConcertPlayed",true)
|
setAttribute(player,"/save:lyreConcertPlayed",true)
|
||||||
player.removeAttribute("LyreEnchanted")
|
removeAttribute(player, "/save:LyreEnchanted")
|
||||||
if(removeItem(player,Lyre))
|
if (removeItem(player,lyre)) {
|
||||||
addItem(player, Items.ENCHANTED_LYRE_3690)
|
addItem(player, Items.ENCHANTED_LYRE_3690)
|
||||||
|
}
|
||||||
player.unlock()
|
player.unlock()
|
||||||
|
return@queueScript stopExecuting(player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return@queueScript delayScript(player, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user