Rewrote animal magnetism cutscene in the new cutscene system
Fixes bug where the player could not progress
This commit is contained in:
@@ -14,6 +14,10 @@ import core.game.world.map.Location
|
||||
import core.game.world.map.Region
|
||||
import core.game.world.map.RegionManager
|
||||
import core.game.world.map.build.DynamicRegion
|
||||
import core.game.world.map.path.Pathfinder
|
||||
import core.net.packet.PacketRepository
|
||||
import core.net.packet.context.MinimapStateContext
|
||||
import core.net.packet.out.MinimapState
|
||||
import org.rs09.consts.Components
|
||||
import rs09.ServerConstants
|
||||
import rs09.game.Event
|
||||
@@ -94,7 +98,7 @@ abstract class Cutscene(val player: Player) {
|
||||
fun move(entity: Entity, regionX: Int, regionY: Int)
|
||||
{
|
||||
logCutscene("Moving ${entity.username} to LOCAL[$regionX,$regionY].")
|
||||
entity.pulseManager.run(object : MovementPulse(entity, base.transform(regionX,regionY,0)) {
|
||||
entity.pulseManager.run(object : MovementPulse(entity, base.transform(regionX,regionY,0), Pathfinder.SMART) {
|
||||
override fun pulse(): Boolean {
|
||||
return true
|
||||
}
|
||||
@@ -223,6 +227,7 @@ abstract class Cutscene(val player: Player) {
|
||||
region = RegionManager.forId(player.location.regionId)
|
||||
base = RegionManager.forId(player.location.regionId).baseLocation
|
||||
setup()
|
||||
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 2))
|
||||
runStage(player.getCutsceneStage())
|
||||
setAttribute(player, ATTRIBUTE_CUTSCENE, this)
|
||||
setAttribute(player, ATTRIBUTE_CUTSCENE_STAGE, 0)
|
||||
@@ -262,6 +267,7 @@ abstract class Cutscene(val player: Player) {
|
||||
player.unhook(CUTSCENE_DEATH_HOOK)
|
||||
player.logoutListeners.remove("cutscene")
|
||||
RandomEventManager.getInstance(player)!!.enabled = true
|
||||
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 0))
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
package rs09.game.content.quest.members.anma
|
||||
|
||||
import Cutscene
|
||||
import api.*
|
||||
import core.game.content.dialogue.FacialExpression
|
||||
import core.game.node.entity.combat.ImpactHandler
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.Direction
|
||||
import org.rs09.consts.Animations
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
class AnmaCutscene(player: Player) : Cutscene(player) {
|
||||
override fun setup() {
|
||||
setExit(player.location.transform(0,0,0)) //create copy of player's location
|
||||
loadRegion(14391)
|
||||
addNPC(FARMER, 36, 9, Direction.EAST, 0)
|
||||
addNPC(CHICKEN, 44, 10, Direction.WEST, 0)
|
||||
addNPC(ALICE, 43, 5, Direction.WEST)
|
||||
addNPC(COWKILLER, 52, 8, Direction.WEST)
|
||||
addNPC(COW, 37, 8, Direction.WEST)
|
||||
}
|
||||
|
||||
override fun runStage(stage: Int) {
|
||||
when (stage) {
|
||||
0 -> {
|
||||
fadeToBlack()
|
||||
timedUpdate(5)
|
||||
}
|
||||
1 -> {
|
||||
teleport(player, 46, 13)
|
||||
face(player, getNPC(CHICKEN)!!.location)
|
||||
face(getNPC(FARMER)!!, getNPC(CHICKEN)!!)
|
||||
move(getNPC(FARMER)!!, 43, 10)
|
||||
timedUpdate(5)
|
||||
}
|
||||
2 -> {
|
||||
fadeFromBlack()
|
||||
moveCamera(48,16, 500)
|
||||
rotateCamera(44, 0)
|
||||
dialogueUpdate(FARMER, FacialExpression.NEUTRAL, "Here, chicky chicky!")
|
||||
}
|
||||
3 -> {
|
||||
move(getNPC(FARMER)!!, 44, 10)
|
||||
animate(getNPC(FARMER)!!, ATTEMPT_CATCH)
|
||||
move(getNPC(CHICKEN)!!, 45, 9)
|
||||
timedUpdate(2)
|
||||
}
|
||||
4 -> {
|
||||
move(getNPC(FARMER)!!, 53, 8)
|
||||
move(getNPC(CHICKEN)!!, 53, 8)
|
||||
timedUpdate(10)
|
||||
}
|
||||
5 -> {
|
||||
move(getNPC(CHICKEN)!!, 47, 8)
|
||||
timedUpdate(1)
|
||||
}
|
||||
6 -> {
|
||||
move(getNPC(FARMER)!!, 48, 8)
|
||||
timedUpdate(8)
|
||||
}
|
||||
7 -> {
|
||||
move(getNPC(CHICKEN)!!, 45, 10)
|
||||
animate(getNPC(FARMER)!!, ATTEMPT_CATCH)
|
||||
timedUpdate(1)
|
||||
}
|
||||
8 -> {
|
||||
move(getNPC(FARMER)!!, 45, 10)
|
||||
move(getNPC(CHICKEN)!!, 38, 10)
|
||||
animate(getNPC(CHICKEN)!!, CHICKEN_JUMP)
|
||||
timedUpdate(1)
|
||||
}
|
||||
9 -> {
|
||||
move(getNPC(FARMER)!!, 38, 10)
|
||||
timedUpdate(9)
|
||||
}
|
||||
10 -> {
|
||||
face(player, getNPC(FARMER)!!.location)
|
||||
dialogueUpdate(FARMER, FacialExpression.NEUTRAL, "Git 'ere yer pesky bird!")
|
||||
}
|
||||
11 -> {
|
||||
move(getNPC(FARMER)!!, 44, 10)
|
||||
move(getNPC(CHICKEN)!!, 45, 10)
|
||||
timedUpdate(8)
|
||||
}
|
||||
12 -> {
|
||||
animate(getNPC(FARMER)!!, ATTEMPT_CATCH)
|
||||
animate(getNPC(CHICKEN)!!, CHICKEN_JUMP)
|
||||
face(player, getNPC(CHICKEN)!!.location)
|
||||
move(getNPC(CHICKEN)!!, 47, 7)
|
||||
timedUpdate(3)
|
||||
}
|
||||
13 -> {
|
||||
move(getNPC(FARMER)!!, 52, 8)
|
||||
timedUpdate(6)
|
||||
}
|
||||
14 -> {
|
||||
face(getNPC(CHICKEN)!!, getNPC(CHICKEN)!!.location.transform(0, 1, 0))
|
||||
timedUpdate(6)
|
||||
}
|
||||
15 -> {
|
||||
move(getNPC(CHICKEN)!!, 47, 11)
|
||||
face(getNPC(COW)!!, getNPC(COW)!!.location.transform(Direction.EAST))
|
||||
timedUpdate(8)
|
||||
}
|
||||
16 -> {
|
||||
face(getNPC(CHICKEN)!!, getNPC(FARMER)!!.location)
|
||||
teleport(getNPC(COW)!!, 41, 10)
|
||||
dialogueUpdate(FARMER, FacialExpression.NEUTRAL, "Where'd she go?")
|
||||
}
|
||||
17 -> {
|
||||
setAttribute(getNPC(COWKILLER)!!, "1hko", true)
|
||||
move(getNPC(COWKILLER)!!, 46, 9)
|
||||
move(getNPC(COW)!!, 46, 10)
|
||||
move(getNPC(FARMER)!!, 44, 10)
|
||||
move(getNPC(ALICE)!!, 48, 8)
|
||||
timedUpdate(11)
|
||||
}
|
||||
18 -> {
|
||||
face(getNPC(FARMER)!!, player.location)
|
||||
face(player, getNPC(FARMER)!!.location)
|
||||
move(getNPC(CHICKEN)!!, 45, 9)
|
||||
dialogueUpdate(FARMER, FacialExpression.ANNOYED, "Git oof my laaaaaand!")
|
||||
}
|
||||
19 -> {
|
||||
face(getNPC(FARMER)!!, getNPC(ALICE)!!.location)
|
||||
face(getNPC(ALICE)!!, getNPC(COWKILLER)!!.location)
|
||||
dialogueUpdate(ALICE, FacialExpression.ANNOYED, "You heard my husband: leave now!")
|
||||
}
|
||||
20 -> {
|
||||
face(getNPC(ALICE)!!, getNPC(COWKILLER)!!.location)
|
||||
face(getNPC(COWKILLER)!!, getNPC(ALICE)!!.location)
|
||||
dialogueUpdate(COWKILLER, FacialExpression.HALF_THINKING, "Always the same, I can never get these animals to myself.")
|
||||
}
|
||||
21 -> {
|
||||
face(getNPC(COWKILLER)!!, getNPC(COW)!!.location)
|
||||
animate(getNPC(COWKILLER)!!, ATTACK_ANIM)
|
||||
impact(getNPC(COW)!!, 8, ImpactHandler.HitsplatType.NORMAL)
|
||||
timedUpdate(3)
|
||||
}
|
||||
22 -> {
|
||||
dialogueUpdate(ALICE, FacialExpression.SAD, "You killed Bessie!")
|
||||
}
|
||||
23 -> {
|
||||
dialogueUpdate(COWKILLER, FacialExpression.FRIENDLY, "Buying cowhides and feathers - ahh, that chicken is next, feathers for me!")
|
||||
}
|
||||
24 -> {
|
||||
move(getNPC(COWKILLER)!!, 46, 10)
|
||||
timedUpdate(3)
|
||||
}
|
||||
25 -> {
|
||||
animate(getNPC(COWKILLER)!!, Animations.HUMAN_BURYING_BONES_827)
|
||||
timedUpdate(1)
|
||||
}
|
||||
26 -> {
|
||||
face(getNPC(COWKILLER)!!, getNPC(COWKILLER)!!.location.transform(-1,0,0))
|
||||
timedUpdate(2)
|
||||
}
|
||||
27 -> {
|
||||
face(getNPC(CHICKEN)!!, getNPC(CHICKEN)!!.location.transform(0,1,0))
|
||||
sendChat(getNPC(CHICKEN)!!, "Woo woo!")
|
||||
timedUpdate(2)
|
||||
}
|
||||
28 -> {
|
||||
move(getNPC(CHICKEN)!!, 45, 10)
|
||||
timedUpdate(2)
|
||||
}
|
||||
29 -> {
|
||||
animate(getNPC(COWKILLER)!!, ATTACK_ANIM)
|
||||
animate(getNPC(CHICKEN)!!, CHICKEN_JUMP)
|
||||
impact(getNPC(CHICKEN)!!, 0, ImpactHandler.HitsplatType.MISS)
|
||||
timedUpdate(2)
|
||||
}
|
||||
30 -> {
|
||||
face(getNPC(CHICKEN)!!, getNPC(FARMER)!!)
|
||||
face(getNPC(FARMER)!!, getNPC(CHICKEN)!!)
|
||||
visualize(getNPC(FARMER)!!, GRAB_CHICKEN_ANIM, GRAB_CHICKEN_GFX)
|
||||
timedUpdate(6)
|
||||
}
|
||||
31 -> {
|
||||
getNPC(CHICKEN)!!.clear()
|
||||
playerDialogueUpdate(FacialExpression.FRIENDLY, "Well, that's one way to catch a chicken, I suppose.")
|
||||
}
|
||||
32 -> {
|
||||
end {
|
||||
setQuestStage(player, "Animal Magnetism", 20)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val FARMER = NPCs.ALICES_HUSBAND_5205
|
||||
val ALICE = NPCs.ALICE_5212
|
||||
val CHICKEN = NPCs.UNDEAD_CHICKEN_1692
|
||||
val COWKILLER = NPCs.COW1337KILLR_5210
|
||||
val COW = NPCs.UNDEAD_COW_5211
|
||||
val ATTEMPT_CATCH = 5377
|
||||
val ATTACK_ANIM = 2066
|
||||
val GRAB_CHICKEN_ANIM = 5376
|
||||
val GRAB_CHICKEN_GFX = 973
|
||||
val CHICKEN_JUMP = 5380
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,11 @@ import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.rs09.consts.Components
|
||||
import rs09.ServerConstants
|
||||
import rs09.game.camerautils.PlayerCamera
|
||||
import rs09.game.content.activity.fishingtrawler.TrawlerLoot
|
||||
import rs09.game.content.ame.RandomEventManager
|
||||
import rs09.game.content.ame.RandomEvents
|
||||
import rs09.game.content.quest.members.anma.AnmaCutscene
|
||||
import rs09.game.ge.GrandExchange
|
||||
import rs09.game.node.entity.state.newsys.states.FarmingState
|
||||
import rs09.game.system.SystemLogger
|
||||
@@ -62,6 +64,48 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
|
||||
}
|
||||
}
|
||||
|
||||
define("movcam", Privilege.ADMIN) {player, args ->
|
||||
val regionX = args[1].toIntOrNull() ?: return@define
|
||||
val regionY = args[2].toIntOrNull() ?: return@define
|
||||
var height = 300
|
||||
var speed = 100
|
||||
|
||||
if (args.size > 3)
|
||||
height = args[3].toIntOrNull() ?: return@define
|
||||
|
||||
if (args.size > 4)
|
||||
speed = args[4].toIntOrNull() ?: return@define
|
||||
|
||||
val region = RegionManager.forId(player.location.regionId)
|
||||
val base = region.baseLocation
|
||||
|
||||
val globalLoc = base.transform(regionX, regionY, 0)
|
||||
PlayerCamera(player).panTo(globalLoc.x, globalLoc.y, height, speed)
|
||||
}
|
||||
|
||||
define("rotcam", Privilege.ADMIN) {player, args ->
|
||||
val regionX = args[1].toIntOrNull() ?: return@define
|
||||
val regionY = args[2].toIntOrNull() ?: return@define
|
||||
var height = 300
|
||||
var speed = 100
|
||||
|
||||
if (args.size > 3)
|
||||
height = args[3].toIntOrNull() ?: return@define
|
||||
|
||||
if (args.size > 4)
|
||||
speed = args[4].toIntOrNull() ?: return@define
|
||||
|
||||
val region = RegionManager.forId(player.location.regionId)
|
||||
val base = region.baseLocation
|
||||
|
||||
val globalLoc = base.transform(regionX, regionY, 0)
|
||||
PlayerCamera(player).rotateTo(globalLoc.x, globalLoc.y, height, speed)
|
||||
}
|
||||
|
||||
define("anmacs", Privilege.ADMIN) { player, _ ->
|
||||
AnmaCutscene(player).start()
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints player's current location
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user