Add crafting for spiky vambraces, and fix Yak Armor crafting levels

This commit is contained in:
downthecrop 2021-11-04 15:59:25 +00:00 committed by Ceikry
parent 4a67a1c8e6
commit 9f297af184
3 changed files with 72 additions and 2 deletions

View file

@ -45,4 +45,6 @@
- Addressed a potentially serious issue with charm droprates
< ---- ABOVE Released NOVEMBER 1, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Nov-1-2021 ---- >
- Removed halloween decorations
- Alkharid Upstairs locations can now be entered exited correctly
- Alkharid Upstairs locations can now be entered exited correctly
- Fix Yak Hide Armor crafting level requirements
- Spiky Vambraces crafing added

View file

@ -96,7 +96,7 @@ public class YakArmourPlugin extends UseWithHandler {
@Override
public boolean checkRequirements() {
int level = (index == 1 ? 43 : 46);
int level = (index == 1 ? 46 : 43);
if (player.getSkills().getLevel(Skills.CRAFTING) < level) {
player.getDialogueInterpreter().sendDialogue("You need a Crafting level of at least " + level + " in order to do this.");
return false;

View file

@ -0,0 +1,68 @@
package rs09.game.node.entity.skill.crafting.leather
import api.Container
import api.ContentAPI
import core.game.interaction.NodeUsageEvent
import core.game.interaction.UseWithHandler
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
import org.rs09.consts.Items
import core.plugin.Initializable
import core.plugin.Plugin
/**
* Handles attaching Kebbit Claws to Vambraces
* to create "Spiky Vambraces"
* @author downthecrop
*/
@Initializable
class SpikyVambraces: UseWithHandler(Items.KEBBIT_CLAWS_10113) {
override fun newInstance(arg: Any?): Plugin<Any> {
addHandler(Items.LEATHER_VAMBRACES_1063, ITEM_TYPE, this)
addHandler(Items.GREEN_DHIDE_VAMB_1065, ITEM_TYPE, this)
addHandler(Items.BLUE_DHIDE_VAMB_2487, ITEM_TYPE, this)
addHandler(Items.RED_DHIDE_VAMB_2489, ITEM_TYPE, this)
addHandler(Items.BLACK_DHIDE_VAMB_2491, ITEM_TYPE, this)
return this
}
override fun handle(event: NodeUsageEvent?): Boolean {
event ?: return false
val vamb = event.usedWith.id
val player = event.player
when(vamb){
Items.LEATHER_VAMBRACES_1063 -> {
craftVamb(player,vamb,Items.SPIKY_VAMBRACES_10077,"leather")
}
Items.GREEN_DHIDE_VAMB_1065 -> {
craftVamb(player,vamb,Items.GREEN_SPIKY_VAMBS_10079,"green dragonhide")
}
Items.BLUE_DHIDE_VAMB_2487 -> {
craftVamb(player,vamb,Items.BLUE_SPIKY_VAMBS_10081,"blue dragonhide")
}
Items.RED_DHIDE_VAMB_2489 -> {
craftVamb(player,vamb,Items.RED_SPIKY_VAMBS_10083,"red dragonhide")
}
Items.BLACK_DHIDE_VAMB_2491 -> {
craftVamb(player,vamb,Items.BLACK_SPIKY_VAMBS_10085,"black dragonhide")
}
}
return true
}
private fun craftVamb(player: Player, vamb: Int, product: Int, vambLeather: String){
if (player.skills.getLevel(Skills.CRAFTING) >= 32){
if (ContentAPI.removeItem(player,vamb,Container.INVENTORY) &&
ContentAPI.removeItem(player,Items.KEBBIT_CLAWS_10113,Container.INVENTORY)
) {
ContentAPI.addItem(player,product)
player.skills.addExperience(Skills.CRAFTING,6.0)
ContentAPI.sendMessage(player, "You carefully attach the sharp claws to the $vambLeather vambraces.")
}
}
else{
ContentAPI.sendMessage(player,"You need a crafting level of 32 to craft this.")
}
}
}