Skip to content

OnItemUpgrade

Usage

  • No return behavior

Example Autogenerated

csharp
private void OnItemUpgrade( Item item, Item item2, BasePlayer player )
{
    Puts( "OnItemUpgrade works!" );
}

Location

  • ItemModUpgrade::ServerCommand(Item item, string command, BasePlayer player)
csharp
//---
		}
		if (UnityEngine.Random.Range(0f, 1f) <= this.upgradeSuccessChance)
		{
			item.UseItem(this.numForUpgrade);
			Item item2 = ItemManager.Create(this.upgradedItem, this.numUpgradedItem, 0uL, true);
			Interface.CallHook("OnItemUpgrade", item, item2, player);
			if (!item2.MoveToContainer(player.inventory.containerMain, -1, true, false, null, true))
			{
				item2.Drop(player.GetDropPosition(), player.GetDropVelocity(), default(Quaternion));
			}
			if (this.successEffect.isValid)
//---

Released under the MIT License.