Skillcape dailies reset with other dailies at midnight server time
This commit is contained in:
@@ -82,7 +82,7 @@ class StarSpriteDialogue(player: Player? = null) : core.game.dialogue.DialoguePl
|
|||||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
when (stage) {
|
when (stage) {
|
||||||
0 -> {
|
0 -> {
|
||||||
npc("I'm a star sprite! I Was in my star in the sky, when it", "lost control and crashed into the ground. With half my", "star sticking into the ground, I became stuck.", "Fortunately, I was mined out by the kind creatures of")
|
npc("I'm a star sprite! I was in my star in the sky, when it", "lost control and crashed into the ground. With half my", "star sticking into the ground, I became stuck.", "Fortunately, I was mined out by the kind creatures of")
|
||||||
stage++
|
stage++
|
||||||
}
|
}
|
||||||
1 -> {
|
1 -> {
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ import core.game.world.map.zone.impl.DarkZone
|
|||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
import content.global.skill.farming.*
|
import content.global.skill.farming.*
|
||||||
|
import core.ServerStore
|
||||||
|
import core.ServerStore.Companion.getBoolean
|
||||||
|
import core.ServerStore.Companion.getInt
|
||||||
import core.api.*
|
import core.api.*
|
||||||
import core.cache.def.impl.ItemDefinition
|
import core.cache.def.impl.ItemDefinition
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
@@ -29,28 +32,30 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
|
|||||||
DAMAGE_SPONG("cape_perks:damage-sponge"),
|
DAMAGE_SPONG("cape_perks:damage-sponge"),
|
||||||
MARATHON_RUNNER("cape_perks:marathon-runner"),
|
MARATHON_RUNNER("cape_perks:marathon-runner"),
|
||||||
LIBRARIAN_MAGUS("cape_perks:librarian-magus",{player ->
|
LIBRARIAN_MAGUS("cape_perks:librarian-magus",{player ->
|
||||||
val time = player.getAttribute("cape_perks:librarian-magus-timer",0L)
|
val store = ServerStore.getArchive("daily-librarian-magus")
|
||||||
if(player.getAttribute("cape_perks:librarian-magus-charges",2) > 0 || System.currentTimeMillis() > time){
|
val used = store.getInt(player.name,0)
|
||||||
if(System.currentTimeMillis() > time) player.setAttribute("/save:cape_perks:librarian-magus-charges",3)
|
if (used >= 3) {
|
||||||
|
player.dialogueInterpreter.sendDialogue("Your cape is still on cooldown.")
|
||||||
|
} else {
|
||||||
player.dialogueInterpreter.open(509871234)
|
player.dialogueInterpreter.open(509871234)
|
||||||
if(System.currentTimeMillis() > time)
|
store[player.name] = used + 1
|
||||||
player.setAttribute("/save:cape_perks:librarian-magus-timer",System.currentTimeMillis() + java.util.concurrent.TimeUnit.DAYS.toMillis(1))
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
ABYSS_WARPING("cape_perks:abyss_warp",{player ->
|
ABYSS_WARPING("cape_perks:abyss_warp",{player ->
|
||||||
val time = player.getAttribute("cape_perks:abyssal_warp_timer",0L)
|
val store = ServerStore.getArchive("daily-abyss-warp")
|
||||||
if(player.getAttribute("cape_perks:abyssal_warp",3) > 0 || System.currentTimeMillis() > time){
|
val used = store.getInt(player.name,0)
|
||||||
if(System.currentTimeMillis() > time) player.setAttribute("/save:cape_perks:abyssal_warp",3)
|
if (used >= 3) {
|
||||||
player.dialogueInterpreter.open(509871233)
|
player.dialogueInterpreter.sendDialogue("Your cape is still on cooldown.")
|
||||||
if(System.currentTimeMillis() > time)
|
|
||||||
player.setAttribute("/save:cape_perks:abyssal_warp_timer",System.currentTimeMillis() + java.util.concurrent.TimeUnit.DAYS.toMillis(1))
|
|
||||||
} else {
|
} else {
|
||||||
player.dialogueInterpreter.sendDialogue("Your cape is still on cooldown.","Ready in " + java.util.concurrent.TimeUnit.MILLISECONDS.toMinutes(time - System.currentTimeMillis()) + " minutes.")
|
player.dialogueInterpreter.open(509871233)
|
||||||
|
store[player.name] = used + 1
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
SEED_ATTRACTION("cape_perks:seed_attract",{player ->
|
SEED_ATTRACTION("cape_perks:seed_attract",{player ->
|
||||||
val time = player.getAttribute("cape_perks:seed_attract_timer",0L)
|
val store = ServerStore.getArchive("daily-seed-attract")
|
||||||
if(System.currentTimeMillis() > time){
|
if (store.getBoolean(player.name)) {
|
||||||
|
player.dialogueInterpreter.sendDialogue("Your cape is still on cooldown.")
|
||||||
|
} else {
|
||||||
val possibleSeeds = Plantable.values()
|
val possibleSeeds = Plantable.values()
|
||||||
for(i in 0 until 10){
|
for(i in 0 until 10){
|
||||||
var seed = possibleSeeds.random()
|
var seed = possibleSeeds.random()
|
||||||
@@ -63,9 +68,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.dialogueInterpreter.sendDialogue("You pluck off the seeds that were stuck to your cape.")
|
player.dialogueInterpreter.sendDialogue("You pluck off the seeds that were stuck to your cape.")
|
||||||
player.setAttribute("/save:cape_perks:seed_attract_timer",System.currentTimeMillis() + java.util.concurrent.TimeUnit.DAYS.toMillis(1))
|
store[player.name] = true
|
||||||
} else {
|
|
||||||
player.dialogueInterpreter.sendDialogue("Your cape is still on cooldown.","Ready in " + java.util.concurrent.TimeUnit.MILLISECONDS.toMinutes(time - System.currentTimeMillis()) + " minutes.")
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
TRICKS_OF_THE_TRADE("cape_perks:tott",{player ->
|
TRICKS_OF_THE_TRADE("cape_perks:tott",{player ->
|
||||||
|
|||||||
Reference in New Issue
Block a user