diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/cosmetics/cosmetic/dragon/dragonWings.js | 7 | ||||
-rw-r--r-- | features/cosmetics/index.js | 22 | ||||
-rw-r--r-- | features/slayers/index.js | 13 |
3 files changed, 24 insertions, 18 deletions
diff --git a/features/cosmetics/cosmetic/dragon/dragonWings.js b/features/cosmetics/cosmetic/dragon/dragonWings.js index 8638b93..a5b76d8 100644 --- a/features/cosmetics/cosmetic/dragon/dragonWings.js +++ b/features/cosmetics/cosmetic/dragon/dragonWings.js @@ -291,12 +291,17 @@ class DragonWings extends Cosmetic { if(wingCosmetic !== null){ this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{ b.isHidden = true + this.parent.hiddenCosmetics.push(b) }) }else{ let fullBodyCosmetic = this.player.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.FULL_BODY) if(fullBodyCosmetic === "DRAGON_ONESIE_2"){ this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{ - if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1")b.isHidden = true + if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1"){ + b.isHidden = true + + this.parent.hiddenCosmetics.push(b) + } }) } } diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js index d519351..4fb1242 100644 --- a/features/cosmetics/index.js +++ b/features/cosmetics/index.js @@ -17,6 +17,8 @@ class Cosmetics extends Feature { this.uuidToCosmetic = {} this.cosmeticsData = {} + + this.hiddenCosmetics = [] this.playerHasACosmeticA = false @@ -157,23 +159,10 @@ class Cosmetics extends Feature { } restoreEssentialCosmetics(){ - World.getAllPlayers().forEach(p=>{ - if(!p.getPlayer().getEssentialCosmetics()) return - - let wingCosmetic = p.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.WINGS) - if(wingCosmetic !== null){ - p.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{ - b.isHidden = false - }) - }else{ - let fullBodyCosmetic = p.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.FULL_BODY) - if(fullBodyCosmetic === "DRAGON_ONESIE_2"){ - p.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{ - if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1")b.isHidden = false - }) - } - } + this.hiddenCosmetics.forEach(cosmetic=>{ + cosmetic.isHidden = false }) + this.hiddenCosmetics = [] } renderWorld(ticks){ @@ -187,6 +176,7 @@ class Cosmetics extends Feature { this.uuidToCosmetic = undefined this.playerHasACosmeticA = undefined this.cosmeticsData = undefined + this.hiddenCosmetics = undefined } onDisable(){ diff --git a/features/slayers/index.js b/features/slayers/index.js index 8d35304..8617a60 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -15,7 +15,7 @@ class Slayers extends Feature { onEnable(){ this.initVariables() - this.expOnKill = new ToggleSetting("Show slayer exp on boss kill", "Says your slayer exp in chat when you kill a boss", true, "slayer_xp", this) + this.expOnKill = new ToggleSetting("Show slayer exp on boss kill", "Says your slayer exp in chat when you kill a boss, also says time taken to spawn+kill", true, "slayer_xp", this) this.slainAlert = new ToggleSetting("Show boss slain alert", "This helps you to not kill mobs for ages with an inactive quest", true, "boss_slain_alert", this) this.spawnAlert = new ToggleSetting("Show boss spawned alert", "This helps you to not miss your boss when you spawn it", true, "boss_spawn_alert", this) @@ -38,6 +38,7 @@ class Slayers extends Feature { this.lastSlayerType = "" this.lastSlayerExp = 0 + this.lastBossSlain = 0 this.registerChat("&r &r&a&lSLAYER QUEST COMPLETE!&r",(e)=>{ this.slayerExp[this.lastSlayerType] = this.lastSlayerExp + (this.slayerExp[this.lastSlayerType] || 0) if(this.expOnKill.getValue()){ @@ -45,7 +46,9 @@ class Slayers extends Feature { ChatLib.chat("&r &r&a&lSLAYER QUEST COMPLETE!&r") ChatLib.chat("&r &r&aYou have &d" + numberWithCommas(this.slayerExp[this.lastSlayerType]) + " " + this.lastSlayerType + " XP&r&7!&r") ChatLib.chat("&r &r&aYou have &d" + numberWithCommas(Object.values(this.slayerExp).reduce((a, t)=>t+a, 0)) + " total XP&r&7!&r") + if(Date-now()-this.lastBossSlain < 60000*5) ChatLib.chat("&r &r&aBoss took &d" + timeNumber((Date-now()-this.lastBossSlain)) + " to spawn and kill&r&7!&r") } + this.lastBossSlain = Date.now() }) this.bossSlainMessage = false @@ -374,4 +377,12 @@ class Slayers extends Feature { module.exports = { class: new Slayers() +} + +function timeNumber(time){ + let mins = Math.floor(time/1000/60) + let secs = Math.floor(time/1000)%60 + + if(mins === 0) return secs + "s" + return `${mins}m ${secs}s` }
\ No newline at end of file |