diff --git a/Server/src/main/java/core/game/content/quest/members/merlinscrystal/MerlinCrystal.java b/Server/src/main/java/core/game/content/quest/members/merlinscrystal/MerlinCrystal.java index 7150f515c..7d1cbd416 100644 --- a/Server/src/main/java/core/game/content/quest/members/merlinscrystal/MerlinCrystal.java +++ b/Server/src/main/java/core/game/content/quest/members/merlinscrystal/MerlinCrystal.java @@ -27,7 +27,7 @@ public final class MerlinCrystal extends Quest { line(player, "I can start this quest by speaking to King Arthur at Camelot Castle, just North West of CatherbyI must be able to defeat a level 37 enemy", 11); break; case 10:// after talking to arthur - line(player, "I spoke to King Arthur and he said I would be worthy of becoming a Knight of the Round Table if I could free Merlinfrom a giant crystal that he has been trapped in." + "


I should ask the other Knights if they have any advice forme on how I should go about doing this.", 11); + line(player, "I spoke to King Arthur and he said I would be worthy of becoming a Knight of the Round Table if I could free Merlinfrom a giant crystal that he has been trapped in." + " I should ask the other Knights if they have any advice forme on how I should go about doing this.", 11); break; case 20:// upon talking to kay/gawain and learning how merlin got trapped line(player, "I spoke to King Arthur and he said I would be worthy of becoming a Knight of the Round Table if I could free Merlinfrom a giant crystal that he has been trapped in." + "Gawain told me it was the work of Morgan Le Faye.", 11); diff --git a/Server/src/main/java/core/game/content/quest/members/waterfallquest/AlmeraDialogue.java b/Server/src/main/java/core/game/content/quest/members/waterfallquest/AlmeraDialogue.java index 6c05aa308..739f73716 100644 --- a/Server/src/main/java/core/game/content/quest/members/waterfallquest/AlmeraDialogue.java +++ b/Server/src/main/java/core/game/content/quest/members/waterfallquest/AlmeraDialogue.java @@ -61,7 +61,7 @@ public class AlmeraDialogue extends DialoguePlugin { } break; case 3: - interpreter.sendDialogues(304, FacialExpression.DISGUSTED, "It's my son Hudon, he's always getting to trouble, the", "boy's convinced there's hidden treasure in the river and", "I'm a bit worried about his safety, the poor lad can't", "even swim."); + interpreter.sendDialogues(304, FacialExpression.DISGUSTED, "It's my son Hudon, he's always getting into trouble, the", "boy's convinced there's hidden treasure in the river and", "I'm a bit worried about his safety, the poor lad can't", "even swim."); stage = 4; break; case 4: diff --git a/Server/src/main/java/core/game/node/entity/skill/cooking/CookableItems.java b/Server/src/main/java/core/game/node/entity/skill/cooking/CookableItems.java index 13d740878..669c725a3 100644 --- a/Server/src/main/java/core/game/node/entity/skill/cooking/CookableItems.java +++ b/Server/src/main/java/core/game/node/entity/skill/cooking/CookableItems.java @@ -89,7 +89,8 @@ public enum CookableItems { //Miscellaneous RAW_OOMLIE(Items.RAW_OOMLIE_2337, 0, Items.BURNT_OOMLIE_2426, 50, 0, 999,0,0), // always burns - OOMLIE_WRAP(Items.COOKED_OOMLIE_WRAP_2343, Items.WRAPPED_OOMLIE_2341, Items.BURNT_OOMLIE_WRAP_2345, 50, 110, 999,0,0); + OOMLIE_WRAP(Items.COOKED_OOMLIE_WRAP_2343, Items.WRAPPED_OOMLIE_2341, Items.BURNT_OOMLIE_WRAP_2345, 50, 110, 999,0,0), + SEAWEED(Items.SEAWEED_401,0,Items.SODA_ASH_1781,0,0,999,0,0); public final static HashMapcookingMap = new HashMap<>(); public final static HashMapintentionalBurnMap = new HashMap<>(); diff --git a/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt b/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt index 4acf52ded..e9018f88e 100644 --- a/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt +++ b/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt @@ -35,10 +35,6 @@ class CookingRewrite : InteractionListener() { player.dialogueInterpreter.open(CookingDialogue(item.id,9436,true,obj)) return@onUseWith true } - SEAWEED_401 -> if (range) { - player.dialogueInterpreter.open(CookingDialogue(item.id,1781,false,obj)) - return@onUseWith true - } BREAD_DOUGH_2307, UNCOOKED_CAKE_1889 -> if (!range) { player.packetDispatch.sendMessage("You need to cook this on a range.") return@onUseWith false diff --git a/Server/src/main/java/core/game/node/entity/skill/cooking/StandardCookingPulse.java b/Server/src/main/java/core/game/node/entity/skill/cooking/StandardCookingPulse.java index 976be2063..bf2dc716c 100644 --- a/Server/src/main/java/core/game/node/entity/skill/cooking/StandardCookingPulse.java +++ b/Server/src/main/java/core/game/node/entity/skill/cooking/StandardCookingPulse.java @@ -212,15 +212,15 @@ public class StandardCookingPulse extends Pulse { if (food.getId() == Items.RAW_OOMLIE_2337) { return "The meat is far too delicate to cook like this. Perhaps you should wrap something around it to protect it from the heat."; } - if (CookableItems.intentionalBurn(food.getId())) { - return "You deliberately burn the perfectly good piece of meat."; - } switch (product.getId()) { case Items.SINEW_9436: return "You dry the meat into sinew."; case Items.SODA_ASH_1781: return "You burn the seaweed into soda ash."; } + if (CookableItems.intentionalBurn(food.getId())) { + return "You deliberately burn the perfectly good piece of meat."; + } if (!burned) { return "You manage to cook some " + food.getName().replace("Raw ", ""); } else { diff --git a/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt b/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt index da53afcb1..e7671417c 100644 --- a/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt +++ b/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt @@ -1,5 +1,7 @@ package rs09.game.content.zone.phasmatys.bonegrinder +import api.Container +import api.ContentAPI import core.game.content.global.Bones import core.game.node.entity.player.Player import core.game.node.item.Item @@ -13,16 +15,18 @@ import rs09.game.world.GameWorld.Pulser private const val LOADER = 11162 private const val BONE_GRINDER = 11163 private const val BIN = 11164 + private const val LOADED_BONE_KEY = "/save:bonegrinder-bones" private const val BONE_HOPPER_KEY = "/save:bonegrinder-hopper" private const val BONE_BIN_KEY = "/save:bonegrinder-bin" + private val FILL_ANIM = Animation(1649) private val WIND_ANIM = Animation(1648) private val SCOOP_ANIM = Animation(1650) class BoneGrinderListener : InteractionListener() { - val boneIDs = Bones.values().map { it.itemId }.toIntArray() + private val boneIDs = Bones.values().map { it.itemId }.toIntArray() override fun defineListeners() { @@ -67,15 +71,15 @@ class BoneGrinderListener : InteractionListener() { fun handleFill(player: Player): Boolean{ val bone = getBone(player) if(bone == null){ - player.sendMessage("You have no bones to grind.") + ContentAPI.sendMessage(player,"You have no bones to grind.") return true } - if(player.getAttribute(BONE_HOPPER_KEY,false) != false){ - player.sendMessage("You already have some bones in the hopper.") + if(ContentAPI.getAttribute(player,BONE_HOPPER_KEY,false)){ + ContentAPI.sendMessage(player,"You already have some bones in the hopper.") return true } - if(player.getAttribute(BONE_BIN_KEY,false) != false){ - player.sendMessage("You already have some bonemeal that needs to be collected.") + if(ContentAPI.getAttribute(player,BONE_BIN_KEY,false)){ + ContentAPI.sendMessage(player,"You already have some bonemeal that needs to be collected.") return true } @@ -84,15 +88,14 @@ class BoneGrinderListener : InteractionListener() { override fun pulse(): Boolean { when(stage++){ 0 -> { - player.lock() - player.animator.animate(FILL_ANIM) + ContentAPI.lock(player, FILL_ANIM.duration) + ContentAPI.animate(player,FILL_ANIM) } FILL_ANIM.duration -> { - player.sendMessage("You fill the hopper with bones.") - player.unlock() - player.inventory.remove(Item(bone.itemId)) - player.setAttribute(LOADED_BONE_KEY,bone.ordinal) - player.setAttribute(BONE_HOPPER_KEY,true) + ContentAPI.sendMessage(player,"You fill the hopper with bones.") + ContentAPI.removeItem(player,Item(bone.itemId),Container.INVENTORY) + ContentAPI.setAttribute(player,LOADED_BONE_KEY,bone.ordinal) + ContentAPI.setAttribute(player,BONE_HOPPER_KEY,true) return true } } @@ -100,30 +103,28 @@ class BoneGrinderListener : InteractionListener() { } } - if(player.inventory.getAmount(bone.itemId) > 0){ + if(ContentAPI.inInventory(player,bone.itemId)){ player.pulseManager.run(object : Pulse(){ var stage = 0 override fun pulse(): Boolean { when(stage++){ 0 -> Pulser.submit(fillPulse).also { delay = FILL_ANIM.duration + 1} 1 -> { - player.walkingQueue.reset() - player.walkingQueue.addPath(3659,3524,true) + ContentAPI.stopWalk(player) + ContentAPI.forceWalk(player,Location(3659,3524),"smart") delay = 2 } 2 -> { - player.faceLocation(Location.create(3659, 3526, 1)) handleWind(player) delay = WIND_ANIM.duration + 1 } 3 -> { - player.walkingQueue.reset() - player.walkingQueue.addPath(3658,3524,true) + ContentAPI.stopWalk(player) + ContentAPI.forceWalk(player,Location(3658,3524),"smart") delay = 2 } 4 -> { - player.faceLocation(Location.create(3658, 3525, 1)) - if(!player.inventory.contains(Items.EMPTY_POT_1931,1)){ + if(!ContentAPI.inInventory(player,Items.EMPTY_POT_1931,1)){ return handleEmpty(player) } else { handleEmpty(player) @@ -131,12 +132,12 @@ class BoneGrinderListener : InteractionListener() { } } 5 -> { - player.walkingQueue.reset() - player.walkingQueue.addPath(3660,3524,true) + ContentAPI.stopWalk(player) + ContentAPI.forceWalk(player,Location(3660,3524),"smart") delay = 4 } 6 -> { - player.faceLocation(Location.create(3660,3526)) + ContentAPI.face(player,Location(3660,3526)) handleFill(player) return true } @@ -151,13 +152,13 @@ class BoneGrinderListener : InteractionListener() { } fun handleWind(player: Player): Boolean{ - if(!player.getAttribute(BONE_HOPPER_KEY,false)){ - player.sendMessage("You have no bones loaded to grind.") + if(!ContentAPI.getAttribute(player,BONE_HOPPER_KEY,false)){ + ContentAPI.sendMessage(player,"You have no bones loaded to grind.") return true } - if(player.getAttribute(BONE_BIN_KEY,false)){ - player.sendMessage("You already have some bonemeal which you need to collect.") + if(ContentAPI.getAttribute(player,BONE_BIN_KEY,false)){ + ContentAPI.sendMessage(player,"You already have some bonemeal which you need to collect.") return true } @@ -166,15 +167,15 @@ class BoneGrinderListener : InteractionListener() { override fun pulse(): Boolean { when(stage++){ 0 -> { - player.lock() - player.animator.animate(WIND_ANIM) - player.sendMessage("You wind the handle.") + ContentAPI.face(player,Location(3659, 3526, 1)) + ContentAPI.lock(player,WIND_ANIM.duration) + ContentAPI.animate(player,WIND_ANIM) + ContentAPI.sendMessage(player,"You wind the handle.") } WIND_ANIM.duration -> { - player.unlock() - player.sendMessage("The bonemeal falls into the bin.") - player.setAttribute(BONE_HOPPER_KEY,false) - player.setAttribute(BONE_BIN_KEY,true) + ContentAPI.sendMessage(player,"The bonemeal falls into the bin.") + ContentAPI.setAttribute(player,BONE_HOPPER_KEY,false) + ContentAPI.setAttribute(player,BONE_BIN_KEY,true) return true } } @@ -184,51 +185,54 @@ class BoneGrinderListener : InteractionListener() { return true } - fun handleStatus(player: Player): Boolean{ - val bonesLoaded = player.getAttribute(BONE_HOPPER_KEY,false) - val boneMealReady = player.getAttribute(BONE_BIN_KEY,false) + private fun handleStatus(player: Player): Boolean{ + val bonesLoaded = ContentAPI.getAttribute(player,BONE_HOPPER_KEY,false) + val boneMealReady = ContentAPI.getAttribute(player,BONE_BIN_KEY,false) - if(bonesLoaded) player.sendMessage("There are bones waiting in the hopper.") - if(boneMealReady) player.sendMessage("There is bonemeal waiting in the bin to be collected.") + if(bonesLoaded) ContentAPI.sendMessage(player,"There are bones waiting in the hopper.") + if(boneMealReady) ContentAPI.sendMessage(player,"There is bonemeal waiting in the bin to be collected.") if(!bonesLoaded && !boneMealReady){ - player.sendMessage("There is nothing loaded into the machine.") + ContentAPI.sendMessage(player,"There is nothing loaded into the machine.") } return true } fun handleEmpty(player: Player): Boolean{ - if(!player.getAttribute(BONE_BIN_KEY,false)){ - player.sendMessage("You have no bonemeal to collect.") + if(!ContentAPI.getAttribute(player,BONE_BIN_KEY,false)){ + ContentAPI.sendMessage(player,"You have no bonemeal to collect.") return true } - if(player.getAttribute(BONE_HOPPER_KEY,false) && !player.getAttribute(BONE_BIN_KEY,false)){ - player.sendMessage("You need to wind the wheel to grind the bones.") + if(ContentAPI.getAttribute(player,BONE_HOPPER_KEY,false) && !ContentAPI.getAttribute(player,BONE_BIN_KEY,false)){ + ContentAPI.sendMessage(player,"You need to wind the wheel to grind the bones.") return true } - if(!player.inventory.contains(Items.EMPTY_POT_1931,1)){ - player.sendMessage("You don't have any pots to take the bonemeal with.") + if(!ContentAPI.inInventory(player,Items.EMPTY_POT_1931,1)){ + ContentAPI.sendMessage(player,"You don't have any pots to take the bonemeal with.") return true } - val bone = Bones.values()[player.getAttribute(LOADED_BONE_KEY,-1)] + val bone = Bones.values()[ContentAPI.getAttribute(player,LOADED_BONE_KEY,-1)] + - player.lock() Pulser.submit(object : Pulse(){ var stage = 0 override fun pulse(): Boolean { when(stage++){ - 0 -> player.animator.animate(SCOOP_ANIM) + 0 -> { + ContentAPI.face(player,Location(3658, 3525, 1)) + ContentAPI.lock(player, SCOOP_ANIM.duration) + ContentAPI.animate(player,SCOOP_ANIM) + } SCOOP_ANIM.duration -> { - player.unlock() - if(player.inventory.remove(Item(Items.EMPTY_POT_1931))){ - player.inventory.add(bone.boneMeal) - player.setAttribute(BONE_BIN_KEY,false) - player.setAttribute(BONE_HOPPER_KEY,false) - player.setAttribute(LOADED_BONE_KEY,-1) + if(ContentAPI.removeItem(player,Item(Items.EMPTY_POT_1931),Container.INVENTORY)){ + ContentAPI.addItem(player,bone.boneMeal.id) + ContentAPI.setAttribute(player,BONE_BIN_KEY,false) + ContentAPI.setAttribute(player,BONE_HOPPER_KEY,false) + ContentAPI.setAttribute(player,LOADED_BONE_KEY,-1) } return true } @@ -236,13 +240,12 @@ class BoneGrinderListener : InteractionListener() { return false } }) - return true } fun getBone(player: Player): Bones? { for(bone in Bones.values()){ - if(player.inventory.contains(bone.itemId,1)) return bone + if(ContentAPI.inInventory(player,bone.itemId)) return bone } return null } diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt b/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt index 8211302cc..ba3113972 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt @@ -7,7 +7,6 @@ import core.game.node.entity.skill.Skills import core.game.node.entity.skill.gather.SkillingTool import core.game.world.map.Location import core.game.world.update.flag.context.Animation -import core.net.packet.out.SkillLevel import org.rs09.consts.Components object CanoeUtils {