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,
"name": "Burnt curry",
"tradeable": "true",
"archery_ticket_price":"0",
"id":"2013"
"archery_ticket_price": "0",
"id": "2013"
},
{
"durability": null,
@@ -34994,7 +34994,9 @@
"examine": "The lowest maintenance pet you will ever have.",
"walk_anim": "6658",
"durability": null,
"weight": "1",
"turn90ccw_anim": "6663",
"two_handed": "true",
"turn180_anim": "6659",
"render_anim": "792",
"equipment_slot": "3",
@@ -1,56 +1,66 @@
package content.global.handlers.item
import core.api.openDialogue
import org.rs09.consts.Items
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.interaction.InteractionListener
import core.game.dialogue.FacialExpression
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 org.rs09.consts.Items
class PetRockPlugin : InteractionListener {
class PetRockListener : InteractionListener {
override fun defineListeners() {
on(Items.PET_ROCK_3695, IntType.ITEM, "interact"){ player, _ ->
openDialogue(player, PetRockDialogue())
return@on true
}
}
}
class PetRockDialogue() : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when(stage) {
0 -> options("Talk", "Stroke", "Feed", "Fetch", "Stay").also { stage++ }
1 -> {
when(buttonID) {
1 -> {
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Who's a good rock then? Yes you are... You're such a good rock... ooga booga googa.")
player!!.sendMessage("Your rock seems a little happier.")
stage = END_DIALOGUE
}
2 -> {
player!!.sendMessage("You stroke your pet rock.")
// Missing animation
player!!.sendMessage("Your rock seems much happier.")
end()
}
3 -> {
player!!.sendMessage("You try and feed the rock.")
player!!.sendMessage("Your rock doesn't seem hungry.")
end()
}
4 -> {
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Want to fetch the stick, rock? Of course you do...")
// Missing animation
stage = END_DIALOGUE
}
5 -> {
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Be a good rock...")
player!!.sendMessage("You wait a few seconds and pick your rock back up and pet it.")
// Missing animation
stage = END_DIALOGUE
}
}
}
on(Items.PET_ROCK_3695, IntType.ITEM, "interact") { player, _ ->
openDialogue(player, PetRockDialogue())
return@on true
}
}
}
class PetRockDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when(stage) {
0 -> options("Talk", "Stroke", "Feed", "Fetch", "Stay").also { stage++ }
1 -> when(buttonID) {
1 -> {
sendPlayerDialogue(player!!, "Who's a good rock, then? Yes, you are! You're such a good rock. Ooga booga googa.", FacialExpression.FRIENDLY)
sendMessage(player!!, "Your rock seems a little happier.")
stage = END_DIALOGUE
}
2 -> {
end()
sendMessage(player!!, "You stroke your pet rock.")
animate(player!!, 1333, false)
//waits for the animation to finish before sending the message
queueScript(player!!, animationDuration(Animation(1333)), QueueStrength.SOFT) {
sendMessage(player!!, "Your rock seems much happier.")
return@queueScript stopExecuting(player!!)
}
}
3 -> {
end()
sendMessage(player!!, "You try and feed the rock.")
sendMessage(player!!, "Your rock doesn't seem hungry.")
}
4 -> {
sendPlayerDialogue(player!!, "Want to fetch the stick, rock? Of course you do.", FacialExpression.FRIENDLY)
face(player!!, Location.getRandomLocation(getLocation(player), 2, true))
visualize(player!!, 6665, 1157)
spawnProjectile(getLocation(player), Location.getRandomLocation(getLocation(player), 5, true), 1158, 40, 0,150, 250, 25)
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
}
}
}
}
}