Skip to content

Commit 8c15518

Browse files
feat: Added script conditions for Umbrea and Obscurum weapons
1 parent 10b3cb1 commit 8c15518

File tree

1 file changed

+92
-4
lines changed

1 file changed

+92
-4
lines changed

ScriptConditions/Extras.cs

Lines changed: 92 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static bool IsAimingClass()
197197
return Core.Me.CurrentJob switch
198198
{
199199
ClassJobType.Archer or ClassJobType.Bard or ClassJobType.Dancer or ClassJobType.Machinist => true,
200-
_ => false
200+
_ => false
201201
};
202202
}
203203

@@ -244,7 +244,7 @@ public static bool IsDiscipleofWarClass()
244244
{
245245
ClassJobType.Pugilist or ClassJobType.Monk or ClassJobType.Lancer or ClassJobType.Dragoon or ClassJobType.Samurai or ClassJobType.Rogue or ClassJobType.Ninja or ClassJobType.Archer or ClassJobType.Bard or ClassJobType.Dancer or ClassJobType.Machinist or ClassJobType.Marauder or ClassJobType.Warrior or ClassJobType.Gladiator or ClassJobType.Paladin or ClassJobType.Gunbreaker or ClassJobType.DarkKnight or ClassJobType.Reaper
246246
#if RB_DT
247-
or ClassJobType.Viper
247+
or ClassJobType.Viper
248248
#endif
249249
=> true,
250250
_ => false
@@ -257,7 +257,7 @@ public static bool IsDiscipleofMagicClass()
257257
{
258258
ClassJobType.Arcanist or ClassJobType.Summoner or ClassJobType.Thaumaturge or ClassJobType.BlackMage or ClassJobType.RedMage or ClassJobType.BlueMage or ClassJobType.Scholar or ClassJobType.Conjurer or ClassJobType.WhiteMage or ClassJobType.Astrologian or ClassJobType.Sage
259259
#if RB_DT
260-
or ClassJobType.Pictomancer
260+
or ClassJobType.Pictomancer
261261
#endif
262262
=> true,
263263
_ => false
@@ -293,11 +293,11 @@ public static bool IsNearShortcut(int npcId)
293293
return false;
294294
}
295295

296-
297296
public static bool IsGlobalClient()
298297
{
299298
return OffsetManager.ActiveRegion == ClientRegion.Global;
300299
}
300+
301301
public static bool IsTCClient()
302302
{
303303
return OffsetManager.ActiveRegion == ClientRegion.TraditionalChinese;
@@ -405,6 +405,58 @@ public static bool IsInNPCParty()
405405
{ ClassJobType.Pictomancer, 47889 },
406406
};
407407

408+
private static readonly Dictionary<ClassJobType, uint> UmbreaWeaponIds =
409+
new Dictionary<ClassJobType, uint>
410+
{
411+
{ ClassJobType.Paladin, 47006 },
412+
{ ClassJobType.Monk, 47007 },
413+
{ ClassJobType.Warrior, 47008 },
414+
{ ClassJobType.Dragoon, 47009 },
415+
{ ClassJobType.Bard, 47010 },
416+
{ ClassJobType.WhiteMage, 47011 },
417+
{ ClassJobType.BlackMage, 47012 },
418+
{ ClassJobType.Summoner, 47013 },
419+
{ ClassJobType.Scholar, 47014 },
420+
{ ClassJobType.Ninja, 47015 },
421+
{ ClassJobType.DarkKnight, 47016 },
422+
{ ClassJobType.Machinist, 47017 },
423+
{ ClassJobType.Astrologian, 47018 },
424+
{ ClassJobType.Samurai, 47019 },
425+
{ ClassJobType.RedMage, 47020 },
426+
{ ClassJobType.Gunbreaker, 47021 },
427+
{ ClassJobType.Dancer, 47022 },
428+
{ ClassJobType.Reaper, 47023 },
429+
{ ClassJobType.Sage, 47024 },
430+
{ ClassJobType.Viper, 47025 },
431+
{ ClassJobType.Pictomancer, 47026 },
432+
};
433+
434+
private static readonly Dictionary<ClassJobType, uint> ObscurumWeaponIds =
435+
new Dictionary<ClassJobType, uint>
436+
{
437+
{ ClassJobType.Paladin, 50032 },
438+
{ ClassJobType.Monk, 50033 },
439+
{ ClassJobType.Warrior, 50034 },
440+
{ ClassJobType.Dragoon, 50035 },
441+
{ ClassJobType.Bard, 50036 },
442+
{ ClassJobType.WhiteMage, 50037 },
443+
{ ClassJobType.BlackMage, 50038 },
444+
{ ClassJobType.Summoner, 50039 },
445+
{ ClassJobType.Scholar, 50040 },
446+
{ ClassJobType.Ninja, 50041 },
447+
{ ClassJobType.DarkKnight, 50042 },
448+
{ ClassJobType.Machinist, 50043 },
449+
{ ClassJobType.Astrologian, 50044 },
450+
{ ClassJobType.Samurai, 50045 },
451+
{ ClassJobType.RedMage, 50046 },
452+
{ ClassJobType.Gunbreaker, 50047 },
453+
{ ClassJobType.Dancer, 50048 },
454+
{ ClassJobType.Reaper, 50049 },
455+
{ ClassJobType.Sage, 50050 },
456+
{ ClassJobType.Viper, 50051 },
457+
{ ClassJobType.Pictomancer, 50052 },
458+
};
459+
408460
public static bool IsPenumbraeWeaponEquipped()
409461
{
410462
ClassJobType currentJob = Core.Me.CurrentJob;
@@ -422,5 +474,41 @@ public static bool IsPenumbraeWeaponEquipped()
422474

423475
return mainHand.RawItemId == expectedItemId;
424476
}
477+
478+
public static bool IsUmbraeWeaponEquipped()
479+
{
480+
ClassJobType currentJob = Core.Me.CurrentJob;
481+
482+
if (!UmbreaWeaponIds.TryGetValue(currentJob, out uint expectedItemId))
483+
return false;
484+
485+
var mainHand =
486+
InventoryManager
487+
.GetBagByInventoryBagId(InventoryBagId.EquippedItems)
488+
[EquipmentSlot.MainHand];
489+
490+
if (mainHand == null)
491+
return false;
492+
493+
return mainHand.RawItemId == expectedItemId;
494+
}
495+
496+
public static bool IsObscurumWeaponEquipped()
497+
{
498+
ClassJobType currentJob = Core.Me.CurrentJob;
499+
500+
if (!ObscurumWeaponIds.TryGetValue(currentJob, out uint expectedItemId))
501+
return false;
502+
503+
var mainHand =
504+
InventoryManager
505+
.GetBagByInventoryBagId(InventoryBagId.EquippedItems)
506+
[EquipmentSlot.MainHand];
507+
508+
if (mainHand == null)
509+
return false;
510+
511+
return mainHand.RawItemId == expectedItemId;
512+
}
425513
}
426514
}

0 commit comments

Comments
 (0)