Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using Zeta;
- using Zeta.Common;
- using Zeta.CommonBot;
- using Zeta.Common.Plugins;
- using Zeta.Internals.Actors;
- namespace Unidentify
- {
- internal class Unidentify : IPlugin
- {
- private List<string> m_Blacklist = new List<string>()
- {
- };
- #region IPlugin Members
- public bool Equals(IPlugin other)
- {
- return Name == other.Name;
- }
- public string Author { get { return "Haigent feat. Ministry"; } }
- public Version Version { get { return new Version(0, 6); } }
- public string Name { get { return "LegendaryUnids"; } }
- public string Description { get { return "Keep all legendaries as unidentified"; } }
- public Window DisplayWindow { get { return null; } }
- public void OnPulse()
- {
- }
- public void OnInitialize()
- {
- }
- public void OnShutdown()
- {
- UnsubscribeEvents();
- }
- public void OnEnabled()
- {
- SubscribeEvents();
- }
- public void OnDisabled()
- {
- UnsubscribeEvents();
- }
- public void Log(string message, LogLevel level = LogLevel.Normal)
- {
- Logging.Write(level, string.Format("[{0}] {1}", Name, message));
- }
- #endregion
- #region Events
- private void SubscribeEvents()
- {
- try
- {
- GameEvents.OnItemIdentificationRequest += OnItemIdentificationRequest;
- }
- catch (Exception ex)
- {
- Log(ex.ToString());
- }
- }
- private void UnsubscribeEvents()
- {
- try
- {
- GameEvents.OnItemIdentificationRequest -= OnItemIdentificationRequest;
- }
- catch (Exception ex)
- {
- Log(ex.ToString());
- }
- }
- void OnItemIdentificationRequest(object sender, ItemIdentifyRequestEventArgs args)
- {
- ACDItem item = args.Item;
- bool keep = ShouldKeep(item);
- if (keep)
- {
- Log("Keep: " + item.ToString());
- }
- args.IgnoreIdentification = keep;
- }
- bool ShouldKeep(ACDItem item)
- {
- bool keep = false;
- keep = item.ItemQualityLevel == ItemQuality.Legendary;
- if (keep == true)
- {
- return keep;
- }
- return keep;
- }
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment