//=============================================================================
// 
//=============================================================================
class MMRPGSellButton extends DeusExDecoration;

var(lagshot) int CreditCost;
var(lagshot) class<Inventory> SpawnClass;

function Frob(Actor Frobber, Inventory frobWith)
{
	local Inventory Inv;
	local MMRPGCreditCard Cred;
	local _MMRPGPlayer Player;

	Player = _MMRPGPlayer(Frobber);

	Super.Frob(Frobber, frobwith);
	
	If(Player != None)
	{
		ForEach AllActors(Class'Inventory', Inv)
		{
			If (Inv.Owner == Player)
			{
				If (Inv.Class == SpawnClass)
				{
					If (Inv != None)
					{
						Cred = Player.CreditCard;
						Cred.CreditAmount += CreditCost;
						Player.ClientMessage(""$Inv.ItemName$ " traded in for "$CreditCost$ " credits.");
						Inv.Destroy();
						return;
					}

					Else
					{
						Player.ClientMessage("You do not have one!");
					}
				}
			}
		}
	}
						
}	


defaultproperties
{
     bInvincible=True
     ItemName="Sell"
     bPushable=False
     Skin=Texture'DeusExDeco.Button1Tex0'
     Physics=PHYS_None
     RemoteRole=ROLE_SimulatedProxy
     Mesh=LodMesh'DeusExDeco.Button1'
     CollisionRadius=2.000000
     CollisionHeight=2.000000
     bCollideWorld=False
     bBlockActors=False
     Mass=5.000000
     Buoyancy=2.000000
}
