Dayz 服务器出生装备设置

override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemClothing;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemEnt = player.GetInventory().CreateInInventory( "ImprovisedBag" );   \\背包
itemClothing = player.FindAttachmentBySlotName( "Back" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.GetInventory().CreateInInventory( "BandageDressing" );  \\衣服里装的东西 这里是绷带
if ( Class.CastTo( itemBs, itemEnt ) )
itemBs.SetQuantity( 2 );
player.SetQuickBarEntityShortcut(itemEnt, 2);
string chemlightArray[] = { "Apple", "Pear", "Plum" };  \\身上装的食物
int rndIndex = Math.RandomInt( 0, 4 );
itemEnt = itemClothing.GetInventory().CreateInInventory( chemlightArray[rndIndex] );
SetRandomHealth( itemEnt );
player.SetQuickBarEntityShortcut(itemEnt, 1);
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" );
player.SetQuickBarEntityShortcut(itemEnt, 3);
SetRandomHealth( itemEnt );
}  \\这里是背包里装的东西
itemEnt = player.GetInventory().CreateInInventory( "BeanieHat_Black" );
itemEnt = player.GetInventory().CreateInInventory( "WoolGlovesFingerless_ChristmasBlue" );
itemEnt = player.GetInventory().CreateInInventory( "BandageDressing" );
if ( Class.CastTo( itemBs, itemEnt ) )
itemBs.SetQuantity( 2 );
itemEnt = itemClothing.GetInventory().CreateInInventory( "Chemlight_Red" );
if ( Class.CastTo( itemBs, itemEnt ) )
itemBs.SetQuantity( 1 );
itemEnt = itemClothing.GetInventory().CreateInInventory( "StoneKnife" );
if ( Class.CastTo( itemBs, itemEnt ) )
itemBs.SetQuantity( 20 );
itemBs.SetQuantity( 20 );
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
SetRandomHealth( itemClothing );
itemClothing = player.FindAttachmentBySlotName( "Feet" );
}
};

版权声明:
作者:牛大圣
链接:https://nds.cool/?p=174
来源:牛大圣的博客
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>