► Show Spoiler
Code: Select all
@Initializable
class TaxidermistDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any): Boolean {
npc = args[0] as NPC
npc(FacialExpression.HALF_GUILTY, "Oh, hello. Have you got something you want", "preserving?")
stage = 0
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> options("Yes please", "Not right now", "What?").also { stage++ }
1 -> when (buttonId) {
1 -> player(FacialExpression.HALF_GUILTY, "Yes please.").also { stage = 5 }
2 -> player(FacialExpression.HALF_GUILTY, "Not right now.").also { stage++ }
3 -> player(FacialExpression.ASKING, "What?").also { stage = 3 }
}
2 -> npc(FacialExpression.HALF_GUILTY, "Well, you go kill things so I can stuff them, eh?").also { stage = END_DIALOGUE }
3 -> npcl(FacialExpression.HALF_GUILTY, "If you bring me a monster head or a very big fish, I can preserve it for you so you can mount it in your house. I hear there are all sorts of exotic creatures in the Slayer Tower.").also { stage++ }
4 -> npc("I'd like a chance to stuff one of them!").also { stage = END_DIALOGUE }
5 -> npc("Give it to me to look at then.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player): DialoguePlugin {
return TaxidermistDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.TAXIDERMIST_4246)
}
}
► Show Spoiler
Code: Select all
package content.region.morytania.handlers.canifis
import content.data.config.Items
enum class StuffedItem(val dropId : Int, val stuffedId : Int, val price : Int, val message : String) {
CRAWLING_HAND_DROP(
Items.CRAWLING_HAND_7975,
Items.CRAWLING_HAND_7982,
1000,
"That's a very fine crawling hand."
),
COCKATRICE_HEAD_DROP(
Items.COCKATRICE_HEAD_7976,
Items.COCKATRICE_HEAD_7983,
2000,
"A cockatrice! Beautiful, isn't it? Look at the plumage!"
),
BASILISK_HEAD_DROP(
Items.BASILISK_HEAD_7977,
Items.BASILISK_HEAD_7984,
4000,
"My, he's a scary-looking fellow, isn't he? He'll look good on your wall!"
),
KURASK_HEAD_DROP(
Items.KURASK_HEAD_7978,
Items.KURASK_HEAD_7985,
6000,
"A kurask? Splendid! Look at those horns!"
),
ABYSSAL_HEAD_DROP(
Items.ABYSSAL_HEAD_7979,
Items.ABYSSAL_HEAD_7986,
12000,
"Goodness, an abyssal demon! See how it's still glowing? I'll have to use some magic to preserve that."
),
KBD_HEADS_DROP(
Items.KBD_HEADS_7980,
Items.KBD_HEADS_7987,
50000,
"This must be a King Black Dragon! I'll have to get out my heavy duty tools, this skin's as tough as iron!"
),
KQ_HEAD_DROP(
Items.KQ_HEAD_7981,
Items.KQ_HEAD_7988,
50000,
"That must be the biggest kalphite I've ever seen! Preserving insects is always tricky. I'll have to be careful..."
),
BIG_BASS_DROP(
Items.BIG_BASS_7989,
Items.BIG_BASS_7990,
1000,
"That's a mighty fine sea bass you've caught there."
),
BIG_SWORDFISH_DROP(
Items.BIG_SWORDFISH_7991,
Items.BIG_SWORDFISH_7992,
2500,
"Don't point that thing at me!"
),
BIG_SHARK_DROP(
Items.BIG_SHARK_7993,
Items.BIG_SHARK_7994,
5000,
"That's quite a fearsome shark! You've done everyone a service by removing it from the sea!"
);
companion object {
val stuffedItemMap = HashMap<Int, StuffedItem>()
init {
for (stuffedItem in entries) {
stuffedItemMap[stuffedItem.dropId] = stuffedItem
}
}
}
}
► Show Spoiler
Code: Select all
import content.data.config.NPCs
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.npc.NPC
class StuffedItemListener : InteractionListener {
private val headIds = StuffedItem.entries.map { it.dropId }.toIntArray()
override fun defineListeners() {
onUseWith(IntType.NPC, headIds, NPCs.TAXIDERMIST_4246) { player, used, _ ->
val stuffed = StuffedItem.stuffedItemMap[used.id] ?: return@onUseWith true
face(findNPC(NPCs.TAXIDERMIST_4246)!!, player, 3)
if (amountInInventory(player, stuffed.dropId) == 1) {
openDialogue(player, object : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.TAXIDERMIST_4246)
when (stage) {
0 -> npc(*splitLines(stuffed.message)).also { stage++ }
1 -> npc("I can preserve that for you for ${stuffed.price} coins.").also { stage++ }
2 -> options("Yes please.", "No thanks.").also { stage++ }
3 -> when (buttonID) {
1 -> {
end()
if (!removeItem(player, Item(Items.COINS_995, stuffed.price), Container.INVENTORY)) {
sendDialogue(player, "You don't have enough coins in order to do that.")
} else {
if (removeItem(player, Item(stuffed.dropId, 1), Container.INVENTORY)){
addItem(player, stuffed.stuffedId, 1, Container.INVENTORY)
npc("There you go!")
}
}
}
2 -> {
end()
npc("All right, come back if you change your mind, eh?")
}
}
}
}
})
}
return@onUseWith true
}
}
}
► Show Spoiler
Code: Select all
{
"id": "7975",
"name": "Crawling hand",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7976",
"name": "Cockatrice head",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7977",
"name": "Basilisk head",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7978",
"name": "Kurask head",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7979",
"name": "Abyssal head",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7980",
"name": "Kbd heads",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7981",
"name": "Kq head",
"examine": "I should get it stuffed!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7982",
"name": "Crawling hand (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7983",
"name": "Cockatrice head (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7984",
"name": "Basilisk head (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7985",
"name": "Kurask head (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7986",
"name": "Abyssal head (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7987",
"name": "Kbd heads (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7988",
"name": "Kq head (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "7989",
"name": "Big bass",
"examine": "Whopper! I should get this stuffed!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "6"
},
{
"id": "7990",
"name": "Big bass (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "6"
},
{
"id": "7991",
"name": "Big swordfish",
"examine": "Whopper! I should get this stuffed!",
"archery_ticket_price": "0",
"tradeable": "false",
"durability": null
},
{
"id": "7992",
"name": "Big swordfish (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false"
},
{
"id": "7993",
"name": "Big shark",
"examine": "Its a monster! I should get this stuffed!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "0.7"
},
{
"id": "7994",
"name": "Big shark (stuffed)",
"examine": "I could mount this on my wall!",
"archery_ticket_price": "0",
"durability": null,
"tradeable": "false",
"weight": "0.7"
},
{
"id": "8260",
"name": "Crawling hand (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"durability": null,
"attack_speed": "4"
},
{
"id": "8261",
"name": "Cockatrice head (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "8262",
"name": "Basilisk head (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "8263",
"name": "Kurask head (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "8264",
"name": "Abyssal head (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "8265",
"name": "Kbd heads (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"destroy": "true",
"durability": null,
"tradeable": "false",
"weight": "10"
},
{
"id": "8266",
"name": "Kq head (Mounted)",
"examine": "A trophy of a mighty slayer!",
"archery_ticket_price": "0",
"durability": null
},
{
"id": "8267",
"name": "Mounted bass",
"examine": "A trophy of a master fisher.",
"archery_ticket_price": "0",
"durability": null
},
{
"id": "8268",
"name": "Mounted swordfish",
"examine": "A trophy of a master fisher.",
"archery_ticket_price": "0",
"durability": null
},
{
"id": "8269",
"name": "Mounted shark",
"examine": "A trophy of a master fisher.",
"archery_ticket_price": "0",
"durability": null
},