mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
implemented seaweed nets at fishing colony, but also locked it behind the appropriate quest (which isn't implemented yet, so no real change for players yet)
fixed NPE in quest getStage code when getting stage of quests that haven't been implemented yet
This commit is contained in:
parent
90060fde21
commit
d5bb44230c
2 changed files with 56 additions and 1 deletions
|
|
@ -232,7 +232,11 @@ public final class QuestRepository {
|
|||
* @return The stage.
|
||||
*/
|
||||
public int getStage(String name) {
|
||||
return getStage(QUESTS.get(name));
|
||||
var quest = QUESTS.get(name);
|
||||
if (quest == null) {
|
||||
return 0;
|
||||
}
|
||||
return getStage(quest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package rs09.game.interaction.`object`
|
||||
|
||||
import api.*
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.node.item.Item
|
||||
import core.game.node.scenery.Scenery
|
||||
import core.game.node.scenery.SceneryBuilder
|
||||
import core.game.system.task.Pulse
|
||||
import org.rs09.consts.Animations
|
||||
import org.rs09.consts.Items
|
||||
import rs09.game.interaction.InteractionListener
|
||||
|
||||
class SeaweedNetHandler : InteractionListener {
|
||||
|
||||
override fun defineListeners() {
|
||||
on(NET, SCENERY, "Take-from"){ player, node ->
|
||||
if (!isQuestComplete(player, "Swan Song"))
|
||||
{
|
||||
sendMessage(player, "You must complete Swan Song first.")
|
||||
}
|
||||
else if (!hasSpaceFor(player, Item(Items.SEAWEED_401, 1))) {
|
||||
sendMessage(player, "You do not have space in your inventory.")
|
||||
}
|
||||
else {
|
||||
submitIndividualPulse(player, object : Pulse() {
|
||||
private var tick = 0
|
||||
override fun pulse(): Boolean {
|
||||
when(tick++){
|
||||
0 -> {
|
||||
animate(player, Animations.HUMAN_BURYING_BONES_827) // no idea what animation is supposed to be used, can't even find a video of this content
|
||||
}
|
||||
1 -> {
|
||||
if (addItem(player, Items.SEAWEED_401)) {
|
||||
SceneryBuilder.replace(node.asScenery(), Scenery(EMPTY_NET, node.location, node.asScenery().rotation),5) // osrs wiki says 3 second respawn timer
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val NET = 14973
|
||||
private const val EMPTY_NET = 14972
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue