Merge branch 'master' into 'master'

Fix: Crop Noting, misc JSON

See merge request 2009scape/2009scape!319
This commit is contained in:
Ceikry
2021-10-27 19:08:02 +00:00
3 changed files with 42 additions and 95 deletions
+4
View File
@@ -287,6 +287,10 @@
"item_id": "1523", "item_id": "1523",
"loc_data": "{1,2614,9570,0,5898270}" "loc_data": "{1,2614,9570,0,5898270}"
}, },
{
"item_id": "1550",
"loc_data": "{1,2714,3478,0,5898270}"
},
{ {
"item_id": "1573", "item_id": "1573",
"loc_data": "{1,2740,3637,0,5898270}-{1,2736,3638,0,5898270}-{1,2735,3636,0,5898270}-{1,2743,3636,0,5898270}-{1,2739,3634,0,5898270}-{1,2743,3640,0,5898270}-{1,2741,3639,0,5898270}-{1,2736,3641,0,5898270}-{1,2738,3641,0,5898270}-{1,2734,3640,0,5898270}-{1,2738,3636,0,5898270}" "loc_data": "{1,2740,3637,0,5898270}-{1,2736,3638,0,5898270}-{1,2735,3636,0,5898270}-{1,2743,3636,0,5898270}-{1,2739,3634,0,5898270}-{1,2743,3640,0,5898270}-{1,2741,3639,0,5898270}-{1,2736,3641,0,5898270}-{1,2738,3641,0,5898270}-{1,2734,3640,0,5898270}-{1,2738,3636,0,5898270}"
-60
View File
@@ -80084,26 +80084,6 @@
"range_level": "1", "range_level": "1",
"attack_level": "1" "attack_level": "1"
}, },
{
"agg_radius": "64",
"examine": "Roar! A dragon!",
"melee_animation": "80",
"attack_speed": "4",
"magic_level": "70",
"respawn_delay": "35",
"defence_animation": "89",
"death_animation": "4642",
"name": "Elvarg",
"defence_level": "70",
"safespot": null,
"lifepoints": "80",
"strength_level": "70",
"id": "742",
"aggressive": "true",
"bonuses": "0,0,0,0,0,20,40,40,30,20,0,0,0,0,0",
"range_level": "1",
"attack_level": "70"
},
{ {
"examine": "A badly-behaved goblin.", "examine": "A badly-behaved goblin.",
"slayer_task": "38", "slayer_task": "38",
@@ -144623,26 +144603,6 @@
"range_level": "1", "range_level": "1",
"attack_level": "1" "attack_level": "1"
}, },
{
"agg_radius": "64",
"examine": "Roar! A dragon!",
"melee_animation": "80",
"attack_speed": "4",
"magic_level": "70",
"respawn_delay": "35",
"defence_animation": "89",
"death_animation": "4642",
"name": "Elvarg",
"defence_level": "70",
"safespot": null,
"lifepoints": "80",
"strength_level": "70",
"id": "742",
"aggressive": "true",
"bonuses": "0,0,0,0,0,20,40,40,30,20,0,0,0,0,0",
"range_level": "1",
"attack_level": "70"
},
{ {
"examine": "A badly-behaved goblin.", "examine": "A badly-behaved goblin.",
"slayer_task": "38", "slayer_task": "38",
@@ -209989,26 +209949,6 @@
"range_level": "1", "range_level": "1",
"attack_level": "1" "attack_level": "1"
}, },
{
"agg_radius": "64",
"examine": "Roar! A dragon!",
"melee_animation": "80",
"attack_speed": "4",
"magic_level": "70",
"respawn_delay": "35",
"defence_animation": "89",
"death_animation": "4642",
"name": "Elvarg",
"defence_level": "70",
"safespot": null,
"lifepoints": "80",
"strength_level": "70",
"id": "742",
"aggressive": "true",
"bonuses": "0,0,0,0,0,20,40,40,30,20,0,0,0,0,0",
"range_level": "1",
"attack_level": "70"
},
{ {
"examine": "A badly-behaved goblin.", "examine": "A badly-behaved goblin.",
"slayer_task": "38", "slayer_task": "38",
@@ -1,36 +1,39 @@
package rs09.game.node.entity.skill.farming package rs09.game.node.entity.skill.farming
import core.game.content.dialogue.FacialExpression import api.ContentAPI
import core.game.node.item.Item import core.game.content.dialogue.DialoguePlugin
import core.plugin.Initializable import core.game.content.dialogue.FacialExpression
import org.rs09.consts.NPCs import core.game.node.item.Item
import rs09.game.interaction.InteractionListener import core.plugin.Initializable
import org.rs09.consts.NPCs
class LeprechaunNoter : InteractionListener() { import rs09.game.interaction.InteractionListener
val CROPS = Plantable.values().map{ it.harvestItem }.toIntArray() class LeprechaunNoter : InteractionListener() {
val LEPRECHAUNS = intArrayOf(NPCs.TOOL_LEPRECHAUN_3021,NPCs.GOTH_LEPRECHAUN_8000,NPCs.TOOL_LEPRECHAUN_4965)
val CROPS = Plantable.values().map{ it.harvestItem }.toIntArray()
override fun defineListeners() { val LEPRECHAUNS = intArrayOf(NPCs.TOOL_LEPRECHAUN_3021,NPCs.GOTH_LEPRECHAUN_8000,NPCs.TOOL_LEPRECHAUN_4965,NPCs.TECLYN_2861)
onUseWith(NPC,CROPS,*LEPRECHAUNS){player, used, with ->
val usedItem = used.asItem() override fun defineListeners() {
val npc = with.asNpc() onUseWith(NPC,CROPS,*LEPRECHAUNS){player, used, with ->
val expr = when(npc.id){ val usedItem = used.asItem()
3021 -> FacialExpression.OLD_NORMAL val npc = with.asNpc()
else -> FacialExpression.FRIENDLY val expr = when(npc.id){
} 3021 -> FacialExpression.OLD_NORMAL
else -> FacialExpression.FRIENDLY
if(usedItem.noteChange != usedItem.id){ }
val amt = player.inventory.getAmount(usedItem.id)
if(player.inventory.remove(Item(usedItem.id,amt))){ if(usedItem.noteChange != usedItem.id){
player.inventory.add(Item(usedItem.noteChange,amt)) val amt = player.inventory.getAmount(usedItem.id)
} if(player.inventory.remove(Item(usedItem.id,amt))){
player.dialogueInterpreter.sendDialogues(npc.id,expr,"There ya go.") player.inventory.add(Item(usedItem.noteChange,amt))
} else { }
player.dialogueInterpreter.sendDialogues(npc.id,expr,"But that's already a note!") ContentAPI.sendItemDialogue(player,usedItem.id,"The leprechaun exchanges your items for banknotes.")
} } else {
// Unsure why the line below no longer functions, despite only changing the line above to be more correct. Using your note(NOT CROP) on the leprechaun no longer functions because of this. - Crash
return@onUseWith true player.dialogueInterpreter.sendDialogues(npc.id,expr,"That IS a banknote!")
} }
}
return@onUseWith true
}
}
} }