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:
@@ -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 -> when(buttonID) {
|
||||||
1 -> {
|
1 -> {
|
||||||
when(buttonID) {
|
sendPlayerDialogue(player!!, "Who's a good rock, then? Yes, you are! You're such a good rock. Ooga booga googa.", FacialExpression.FRIENDLY)
|
||||||
1 -> {
|
sendMessage(player!!, "Your rock seems a little happier.")
|
||||||
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
|
stage = END_DIALOGUE
|
||||||
}
|
}
|
||||||
2 -> {
|
2 -> {
|
||||||
player!!.sendMessage("You stroke your pet rock.")
|
|
||||||
// Missing animation
|
|
||||||
player!!.sendMessage("Your rock seems much happier.")
|
|
||||||
end()
|
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 -> {
|
3 -> {
|
||||||
player!!.sendMessage("You try and feed the rock.")
|
|
||||||
player!!.sendMessage("Your rock doesn't seem hungry.")
|
|
||||||
end()
|
end()
|
||||||
|
sendMessage(player!!, "You try and feed the rock.")
|
||||||
|
sendMessage(player!!, "Your rock doesn't seem hungry.")
|
||||||
}
|
}
|
||||||
4 -> {
|
4 -> {
|
||||||
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Want to fetch the stick, rock? Of course you do...")
|
sendPlayerDialogue(player!!, "Want to fetch the stick, rock? Of course you do.", FacialExpression.FRIENDLY)
|
||||||
// Missing animation
|
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
|
stage = END_DIALOGUE
|
||||||
}
|
}
|
||||||
5 -> {
|
5 -> {
|
||||||
playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Be a good rock...")
|
face(player!!, Location.getRandomLocation(getLocation(player), 2, true))
|
||||||
player!!.sendMessage("You wait a few seconds and pick your rock back up and pet it.")
|
sendPlayerDialogue(player!!, "Be a good rock...", FacialExpression.FRIENDLY)
|
||||||
// Missing animation
|
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
|
stage = END_DIALOGUE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user