Merge branch 'skelsoft/2009scape-master'

This commit is contained in:
ceikry 2021-09-04 16:30:12 -05:00
commit c8c1a49c05
5 changed files with 111 additions and 1399 deletions

File diff suppressed because it is too large Load diff

View file

@ -173,7 +173,7 @@
}, },
{ {
"npc_id": "54", "npc_id": "54",
"loc_data": "{2831,9825,0,1,0}-{2838,9824,0,1,1}-{2344,9763,0,1,1}" "loc_data": "{2834,9824,0,1,0}"
}, },
{ {
"npc_id": "55", "npc_id": "55",
@ -437,7 +437,7 @@
}, },
{ {
"npc_id": "134", "npc_id": "134",
"loc_data": "{3088,9945,0,1,3}-{3089,9943,0,1,0}-{3090,9944,0,1,7}-{3043,10262,0,1,1}-{3044,10252,0,1,4}-{3051,10257,0,1,3}-{3055,10253,0,1,3}-{3067,10255,0,1,3}-{3067,10257,0,1,3}-{3068,10253,0,1,2}-{3069,10257,0,1,4}-{3069,10259,0,1,0}-{2876,9810,0,1,4}-{2876,9803,0,1,5}-{2869,9799,0,1,4}-{2858,9804,0,1,7}-{2857,9821,0,1,4}-{2869,9816,0,1,0}-{2849,9817,0,1,6}-{3278,5477,0,1,1}-{3278,5476,0,1,2}-{3277,5451,0,1,5}-{3283,5449,0,1,4}-{3280,5476,0,1,3}-{3274,5463,0,1,1}-{3272,5477,0,1,1}-{3271,5473,0,1,4}-{3270,5459,0,1,1}-{3271,5454,0,1,3}-{3278,5525,0,1,3}-{3272,5529,0,1,3}-{3270,5536,0,1,6}-{3277,5536,0,1,4}-{3277,5512,0,1,3}-{3279,5516,0,1,6}-{3280,5531,0,1,6}-{2598,9558,0,1,6}-{2599,9557,0,1,4}-{2598,9556,0,1,4}-{2600,9555,0,1,3}-{2601,9553,0,1,1}-{2572,9569,0,1,3}-{2599,9552,0,1,6}-{2601,9560,0,1,1}-{2599,9564,0,1,6}-{2600,9563,0,1,4}-{2597,9569,0,1,1}-{2594,9571,0,1,2}-{2589,9571,0,1,4}-{2589,9574,0,1,3}-{2584,9572,0,1,6}-{2581,9575,0,1,6}-{2583,9577,0,1,6}-{2582,9572,0,1,3}-{2572,9568,0,1,1}-{2570,9567,0,1,1}-{2572,9571,0,1,3}-{2575,9572,0,1,0}-{2577,9574,0,1,3}-{2580,9578,0,1,3}-{2597,9572,0,1,6}" "loc_data": "{2871,9793,0,1,0}-{2869,9799,0,1,0}-{2876,9806,0,1,0}-{2864,9819,0,1,0}-{2857,9822,0,1,0}-{2858,9814,0,1,0}-{2859,9802,0,1,0}-{2849,9809,0,1,0}-{3088,9945,0,1,3}-{3089,9943,0,1,0}-{3090,9944,0,1,7}-{3043,10262,0,1,1}-{3044,10252,0,1,4}-{3051,10257,0,1,3}-{3055,10253,0,1,3}-{3067,10255,0,1,3}-{3067,10257,0,1,3}-{3068,10253,0,1,2}-{3069,10257,0,1,4}-{3069,10259,0,1,0}-{3278,5477,0,1,1}-{3278,5476,0,1,2}-{3277,5451,0,1,5}-{3283,5449,0,1,4}-{3280,5476,0,1,3}-{3274,5463,0,1,1}-{3272,5477,0,1,1}-{3271,5473,0,1,4}-{3270,5459,0,1,1}-{3271,5454,0,1,3}-{3278,5525,0,1,3}-{3272,5529,0,1,3}-{3270,5536,0,1,6}-{3277,5536,0,1,4}-{3277,5512,0,1,3}-{3279,5516,0,1,6}-{3280,5531,0,1,6}-{2598,9558,0,1,6}-{2599,9557,0,1,4}-{2598,9556,0,1,4}-{2600,9555,0,1,3}-{2601,9553,0,1,1}-{2572,9569,0,1,3}-{2599,9552,0,1,6}-{2601,9560,0,1,1}-{2599,9564,0,1,6}-{2600,9563,0,1,4}-{2597,9569,0,1,1}-{2594,9571,0,1,2}-{2589,9571,0,1,4}-{2589,9574,0,1,3}-{2584,9572,0,1,6}-{2581,9575,0,1,6}-{2583,9577,0,1,6}-{2582,9572,0,1,3}-{2572,9568,0,1,1}-{2570,9567,0,1,1}-{2572,9571,0,1,3}-{2575,9572,0,1,0}-{2577,9574,0,1,3}-{2580,9578,0,1,3}-{2597,9572,0,1,6}"
}, },
{ {
"npc_id": "138", "npc_id": "138",
@ -553,7 +553,7 @@
}, },
{ {
"npc_id": "190", "npc_id": "190",
"loc_data": "{2837,9815,0,1,1}-{2833,9814,0,1,2}-{2831,9808,0,1,3}-{2829,9804,0,1,7}-{2825,9806,0,1,1}-{2828,9809,0,1,3}-{2826,9813,0,1,6}" "loc_data": "{2833,9814,0,1,0}-{2829,9812,0,1,0}-{2825,9811,0,1,0}-{2829,9808,0,1,0}-{2833,9808,0,1,0}-{2827,9805,0,1,0}"
}, },
{ {
"npc_id": "191", "npc_id": "191",
@ -6755,6 +6755,10 @@
"npc_id": "4672", "npc_id": "4672",
"loc_data": "{3212,3847,0,1,6}-{3221,3827,0,1,6}" "loc_data": "{3212,3847,0,1,6}-{3221,3827,0,1,6}"
}, },
{
"npc_id": "4673",
"loc_data": "{2829,9827,0,1,0}"
},
{ {
"npc_id": "4675", "npc_id": "4675",
"loc_data": "{3048,10266,0,1,4}" "loc_data": "{3048,10266,0,1,4}"
@ -10033,8 +10037,12 @@
}, },
{ {
"npc_id": "8349", "npc_id": "8349",
"loc_data": "{2603,5740,0,0,7}-{2591,5739,0,1,3}-{2616,5733,0,1,3}-{2613,5712,0,1,3}-{2603,5712,0,1,3}-{2588,5712,0,1,3}" "loc_data": "{2589,5735,0,1,0}-{2589,5713,0,1,0}-{2610,5709,0,1,0}-{2613,5732,0,1,0}"
}, },
{
"npc_id": "8358",
"loc_data": "{2601,5710,0,1,0}-{2603,5737,0,1,0}"
},
{ {
"npc_id": "8536", "npc_id": "8536",
"loc_data": "{2654,5600,0,1,3}-{2650,5600,0,0,3}-{2662,5593,0,0,3}-{2653,5590,0,0,3}-{2644,5592,0,0,3-{2644,5601,0,0,3}-{2654,5604,0,0,3}-{2663,5606,0,0,3}-{2670,5597,0,0,3}-{2657,5589,0,0,3}-" "loc_data": "{2654,5600,0,1,3}-{2650,5600,0,0,3}-{2662,5593,0,0,3}-{2653,5590,0,0,3}-{2644,5592,0,0,3-{2644,5601,0,0,3}-{2654,5604,0,0,3}-{2663,5606,0,0,3}-{2670,5597,0,0,3}-{2657,5589,0,0,3}-"

View file

@ -653,7 +653,7 @@
}, },
{ {
"examine": "I hope no-one's home...", "examine": "I hope no-one's home...",
"ids": "398" "ids": "398,32290"
}, },
{ {
"examine": "I see dead people.", "examine": "I see dead people.",
@ -2821,7 +2821,7 @@
}, },
{ {
"examine": "I shudder to think what has taken place here.", "examine": "I shudder to think what has taken place here.",
"ids": "1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895" "ids": "1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,32289"
}, },
{ {
"examine": "This hasn't seen a duster for a while.", "examine": "This hasn't seen a duster for a while.",

View file

@ -2022,7 +2022,7 @@
"general_store": "false", "general_store": "false",
"id": "228", "id": "228",
"title": "Fernahei's Fishing Hut", "title": "Fernahei's Fishing Hut",
"stock": "{307,5}-{309,5}-{313,200}-{314,500}-{335,0}-{349,0}-{331,0}" "stock": "{307,10}-{309,10}-{313,1000}-{314,1000}-{335,0}-{349,0}-{331,0}"
}, },
{ {
"npcs": "2357", "npcs": "2357",

View file

@ -1,97 +1,97 @@
package rs09.game.node.entity.skill.crafting.lightsources package rs09.game.node.entity.skill.crafting.lightsources
import core.game.interaction.NodeUsageEvent import core.game.interaction.NodeUsageEvent
import core.game.interaction.UseWithHandler import core.game.interaction.UseWithHandler
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills import core.game.node.entity.skill.Skills
import core.game.node.item.Item import core.game.node.item.Item
import core.plugin.Initializable import core.plugin.Initializable
import core.plugin.Plugin import core.plugin.Plugin
/** /**
* Handles the combining of items to craft lanterns * Handles the combining of items to craft lanterns
* @author Ceikry * @author Ceikry
*/ */
@Initializable @Initializable
class LanternCrafting : UseWithHandler(36,38,4525,4542,1607){ class LanternCrafting : UseWithHandler(36,38,4525,4542,1607){
/** /**
* For candle lanterns -> Glassblowing produces 4527 * For candle lanterns -> Glassblowing produces 4527
* 4527 + white candle = 4529 * 4527 + white candle = 4529
* 4527 + black candle = 4532 * 4527 + black candle = 4532
* *
* For oil lanterns -> Glassblowing produces 4525 * For oil lanterns -> Glassblowing produces 4525
* 4525 + 4540 (oil lantern frame) = 4535 (empty oil lantern) * 4525 + 4540 (oil lantern frame) = 4535 (empty oil lantern)
* *
* For Bullseye lanterns -> Smithing produces 4544 (bullseye lantern (unf)) * For Bullseye lanterns -> Smithing produces 4544 (bullseye lantern (unf))
* 4544 + Lens(4542) -> 4546 * 4544 + Lens(4542) -> 4546
* 4544 + Sapphire(1607) -> 4700 (Sapphire lantern) * 4544 + Sapphire(1607) -> 4700 (Sapphire lantern)
*/ */
override fun newInstance(arg: Any?): Plugin<Any> { override fun newInstance(arg: Any?): Plugin<Any> {
addHandler(4527, ITEM_TYPE, this) //Empty candle lantern addHandler(4527, ITEM_TYPE, this) //Empty candle lantern
addHandler(4540, ITEM_TYPE,this) //oil lantern frame addHandler(4540, ITEM_TYPE,this) //oil lantern frame
addHandler(4544, ITEM_TYPE,this) //Bullseye lantern(unf) addHandler(4544, ITEM_TYPE,this) //Bullseye lantern(unf)
return this return this
} }
override fun handle(event: NodeUsageEvent?): Boolean { override fun handle(event: NodeUsageEvent?): Boolean {
event ?: return false //if event is null don't execute event ?: return false //if event is null don't execute
val used = event.used val used = event.used
return when(used.id){ return when(used.id){
4527 -> craftCandleLantern(event.player,event) 4527 -> craftCandleLantern(event.player,event)
4540 -> craftOilLantern(event.player,event) 4540 -> craftOilLantern(event.player,event)
4544 -> craftBullseyeLantern(event.player,event) 4544 -> craftBullseyeLantern(event.player,event)
else -> false else -> false
} }
} }
private fun craftCandleLantern(player: Player, event: NodeUsageEvent): Boolean{ private fun craftCandleLantern(player: Player, event: NodeUsageEvent): Boolean{
return when(event.usedWith.id){ return when(event.usedWith.id){
36,38 -> { 36,38 -> {
removeEventItems(player,event) removeEventItems(player,event)
player.inventory.add( if(event.usedWith.id == 36) Item(4529) else Item(4532)) player.inventory.add( if(event.usedWith.id == 36) Item(4529) else Item(4532))
player.sendMessage("You place the unlit candle inside the lantern.") player.sendMessage("You place the unlit candle inside the lantern.")
true true
} }
else -> false else -> false
} }
} }
private fun craftOilLantern(player: Player, event: NodeUsageEvent): Boolean { private fun craftOilLantern(player: Player, event: NodeUsageEvent): Boolean {
return when(event.usedWith.id){ return when(event.usedWith.id){
4525 -> { 4525 -> {
removeEventItems(player,event) removeEventItems(player,event)
player.inventory.add(Item(4535)) player.inventory.add(Item(4535))
player.sendMessage("You place the oil lamp inside its metal frame.") player.sendMessage("You place the oil lamp inside its metal frame.")
true true
} }
else -> false else -> false
} }
} }
private fun craftBullseyeLantern(player: Player,event: NodeUsageEvent): Boolean{ private fun craftBullseyeLantern(player: Player,event: NodeUsageEvent): Boolean{
return when(event.usedWith.id){ return when(event.usedWith.id){
4542 -> { 4542 -> {
removeEventItems(player,event) removeEventItems(player,event)
player.inventory.add( Item(4546) ) player.inventory.add( Item(4546) )
player.sendMessage("You fashion the lens onto the lantern.") player.sendMessage("You fashion the lens onto the lantern.")
true true
} }
1607 -> { 1607 -> {
if(player.skills.getLevel(Skills.CRAFTING) >= 20){ if(player.skills.getLevel(Skills.CRAFTING) >= 20){
removeEventItems(player,event) removeEventItems(player,event)
player.inventory.add(Item(4700)) player.inventory.add(Item(4700))
player.sendMessage("You fashion the gem into a lens and fit it onto the lantern") player.sendMessage("You fashion the gem into a lens and fit it onto the lantern.")
} else { } else {
player.sendMessage("You require a crafting level of 20 to use a gem as a lens.") player.sendMessage("You require a crafting level of 20 to use a gem as a lens.")
} }
true true
} }
else -> false else -> false
} }
} }
private fun removeEventItems(player: Player, event: NodeUsageEvent){ private fun removeEventItems(player: Player, event: NodeUsageEvent){
player.inventory.remove(event.used.asItem()) player.inventory.remove(event.used.asItem())
player.inventory.remove(event.usedWith.asItem()) player.inventory.remove(event.usedWith.asItem())
} }
} }