DayZ Server Starting Kit
DayZ Server Starting Kit
DayZ Server Starting Kit
For ages I've thought it would add flavour if you had a starting loadout that suggested
some back story, to make you care about your character a bit more. This is my first
prototype using the init.c file. There's a lot of improvements needed since a lot of loot isn't
in the game yet - eventually I'd like to have at least 20 classes and the existing ones have
better gear, like the cop really needs handcuffs. I based it on u/teaearlgraycold s
great example and got invaluable help with syntax from r00tz on discord.
void main()
{
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
weather.SetWindMaximumSpeed(15);
weather.SetWindFunctionParams(0.1, 0.3, 50);
}
return m_player;
}
EntityAI itemEnt;
ItemBase itemBs;
break;
case 6:
// Lumberjack
player.GetInventory().CreateInInventory("Shirt_RedCheck");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Jeans_Blue");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WoodAxe");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WorkingBoots_Brown");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Ushanka_Green");itemBs =
ItemBase.Cast(itemEnt);
break;
case 7:
// Hood
player.GetInventory().CreateInInventory("TrackSuitPants_Black");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("TrackSuitJacket_Black");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AthleticShoes_Black");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("KitchenKnife");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Kvass");itemBs =
ItemBase.Cast(itemEnt);
break;
case 8:
// Fireman
player.GetInventory().CreateInInventory("FirefighterJacket_Beige");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("FirefightersPants_Beige");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("FirefightersHelmet_White");itemBs
= ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WorkingBoots_Yellow");itemBs =
ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("FirefighterAxe");itemBs =
ItemBase.Cast(itemEnt);
break;
}
// Give universal gear
itemEnt = player.GetInventory().CreateInInventory("Rag");
itemBs = ItemBase.Cast(itemEnt);
itemBs.SetQuantity(4);
// SetRandomHealth(itemEnt);
// player.GetInventory().CreateInInventory("HuntingKnife");
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
if you want, you can also switch it up to add from a desired array
//create arrays
player.RemoveAllItems();
EntityAI item =
player.GetInventory().CreateInInventory(topsArray.GetRandomElement());
EntityAI item2 =
player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
EntityAI item3 =
player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
EntityAI item4 =
player.GetInventory().CreateInInventory(backpackArray.GetRandomElement());
EntityAI item5 =
player.GetInventory().CreateInInventory(vestsArray.GetRandomElement());
..you could also use this in conjunction with your method, and have random guns or tools
added.
EXAMPLE:
//Random guns
switch (Math.RandomInt(0, 3)) {
case 0:
// SVD
EntityAI gun3 = player.GetHumanInventory().CreateInHands("SVD");
gun3.GetInventory().CreateAttachment("PSO1Optic");
itemEnt = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
itemBs = ItemBase.Cast(itemEnt);
break;
case 1:
// M4A1
EntityAI gun1 = player.GetHumanInventory().CreateInHands("M4A1");
gun1.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
gun1.GetInventory().CreateAttachment("M4_MPBttstck_Black");
itemEnt = player.GetInventory().CreateInInventory("Mag_STANAG_30Rnd");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Mag_STANAG_30Rnd");
itemBs = ItemBase.Cast(itemEnt);
break;
case 3:
// CZ75
EntityAI gun2 = player.GetHumanInventory().CreateInHands("CZ75");
gun2.GetInventory().CreateAttachment("TLRLight");
gun2.GetInventory().CreateAttachment("PistolSuppressor");
itemEnt = player.GetInventory().CreateInInventory("Mag_CZ75_15Rnd");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Mag_CZ75_15Rnd");
itemBs = ItemBase.Cast(itemEnt);
break;};
Ak_Woodland_Cobra :
itemEnt = player.GetInventory().CreateInInventory("AKM");
itemEnt.GetInventory().CreateAttachment("Mag_AKM_30Rnd");
itemEnt.GetInventory().CreateAttachment("AK_WoodHndgrd_Camo");
itemEnt.GetInventory().CreateAttachment("AK_WoodBttstck_Camo");
itemEnt.GetInventory().CreateAttachment("GhillieAtt_Woodland");
itemEnt.GetInventory().CreateAttachment("KobraOptic");
Ak_Woodland_PSO11 :
itemEnt = player.GetInventory().CreateInInventory("AKM");
itemEnt.GetInventory().CreateAttachment("Mag_AKM_30Rnd");
itemEnt.GetInventory().CreateAttachment("AK_WoodHndgrd_Camo");
itemEnt.GetInventory().CreateAttachment("AK_WoodBttstck_Camo");
itemEnt.GetInventory().CreateAttachment("GhillieAtt_Woodland");
itemEnt.GetInventory().CreateAttachment("PSO11Optic");