Fixed bug where swamp toads never respawned

Set a respawn_delay for swamp toad npc to 34 ticks (20 seconds)
This commit is contained in:
Byte 2022-09-11 14:08:56 +00:00 committed by Ryan
parent a2819f81e6
commit de3cf3e856
2 changed files with 6 additions and 2 deletions

View file

@ -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",

View file

@ -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