void main()
{
//INIT WEATHER BEFORE ECONOMY INIT------------------------
Weather weather = g_Game.GetWeather();
weather.MissionWeather(false); // false = use weather controller from Weather.c
weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
//DATE RESET AFTER ECONOMY INIT-------------------------
int year, month, day, hour, minute;
int reset_month = 9, reset_day = 20;
GetGame().GetWorld().GetDate(year, month, day, hour, minute);
if ((month == reset_month) && (day < reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month == reset_month + 1) && (day > reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month < reset_month) || (month > reset_month + 1))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
}
}
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
int rndHlt = Math.RandomInt(55,100);
itemEnt.SetHealth("","",rndHlt);
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
string GUID = player.GetIdentity().GetPlainId();
if (GUID=="玩家1Guid")
{
pos="10751 2 14289";
}
if (GUID=="玩家2Guid")
{
pos="0 0 0";
}
if (GUID=="玩家3Guid")
{
pos="0 0 0";
}
playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
/* EntityAI itemEnt;
ItemBase itemBs;
string GUID = player.GetIdentity().GetPlainId();
if (GUID=="76561198369741047")
{
player.RemoveAllItems();
player.GetInventory().CreateInInventory("KOD_AWM");
player.GetInventory().CreateInInventory("Mag_KOD_AWM_5Rnd");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
}
if (GUID=="玩家2Guid")
{
player.RemoveAllItems();
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
}
ref array<string> team_Cat={"Cat队员1Guid","Cat队员2Guid","Cat队员3Guid","Cat队员4Guid"};
ref array<string> team_Dog={"Dog队员1Guid","Dog队员2Guid","Dog队员3Guid","Dog队员4Guid"};
ref array<string> team_Abc={"Abc队员1Guid","Abc队员2Guid","Abc队员3Guid","Abc队员4Guid"};
if (team_Cat.Find(GUID)>-1)
{
player.RemoveAllItems();
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
}
if (team_Dog.Find(GUID)>-1)
{
player.RemoveAllItems();
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
player.GetInventory().CreateInInventory("");
}
itemTop = player.FindAttachmentBySlotName("Body");
if ( itemTop )
{
itemEnt = itemTop.GetInventory().CreateInInventory("BandageDressing");
if ( Class.CastTo(itemBs, itemEnt ) )
itemBs.SetQuantity(6);
SetRandomHealth(itemEnt);
itemEnt = itemTop.GetInventory().CreateInInventory("Msp_Water_Gun");
SetRandomHealth(itemEnt);
itemEnt = itemTop.GetInventory().CreateInInventory("Msp_Water_Gun_Mag");
SetRandomHealth(itemEnt);
itemEnt = itemTop.GetInventory().CreateInInventory("Msp_Water_Gun_Mag");
SetRandomHealth(itemEnt);
itemEnt = itemTop.GetInventory().CreateInInventory("Msp_Water_Gun_Mag");
SetRandomHealth(itemEnt);
itemEnt = itemTop.GetInventory().CreateInInventory("Msp_Water_Gun_Mag");
SetRandomHealth(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("FP4_Surv_Bag");
SetRandomHealth(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("PressVest_Blue");
SetRandomHealth(itemEnt);
rand = Math.RandomFloatInclusive(0.0, 1.0);
if ( rand < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("Apple");
else if ( rand > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("Pear");
else
itemEnt = player.GetInventory().CreateInInventory("Plum");
SetRandomHealth(itemEnt);
} */
player.RemoveAllItems();
EntityAI itemEnt;
ItemBase itemBs;
float Yifu;
float Kuzi;
float Xiezi;
float Baobao;
itemEnt = player.GetInventory().CreateInInventory("PoliceVest");
itemBs = ItemBase.Cast(itemEnt);
Yifu = Math.RandomFloatInclusive(0.0, 1.0);
if ( Yifu < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("GorkaEJacket_Autumn");
else if ( Yifu > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("PoliceJacket");
else
itemEnt = player.GetInventory().CreateInInventory("PrisonUniformJacket");
itemBs = ItemBase.Cast(itemEnt);
Kuzi = Math.RandomFloatInclusive(0.0, 1.0);
if ( Kuzi < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("GorkaPants_Autumn");
else if ( Kuzi > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("PolicePants");
else
itemEnt = player.GetInventory().CreateInInventory("PrisonUniformPants");
itemBs = ItemBase.Cast(itemEnt);
Xiezi = Math.RandomFloatInclusive(0.0, 1.0);
if ( Xiezi < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("JungleBoots_Beige");
else if ( Xiezi > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("JungleBoots_Black");
else
itemEnt = player.GetInventory().CreateInInventory("JungleBoots_Green");
itemBs = ItemBase.Cast(itemEnt);
Baobao = Math.RandomFloatInclusive(0.0, 1.0);
if ( Baobao < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("FP4_Surv_Bag_violet");
else if ( Baobao > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("FP4_Surv_Bag");
else
itemEnt = player.GetInventory().CreateInInventory("FP4_Surv_Bag_orange");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Rice");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Canteen");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("HuntingKnife");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Rice");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Roadflare");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("BandageDressing");
itemBs.SetQuantity(6);
itemBs = ItemBase.Cast(itemEnt);
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
|