void OnEntitySpawned(NPCMurderer murderer)
        {
            var combatEntity = murderer as BaseCombatEntity;

            combatEntity._maxHealth = _config.murdererHealth;
            combatEntity.health     = _config.murdererHealth;

            if (_config.useKits)
            {
                GiveKitMurderer(murderer, GetKitName(_config.MurdererKits));
            }
            else
            {
                ClotheMurderer(murderer);
            }
        }
        void ClotheMurderer(NPCMurderer murderer)
        {
            var inv_wear = murderer.inventory.containerWear;
            var inv_belt = murderer.inventory.containerBelt;

            Item gloweyes = ItemManager.CreateByName("gloweyes");

            Item itemHeadwear = GetItem(_config.Headwear);
            Item itemTorso    = GetItem(_config.Torso);
            Item itemLegs     = GetItem(_config.Legs);
            Item itemFeet     = GetItem(_config.Feet);
            Item itemHands    = GetItem(_config.Hands);

            inv_wear.Clear();
            if (_config.GlowingEyes)
            {
                gloweyes.MoveToContainer(inv_wear);
            }
            if (itemHeadwear != null)
            {
                itemHeadwear.MoveToContainer(inv_wear);
            }
            if (itemTorso != null)
            {
                itemTorso.MoveToContainer(inv_wear);
            }
            if (itemLegs != null)
            {
                itemLegs.MoveToContainer(inv_wear);
            }
            if (itemFeet != null)
            {
                itemFeet.MoveToContainer(inv_wear);
            }
            if (itemHands != null)
            {
                itemHands.MoveToContainer(inv_wear);
            }

            Item itemMelee = GetItem(_config.MeleeWeapon);

            if (itemMelee != null)
            {
                inv_belt.Clear();
                itemMelee.MoveToContainer(inv_belt);
            }
        }
        private static void GiveKitMurderer(NPCMurderer npc, string kit)
        {
            if (kit == null)
            {
                return;
            }

            Interface.Oxide.CallHook("GiveKit", npc, kit);

            Item item = npc.inventory.containerBelt.GetSlot(0);

            if (item == null)
            {
                return;
            }

            npc.UpdateActiveItem(item.uid);
        }
Пример #4
0
        void OnEntitySpawned(NPCMurderer murderer)
        {
            var inv_wear = murderer.inventory.containerWear;

            Item burlap_headwrap = ItemManager.CreateByName("burlap.headwrap", 1, 807624505);
            Item gloweyes        = ItemManager.CreateByName("gloweyes");
            Item tshirt          = ItemManager.CreateByName("tshirt", 1, 795997221);
            Item burlap_gloves   = ItemManager.CreateByName("burlap.gloves", 1, 1132774091);
            Item burlap_trousers = ItemManager.CreateByName("burlap.trousers", 1, 806966575);
            Item boots           = ItemManager.CreateByName("shoes.boots");

            inv_wear.Clear();
            if (burlap_headwrap != null)
            {
                burlap_headwrap.MoveToContainer(inv_wear);
            }
            if (gloweyes != null)
            {
                gloweyes.MoveToContainer(inv_wear);
            }
            if (tshirt != null)
            {
                tshirt.MoveToContainer(inv_wear);
            }
            if (burlap_gloves != null)
            {
                burlap_gloves.MoveToContainer(inv_wear);
            }
            if (burlap_trousers != null)
            {
                burlap_trousers.MoveToContainer(inv_wear);
            }
            if (boots != null)
            {
                boots.MoveToContainer(inv_wear);
            }
        }