Skip to content

Commit a716497

Browse files
fix: (Extras.cs) Added Penumbrea weapon check
1 parent 571a200 commit a716497

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

ScriptConditions/Extras.cs

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using System.Collections.Generic;
2+
using System.Linq;
23
using System.Threading.Tasks;
34
using ff14bot;
45
using ff14bot.Directors;
@@ -377,5 +378,49 @@ public static bool IsInNPCParty()
377378
{
378379
return PartyManager.VisibleMembers.Any(i => i.GetType() == typeof(TrustPartyMember));
379380
}
381+
382+
private static readonly Dictionary<ClassJobType, uint> PenumbraeWeaponIds =
383+
new Dictionary<ClassJobType, uint>
384+
{
385+
{ ClassJobType.Paladin, 47869 },
386+
{ ClassJobType.Monk, 47870 },
387+
{ ClassJobType.Warrior, 47871 },
388+
{ ClassJobType.Dragoon, 47872 },
389+
{ ClassJobType.Bard, 47873 },
390+
{ ClassJobType.WhiteMage, 47874 },
391+
{ ClassJobType.BlackMage, 47875 },
392+
{ ClassJobType.Summoner, 47876 },
393+
{ ClassJobType.Scholar, 47877 },
394+
{ ClassJobType.Ninja, 47878 },
395+
{ ClassJobType.DarkKnight, 47879 },
396+
{ ClassJobType.Machinist, 47880 },
397+
{ ClassJobType.Astrologian, 47881 },
398+
{ ClassJobType.Samurai, 47882 },
399+
{ ClassJobType.RedMage, 47883 },
400+
{ ClassJobType.Gunbreaker, 47884 },
401+
{ ClassJobType.Dancer, 47885 },
402+
{ ClassJobType.Reaper, 47886 },
403+
{ ClassJobType.Sage, 47887 },
404+
{ ClassJobType.Viper, 47888 },
405+
{ ClassJobType.Pictomancer, 47889 },
406+
};
407+
408+
public static bool IsPenumbraeWeaponEquipped()
409+
{
410+
ClassJobType currentJob = Core.Me.CurrentJob;
411+
412+
if (!PenumbraeWeaponIds.TryGetValue(currentJob, out uint expectedItemId))
413+
return false;
414+
415+
var mainHand =
416+
InventoryManager
417+
.GetBagByInventoryBagId(InventoryBagId.EquippedItems)
418+
[EquipmentSlot.MainHand];
419+
420+
if (mainHand == null)
421+
return false;
422+
423+
return mainHand.RawItemId == expectedItemId;
424+
}
380425
}
381426
}

0 commit comments

Comments
 (0)