-
Active Member
[Ez] ItemPowerShow
This plugin show the items powers in inventory and stash or inventory only, and if you prefer, restrict it to unidentified items.
My intention is to include all powers with non-fixed values, they will be added progressively.
There is the option to hide the item powers that you don't find interesting, or also from all primals (same value) or non-ancient legendaries.
Download => Plugins\Ez\ItemPowerShow.cs
Code:
Hud.RunOnPlugin<Ez.ItemPowerShow>(plugin =>
{
plugin.ShowInLegendary = true;
plugin.ShowInAncient = true;
plugin.ShowInPrimal = true;
plugin.ShowOnUnidentifiedOnly = false;
plugin.ShowInStash = true; // Inventory and Stash or only Inventory
plugin.TextMaxValue = "Max"; // Ex: "Max". Set to null for numeric value
plugin.NumericTextMaxValue = "[{0}{1}]"; // Format for TextMaxValue when is null // {0} -> numeric value , {1| -> suffix
plugin.xPor = 0.50f; // Item pos X 0 ... 1
plugin.yPor = 0.64f; // Item pos Y 0 ... 1 // items width == height (ring,amulet,belt ..)
plugin.yPorLarge = 0.77f; // Item pos Y 0 ... 1 // items width != height
plugin.centered = true; // Center text at that position X,Y
// Hide for items:
plugin.Sno_IdPercent.Remove(ActorSnoEnum._ring_norm_unique_004); // Puzzle Ring
plugin.Sno_IdPercent.Remove(ActorSnoEnum._amulet_norm_unique_13); // Mara's Kaleidoscope
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_flail1h_norm_unique_04); // Kassar's Retribution
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_amulet_norm_unique_23); // Dovu Energy Trap
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_amulet_norm_unique_24); // Rakoff's Glass of Life
plugin.Sno_IdPercent.Remove(ActorSnoEnum._amulet_norm_unique_04); // Xephirian Amulet
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_amulet_norm_unique_25); // Halcyon's Ascent
plugin.Sno_IdPercent.Remove(ActorSnoEnum._ring_norm_unique_018); // Nagelring
plugin.Sno_IdPercent.Remove(ActorSnoEnum._axe_norm_unique_04); // Sky Splitter
plugin.Sno_IdPercent.Remove(ActorSnoEnum._bracers_norm_unique_02); // Promise of Glory
plugin.Sno_IdPercent.Remove(ActorSnoEnum._twohandedsword_norm_unique_06); // Scourge
plugin.Sno_IdPercent.Remove(ActorSnoEnum._p2_twohandedsword_norm_unique_02); // Corrupted Ashbringer
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_mace_norm_unique_11); // Solanium
plugin.Sno_IdPercent.Remove(ActorSnoEnum._amulet_norm_unique_06); // The Star of Azkaranth
plugin.Sno_IdPercent.Remove(ActorSnoEnum._barbbelt_norm_unique_03); // Thundergod's Vigor
plugin.Sno_IdPercent.Remove(ActorSnoEnum._amulet_norm_unique_10); // Talismán de Aranoch
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_amulet_norm_unique_21); // Golden Gorget of Leoric
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_belt_norm_unique_16); // Sash of Knives
plugin.Sno_IdPercent.Remove(ActorSnoEnum._boots_norm_unique_085); // Fire Walkers
plugin.Sno_IdPercent.Remove(ActorSnoEnum._twohandedmace_norm_unique_01); // Arthef's Spark of Life
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_mace_norm_unique_12); // Mad Monarch's Scepter
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_crushield_norm_unique_08); // Salvation
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_sword_norm_unique_15); // Fulminator
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_twohandedsword_norm_unique_13); // Blood Brother
plugin.Sno_IdPercent.Remove(ActorSnoEnum._p2_dagger_norm_unique_01); // Eun-jang-do
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_belt_norm_unique_19); // Harrington Waistguard
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_belt_norm_unique_18); // Cord of the Sherma
plugin.Sno_IdPercent.Remove(ActorSnoEnum._p2_ring_norm_unique_02); // Arcstone
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_twohandedsword_norm_unique_11); // Stalgard's Decimator
plugin.Sno_IdPercent.Remove(ActorSnoEnum._shoulderpads_norm_unique_02); // Death Watch Mantle
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_belt_norm_unique_15); // Razor Strop
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_helm_norm_unique_14); // Deathseer's Cowl
plugin.Sno_IdPercent.Remove(ActorSnoEnum._twohandedmace_norm_unique_07); // Schaefer's Hammer
plugin.Sno_IdPercent.Remove(ActorSnoEnum._quiver_norm_unique_01); // Augustine's Panacea
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_boots_norm_unique_04); // Irontoe Mudsputters
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_pants_norm_unique_02); // Death's Bargain
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_shield_norm_unique_15); // Coven's Criterion
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_twohandedmace_norm_unique_09); // Soulsmasher
plugin.Sno_IdPercent.Remove(ActorSnoEnum._x1_sword_norm_promo_02); // Shard of Hate
} );
Last edited by EzGo; 2 Weeks Ago at 01:30 PM.
Reason: 14 item powers added
-
Post Thanks / Like - 3 Thanks
-
Active Member
The dictionary can be used to make another plugin that selectively recycles items depending on the value of itempower.
As an example this plugin. Remove after testing, is not practical:
Plugins\User\RecycleExample.cs
If you are in town and you mouse over a Coe or a Witching Hour (inventory only) and they have itempower less than 195 or critical damage less than 48 respectively, will tell you to recycle it.
Last edited by EzGo; 04-17-2024 at 10:51 AM.
-
Member
Thank you for creating the plugin. I'm looking forward to using it, but I have a question. Is it possible to know the critical damage, critical chance, cooldown reduction, and attack speed of an item in advance, like 'item_power_passive' for unidentified items?
-
Active Member
Yes, it is possible.
In principle, the dictionary should be used to query the most important stat of an item: the item power, and in the event that an item does not have an item power, it could be used to store another stat of interest, such as the critical damage of a witching hour.
The following explanation is primarily intended for plugin developers:
The plugin includes a function not used by the plugin itself "ItemIdValue" as an example of how to get the value of any other stat: it will only query the dictionary if we don't specify an ID (the function of the dictionary is to save a main ID)
If you set DebugOn to true, and press Alt+A on an item on the ground, the values for item powers and one or more stats related to critical damage and critical chance will be displayed.
In addition, plugins\log\ItemsId.txt will save a list of all available stats and some additional data
Example: witching hour
plugin.DebugOn = true;
Alt+A
plugins\log\ItemsId.txt
To get the value of IAS, several ways:
ItemIdValue(item, "Attacks_Per_Second_Percent#1048575", percent = true); ( or ItemIdValue(item, "Attacks_Per_Second_Percent#1048575"); )
ItemIdValue(item, ias, percent = false);
Critical Damage value:
ItemIdValue(item, "Crit_Damage_Percent#1048575", percent = true); ( or ItemIdValue(item, "Crit_Damage_Percent#1048575"); )
ItemIdValue(item, "critdmg", percent = false);
An interesting fact: 1048575 the maximum positive integer value that can be represented by 2^20. On item powers, the buff sno will be used instead.
You could add the critical damage of the witching hour to the dictionary like this:
using System;
Hud.RunOnPlugin<Ez.ItemPowerShow>(plugin =>
{
plugin.Sno_IdPercent.Add(ActorSnoEnum._belt_norm_unique_07, new Tuple<string,bool,string,double>("Crit_Damage_Percent#1048575", true, "%", 50)); // item sno, <stat ID, multipliy x 100, suffix , max value>
} );
-
Post Thanks / Like - 1 Thanks
hackerlol (1 members gave Thanks to EzGo for this useful post)
-
Member
Let's take the Demon Hunter's mechanical Foldrons as an example.
Mechanical Pauldrons (Unidentified item)
--------------------------
Mechanical Pauldrons (Identified item)
---------------------------
Mechanical Foldrons (Identified item) was able to find Id: Power_Cooldown_Reduction_Percent_All#1048575, but Mechanical Foldrons (Unidentified item) was not found.
I added mechanical Foldrons in RecycleExample.cs, but Identified items worked fine, but unidentified items did not.
RecycleExample.cs
using Turbo.Plugins.Default;
using System;
using System.Linq;
using System.Collections.Generic;
namespace Turbo.Plugins.User
{
public class RecycleExample : BasePlugin, ICustomizer, IInGameTopPainter
{
public Dictionary<ActorSnoEnum, Tuple<string, bool, string, double>> ChooseAName { get; set; } = new Dictionary<ActorSnoEnum, Tuple<string, bool, string, double>>();
private int LapseAction = 0;
public RecycleExample()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
}
public void Customize()
{
// a) Option 1 => Use the original dictionary
// Hud.RunOnPlugin<Ez.ItemPowerShow>(plugin => ChooseAName = plugin.Sno_IdPercent);
// b) Option 2 => Duplicate dictionary so as not to modify the original.
Dictionary<ActorSnoEnum, Tuple<string, bool, string, double>> tmp = null;
Hud.RunOnPlugin<Ez.ItemPowerShow>(plugin => tmp = plugin.Sno_IdPercent);
if (tmp != null)
{
foreach (var data in tmp)
{
ChooseAName.Add(data.Key, data.Value);
}
}
/* ---- From here, you can add other power items to the dictionary. Actually, the dictionary is not limited to items powers, you could add the critical damage of the witching hour */
ChooseAName[ActorSnoEnum._belt_norm_unique_07] = new Tuple<string, bool, string, double>("Crit_Damage_Percent#1048575", true, "%", 50); // Add The Witching Hour to Dictionary , stat crit damage
ChooseAName[ActorSnoEnum._p69_shoulderpads_norm_set_01] = new Tuple<string, bool, string, double>("Power_Cooldown_Reduction_Percent_All#1048575", true, "%", ; // Add The mechanical Foldrons to Dictionary , stat Cooldown_Reduction
}
private double ItemIdValue(IItem item, string id = "", bool percent = true) // a) ItemIdValue(item1); => Use default ID and percentage for this item, extracted from the dictionary
{ // b) ItemIdValue(item2, id = "Item_Power_Passive#475241"); => Find the specified ID and multiply the value by 100 (default behavior)
if (id == string.Empty) // c) ItemIdValue(item3, id = "Item_Power_Passive#475241", percent = false); => Searches for the specified ID and does not multiply by 100
{ // Function return 0 if the specified ID/Stat does not exist, or double.MaxValue if the ID was omitted and the item does not exist in the dictionary
if (ChooseAName.TryGetValue(item.SnoActor.Sno, out var data))
{
id = data.Item1; percent = data.Item2; //< item.SnoActor.Sno, Tuple<STAT.Id, multiply x 100, Suffix, MaxValue> >
}
else return double.MaxValue; // queries in the Dictionary, but the item does not exist
}
var stat = item.StatList.FirstOrDefault(s => s.Id == id);
if (stat != null)
{
return Math.Round(stat.DoubleValue * (percent ? 10000 : 100)) / 100;
}
else return 0; // stat (id) not found in item
}
public void PaintTopInGame(ClipState clipState)
{
if (!Hud.Game.IsInGame || !Hud.Game.IsInTown || !Hud.Window.IsForeground) return;
if (clipState == ClipState.Inventory)
{
if (Hud.Inventory.InventoryMainUiElement.Visible && Hud.Game.CurrentGameTick > LapseAction)
{
LapseAction = Hud.Game.CurrentGameTick + 180; //3 sec.
var item = Hud.Game.Items.FirstOrDefault(x => x.Location == ItemLocation.Inventory && Hud.Inventory.GetItemRect(x).Contains(Hud.Window.CursorX, Hud.Window.CursorY));
if (item != null)
{
if (item.SnoActor.Sno == ActorSnoEnum._p2_ring_norm_unique_03)
{
var val = ItemIdValue(item);
if (val < 195)
Hud.Sound.Speak("Recycle it , the value is" + val + " , below 195 ");
}
else if (item.SnoActor.Sno == ActorSnoEnum._belt_norm_unique_07)
{
var val = ItemIdValue(item);
if (val < 4
Hud.Sound.Speak("Recycle it, the value is" + val + " , below 48 ");
}
else if (item.SnoActor.Sno == ActorSnoEnum._p69_shoulderpads_norm_set_01) //Mechanical Pauldrons
{
var val = ItemIdValue(item);
if (val <= 7)
Hud.Sound.Speak("Recycle it, the value is" + val + " , below 7 ");
}
}
}
}
}
}
}
Last edited by ljj16; 04-24-2024 at 08:34 AM.
-
Post Thanks / Like - 1 Thanks
EzGo (1 members gave Thanks to ljj16 for this useful post)
-
Active Member
You're right, many stats are not available if the item is unidentified.
in dump_items_Floor.txt they don't appear either (debug). These statistics are likely to have been intentionally hidden.
Last edited by EzGo; 04-24-2024 at 08:45 AM.