c52e02936d
Implemented admin audio command ::audio audioId loops[optional] Implemented admin globalaudio command ::globalaudio audioId radius playername (plays from that players location) or can be used by coords ::globalaudio audioId radius x y z Refactored the following sounds: Tribal totem quest Cromperty teleport (fixed looping) Vinesweeper tool leprechaun teleport sound (Corrected this sound so it does not loop 10 times) Antifire and poision immunity 30 seconds remaining tick tock sounds and sound of the potions expiring (Fixed it so it plays the correct number of tick tocks) Sound when summoning a familiar (All familiars were using the summon unicorn sound. It is now defaulted to the normal summoning sound instead of the unicorn summon sound. All familiars on first summon have a their own sounds that will need to be implemented later) Door and gate sounds Bank interface sounds Unicorn stallion special move sound Agility pyramid rolling block sounds Prayer book sounds Lunar stat spy Hunter falconry Picking items in a field like potatoes Ectophial teleport and refill Summoning pouch creation and renewing points Runecrafting at altar sound Making finished and unfinished potions Cutting gems Entering giant mole area Praying at an altar Warriors guild animator sounds Chiseling limestone Spirit wolf special move sound Telegrab spell sound Glassblowing sound Strong of security opening reward chest creaking sound Butterfly net sound Desert rug travel rise and descend sound Enchanting bolts Woodcutting tree falling and chopping sound Hunter setting up dismantling traps and pitfall sounds Explorers ring run energy restore sound Farming: Raking, adding compost to patch, picking from fruit trees, seed dibb, using plant cure on patch, opening/closing/adding to/from compost bin Mage training arena alchemy spell sounds Breaking bones to peaches/bananas tab sound Casting silver sickle bloom Entrana magic door teleport Cabbage teleport Teleother cast sound Fairy ring teleport sound Lunar vengeance spells Running out of prayer sound Lunar (non teleport) spells Super heat and bones to bananas normal spell book sounds Equip/unequip item sound Revenant combat sounds Herb cleaning sound Emptying buckets/bowls/jugs of water Making cannonballs at a furnace Digging with a spade Peer the seer fremmenik trials challenge: heating items on the range Blessing a spirit shield at a POH altar ContentAPI function stun sound Picking up items off the ground Eating food sound Cooking and intentionally burning food Drinking a potion Warriors guild catapult Pulling wilderness teleport levers Offering bones on a POH altar Slashing spider webs in Varrock sewers Entering POH portal teleport sound GE exchanging item set sound Jumping wilderness ditch Dragon axe special Digging up a farming patch Lunar heal spells Chaos elemental projectile impact sounds Mounted glory teleport Lunar share and boost potion spell Dwarf multi cannon setup, rotate, and firing sounds NPC attacking sound Enchanted bolt effect combat sound
134 lines
7.5 KiB
Kotlin
134 lines
7.5 KiB
Kotlin
package content.region.karamja.quest.tribaltotem
|
|
|
|
import core.game.node.entity.impl.Projectile
|
|
import core.game.node.entity.npc.NPC
|
|
import core.game.node.entity.player.Player
|
|
import core.game.system.task.Pulse
|
|
import core.game.world.map.Location
|
|
import core.game.world.update.flag.context.Animation
|
|
import core.game.world.update.flag.context.Graphics
|
|
import core.plugin.Initializable
|
|
import org.rs09.consts.NPCs
|
|
import content.global.travel.EssenceTeleport
|
|
import core.api.playAudio
|
|
import core.game.world.GameWorld
|
|
import org.rs09.consts.Sounds
|
|
|
|
@Initializable
|
|
class CrompertyDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) {
|
|
|
|
override fun open(vararg args: Any?): Boolean {
|
|
npc = args[0] as NPC
|
|
npcl(core.game.dialogue.FacialExpression.HAPPY,"Hello ${player.name}, I'm Cromperty. Sedridor has told me about you. As a wizard and an inventor he has aided me in my great invention!")
|
|
stage = 0
|
|
return true
|
|
}
|
|
|
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
|
when(stage){
|
|
0 -> options("Two jobs? that's got to be tough","So what have you invented?","Can you teleport me to the Rune Essence?").also { stage++ }
|
|
1 ->when(buttonId){
|
|
1 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Two jobs? That's got to be tough.").also { stage = 5 }
|
|
2 -> playerl(core.game.dialogue.FacialExpression.ASKING,"So, what have you invented?").also { stage = 10 }
|
|
3 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Can you teleport me to the Rune Essence?").also {
|
|
if(player.questRepository.isComplete("Rune Mysteries")){
|
|
EssenceTeleport.teleport(npc,player)
|
|
end()
|
|
}
|
|
else stage = 2
|
|
}
|
|
}
|
|
2 -> npcl(core.game.dialogue.FacialExpression.THINKING,"I have no idea what you're talking about.")
|
|
5 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Not when you combine them it isn't! Invent MAGIC things!").also { stage++ }
|
|
6 -> options("So what have you invented?","Well I shall leave you to your inventing").also { stage++ }
|
|
7 -> when(buttonId){
|
|
1 -> playerl(core.game.dialogue.FacialExpression.ASKING,"So, what have you invented?").also { stage = 10 }
|
|
2 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Well I shall leave you to your inventing").also { stage++ }
|
|
}
|
|
8 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Thanks for dropping by! Stop again anytime!").also { stage = 1000 }
|
|
|
|
10 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Ah! My latest invention is my patent pending teleportation block! It emits a low level magical signal,").also { stage++ }
|
|
11 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"that will allow me to locate it anywhere in the world, and teleport anything directly to it! I hope to revolutionize the entire teleportation system!").also { stage++ }
|
|
12 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Don't you think I'm great? Uh, I mean it's great?").also { stage++ }
|
|
13 -> options("So where is the other block?","Can I be teleported please?").also { stage++ }
|
|
14 -> when(buttonId){
|
|
1 -> playerl(core.game.dialogue.FacialExpression.ASKING,"So where is the other block?").also { stage = 15 }
|
|
2 -> playerl(core.game.dialogue.FacialExpression.ASKING,"Can I be teleported please?").also { stage = 25 }
|
|
}
|
|
|
|
15 -> npcl(core.game.dialogue.FacialExpression.THINKING,"Well...Hmm. I would guess somewhere between here and the Wizards' Tower in Misthalin.").also { stage++ }
|
|
16 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"All I know is that it hasn't got there yet as the wizards there would have contacted me.").also { stage++ }
|
|
17 -> npcl(core.game.dialogue.FacialExpression.THINKING,"I'm using the GPDT for delivery. They assured me it would be delivered promptly.").also { stage++ }
|
|
18 -> playerl(core.game.dialogue.FacialExpression.ASKING,"Who are the GPDT?").also { stage++ }
|
|
19 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"The Gielinor Parcel Delivery Team. They come very highly recommended.").also { stage++ }
|
|
20 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Their motto is: \"We aim to deliver your stuff at some point after you have paid us!\"").also { stage = 1000 }
|
|
|
|
25 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"By all means! I'm afraid I can't give you any specifics as to where you will come out however. Presumably wherever the other block is located.").also { stage++ }
|
|
26 -> options("Yes, that sounds good. Teleport me!","That sounds dangerous. Leave me here.").also { stage++ }
|
|
27 -> when(buttonId){
|
|
1 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Yes, that sounds good. Teleport me!").also { stage = 30 }
|
|
2 -> playerl(core.game.dialogue.FacialExpression.THINKING,"That sounds dangerous. Leave me here.").also { stage++ }
|
|
}
|
|
28 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"As you wish.").also { stage = 1000 }
|
|
|
|
30 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Okey dokey! Ready?").also {
|
|
stage = if(player.questRepository.hasStarted("Tribal Totem") && player.questRepository.getStage("Tribal Totem") < 50) {
|
|
35
|
|
}
|
|
else 31
|
|
}
|
|
31 -> npcl(core.game.dialogue.FacialExpression.THINKING,"Hmmm... that's odd... I can't seem to get a signal...").also { stage++ }
|
|
32 -> playerl(core.game.dialogue.FacialExpression.SAD,"Oh well, never mind.").also { stage = 1000 }
|
|
|
|
35 -> npcl(core.game.dialogue.FacialExpression.HAPPY,"Okay, I got a signal. Get ready!").also {
|
|
TribalTotemTeleport(player, npc)
|
|
end()
|
|
}
|
|
|
|
1000 -> end()
|
|
}
|
|
return true
|
|
}
|
|
|
|
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
|
|
return CrompertyDialogue(player)
|
|
}
|
|
|
|
override fun getIds(): IntArray {
|
|
return intArrayOf(844,NPCs.WIZARD_CROMPERTY_2328)
|
|
}
|
|
|
|
fun TribalTotemTeleport(player : Player, npc: NPC) {
|
|
val LOCATIONS = arrayOf(Location.create(2649, 3272, 0),Location.create(2642, 3321, 0))
|
|
npc.animate(Animation(437))
|
|
npc.faceTemporary(player, 1)
|
|
npc.graphics(Graphics(108))
|
|
player.lock()
|
|
playAudio(player, Sounds.CURSE_ALL_125, 0, 1)
|
|
Projectile.create(npc, player, 109).send()
|
|
npc.sendChat("Dipsolum sententa sententi!")
|
|
GameWorld.Pulser.submit(object : Pulse(1) {
|
|
var counter = 0
|
|
var delivered = player.questRepository.getStage("Tribal Totem") >= 25
|
|
override fun pulse(): Boolean {
|
|
when(counter++){
|
|
2 -> {
|
|
if(delivered) {
|
|
player.questRepository.getQuest("Tribal Totem").setStage(player,30)
|
|
player.properties.teleportLocation = LOCATIONS[1]
|
|
}
|
|
else player.properties.teleportLocation = LOCATIONS[0]
|
|
}
|
|
3 ->{
|
|
player.graphics(Graphics(110))
|
|
player.unlock()
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|