Created
August 25, 2018 01:20
-
-
Save evan6944/8fb0441c0e6ddf017dd93557e7129287 to your computer and use it in GitHub Desktop.
Says RG's name when it spawns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using System; | |
using System.Collections.Generic; | |
using Turbo.Plugins.Default; | |
//written in response to Csavo's request at https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-support/624252-text-speech-boss-spawns.html | |
namespace Turbo.Plugins.User | |
{ | |
public class SpeakGuardianPlugin : BasePlugin, IInGameWorldPainter | |
{ | |
public SpeakGuardianPlugin() | |
{ | |
Enabled = true; | |
} | |
public override void Load(IController hud) | |
{ | |
base.Load(hud); | |
} | |
public void PaintWorld(WorldLayer layer) | |
{ | |
var mobs = Hud.Game.AliveMonsters; | |
foreach (var mob in mobs) | |
{ | |
if (mob.Rarity == ActorRarity.Boss) | |
{ | |
if ((mob.LastSpeak == null) && (Hud.Sound.LastSpeak.TimerTest(5000))) | |
{ | |
Hud.Sound.Speak(mob.SnoActor.NameLocalized + " has sponned"); //250818 change this to "has spawned" if you like to, but this sounds better IMO | |
mob.LastSpeak = Hud.Time.CreateAndStartWatch(); | |
mob.LastSpeak.Restart(); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment