Advertisement
s4000

DAV_EnmityPortal

Sep 26th, 2023
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.40 KB | Gaming | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using Turbo.Plugins.Default;
  4.  
  5. namespace Turbo.Plugins.DAV {
  6.  
  7.     public class DAV_EnmityPortal : BasePlugin, IPortalFoundHandler {
  8.         public string SpeakMessage { get; set; } = "Enmity Portal Found";
  9.  
  10.         private List<ActorSnoEnum> enmityList { get; set; } = new List<ActorSnoEnum> {
  11.             ActorSnoEnum._p76_portal_oldtristram_seasontheme,
  12.             ActorSnoEnum._p76_portal_newtristram_seasontheme,
  13.             ActorSnoEnum._p76_portal_graveyardact1_seasontheme,
  14.             ActorSnoEnum._p76_portal_bloodpit_seasontheme,
  15.             ActorSnoEnum._p76_portal_moors_sacrifice_seasontheme,
  16.             ActorSnoEnum._p76_portal_boneyard_seasontheme,
  17.             ActorSnoEnum._p76_portal_church_seasontheme,
  18.             ActorSnoEnum._p76_portal_alcarnus_seasontheme,
  19.             ActorSnoEnum._p76_portal_sescheron_seasontheme,
  20.             ActorSnoEnum._p76_portal_foresttower_seasontheme,
  21.             ActorSnoEnum._p76_portal_bog_seasontheme,
  22.             ActorSnoEnum._p76_portal_gideonscourt_seasontheme,
  23.             ActorSnoEnum._p76_portal_spire_seasontheme,
  24.             ActorSnoEnum._p76_portal_hell_seasontheme,
  25.             ActorSnoEnum._p76_portal_ram_seasontheme,
  26.         };
  27.  
  28.         public DAV_EnmityPortal() {
  29.             Enabled = true;
  30.         }
  31.  
  32.         public void OnPortalFound(IPortal portal) {
  33.             if (Hud.Game.IsInTown || Hud.Game.Me.SnoArea?.Code?.StartsWith("p76") == true) return;
  34.  
  35.             if (portal.SnoActor != null && enmityList.Contains(portal.SnoActor.Sno))
  36.                 Hud.Sound.Speak(SpeakMessage);
  37.         }
  38.     }
  39. }
Tags: d3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement