diff --git a/Server/src/main/content/global/skill/summoning/pet/IncubatorHandler.kt b/Server/src/main/content/global/skill/summoning/pet/IncubatorHandler.kt index 79ef7c12d..edb11ca18 100644 --- a/Server/src/main/content/global/skill/summoning/pet/IncubatorHandler.kt +++ b/Server/src/main/content/global/skill/summoning/pet/IncubatorHandler.kt @@ -1,11 +1,8 @@ package content.global.skill.summoning.pet import core.api.* -import core.cache.def.impl.SceneryDefinition import core.game.node.Node import core.game.node.entity.player.Player -import core.game.node.entity.skill.Skills -import core.game.node.item.GroundItemManager import core.game.interaction.* import core.tools.StringUtils diff --git a/Server/src/main/content/global/skill/summoning/pet/IncubatorTimer.kt b/Server/src/main/content/global/skill/summoning/pet/IncubatorTimer.kt index 6395a79eb..899deee2a 100644 --- a/Server/src/main/content/global/skill/summoning/pet/IncubatorTimer.kt +++ b/Server/src/main/content/global/skill/summoning/pet/IncubatorTimer.kt @@ -42,6 +42,13 @@ class IncubatorTimer : PersistTimer (500, "incubation") { root["eggs"] = arr } + override fun onRegister(entity: Entity) { + if (entity !is Player) return + for ((region, _) in incubatingEggs) { + setVarbit(entity.asPlayer(), varbitForRegion(region), 1, true) + } + } + override fun run (entity: Entity) : Boolean { if (entity !is Player) return false for ((_, egg) in incubatingEggs) { @@ -60,14 +67,14 @@ class IncubatorTimer : PersistTimer (500, "incubation") { } companion object { - val TAVERLY_REGION = 11573 - val TAVERLY_VARBIT = 4277 + val TAVERLEY_REGION = 11573 + val TAVERLEY_VARBIT = 4277 val YANILLE_REGION = 10288 val YANILLE_VARBIT = 4221 fun varbitForRegion (region: Int) : Int { return when (region) { - TAVERLY_REGION -> TAVERLY_VARBIT + TAVERLEY_REGION -> TAVERLEY_VARBIT YANILLE_REGION -> YANILLE_VARBIT else -> -1 }