I tested this on my ZC and this code seems to do exactly what you asked for (approximately).
D0 is minimum amount of rupees given by the rupee pickup and D1 is the maximum it will give.
Code:
item script RupeeScore
{
void run(int minrupees,int maxrupees)
{
int rupees=minrupees+Rand(maxrupees);if(rupees>maxrupees)rupees=maxrupees;
int percentage=Choose(1,2,3);
if(percentage==1||percentage==2)
{
int mindiv=Rand(4);if(mindiv==0)mindiv=1;int split=Ceiling(maxrupees/5)/mindiv;
Game->Counter[1]+=Ceiling(split);
}
if(percentage==3)
{
percentage=Choose(1,2,3);
if(percentage==1)
{
int mindiv=Rand(4);if(mindiv==0)mindiv=1;int split=Ceiling(maxrupees/5)/mindiv;
if(split<minrupees)split=minrupees;
Game->Counter[1]+=Ceiling(split);
}
if(percentage==2)
{
int mindiv=Rand(2);if(mindiv==0)mindiv=1;int split=Ceiling(maxrupees/2)/mindiv;
if(split<minrupees)split=minrupees;
Game->Counter[1]+=Ceiling(split);
}
if(percentage==3)
{
percentage=Choose(1,2,3);
if(percentage==1)
{
int mindiv=Rand(5);if(mindiv==0)mindiv=1;int split=Ceiling(rupees/mindiv);
if(split<minrupees)split=minrupees;
Game->Counter[1]+=Ceiling(split);
}
if(percentage==2)
{
int mindiv=Rand(10);if(mindiv==0)mindiv=1;int split=Ceiling(rupees/mindiv);
if(split<minrupees)split=minrupees;
Game->Counter[1]+=Ceiling(split);
}
if(percentage==3)
{
int mindiv=Rand(10);int split=Ceiling(rupees/mindiv);
if(split<minrupees)split=minrupees;
if(rupees!=maxrupees){Game->Counter[1]+=Ceiling(split);}
if(rupees==maxrupees){Game->Counter[1]+=maxrupees;}
}
}
}
}
}
Keese! Keese Keese!
I could write in a thing to display the amount of rupees the script gives also if you'd prefer that.. Also the thought of making the counter go up by 1 until the amount it gives is reached might be desirable, although then you might run into some of those bugs similar to spending the same rupees twice dealios if the player gets other rupees by other methods before the counter hits it's mark and whatnot.
It's fine the way it is though.