mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
slight bugfix
This commit is contained in:
parent
a48d4d5dfa
commit
b174bbe94b
1 changed files with 25 additions and 35 deletions
|
|
@ -1,54 +1,44 @@
|
|||
package rs09.game.content.quest.members.thelosttribe
|
||||
|
||||
import core.cache.def.impl.NPCDefinition
|
||||
import core.game.content.dialogue.FacialExpression
|
||||
import core.game.interaction.OptionHandler
|
||||
import core.game.node.Node
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.game.system.task.Pulse
|
||||
import core.game.world.update.flag.context.Animation
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
import rs09.game.interaction.InteractionListener
|
||||
import rs09.game.world.GameWorld
|
||||
|
||||
@Initializable
|
||||
/**
|
||||
* handles pickpocketing sigmund during the lost tribe quest
|
||||
* @author Ceikry
|
||||
*/
|
||||
class PickpocketSigmund : OptionHandler(){
|
||||
override fun newInstance(arg: Any?): Plugin<Any> {
|
||||
NPCDefinition.forId(2082).handlers["option:pickpocket"] = this
|
||||
return this
|
||||
}
|
||||
class PickpocketSigmund : InteractionListener(){
|
||||
val SIGMUND = NPCs.SIGMUND_2082
|
||||
|
||||
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
||||
player ?: return false
|
||||
node ?: return false
|
||||
|
||||
player.lock()
|
||||
GameWorld.Pulser.submit(object : Pulse(){
|
||||
var counter = 0
|
||||
override fun pulse(): Boolean {
|
||||
when(counter++){
|
||||
0 -> player.animator.animate(Animation(881))
|
||||
3 -> {
|
||||
if(player.questRepository.getQuest("Lost Tribe").getStage(player) == 47 && !player.inventory.containsItem(Item(Items.KEY_423))){
|
||||
player.inventory.add(Item(Items.KEY_423))
|
||||
player.dialogueInterpreter.sendItemMessage(Items.KEY_423,"You find a small key on Sigmund.")
|
||||
} else {
|
||||
player.dialogueInterpreter.sendDialogues(2082,FacialExpression.ANGRY,"What do you think you're doing?!")
|
||||
override fun defineListeners() {
|
||||
on(SIGMUND,NPC,"pickpocket"){player, node ->
|
||||
player.lock()
|
||||
GameWorld.Pulser.submit(object : Pulse(){
|
||||
var counter = 0
|
||||
override fun pulse(): Boolean {
|
||||
when(counter++){
|
||||
0 -> player.animator.animate(Animation(881))
|
||||
3 -> {
|
||||
if(player.questRepository.getQuest("Lost Tribe").getStage(player) == 47 && !player.inventory.containsItem(Item(Items.KEY_423))){
|
||||
player.inventory.add(Item(Items.KEY_423))
|
||||
player.dialogueInterpreter.sendItemMessage(Items.KEY_423,"You find a small key on Sigmund.")
|
||||
} else {
|
||||
player.dialogueInterpreter.sendDialogues(2082,FacialExpression.ANGRY,"What do you think you're doing?!")
|
||||
}
|
||||
player.unlock()
|
||||
return true
|
||||
}
|
||||
player.unlock()
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
return true
|
||||
})
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue