Pet rock animations & fixes

Made the Pet rock two-handed
Changed Pet rock weight to 1 kg
Edited dialogue for the Talk option to be more authentic
Added animation for the Stroke option & a delay for the second message to wait for the animation to finish
Edited dialogue for the Fetch option to be more authentic, added animations & graphics, and added the projectile with graphics
Added animations & graphics for the Stay option
This commit is contained in:
Bonesy
2023-12-13 12:08:10 +00:00
committed by Ryan
parent 6c28a82ebb
commit 25e9104375
2 changed files with 55 additions and 43 deletions
+4 -2
View File
@@ -20737,8 +20737,8 @@
"durability": null, "durability": null,
"name": "Burnt curry", "name": "Burnt curry",
"tradeable": "true", "tradeable": "true",
"archery_ticket_price":"0", "archery_ticket_price": "0",
"id":"2013" "id": "2013"
}, },
{ {
"durability": null, "durability": null,
@@ -34994,7 +34994,9 @@
"examine": "The lowest maintenance pet you will ever have.", "examine": "The lowest maintenance pet you will ever have.",
"walk_anim": "6658", "walk_anim": "6658",
"durability": null, "durability": null,
"weight": "1",
"turn90ccw_anim": "6663", "turn90ccw_anim": "6663",
"two_handed": "true",
"turn180_anim": "6659", "turn180_anim": "6659",
"render_anim": "792", "render_anim": "792",
"equipment_slot": "3", "equipment_slot": "3",
@@ -1,56 +1,66 @@
package content.global.handlers.item package content.global.handlers.item
import core.api.openDialogue import core.api.*
import org.rs09.consts.Items
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.interaction.InteractionListener import core.game.dialogue.FacialExpression
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.interaction.QueueStrength
import core.game.node.entity.impl.Projectile.getLocation
import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
import org.rs09.consts.Items
class PetRockPlugin : InteractionListener { class PetRockListener : InteractionListener {
override fun defineListeners() { override fun defineListeners() {
on(Items.PET_ROCK_3695, IntType.ITEM, "interact"){ player, _ -> on(Items.PET_ROCK_3695, IntType.ITEM, "interact") { player, _ ->
openDialogue(player, PetRockDialogue()) openDialogue(player, PetRockDialogue())
return@on true return@on true
} }
} }
} }
class PetRockDialogue() : DialogueFile() { class PetRockDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when(stage) { when(stage) {
0 -> options("Talk", "Stroke", "Feed", "Fetch", "Stay").also { stage++ } 0 -> options("Talk", "Stroke", "Feed", "Fetch", "Stay").also { stage++ }
1 -> { 1 -> when(buttonID) {
when(buttonID) { 1 -> {
1 -> { sendPlayerDialogue(player!!, "Who's a good rock, then? Yes, you are! You're such a good rock. Ooga booga googa.", FacialExpression.FRIENDLY)
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Who's a good rock then? Yes you are... You're such a good rock... ooga booga googa.") sendMessage(player!!, "Your rock seems a little happier.")
player!!.sendMessage("Your rock seems a little happier.") stage = END_DIALOGUE
stage = END_DIALOGUE }
} 2 -> {
2 -> { end()
player!!.sendMessage("You stroke your pet rock.") sendMessage(player!!, "You stroke your pet rock.")
// Missing animation animate(player!!, 1333, false)
player!!.sendMessage("Your rock seems much happier.") //waits for the animation to finish before sending the message
end() queueScript(player!!, animationDuration(Animation(1333)), QueueStrength.SOFT) {
} sendMessage(player!!, "Your rock seems much happier.")
3 -> { return@queueScript stopExecuting(player!!)
player!!.sendMessage("You try and feed the rock.") }
player!!.sendMessage("Your rock doesn't seem hungry.") }
end() 3 -> {
} end()
4 -> { sendMessage(player!!, "You try and feed the rock.")
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Want to fetch the stick, rock? Of course you do...") sendMessage(player!!, "Your rock doesn't seem hungry.")
// Missing animation }
stage = END_DIALOGUE 4 -> {
} sendPlayerDialogue(player!!, "Want to fetch the stick, rock? Of course you do.", FacialExpression.FRIENDLY)
5 -> { face(player!!, Location.getRandomLocation(getLocation(player), 2, true))
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Be a good rock...") visualize(player!!, 6665, 1157)
player!!.sendMessage("You wait a few seconds and pick your rock back up and pet it.") spawnProjectile(getLocation(player), Location.getRandomLocation(getLocation(player), 5, true), 1158, 40, 0,150, 250, 25)
// Missing animation stage = END_DIALOGUE
stage = END_DIALOGUE }
} 5 -> {
} face(player!!, Location.getRandomLocation(getLocation(player), 2, true))
} sendPlayerDialogue(player!!, "Be a good rock...", FacialExpression.FRIENDLY)
sendMessage(player!!, "You wait a few seconds and pick your rock back up and pet it.")
visualize(player!!, anim = 6664, gfx = 1156)
stage = END_DIALOGUE
}
}
} }
} }
} }