class DEBUG_ItemRebalancer extends GameObject
{
	instanceeditable var m_nodeRef : NodeRef;

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		super.OnRequestComponents( ri );
		EntityRequestComponentsInterface.RequestComponent( ri, 'choice', 'InteractionComponent', false );
	}

	protected event OnInteractionChoice( evt : InteractionChoiceEvent )
	{
		switch( evt.choice.choiceMetaData.tweakDBName )
		{
			case "Rebalance":
				RebalanceItem();
			break;
			default:
				break;
		}
	}

	private function RebalanceItem()
	{
		var playerLevel : Float;
		var statSystem : StatsSystem;
		var player : PlayerPuppet;
		var evt : DEBUG_RebalanceItemEvent;
		var entityID : EntityID;
		statSystem = GameInstance.GetStatsSystem( GetGame() );
		player = GetPlayer( GetGame() );
		evt = new DEBUG_RebalanceItemEvent;
		playerLevel = statSystem.GetStatValue( player.GetEntityID(), gamedataStatType.Level );
		evt.reqLevel = playerLevel;
		entityID = ResolveNodeRefWithEntityID( m_nodeRef, GetEntityID() );
		QueueEventForEntityID( entityID, evt );
	}

}

class DEBUG_RebalanceItemEvent extends Event
{
	var reqLevel : Float;
}

