Skip to content

Instantly share code, notes, and snippets.

@evan6944
Created August 25, 2018 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evan6944/8fb0441c0e6ddf017dd93557e7129287 to your computer and use it in GitHub Desktop.
Save evan6944/8fb0441c0e6ddf017dd93557e7129287 to your computer and use it in GitHub Desktop.
Says RG's name when it spawns
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