Im using this plugin and it works great but i have a little problem, he keeps for me every unid legends and amus but rings only +62ilvl.
Can somebody help me to do that he will kep also rings 60 and 61 ilvl ?
Can somebody help me to do that he will kep also rings 60 and 61 ilvl ?
PHP:
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>()
{
/*Jewelry */
"Ring",
"Amulet",
};
#region IPlugin Members
public bool Equals(IPlugin other)
{
return Name == other.Name;
}
public string Author { get { return "haigent - Edited by DVDA"; } }
public Version Version { get { return new Version(0, 6); } }
public string Name { get { return "Unidentify"; } }
public string Description { get { return "Keep Jewelry and Legendary Items 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(), LogLevel.Verbose);
}
args.IgnoreIdentification = keep;
}
bool ShouldKeep(ACDItem item)
{
bool keep = false;
// compatibility layer
// In config table or Legendary
keep = m_Blacklist.Any(b => item.Name.Contains(b)) ||
item.ItemQualityLevel == ItemQuality.Legendary;
// Jewelry > 60 ival
if (item.ItemBaseType == ItemBaseType.Jewelry && item.Level < 60)
{
keep = false;
}
if (keep == true)
{
return keep;
}
// i18n fallback
if (keep == false)
{
// Keep 62 ilvl Jewelry
if (item.Level == 62 && item.ItemBaseType == ItemBaseType.Jewelry)
{
keep = true;
}
}
return keep;
}
#endregion
}
}