Beispiel #1
0
        static bool Prefix(PLPawnInventoryBase __instance, int inNetID, int inType, int inSubType, int inLevel, int inEquipID)
        {
            PLPawnItem itemAtNetID = __instance.GetItemAtNetID(inNetID);

            if (itemAtNetID != null)
            {
                itemAtNetID.EquipID = inEquipID;
                itemAtNetID.Level   = inLevel;
                itemAtNetID.SubType = inSubType;
            }
            else
            {
                PLPawnItem plpawnItem = ItemModManager.CreatePawnItem(inType, inSubType, inLevel);
                if (plpawnItem != null)
                {
                    plpawnItem.NetID   = inNetID;
                    plpawnItem.EquipID = inEquipID;
                    __instance.AddItem_Internal(inNetID, plpawnItem);
                }
            }
            if (PLNetworkManager.Instance.IsInternalBuild)
            {
                Logger.Info("UpdateItem:    player: " + ((__instance.PlayerOwner != null) ? __instance.PlayerOwner.GetPlayerName(false) : "null") + "    equipID: " + inEquipID.ToString());
            }
            if (PLTabMenu.Instance != null)
            {
                PLTabMenu.Instance.ShouldRecreateLocalInventory = true;
            }
            return(false);
        }
Beispiel #2
0
 static bool Prefix(int inHash, ref PLPawnItem __result)
 {
     PLPawnItem.GetPawnInfoFromHash(inHash, out uint inType, out uint inSubType, out uint inLevel);
     __result = ItemModManager.CreatePawnItem((int)inType, (int)inSubType, (int)inLevel);
     return(false);
 }