diff --git a/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt b/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt index 63808540d..0bcb95c9e 100644 --- a/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt +++ b/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt @@ -76,6 +76,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? } }), HASTY_COOKING("cape_perks:hasty-cooking"), + SMOOTH_HANDS("cape_perks:smooth-hands"), NONE("cape_perks:none") ; @@ -97,7 +98,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? Skillcape.HITPOINTS -> DAMAGE_SPONG Skillcape.AGILITY -> MARATHON_RUNNER Skillcape.HERBLORE -> NONE - Skillcape.THIEVING -> NONE + Skillcape.THIEVING -> SMOOTH_HANDS Skillcape.CRAFTING -> NONE Skillcape.FLETCHING -> NONE Skillcape.SLAYER -> TRICKS_OF_THE_TRADE diff --git a/Server/src/main/content/global/skill/thieving/ThievingListeners.kt b/Server/src/main/content/global/skill/thieving/ThievingListeners.kt index 276b5556c..4f9050e2e 100644 --- a/Server/src/main/content/global/skill/thieving/ThievingListeners.kt +++ b/Server/src/main/content/global/skill/thieving/ThievingListeners.kt @@ -1,5 +1,6 @@ package content.global.skill.thieving +import content.global.skill.skillcapeperks.SkillcapePerks import core.api.stun import core.game.node.entity.combat.ImpactHandler import core.game.node.entity.impl.Animator @@ -24,7 +25,7 @@ class ThievingListeners : InteractionListener { on(IntType.NPC,"pickpocket","pick-pocket"){ player, node -> val pickpocketData = Pickpockets.forID(node.id) ?: return@on false - var successMod = 0 + var successMod = 0.0 if(player.inCombat()){ player.sendMessage("You can't pickpocket while in combat.") @@ -41,11 +42,10 @@ class ThievingListeners : InteractionListener { return@on true } - if(pickpocketData == Pickpockets.FEMALE_HAM_MEMBER || pickpocketData == Pickpockets.MALE_HAM_MEMBER){ - successMod += getHAMItemCount(player) + if(SkillcapePerks.isActive(SkillcapePerks.SMOOTH_HANDS, player)) { + successMod += 25 } - - if(player.equipment.contains(Items.GLOVES_OF_SILENCE_10075,1)){ + if (player.equipment.contains(Items.GLOVES_OF_SILENCE_10075,1)){ successMod += 3 } @@ -74,24 +74,5 @@ class ThievingListeners : InteractionListener { return@on true } - } - - fun getHAMItemCount(player: Player): Int{ - var counter = 0 - for(item in player.equipment.toArray()){ - item ?: continue - counter += when(item.id){ - Items.HAM_LOGO_4306 -> 1 - Items.HAM_ROBE_4300 -> 1 - Items.HAM_HOOD_4302 -> 1 - Items.HAM_CLOAK_4304 -> 1 - Items.BOOTS_4310 -> 1 - Items.GLOVES_4308 -> 1 - else -> 0 - } - } - return counter - } - } \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/MartinThwaitDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/MartinThwaitDialogue.java index 69e3a63e5..675d04822 100644 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/MartinThwaitDialogue.java +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/MartinThwaitDialogue.java @@ -1,5 +1,7 @@ package content.region.asgarnia.burthorpe.dialogue; +import core.api.Container; +import core.api.ContentAPIKt; import core.cache.def.impl.NPCDefinition; import core.game.dialogue.DialoguePlugin; import core.game.dialogue.FacialExpression; @@ -12,6 +14,7 @@ import core.game.node.item.Item; import core.plugin.Plugin; import core.plugin.Initializable; import core.plugin.ClassScanner; +import org.rs09.consts.Items; /** * Represents the dialogue used for martin thwait. @@ -141,17 +144,18 @@ public final class MartinThwaitDialogue extends DialoguePlugin { stage = 34; return true; } - if (!player.getInventory().containsItem(COINS)) { - end(); - return true; - } - if (!player.getInventory().remove(COINS)) { - player("Sorry, I don't seem to have enoug coins", "with me at this time."); + if (!ContentAPIKt.inInventory(player, COINS.getId(), COINS.getAmount())) { + player("Sorry, I don't seem to have enough coins", "with me at this time."); stage = 34; return true; } - player.getInventory().add(ITEMS[player.getSkills().getMasteredSkills() > 1 ? 1 : 0], ITEMS[2]); - npc("There you go! Enjoy."); + if (ContentAPIKt.removeItem(player, COINS, Container.INVENTORY)) { + ContentAPIKt.addItemOrDrop(player, ITEMS[player.getSkills().getMasteredSkills() > 1 ? 1 : 0].getId(),1); + ContentAPIKt.addItemOrDrop(player, ITEMS[2].getId(),1); + npc("There you go! Enjoy."); + } else { + player("Sorry, I don't seem to have enough coins", "with me at this time."); + } stage = 34; break; case 34: