Ejemplo n.º 1
0
            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);
            }
Ejemplo n.º 2
0
            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);
            }