diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-06-22 23:55:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 23:55:40 +0800 |
commit | 289f4707d492aa34808891a5dab41cedd2e80c8b (patch) | |
tree | 8bffc521b51600b31b9eb753cbcb0cfd2c843a2a /features | |
parent | c184757736e0f293ad70c923f57de368646e721a (diff) | |
download | SoopyV2-289f4707d492aa34808891a5dab41cedd2e80c8b.tar.gz SoopyV2-289f4707d492aa34808891a5dab41cedd2e80c8b.tar.bz2 SoopyV2-289f4707d492aa34808891a5dab41cedd2e80c8b.zip |
few updates
- fix a bug that it sometimes hides summons after reload until u killed ur next boss (we do a lil trolling)
- added miniboss ping (on screen and sound ping separated)
- added box around miniboss (not thru wall ofc)
Diffstat (limited to 'features')
-rw-r--r-- | features/slayers/index.js | 81 |
1 files changed, 69 insertions, 12 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js index f6bb1f2..89ec4ab 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -23,6 +23,18 @@ class Slayers extends Feature { 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); + this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); + this.slayerXpElement = new HudTextElement() + .setText("&6Slayer&7> &fLoading...") + .setToggleSetting(this.slayerXpGuiElement) + .setLocationSetting(new LocationSetting("Slayer Xp Location", "Allows you to edit the location of you current slayer xp", "slayer_xp_location", this, [10, 50, 1, 1]).requires(this.slayerXpGuiElement).editTempText("&6Enderman&7> &d&l2,147,483,647 XP").contributor("EmeraldMerchant")); + this.hudElements.push(this.slayerXpElement); + + this.MinibossAlert = new ToggleSetting("Alert when miniboss spawned nearby", "Pops up notification when a miniboss spawned", false, "miniboss_title_ping", this).contributor("EmeraldMerchant"); + this.MinibossPing = new ToggleSetting("Also make a sound when miniboss spawned", "Sound ping when a miniboss spawned", false, "miniboss_sound_ping", this).requires(this.MinibossAlert).contributor("EmeraldMerchant"); + this.BoxAroundMiniboss = new ToggleSetting("Draws boxes around minibosses.", "If they are too far away it doesnt draw.", false, "box_around_miniboss", this).contributor("EmeraldMerchant"); + + this.betterHideDeadEntity = new ToggleSetting("Also hides mob nametag when it's dead.", "An improvement for Skytils's hide dead entity", false, "hide_dead_mob_nametag", this); this.boxAroundEmanBoss = new ToggleSetting("Box around enderman slayer boss", "This helps to know which boss is yours", true, "eman_box", this); this.boxToEmanBeacon = new ToggleSetting("Box and line to the enderman beacon", "This will help to find the beacon when the boss throws it", true, "eman_beacon", this); @@ -32,18 +44,9 @@ class Slayers extends Feature { this.emanHpElement = new HudTextElement().setToggleSetting(this.emanHpGuiElement).setLocationSetting(new LocationSetting("Eman Hp Location", "Allows you to edit the location of the enderman hp", "eman_location", this, [10, 50, 1, 1]).requires(this.emanHpGuiElement).editTempText("&6Enderman&7> &f&l30 Hits")); this.hudElements.push(this.emanHpElement); - this.hideSummonsForLoot = new ToggleSetting("Hides summons for 3s to see t4 voidgloom drops", "This will make loots more visible.", false, "show_loot", this).contributor("EmeraldMerchant"); + this.hideSummonsForLoot = new ToggleSetting("Hides summons for 3s to see t4 drops", "This will make loots more visible.", false, "show_loot", this).contributor("EmeraldMerchant"); this.allEmanBosses = new ToggleSetting("Hides summons for all eman bosses", "Hides summon for not just your boss, might fix ^ sometimes not working", false, "show_loot_all_bosses", this).requires(this.hideSummonsForLoot).contributor("EmeraldMerchant"); - this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); - this.slayerXpElement = new HudTextElement() - .setText("&6Slayer&7> &fLoading...") - .setToggleSetting(this.slayerXpGuiElement) - .setLocationSetting(new LocationSetting("Slayer Xp Location", "Allows you to edit the location of you current slayer xp", "slayer_xp_location", this, [10, 50, 1, 1]).requires(this.slayerXpGuiElement).editTempText("&6Enderman&7> &d&l2,147,483,647 XP").contributor("EmeraldMerchant")); - this.hudElements.push(this.slayerXpElement); - - this.betterHideDeadEntity = new ToggleSetting("Also hides mob nametag when it's dead.", "An improvement for Skytils's hide dead entity", false, "hide_dead_mob_nametag", this); - this.rcmDaeAxeSupport = new ToggleSetting("Eman Hyp hits before Dae axe swapping", "This will tell u how many clicks with hyp is needed before swapping to dae axe", true, "eman_rcm_support", this).requires(this.emanHpGuiElement).contributor("EmeraldMerchant"); this.rcmDamagePerHit = new TextSetting("Hyperion damage", "Your hyp's single hit damage w/o thunderlord/thunderbolt", "", "hyp_dmg", this, "Your hyp dmg (Unit: M)", false).requires(this.rcmDaeAxeSupport).contributor("EmeraldMerchant"); this.whenToShowHitsLeft = new TextSetting("Show hits left timing", "At how much hp should the hits left thing be visible", "", "eman_hp_left", this, "How much hp (Unit: M, enter a valid value 0-300)", false).requires(this.rcmDaeAxeSupport).contributor("EmeraldMerchant"); @@ -111,7 +114,6 @@ class Slayers extends Feature { this.registerChat("&r &r&c&lSLAYER QUEST FAILED!&r", () => { socketConnection.sendSlayerSpawnData({ loc: null }); }) - this.bossSlainMessage = false; this.bossSpawnedMessage = false; this.lastBossNotSpawnedTime = 0; @@ -130,6 +132,7 @@ class Slayers extends Feature { this.deadE = []; this.beaconLocations = {}; this.eyeE = []; + this.minibossEntity = []; this.todoE2 = []; this.emanBoss = undefined; this.actualEmanBoss = undefined @@ -142,6 +145,37 @@ class Slayers extends Feature { this.slayerLocationDataH = {} this.hasQuest = false + this.Miniboss = { + zombie: new Set(["Revenant Sycophant", "Revenant Champion", "Deformed Revenant", "Atoned Champion", "Atoned Revenant"]), + spider: new Set(["Tarantula Vermin", "Tarantula Beast", "Mutant Tarantula"]), + wolf: new Set(["Pack Enforcer", "Sven Follower", "Sven Alpha"]), + enderman: new Set(["Voidling Devotee", "Voidling Radical", "Voidcrazed Maniac"]), + blaze: new Set(["Flare Demon", "Kindleheart Demon", "Burningsoul Demon"]) + } + + this.SlayerWidth = { + zombie: 1, + spider: 2, + wolf: 1, + enderman: 1, + blaze: 1 + } + this.SlayerHeight = { + zombie: -2, + spider: -1, + wolf: -1, + enderman: -3, + blaze: -2 + } + //the volume of miniboss spawning is 0.6000000238418579 + this.registerSoundPlay("random.explode", (pos, name, vol, pitch, categoryName, event) => { + if (Math.round(10 * vol) !== 6 || Math.abs(pos.getY() - Player.getY()) > 5 || pos.getX() - Player.getX() > 20 || pos.getZ() - Player.getZ() > 20 ) return + if (!this.bossSpawnedMessage) { + if (this.MinibossAlert.getValue()) Client.showTitle("&c&lMiniBoss", "", 0, 20, 10); + if (this.MinibossPing.getValue()) World.playSound('random.orb', 1, 1); + } + }) + this.entityAttackEventLoaded = false; this.entityAttackEventE = undefined; this.renderEntityEvent = this.registerEvent("renderEntity", this.renderEntity); @@ -170,6 +204,7 @@ class Slayers extends Feature { this.todoE2 = []; this.beaconLocations = {}; this.eyeE = []; + this.minibossEntity = []; this.emanBoss = undefined; this.actualEmanBoss = undefined; this.hideSummons = false @@ -199,6 +234,13 @@ class Slayers extends Feature { } } renderWorld(ticks) { + this.minibossEntity.forEach((x) => { + let e = x[0] + let slayerType = x[1] + let mobName = `${e.getName().removeFormatting().split(" ")[0]} ${e.getName().removeFormatting().split(" ")[1]}` + drawBoxAtEntity(e, 0, 255, 0, this.SlayerWidth[slayerType], this.SlayerHeight[slayerType], ticks, 4, false); + }) + if (this.emanBoss && this.boxAroundEmanBoss.getValue()) drawBoxAtEntity(this.emanBoss, 0, 255, 0, 1, -3, ticks, 4, false); if (this.emanBoss && this.emanStartedSittingTime > 0 && this.emanLazerTimer.getValue()) { @@ -321,6 +363,15 @@ class Slayers extends Feature { //only runs when t4's hp is <= 3m if (emanHealth.includes("k") || (emanHealth.includes("M") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { this.hideSummons = true + } else this.hideSummons = false + } + } + + if (!this.bossSpawnedMessage && e instanceof net.minecraft.entity.item.EntityArmorStand) { + let mobName = `${e[m.getCustomNameTag]().removeFormatting().split(" ")[0]} ${e[m.getCustomNameTag]().removeFormatting().split(" ")[1]}` + if (this.Miniboss[this.lastSlayerType].has(mobName)) { + if (this.BoxAroundMiniboss.getValue()) { + this.minibossEntity.push([new Entity(e), this.lastSlayerType]); } } } @@ -356,6 +407,11 @@ class Slayers extends Feature { this.emanBoss = undefined this.actualEmanBoss = undefined } + this.minibossEntity.forEach((eArray) => { + if (eArray[0].getEntity()[f.isDead]) { + this.minibossEntity.splice(this.minibossEntity.indexOf(eArray)) + } + }) this.eyeE = this.eyeE.filter((e) => !e.getEntity()[f.isDead]); this.beaconE = this.beaconE.filter((e) => { if (e[f.isDead]) { @@ -448,7 +504,7 @@ class Slayers extends Feature { //only runs when t4's hp is <= 3m if (emanHealth.includes("k") || (emanHealth.includes("M") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { this.hideSummons = true - } + } else this.hideSummons = false if (this.rcmDaeAxeSupport.getValue()) { if (emanHealth.includes("k")) { emanText += " &c0 Hits" @@ -624,6 +680,7 @@ class Slayers extends Feature { this.actualEmanBoss = undefined this.emanStartedSittingTime = undefined this.eyeE = undefined; + this.minibossEntity = undefined; this.nextIsBoss = undefined; this.hudElements = []; this.entityAttackEventLoaded = undefined; |