larhalt82

Member
Hi,
actually the chance of get ANY runic kit from quests is 1/10000 with every kit

That's the code
Code:
switch ( Utility.Random( 10000 ) )
            {
                case 500: return new RunicFletcherTool( CraftResource.OakWood, 45 );
                case 2500: return new RunicFletcherTool( CraftResource.AshWood, 35 );
                case 5000: return new RunicFletcherTool( CraftResource.YewWood, 25 );
                case 10000: return new RunicFletcherTool( CraftResource.Heartwood, 15 );
            }
 
Need help for what?
need this?
Code:
if (Utility.Random( 10000 ) == 1)	//1/10000, this works too i would guess.
{
switch(UtilityRandom(4))
{
case 0: return new RunicFletcherTool( CraftResource.OakWood, 45 ); break;
case 1: return new RunicFletcherTool( CraftResource.AshWood, 35); break;
case 2: return new RunicFletcherTool( CraftResource.YewWood, 25); break;
case 3: return new RunicFletcherTool( CraftResource.Heartwood, 15); break;
}
}
 
Sorry for be so cryptic.
What I mean is that with the actual code, the chance to get a runic kit is 1/10000.
What I need is a code that do the correct random for the reward
That's from UOGuide:
Oak, Ash, Yew, Heartwood (1 in 500/2,500/5,000/10,000)
 
Code:
if (Utility.Random( 500 ) == 1)
return new RunicFletcherTool( CraftResource.OakWood, 45 );
else if (Utility.Random( 2500) == 1)
return new RunicFletcherTool( CraftResource.AshWood, 35);
else if (Utility.Random( 5000) == 1)
return new RunicFletcherTool( CraftResource.YewWood, 25);
else if (Utility.Random( 10000) == 1)
return new RunicFletcherTool( CraftResource.Heartwood, 15);

this generates a number between x and y, then checks if the value 1 pops out, this should work.
 
Hi,
actually the chance of get ANY runic kit from quests is 1/10000 with every kit

That's the code
Code:
switch ( Utility.Random( 10000 ) )
            {
                case 500: return new RunicFletcherTool( CraftResource.OakWood, 45 );
                case 2500: return new RunicFletcherTool( CraftResource.AshWood, 35 );
                case 5000: return new RunicFletcherTool( CraftResource.YewWood, 25 );
                case 10000: return new RunicFletcherTool( CraftResource.Heartwood, 15 );
            }

Actually, that would be 4/10000, which is still wrong, lol

Good catch!
 
int randvalue = Utility.RandomMinMax(1,10000);
if ( randvalue <= 1 ) {
return new RunicFletcherTool( CraftResource.Heartwood, 15);
}
else if ( randvalue <= 2 ) {
return new RunicFletcherTool( CraftResource.YewWood, 25);
}

else if ( randvalue <= 4 ) {
return new RunicFletcherTool( CraftResource.AshWood, 35);
}

else if ( randvalue <= 20 ) {
return new RunicFletcherTool( CraftResource.OakWood, 45 );
}
 
Hello - Where are you putting this drop chance? In the Craftsmans Satchel? (Always thought that was strange for a craftsman to have a satchel.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back