PvP nameplates: correct GC icons (62601/62602/62603), configurable GC IDs, Role/Job icon for enemy players

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-01-31 22:40:28 -05:00
parent 11b4c268f0
commit 80f45f5a31
7 changed files with 275 additions and 42 deletions
+21
View File
@@ -94,6 +94,27 @@ namespace HSUI.Helpers
return plateType >= 4 && plateType <= 11;
}
/// <summary>Returns Grand Company icon ID (Maelstrom, Flames, or Adders) for enemy players in PvP Frontline.
/// Nameplate color types 4, 5, 6 map to the three teams. Returns null when not a PvP enemy team (46).
/// Use iconOverrides for custom IDs: [0]=team1(plate4), [1]=team2(plate5), [2]=team3(plate6). Non-zero overrides default.</summary>
public static unsafe uint? GrandCompanyIconIdForPvPEnemy(IGameObject? obj, (int t1, int t2, int t3)? iconOverrides = null)
{
if (obj == null || !Plugin.ClientState.IsPvP) return null;
StructsGameObject* gameObject = (StructsGameObject*)obj.Address;
byte plateType = gameObject->GetNamePlateColorType();
if (plateType < 4 || plateType > 6) return null;
// 62601=Maelstrom, 62602=Twin Adder, 62603=Immortal Flames
uint iconId = plateType switch
{
4 => iconOverrides.HasValue && iconOverrides.Value.t1 > 0 ? (uint)iconOverrides.Value.t1 : 62601u,
5 => iconOverrides.HasValue && iconOverrides.Value.t2 > 0 ? (uint)iconOverrides.Value.t2 : 62602u,
6 => iconOverrides.HasValue && iconOverrides.Value.t3 > 0 ? (uint)iconOverrides.Value.t3 : 62603u,
_ => 0
};
return iconId > 0 ? iconId : null;
}
public static unsafe float ActorShieldValue(IGameObject? actor)
{
if (actor == null || actor is not ICharacter)