mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-22 10:55:13 -06:00
fixes from testing.
This commit is contained in:
parent
e1fef2c54f
commit
b4babec54f
1 changed files with 32 additions and 10 deletions
|
|
@ -522,6 +522,14 @@ class EW2Listeners : InteractionListener {
|
|||
|
||||
// take item from the jig cart
|
||||
on(jigCartStates, IntType.NPC, "take-from") { player, node ->
|
||||
val cartPos = getVarbit(player, EW2CartLeverVarbit) // cart moving lever. 0 = start (south), 1 = west, 2 = north, 3 = east
|
||||
|
||||
// don't allow interact if cart is not at south station
|
||||
if (cartPos != 0) {
|
||||
sendMessage(player, "I can't reach that.")
|
||||
return@on true
|
||||
}
|
||||
|
||||
when(node.id) {
|
||||
4914 -> {
|
||||
addItemOrDrop(player, Items.ELEMENTAL_METAL_2893)
|
||||
|
|
@ -556,6 +564,13 @@ class EW2Listeners : InteractionListener {
|
|||
// put bar on the jig cart
|
||||
onUseWith(IntType.NPC, intArrayOf(Items.ELEMENTAL_METAL_2893), NPCs.JIG_CART_4913) { player, used, _ ->
|
||||
val cranePos = getVarbit(player, EW2CranePosVarbit)
|
||||
val cartPos = getVarbit(player, EW2CartLeverVarbit) // cart moving lever. 0 = start (south), 1 = west, 2 = north, 3 = east
|
||||
|
||||
// don't allow interact if cart is not at south station
|
||||
if (cartPos != 0) {
|
||||
sendMessage(player, "I can't reach that.")
|
||||
return@onUseWith true
|
||||
}
|
||||
|
||||
// if crane is south down, it's blocking the cart.
|
||||
if (cranePos == 2) {
|
||||
|
|
@ -613,16 +628,17 @@ class EW2Listeners : InteractionListener {
|
|||
val nextPos = currentPos xor 1
|
||||
val craneMat = getVarbit(player, EW2CraneStateVarbit) // Crane State. 0 = broken, 1 = fixed/empty, 2 = ele bar, 3 = hot bar.
|
||||
val cartState = getVarbit(player, EW2JigCartVarbit) // Jig Cart state. 0 = Empty, 1 = ele bar, 2 = hot bar, 3 = smashed hot, 4 = smashed cooled, 5 = primed
|
||||
val cartPos = getVarbit(player, EW2CartLeverVarbit) // cart moving lever. 0 = start (south), 1 = west, 2 = north, 3 = east
|
||||
|
||||
// facing north: pick up and drop off bar
|
||||
// facing north: pick up and drop off bar. don't interact with the cart if the cart isn't here.
|
||||
if (currentPos == 3 && nextPos == 2) {
|
||||
if (craneMat == 1 && (cartState == 1 || cartState == 2)) {
|
||||
if (craneMat == 1 && (cartState == 1 || cartState == 2) && cartPos == 0) {
|
||||
// pick up
|
||||
setVarbit(player, EW2CraneStateVarbit, cartState + 1)
|
||||
setVarbit(player, EW2JigCartVarbit, 0)
|
||||
sendMessage(player, "The crane claw picks up the bar from the cart.")
|
||||
syncCart(player)
|
||||
} else if ((craneMat == 2 || craneMat == 3) && cartState == 0) {
|
||||
} else if ((craneMat == 2 || craneMat == 3) && cartState == 0 && cartPos == 0) {
|
||||
// drop off
|
||||
setVarbit(player, EW2JigCartVarbit, craneMat - 1)
|
||||
setVarbit(player, EW2CraneStateVarbit, 1)
|
||||
|
|
@ -855,7 +871,7 @@ class EW2Listeners : InteractionListener {
|
|||
return@on true
|
||||
}
|
||||
|
||||
// west water valve operates the water inflow
|
||||
// west water valve operates the water inflow. requires pipe to be fixed.
|
||||
on(Scenery.WATER_VALVE_18646, IntType.SCENERY, "turn") { player, _ ->
|
||||
|
||||
val valveState = getVarbit(player, EW2ValveWestVarbit) // water valve west. 0 = closed, 1 = open
|
||||
|
|
@ -866,6 +882,11 @@ class EW2Listeners : InteractionListener {
|
|||
return@on true
|
||||
}
|
||||
|
||||
if(getVarbit(player, EW2PipeVarbit) == 0) {
|
||||
sendMessage(player, "You turn the valve but nothing happens, maybe the pipe needs to be repaired first.")
|
||||
return@on true
|
||||
}
|
||||
|
||||
player.locks.lockInteractions(4)
|
||||
animate(player, 4861)
|
||||
|
||||
|
|
@ -1099,7 +1120,10 @@ class EW2Listeners : InteractionListener {
|
|||
val cartpos = getVarbit(player, EW2CartLeverVarbit) // needs to be 3 to be at this station
|
||||
val cartstate = getVarbit(player, EW2JigCartVarbit) // needs to be state 4: smashed cooled
|
||||
|
||||
// check if the cogs are right. pin 1 (2655) should have the small cog. pin 2 (2656) should have the med cog. pin 3 (2656) should have the large cog.
|
||||
// check if the cogs are right.
|
||||
// pin 1 (2655) should have the small cog.
|
||||
// pin 2 (2656) should have the med cog.
|
||||
// pin 3 (2656) should have the large cog.
|
||||
if (allCogs == 57) {
|
||||
if(lever == 0) {
|
||||
// turn on
|
||||
|
|
@ -1116,14 +1140,12 @@ class EW2Listeners : InteractionListener {
|
|||
setAttribute(player, attrWinded, true)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// turn off
|
||||
} else { // lever == 1, turn off
|
||||
sendDialogue(player, "The machine grinds to a standstill.")
|
||||
setVarbit(player, EW2FanStateVarbit, 0, true)
|
||||
setVarbit(player, EW2FanLeverVarbit, 0, true)
|
||||
syncFan(player)
|
||||
}
|
||||
// cogs are not correct
|
||||
} else {
|
||||
} else { // allCogs != 57, cogs are not correct
|
||||
sendDialogue(player, "The machine starts up, but the fan does not blow.")
|
||||
playAudio(player, Sounds.EW2_MACHINE_RUMBLE_3175)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue