Crafting guild sink can now be used

This commit is contained in:
Roderik 2024-08-10 11:27:23 +00:00 committed by Ryan
parent 209e1ae8cf
commit 24143f5d20

View file

@ -7,6 +7,7 @@ import core.game.world.update.flag.context.Animation
import org.rs09.consts.Items import org.rs09.consts.Items
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.world.map.Location
import org.rs09.consts.Sounds import org.rs09.consts.Sounds
/** /**
@ -14,8 +15,10 @@ import org.rs09.consts.Sounds
* @author Ceikry * @author Ceikry
*/ */
class WaterSourceListener : InteractionListener { class WaterSourceListener : InteractionListener {
// NOTE '9695' should be removed from the array below once the sink object can be used directly, this is a temporary
// solution.
// this is ugly! // this is ugly!
private val waterSources = intArrayOf(21355, 16302, 6827, 11661, 24160, 34577, 15936, 15937, 15938, 23920, 35469, 24265, 153, 879, 880, 2864, 6232, 10436, 10437, 10827, 11007, 11759, 21764, 22973, 24161, 24214, 24265, 28662, 30223, 30820, 34579, 36781, 873, 874, 4063, 6151, 8699, 9143, 9684, 10175, 12279, 12974, 13563, 13564, 14868, 14917, 14918, 15678, 16704, 16705, 20358, 22715, 24112, 24314, 25729, 25929, 26966, 29105, 33458, 34082, 34411, 34496, 34547, 34566, 35762, 36971, 37154, 37155, 878, 884, 3264, 3305, 3359, 4004, 4005, 6097, 6249, 6549, 8747, 8927, 11793, 12201, 12897, 24166, 26945, 31359, 32023, 32024, 34576, 35671, 40063, 13561, 13563, 13559, 12089) private val waterSources = intArrayOf(21355, 16302, 6827, 11661, 24160, 34577, 15936, 15937, 15938, 23920, 35469, 24265, 153, 879, 880, 2864, 6232, 10436, 10437, 10827, 11007, 11759, 21764, 22973, 24161, 24214, 24265, 28662, 30223, 30820, 34579, 36781, 873, 874, 4063, 6151, 8699, 9143, 9684, 9695, 10175, 12279, 12974, 13563, 13564, 14868, 14917, 14918, 15678, 16704, 16705, 20358, 22715, 24112, 24314, 25729, 25929, 26966, 29105, 33458, 34082, 34411, 34496, 34547, 34566, 35762, 36971, 37154, 37155, 878, 884, 3264, 3305, 3359, 4004, 4005, 6097, 6249, 6549, 8747, 8927, 11793, 12201, 12897, 24166, 26945, 31359, 32023, 32024, 34576, 35671, 40063, 13561, 13563, 13559, 12089)
private val nonWellableMsg = "If I drop my @ down there, I don't think I'm likely to get it back." private val nonWellableMsg = "If I drop my @ down there, I don't think I'm likely to get it back."
private val animation = Animation(832) private val animation = Animation(832)
@ -31,6 +34,11 @@ class WaterSourceListener : InteractionListener {
return@onUseWith true return@onUseWith true
} }
if(with.id == 9695 && player.location.regionId != 11571)
{
return@onUseWith false
}
//ugly achievement code, achievement system sux //ugly achievement code, achievement system sux
if(vessel == WaterVessel.BUCKET && with.id == 11661) if(vessel == WaterVessel.BUCKET && with.id == 11661)
{ {
@ -59,6 +67,15 @@ class WaterSourceListener : InteractionListener {
return@onUseWith true return@onUseWith true
} }
// This is needed to make the crafting guild sink work, but technically it's wrong as it is the noticeboard and
// not the sink being used. This is a temporary solution until the sink object can be used directly.
setDest(IntType.SCENERY, intArrayOf(9695), "use") { player, node ->
if (player.location.regionId == 11571){
return@setDest Location.create(2934, 3280, 0)
}
return@setDest node.location
}
} }
private fun formatMsgText(name: String, template: String): String private fun formatMsgText(name: String, template: String): String