OnBonusItemDrop
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private object OnBonusItemDrop( Item item, BasePlayer basePlayer, ItemContainer container )
{
Puts( "OnBonusItemDrop works!" );
return null;
}Location
- LootContainer::DropBonusItems(BaseEntity initiator, ItemContainer container)
csharp
//---
}
basePlayer.modifiers.SetVariableValue(Modifier.ModifierType.Scrap_Yield, variableValue);
if (num3 > 0)
{
Item item = ItemManager.Create(scrapDef, num3, 0uL);
if (item != null && Interface.CallHook("OnBonusItemDrop", item, basePlayer, container) == null)
{
(item.Drop(GetDropPosition() + new Vector3(0f, 0.5f, 0f), GetInheritedDropVelocity()) as DroppedItem).DropReason = DroppedItem.DropReasonEnum.Loot;
Interface.CallHook("OnBonusItemDropped", item, basePlayer, container);
}
}
//---