public static string GetEquipFxName(ItemDrop.ItemData equippedItem, out FxAttachMode mode) { if (equippedItem.IsMagic(out var magicItem)) { if (magicItem.IsUniqueLegendary()) { if (!string.IsNullOrEmpty(magicItem.GetLegendaryInfo()?.EquipFx)) { mode = FxAttachMode.EquipRoot; return(magicItem.GetLegendaryInfo().EquipFx); } } else { var equipEffect = magicItem.GetFirstEquipEffect(out mode); if (!string.IsNullOrEmpty(equipEffect)) { return(equipEffect); } } } mode = FxAttachMode.None; return(null); }
public string GetFirstEquipEffect(out FxAttachMode mode) { foreach (var effect in Effects) { var effectDef = MagicItemEffectDefinitions.Get(effect.EffectType); if (effectDef != null && !string.IsNullOrEmpty(effectDef.EquipFx)) { mode = effectDef.EquipFxMode; return(effectDef.EquipFx); } } mode = FxAttachMode.None; return(null); }
private static bool OtherItemsUseThisEffect(Humanoid humanoid, string equipFx, ItemDrop.ItemData item, FxAttachMode mode) { if (humanoid == null || !humanoid.IsPlayer()) { return(false); } var player = (Player)humanoid; foreach (var equipmentItemData in player.GetEquipment()) { if (equipmentItemData == item) { continue; } if (GetEquipFxName(equipmentItemData, out var equippedItemMode) == equipFx && equippedItemMode == mode) { return(true); } } return(false); }