mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-11 09:00:23 -07:00
Merge branch 'vambs' into 'master'
Add crafting for spiky vambraces, and fix Yak Armor crafting levels See merge request 2009scape/2009scape!328
This commit is contained in:
commit
585b004fc7
3 changed files with 72 additions and 2 deletions
|
|
@ -45,4 +45,6 @@
|
||||||
- Addressed a potentially serious issue with charm droprates
|
- Addressed a potentially serious issue with charm droprates
|
||||||
< ---- ABOVE Released NOVEMBER 1, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Nov-1-2021 ---- >
|
< ---- ABOVE Released NOVEMBER 1, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Nov-1-2021 ---- >
|
||||||
- Removed halloween decorations
|
- 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
|
||||||
|
|
@ -96,7 +96,7 @@ public class YakArmourPlugin extends UseWithHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkRequirements() {
|
public boolean checkRequirements() {
|
||||||
int level = (index == 1 ? 43 : 46);
|
int level = (index == 1 ? 46 : 43);
|
||||||
if (player.getSkills().getLevel(Skills.CRAFTING) < level) {
|
if (player.getSkills().getLevel(Skills.CRAFTING) < level) {
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Crafting level of at least " + level + " in order to do this.");
|
player.getDialogueInterpreter().sendDialogue("You need a Crafting level of at least " + level + " in order to do this.");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -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.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue