Login  Register

Re: Adding custom items to loot spawns

Posted by Haleks on Mar 15, 2014; 9:19pm
URL: http://kodabar-dayz-daizy-single-player-forum.163.s1.nabble.com/Adding-custom-items-to-loot-spawns-tp16011p16014.html

Outlaw2101 wrote
I have also done some research on the PBO files. If I am right, all the spawning for weapons and ammunition is located in the dayz_code. The problem is, how do I access and add weapons that I would like spawned? Can someone please help me with this?
You're right.
I'll assume you know to decompress a pbo file - if not, a quick search should provide some tutorials, I only suggest that you use PBO manager.

Now, I think Panthera is based on an old version of dayz, so the loot tables should be in the config.cpp file.
Open it with a text editor and look for something looking like this :

        class Supermarket: Default {
                lootChance = 0.4;
                minRoaming = 2;
                maxRoaming = 6;
                zombieChance = 0.3;
                zombieClass[] = {"zZombie_Base","zZombie_Base","z_teacher","z_worker1","z_worker2"};
                itemType[] = {
                        {"ItemWatch","generic"},
                        {"ItemMap","weapon"},
                        {"Makarov","weapon"},
                        {"ItemFlashlight","generic"},
                        {"ItemFlint","generic"},
                        {"ItemKnife","generic"},
                        {"","generic"},
                        {"Tokarev","weapon"},
                        {"WeaponHolder_ItemTent","object"},
                        {"","food"},
                        {"","trash"},
                        {"Crossbow","weapon"},
                        {"Binocular","weapon"},
                        {"WeaponHolder_MeleeCrowbar","object"},
                        {"ice_apo_pack1","object"},
                        {"ice_apo_pack2","object"},
                        {"ice_apo_pack3","object"},
                        {"ice_apo_pack4","object"}
                };
                itemChance[] = {
                        0.01, // {"ItemWatch","generic"},
                        0.01, // {"ItemMap","weapon"},
                        0.01, // {"Makarov","weapon"},
                        0.01, // {"ItemFlashlight","generic"},
                        0.01, // {"ItemFlint","generic"},
                        0.01, // {"ItemKnife","generic"},
                        0.01, // {"","generic"},
                        0.01, // {"Tokarev","weapon"},
                        0.01, // {"WeaponHolder_ItemTent","object"},
                        0.01, // {"","food"},
                        0.42, // {"","trash"},
                        0.01, // {"Crossbow","weapon"},
                        0.01, // {"Binocular","weapon"},
                        0.02, // {"WeaponHolder_MeleeCrowbar","object"},
                        0.01, // {"ice_apo_pack1","object"},
                        0.01, // {"ice_apo_pack2","object"},
                        0.01, // {"ice_apo_pack3","object"},
                        0.01 // {"ice_apo_pack4","object"}
                };
        };

All you need to do, is add the classname of the weapon you want, and the corresponding spawn chance :
        class Supermarket: Default {
                lootChance = 0.4;
                minRoaming = 2;
                maxRoaming = 6;
                zombieChance = 0.3;
                zombieClass[] = {"zZombie_Base","zZombie_Base","z_teacher","z_worker1","z_worker2"};
                itemType[] = {
                        {"ItemWatch","generic"},
                        {"ItemMap","weapon"},
                        {"Makarov","weapon"},
                        {"ItemFlashlight","generic"},
                        {"ItemFlint","generic"},
                        {"ItemKnife","generic"},
                        {"","generic"},
                        {"Tokarev","weapon"},
                        {"WeaponHolder_ItemTent","object"},
                        {"","food"},
                        {"","trash"},
                        {"Crossbow","weapon"},
                        {"Binocular","weapon"},
                        {"WeaponHolder_MeleeCrowbar","object"},
                        {"ice_apo_pack1","object"},
                        {"ice_apo_pack2","object"},
                        {"ice_apo_pack3","object"},
                        {"ice_apo_pack4","object"},
                        {"your weapon classname","weapon"}

                };
                itemChance[] = {
                        0.01, // {"ItemWatch","generic"},
                        0.01, // {"ItemMap","weapon"},
                        0.01, // {"Makarov","weapon"},
                        0.01, // {"ItemFlashlight","generic"},
                        0.01, // {"ItemFlint","generic"},
                        0.01, // {"ItemKnife","generic"},
                        0.01, // {"","generic"},
                        0.01, // {"Tokarev","weapon"},
                        0.01, // {"WeaponHolder_ItemTent","object"},
                        0.01, // {"","food"},
                        0.42, // {"","trash"},
                        0.01, // {"Crossbow","weapon"},
                        0.01, // {"Binocular","weapon"},
                        0.02, // {"WeaponHolder_MeleeCrowbar","object"},
                        0.01, // {"ice_apo_pack1","object"},
                        0.01, // {"ice_apo_pack2","object"},
                        0.01, // {"ice_apo_pack3","object"},
                        0.01,        // {"ice_apo_pack4","object"}
                        0.3 //spawn cance
                };
        };

Don't forget the coma!