From de3cf3e856580634318f8516636ffa97b14b1634 Mon Sep 17 00:00:00 2001 From: Byte Date: Sun, 11 Sep 2022 14:08:56 +0000 Subject: [PATCH] Fixed bug where swamp toads never respawned Set a respawn_delay for swamp toad npc to 34 ticks (20 seconds) --- Server/data/configs/npc_configs.json | 1 + .../game/content/quest/members/chompybird/ChompyBird.kt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Server/data/configs/npc_configs.json b/Server/data/configs/npc_configs.json index 03a3889ca..25184f949 100644 --- a/Server/data/configs/npc_configs.json +++ b/Server/data/configs/npc_configs.json @@ -10334,6 +10334,7 @@ "examine": "A green skinned croaker", "melee_animation": "0", "range_animation": "0", + "respawn_delay": "34", "defence_animation": "0", "magic_animation": "0", "death_animation": "0", diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/ChompyBird.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/ChompyBird.kt index b9c20637d..fd322084f 100644 --- a/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/ChompyBird.kt +++ b/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/ChompyBird.kt @@ -20,6 +20,9 @@ import core.game.world.update.flag.context.Graphics as Gfx import rs09.game.interaction.InteractionListener import rs09.game.content.dialogue.SkillDialogueHandler import rs09.game.content.dialogue.SkillDialogueHandler.SkillDialogue +import rs09.game.system.config.ItemConfigParser +import rs09.game.system.config.NPCConfigParser +import rs09.game.world.GameWorld import kotlin.math.min import java.util.Random @@ -228,7 +231,7 @@ class ChompyBird : Quest("Big Chompy Bird Hunting", 35, 34, 2, Vars.VARP_QUEST_C return@onUseWith true } - onUseWith(NPC, filledBellows, NPCs.SWAMP_TOAD_1013) {player, used, with -> + onUseWith(NPC, filledBellows, NPCs.SWAMP_TOAD_1013) {player, used, with -> val hasTooManyToads = amountInInventory(player, Items.BLOATED_TOAD_2875) >= 3 if (hasTooManyToads) { @@ -248,7 +251,7 @@ class ChompyBird : Quest("Big Chompy Bird Hunting", 35, 34, 2, Vars.VARP_QUEST_C addItem(player, filledBellows.getNext(used.id)) } addItem(player, Items.BLOATED_TOAD_2875) - runTask(player) { with.asNpc().clear() } + with.asNpc().respawnTick = GameWorld.ticks + with.asNpc().definition.getConfiguration(NPCConfigParser.RESPAWN_DELAY, 34) } } return@onUseWith true