Exemple #1
0
        public static string GetTemplate(ItemDrop.ItemData.ItemType type)
        {
            switch (type)
            {
            case ItemDrop.ItemData.ItemType.Consumable:
                return("[food]$item_food_health: <color=orange>{itemFoodHealth}</color>\\n$item_food_stamina: <color=orange>{itemFoodStamina}</color>\\n$item_food_duration: <color=orange>{itemFoodDuration}s</color>\\n$item_food_regen: <color=orange>{itemFoodRegen} hp/tick</color>\n[status]\\n{itemStatusInfo}");

            case ItemDrop.ItemData.ItemType.OneHandedWeapon:
            case ItemDrop.ItemData.ItemType.Bow:
            case ItemDrop.ItemData.ItemType.TwoHandedWeapon:
            case ItemDrop.ItemData.ItemType.Torch:
                return("{itemDamage}\n$item_blockpower: <color=orange>{itemBaseBlock}</color> <color=yellow>({itemBlock})</color>\n[timedBlock]$item_deflection: <color=orange>{itemDeflection}</color>\\n$item_parrybonus: <color=orange>{itemBlockBonus}x</color>\n$item_knockback: <color=orange>{itemAttackForce}</color>\n$item_backstab: <color=orange>{itemBackstab}x</color>\n[projectile]\\n{itemProjectileInfo}\n[status]\\n{itemStatusInfo}");

            case ItemDrop.ItemData.ItemType.Shield:
                return("$item_blockpower: <color=orange>{itemBaseBlock}</color> <color=yellow>({itemBlock})</color>\n[timedBlock]$item_deflection: <color=orange>{itemDeflection}</color>\\n$item_parrybonus: <color=orange>{itemBlockBonus}x</color>");

            case ItemDrop.ItemData.ItemType.Helmet:
            case ItemDrop.ItemData.ItemType.Chest:
            case ItemDrop.ItemData.ItemType.Legs:
            case ItemDrop.ItemData.ItemType.Shoulder:
                return("$item_armor: <color=orange>{itemArmor}</color>\n[damageMod]{itemDamageModInfo}\n[status]\\n{itemStatusInfo}");

            case ItemDrop.ItemData.ItemType.Ammo:
                return("{itemDamage}\n$item_knockback: <color=orange>{itemAttackForce}</color>");
            }
            return("");
        }
Exemple #2
0
    // Token: 0x060002C5 RID: 709 RVA: 0x00016128 File Offset: 0x00014328
    private GameObject AttachBackItem(int hash, int variant, bool rightHand)
    {
        GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(hash);

        if (itemPrefab == null)
        {
            ZLog.Log("Missing back attach item prefab: " + hash);
            return(null);
        }
        ItemDrop component = itemPrefab.GetComponent <ItemDrop>();

        ItemDrop.ItemData.ItemType itemType = (component.m_itemData.m_shared.m_attachOverride != ItemDrop.ItemData.ItemType.None) ? component.m_itemData.m_shared.m_attachOverride : component.m_itemData.m_shared.m_itemType;
        if (itemType != ItemDrop.ItemData.ItemType.Torch)
        {
            if (itemType <= ItemDrop.ItemData.ItemType.TwoHandedWeapon)
            {
                switch (itemType)
                {
                case ItemDrop.ItemData.ItemType.OneHandedWeapon:
                    return(this.AttachItem(hash, variant, this.m_backMelee, true));

                case ItemDrop.ItemData.ItemType.Bow:
                    return(this.AttachItem(hash, variant, this.m_backBow, true));

                case ItemDrop.ItemData.ItemType.Shield:
                    return(this.AttachItem(hash, variant, this.m_backShield, true));

                default:
                    if (itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon)
                    {
                        return(this.AttachItem(hash, variant, this.m_backTwohandedMelee, true));
                    }
                    break;
                }
            }
            else
            {
                if (itemType == ItemDrop.ItemData.ItemType.Tool)
                {
                    return(this.AttachItem(hash, variant, this.m_backTool, true));
                }
                if (itemType == ItemDrop.ItemData.ItemType.Attach_Atgeir)
                {
                    return(this.AttachItem(hash, variant, this.m_backAtgeir, true));
                }
            }
            return(null);
        }
        if (rightHand)
        {
            return(this.AttachItem(hash, variant, this.m_backMelee, false));
        }
        return(this.AttachItem(hash, variant, this.m_backTool, false));
    }
Exemple #3
0
    // Token: 0x06000B32 RID: 2866 RVA: 0x000508DC File Offset: 0x0004EADC
    public List <ItemDrop> GetAllItems(ItemDrop.ItemData.ItemType type, string startWith)
    {
        List <ItemDrop> list = new List <ItemDrop>();

        foreach (GameObject gameObject in this.m_items)
        {
            ItemDrop component = gameObject.GetComponent <ItemDrop>();
            if (component.m_itemData.m_shared.m_itemType == type && component.gameObject.name.StartsWith(startWith))
            {
                list.Add(component);
            }
        }
        return(list);
    }
 public static Vector2i GetEquipmentSlotForType(ItemDrop.ItemData.ItemType type)
 {
     return(new Vector2i(EquipSlotTypes.IndexOf(type), 0));
 }
 public static int GetEquipmentSlotForType(ItemDrop.ItemData.ItemType type)
 {
     return(EquipSlotTypes.IndexOf(type));
 }