public void Paint(IActor actor, IWorldCoordinate coord, string text)
        {
            if (!Enabled)
            {
                return;
            }
            if (actor == null)
            {
                return;
            }

            SoundAlertManagerPlugin.Register <T>(actor, SoundAlert);
        }
        public void AfterCollect()
        {
            if (!Hud.Game.IsInGame)
            {
                return;
            }
            if (Hud.Game.IsInTown)
            {
                return;
            }

            // TODO : greed & whyrmshire portals
            //408679	MarkerLocation_GoblinPortalIn
            // 393030	p1_Greed_Portal
            // 405750	p1_Greed_PortalMonsterSummon	Invisible portal summoner
            //408679	MarkerLocation_GoblinPortalIn

            //var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin && x.GetData<SoundAlert<IMonster>>() == null && x.SnoActor.Sno != 410572 && x.SnoActor.Sno != 410574);
            var goblins = Hud.Game.AliveMonsters.Where(x => SnoMapping.ContainsKey(x.SnoMonster.Sno) && x.GetData <SoundAlert <IMonster> >() == null);

            //Says.Debug(string.Join(" ", goblins.Select(g => g.SnoMonster.Sno)));
            if (goblins.Count() > 1)
            {
                if (!lastPack.IsRunning || lastPack.TimerTest(180000)) // 3 minutes
                {
                    lastPack.Restart();
                    SoundAlertManagerPlugin.Register <IMonster>(goblins.First(), GoblinPack);
                }
            }
            else
            {
                foreach (var goblin in goblins)
                {
                    SoundAlert <IMonster> soundAlert;
                    if (!SnoMapping.TryGetValue(goblin.SnoActor.Sno, out soundAlert))
                    {
                        soundAlert = DefaultGoblin;
                    }
                    SoundAlertManagerPlugin.Register <IMonster>(goblin, soundAlert);
                }
            }
        }
示例#3
0
 private void MarkSoundAlert(IItem item)
 {
     SoundAlertManagerPlugin.Register <IItem>(item, SoundAlert);
 }