Implemented many medium and hard Fremennik diary tasks

Added catch messages for pitfall trap
Added Fremmenik milk bucket spawn
Implemented sea boots effect when recharging lyre
This commit is contained in:
szumaster
2023-04-23 08:26:59 +00:00
committed by Ryan
parent 99425f0991
commit 24ff23b148
5 changed files with 191 additions and 12 deletions
+4
View File
@@ -387,6 +387,10 @@
"item_id": "1925",
"loc_data": "{1,2428,3079,0,6553680}-{1,2428,3080,0,6553680}-{1,2371,3128,0,6553680}-{1,2371,3127,0,6553680}-{1,3225,3294,0,6553680}-{1,3121,3359,0,6553660}-{1,3216,9625,0,6553680}-{1,3026,3289,0,6553680}-{1,2958,3510,0,6553680}-{1,3221,3497,1,6553680}-{1,2958,3510,0,6553680}-{1,3222,3491,1,6553680}-{1,3307,3195,0,5898270}-{1,1941,4956,0,5898270}"
},
{
"item_id": "1927",
"loc_data": "{1,2685,3683,0,1966}"
},
{
"item_id": "1929",
"loc_data": "{1,2820,3452,0,7209050}-{1,2823,3449,0,7209050}"
+8 -8
View File
@@ -34907,7 +34907,7 @@
"equipment_slot": "3"
},
{
"examine": "This will teleport me to Rellekka when I play it. A musical intrument that I can magically play.",
"examine": "A musical intrument that I can magically play.",
"durability": null,
"name": "Lyre",
"weight": "1.8",
@@ -34916,7 +34916,7 @@
"equipment_slot": "3"
},
{
"examine": "This will teleport me to Rellekka when I play it. A musical intrument that I can magically play.",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre",
"weight": "1.8",
@@ -34925,7 +34925,7 @@
"equipment_slot": "3"
},
{
"examine": "This will teleport me to Rellekka when I play it. A musical intrument that I can magically play.",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre(1)",
"weight": "1.8",
@@ -55500,7 +55500,7 @@
"id": "6124"
},
{
"examine": "This will teleport me to Rellekka when I play it. A musical intrument that I can magically play.",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre(2)",
"weight": "1.8",
@@ -55509,7 +55509,7 @@
"equipment_slot": "3"
},
{
"examine": "This will teleport me to Rellekka when I play it. A musical intrument that I can magically play.",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre(3)",
"weight": "1.8",
@@ -55518,7 +55518,7 @@
"equipment_slot": "3"
},
{
"examine": "This will teleport me to Rellekka when I play it. A musical intrument that I can magically play.",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre(4)",
"weight": "1.8",
@@ -129985,7 +129985,7 @@
{
"destroy_message": "Drop",
"shop_price": "1000",
"examine": "This will teleport me to Rellekka when I play it. ",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre(5)",
"destroy": "true",
@@ -129999,7 +129999,7 @@
{
"destroy_message": "Drop",
"shop_price": "1000",
"examine": "This will teleport me to Rellekka when I play it. ",
"examine": "This will teleport me to Rellekka when I play it.",
"durability": null,
"name": "Enchanted lyre(6)",
"destroy": "true",
@@ -249,14 +249,17 @@ class PitfallListeners : InteractionListener {
}
on(LARUPIA_PIT, IntType.SCENERY, "dismantle") { player, node ->
lootCorpse(player, node as Scenery, 180.0, Items.LARUPIA_FUR_10095, Items.TATTY_LARUPIA_FUR_10093)
sendMessage(player, "You've caught a spined larupia!")
return@on true
}
on(GRAAHK_PIT, IntType.SCENERY, "dismantle") { player, node ->
lootCorpse(player, node as Scenery, 240.0, Items.GRAAHK_FUR_10099, Items.TATTY_GRAAHK_FUR_10097)
sendMessage(player, "You've caught a horned graahk!")
return@on true
}
on(KYATT_PIT, IntType.SCENERY, "dismantle") { player, node ->
lootCorpse(player, node as Scenery, 300.0, Items.KYATT_FUR_10103, Items.TATTY_KYATT_FUR_10101)
sendMessage(player, "You've caught a sabretoothed kyatt!")
return@on true
}
on(BEAST_IDS, IntType.NPC, "tease") { player, node ->
@@ -9,10 +9,18 @@ import org.rs09.consts.Scenery
import content.minigame.barbassault.CaptainCainDialogue
import content.region.fremennik.rellekka.dialogue.HuntingExpertRellekkaDialogue
import content.global.handlers.iface.FairyRing
import content.global.skill.cooking.dairy.DairyChurnDialogue
import content.region.fremennik.jatizso.dialogue.TowerGuardDialogue
import content.region.fremennik.rellekka.quest.thefremenniktrials.ChieftanBrundt
import core.api.inBorders
import core.api.inEquipment
import core.game.diary.AreaDiaryTask
import core.game.diary.DiaryEventHookBase
import core.game.diary.DiaryLevel
import core.game.event.*
import core.game.node.entity.player.link.SpellBookManager
import core.game.node.entity.skill.Skills
import org.rs09.consts.Components
class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
companion object {
@@ -20,8 +28,13 @@ class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
private const val ATTRIBUTE_ROCK_CRAB_KILLCOUNT = "diary:fremennik:rock-crabs-killed"
private const val ATTRIBUTE_BARBARIAN_FISHING_TRAINING = "barbtraining:fishing"
private const val ATTRIBUTE_BARBARIAN_HUNTING_TRAINING = "barbtraining:hunting"
private const val ATTRIBUTE_DAGANNOTHS_KILLCOUNT = "diary:fremennik:dagannoths-killed"
private val WINDSWEPT_TREE_AREA = ZoneBorders(2743, 3718, 2750, 3737)
private val YRSA_SHOP_BORDERS = ZoneBorders(2622, 3672, 2626, 3676)
private val RELLEKKA_HUNTING_AREA = ZoneBorders(2723, 3776, 2743, 3796)
private val ECTERNIA_TREE_AREA = ZoneBorders(2592, 3887,2620, 3899)
private val RELLEKKA_BLACKSMITH_AREA = ZoneBorders(2616, 3658, 2621, 3668)
private val FISHING_SPOTS = arrayOf(
NPCs.FISHING_SPOT_309, NPCs.FISHING_SPOT_334,
@@ -37,6 +50,17 @@ class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
NPCs.CAVE_CRAWLER_1602, NPCs.CAVE_CRAWLER_1603
)
private val DAGANNOTHS = arrayOf(
NPCs.DAGANNOTH_2455, NPCs.DAGANNOTH_2456,
NPCs.DAGANNOTH_PRIME_2882, NPCs.DAGANNOTH_REX_2883, NPCs.DAGANNOTH_SUPREME_2881
)
private val ICE_TROLLS = arrayOf(
NPCs.ICE_TROLL_RUNT_5521, NPCs.ICE_TROLL_MALE_5522, NPCs.ICE_TROLL_FEMALE_5523, NPCs.ICE_TROLL_GRUNT_5524,
NPCs.ICE_TROLL_RUNT_5525, NPCs.ICE_TROLL_MALE_5526, NPCs.ICE_TROLL_FEMALE_5527, NPCs.ICE_TROLL_GRUNT_5528,
NPCs.ICE_TROLL_RUNT_5473, NPCs.ICE_TROLL_MALE_5474, NPCs.ICE_TROLL_FEMALE_5475, NPCs.ICE_TROLL_GRUNT_5476
)
object EasyTasks {
const val SLAYER_CAVE_KILL_CAVE_CRAWLER = 0
const val KILL_5_ROCK_CRABS = 1
@@ -121,6 +145,40 @@ class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
}
}
override fun onDialogueOptionSelected(player: Player, event: DialogueOptionSelectionEvent) {
when (event.dialogue) {
is TowerGuardDialogue -> {
if (event.currentStage == 10) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.TOWER_GUARDS_WATCH_SHOUTING_MATCH
)
}
}
is ChieftanBrundt -> {
if (event.currentStage == 615){
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.LEARN_HISTORY_FROM_CHIEFTAIN_BRUNDT
)
}
}
is DairyChurnDialogue -> {
if (event.optionId == 12) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.MAKE_CHEESE_WITH_CHURN
)
}
}
}
}
override fun onResourceProduced(player: Player, event: ResourceProducedEvent) {
when (player.viewport.region.id) {
10553 -> if (event.source.id in FISHING_SPOTS) {
@@ -130,6 +188,19 @@ class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
EasyTasks.PIER_CATCH_FISH
)
}
/* After Royal trouble quest
10300 -> when (event.itemId) {
Items.MAHOGANY_LOGS_6332 -> {
if (inBorders(player, ECTERNIA_TREE_AREA)) {
finishTask(
player,
DiaryLevel.HARD,
HardTasks.GET_MAHOGANY_FROM_ETCETERIA
)
}
}
}*/
}
}
@@ -160,6 +231,32 @@ class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
EasyTasks.KILL_ADULT_BLACK_UNICORN
)
}
9886, 10142, 11589 -> if (event.npc.id in DAGANNOTHS) {
progressIncrementalTask(
player,
DiaryLevel.HARD,
HardTasks.KILL_3_DAGANNOTHS,
ATTRIBUTE_DAGANNOTHS_KILLCOUNT,
3
)
}
6995 -> if (event.npc.id == NPCs.MITHRIL_DRAGON_5363) {
finishTask(
player,
DiaryLevel.HARD,
HardTasks.KILL_MITHRIL_DRAGON
)
}
9276, 9532 -> if (event.npc.id in ICE_TROLLS && inEquipment(player, Items.YAK_HIDE_ARMOUR_10822,1)) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.KILL_ICE_TROLL_WHILE_WEARING_YAK_ARMOR
)
}
}
}
@@ -198,4 +295,73 @@ class FremennikAchievementDiary : DiaryEventHookBase(DiaryType.FREMENNIK) {
}
}
}
override fun onInteracted(player: Player, event: InteractionEvent) {
when (player.viewport.region.id) {
10553 -> if (event.target.id == Scenery.FISH_STALL_4277 && event.option == "steal-from" && player.questRepository.isComplete("Fremennik Trials")) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.STEAL_FISH_FROM_STALL
)
}
10811 -> if (event.target.id == Scenery.COLLAPSED_TRAP_19233 && inBorders(player, RELLEKKA_HUNTING_AREA) && event.option == "dismantle") {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.HUNT_SABRE_TOOTHED_KYATT
)
}
}
if (event.option == "watch-shouting") {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.TOWER_GUARDS_WATCH_SHOUTING_MATCH
)
}
if (event.target.id == Items.PET_ROCK_3695 && event.option == "interact") {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.INTERACT_WITH_PET_ROCK
)
}
// You can alternatively browse her regular clothing store to complete the task, no purchase necessary.
if (event.target.id == NPCs.YRSA_1301 && event.option == "trade" && player.questRepository.isComplete("Fremennik Trials") && inBorders(player, YRSA_SHOP_BORDERS)) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.BROWSE_BOOT_COLORS_YRSA
)
}
}
override fun onSpellCast(player: Player, event: SpellCastEvent) {
if (event.spellBook == SpellBookManager.SpellBook.LUNAR && event.spellId == 15) {
finishTask(
player,
DiaryLevel.HARD,
HardTasks.BAKE_PIE_WITH_MAGIC
)
}
}
override fun onButtonClicked(player: Player, event: ButtonClickEvent) {
when {
inBorders(player, RELLEKKA_BLACKSMITH_AREA) -> {
if (event.iface == Components.CRAFTING_GLASS_542 && event.buttonId == 38 && player.skills.getLevel(Skills.CRAFTING) >= 33) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.MAKE_3_VIALS
)
}
}
}
}
}
@@ -320,6 +320,8 @@ class TFTInteractionListeners : InteractionListener {
class SpiritPulse(val player: Player, val fish: Int) : Pulse(){
var counter = 0
val npc = NPC(1273, player.location)
val sea_boots = intArrayOf(Items.FREMENNIK_SEA_BOOTS_1_14571,Items.FREMENNIK_SEA_BOOTS_2_14572,Items.FREMENNIK_SEA_BOOTS_3_14573)
val hasboots = player.equipment.containsAtLeastOneItem(sea_boots)
override fun pulse(): Boolean {
when(counter++){
0 -> {
@@ -332,10 +334,14 @@ class TFTInteractionListeners : InteractionListener {
3 -> player.dialogueInterpreter?.sendDialogues(npc,
core.game.dialogue.FacialExpression.HAPPY,"I will kindly accept this offering, and","bestow upon you a gift in return.")
4 -> if(!removeItem(player,Items.LYRE_3689)) { removeItem(player,Items.ENCHANTED_LYRE_3690) }
5 -> when(fish){
383 -> addItem(player,Items.ENCHANTED_LYRE2_6125)
389 -> addItem(player,Items.ENCHANTED_LYRE3_6126)
395 -> addItem(player,Items.ENCHANTED_LYRE4_6127)
5 -> if(hasboots) when(fish){
383 -> addItem(player, Items.ENCHANTED_LYRE3_6126)
389 -> addItem(player, Items.ENCHANTED_LYRE5_14590)
395 -> addItem(player, Items.ENCHANTED_LYRE6_14591)
} else when(fish){
383 -> addItem(player, Items.ENCHANTED_LYRE2_6125)
389 -> addItem(player, Items.ENCHANTED_LYRE3_6126)
395 -> addItem(player, Items.ENCHANTED_LYRE4_6127)
}
6 -> player.unlock()
10 -> npc.clear().also {