public static bool SetupVisEquipment_Prefix(Humanoid __instance, VisEquipment visEq, bool isRagdoll) { if (!isRagdoll) { visEq.SetLeftItem(__instance.m_leftItem != null ? __instance.m_leftItem?.m_dropPrefab?.name : "", __instance.m_leftItem?.m_variant ?? 0); visEq.SetRightItem(__instance.m_rightItem != null ? __instance.m_rightItem?.m_dropPrefab?.name : ""); if (__instance.IsPlayer()) { visEq.SetLeftBackItem(__instance.m_hiddenLeftItem != null ? __instance.m_hiddenLeftItem.m_dropPrefab?.name : "", __instance.m_hiddenLeftItem?.m_variant ?? 0); visEq.SetRightBackItem(__instance.m_hiddenRightItem != null ? __instance.m_hiddenRightItem.m_dropPrefab?.name : ""); } } visEq.SetChestItem(__instance.m_chestItem != null ? __instance.m_chestItem?.m_dropPrefab?.name : ""); visEq.SetLegItem(__instance.m_legItem != null ? __instance.m_legItem?.m_dropPrefab?.name : ""); visEq.SetHelmetItem(__instance.m_helmetItem != null ? __instance.m_helmetItem?.m_dropPrefab?.name : ""); visEq.SetShoulderItem(__instance.m_shoulderItem != null ? __instance.m_shoulderItem?.m_dropPrefab?.name : "", __instance.m_shoulderItem?.m_variant ?? 0); visEq.SetUtilityItem(__instance.m_utilityItem != null ? __instance.m_utilityItem?.m_dropPrefab?.name : ""); if (!__instance.IsPlayer()) { return(false); } visEq.SetBeardItem(__instance.m_beardItem); visEq.SetHairItem(__instance.m_hairItem); return(false); }
static bool Prefix(ItemDrop.ItemData item, ref ItemDrop.ItemData ___m_rightItem, ref ZNetView ___m_nview, ref VisEquipment ___m_visEquipment) { if (!___m_nview.IsValid() || !___m_nview.IsOwner()) { return(true); } if (!MobManager.IsAliveMob(___m_nview.GetZDO().GetString(Constants.Z_CharacterId))) { return(true); } ___m_rightItem = item; ___m_rightItem.m_equiped = item != null; ___m_visEquipment.SetRightItem(item?.m_dropPrefab?.name); ___m_visEquipment.GetType().GetMethod("UpdateEquipmentVisuals", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(___m_visEquipment, new object[] { }); return(false); }
static bool Prefix(Humanoid __instance, ItemDrop.ItemData item, ref ItemDrop.ItemData ___m_rightItem, ref ZNetView ___m_nview, ref VisEquipment ___m_visEquipment) { if (!__instance.name.Contains("Greyling")) { return(true); } if (!__instance.IsTamed()) { return(true); } ___m_rightItem = item; ___m_rightItem.m_equiped = item != null; ___m_visEquipment.SetRightItem(item?.m_dropPrefab?.name); //Debug.Log($"Set right item prefab to {item?.m_dropPrefab?.name}"); ___m_visEquipment.GetType().GetMethod("UpdateEquipmentVisuals", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(___m_visEquipment, new object[] { }); return(false); }