|
||
|
Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
![]() |
#1 (permalink) |
Forum Novice
Join Date: Apr 2005
Age: 45
Posts: 242
|
![]() I am attempting to get the ML artys to drop, I know where it is .. I.E.
public static bool CheckArtifactChance( Mobile m, BaseCreature bc ) { if ( !Core.AOS ) return false; double fame = (double)bc.Fame; if ( fame > 32000 ) fame = 32000; double chance = 1 / ( Math.Max( 10, 100 * ( 0.83 - Math.Round( Math.Log( Math.Round( fame / 6000, 3 ) + 0.001, 10 ), 3 ) ) ) * ( 100 - Math.Sqrt( m.Luck ) ) / 100.0 ); return chance > Utility.RandomDouble(); } if I comment out the return chance, and put" return true;" in its place i get a drop every time, but with the; return chance > Utility.RandomDouble(); Activated, and four people killing a different ML Mobile set on an instant respawn we have yet to get a single drop.. One persons killing Grobu, another killing acoil, a third killing thrashers etc etc, and at around 100 each I called off the test.. these are non gm characters using suped up weps to kill fast for the test.. My Question is, how do I modify that statement so i can slowly increse the drop rate a little at a time? Utility random statements are pretty easy to figure out, but that one has me scratchign my head.. Thx!
__________________
Vegetarian, An old Indian word meaning bad hunter. |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#2 (permalink) |
Master of the Internet
|
![]() ok - this line here:
double chance = 1 / ( Math.Max( 10, 100 * ( 0.83 - Math.Round( Math.Log( Math.Round( fame / 6000, 3 ) + 0.001, 10 ), 3 ) ) ) * ( 100 - Math.Sqrt( m.Luck ) ) / 100.0 ); lets break it down a little 1/ - the makes it a nicce % chance, bigger the number, the less the chance to get something math.max 10, formula - it is say the highest number to use of 10 or the formula, so unless the formula produces a a number less than 10 it wil be 10, wich means the best chance ever will be 10% (1 / 10) - and thing else is lower 100* this number is just to make it all bigger, lower it raise chance up next section is ment to use the critters fame, the higher the fame the better the chance - just trust me, it is complex then the last part is for adding in a smal bonus for luck, again the higher the luck the better the chance but in all honestly, even wioth fame of like 40,000 for the critter, the chance is still under 10% closer to 1% if i remember right the last time i calcualted it out so yes - very hard to get so i would change the 100* to a smaller number until you get the results you want (i would repeat the 100 kills each for a test) try 50 to start with (basicaly doubling chanches except for luck bonus - and that can make a BIG difference also)
__________________
http://www.AoAUO.com
![]() :) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#4 (permalink) |
Forum Novice
Join Date: Apr 2005
Age: 45
Posts: 242
|
![]() so i would change the 100* to a smaller number until you get the results you want (i would repeat the 100 kills each for a test)
try 50 to start with (basicaly doubling chanches except for luck bonus - and that can make a BIG difference also) Ive set it all the way down to ten now, ( Math.Max( 10, 10 * ( 0.83 etc... and still havent gotten a single drop.. I set my admin character to player, and left him killing Grobu all night on an instant spawn. I got a lot of tokens, but no arty, am somewhat confused to what else i can do.. as it says above, if I replace the ; return chance > Utility.RandomDouble(); with return true I get a drop every time... is there anything else I can try? maybe replacing that formula with a standard utility random drop?
__________________
Vegetarian, An old Indian word meaning bad hunter. |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#5 (permalink) |
Master of the Internet
|
![]() here is how mine is set up, i have extras in there based on some creature types
i also put in a min as you can see also, and a max too pick apart as you want Code:
public static bool CheckArtifactChance( Mobile m, BaseCreature bc ) { if (m != null && bc != null) { double fame = (double)bc.Fame; string cname = (string)bc.Name; if ( fame > 32000 ) fame = 32000; double chance = 1 / ( Math.Max( 10, 100 * ( 0.83 - Math.Round( Math.Log( Math.Round( fame / 6000, 3 ) + 0.001, 10 ), 3 ) ) ) * ( 100 - Math.Sqrt( m.Luck ) ) / 100.0 ); if (chance <= 0.005) chance = 0.005 + ( Math.Sqrt( m.Luck ) / 5000.0 ); if (cname == "Lady Melisande" || cname == "Master Arachnis" || cname == "Master Nox Drone" || cname == "Master of Bones" || cname == "Master Ravager" || cname == "Sasquatch" || cname == "Master Shadow Knight" || cname == "Master Wanderer of the Void" || cname == "Master Guardian of the Past" || cname == "Kruschak" ) chance += .05; if (chance >= .10) chance = .10; return chance > Utility.RandomDouble(); } return false; }
__________________
http://www.AoAUO.com
![]() :) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#6 (permalink) |
Forum Novice
Join Date: Apr 2005
Age: 45
Posts: 242
|
![]() That seemed to fix things, I added those lines exactly as you had them obviously without the extra named part, and am now getting a random Drop, it seemes to be, approximately one in ten, though i only killed about 30 for three arties, thats not far off the mark, to slow the drop a little? Reduce the .10 to .09 now? Or should i go back to the original Formula and try again?
this is what I now have; if ( fame > 32000 ) fame = 32000; double chance = 1 / ( Math.Max( 10, 100 * ( 0.83 - Math.Round( Math.Log( Math.Round( fame / 6000, 3 ) + 0.001, 10 ), 3 ) ) ) * ( 100 - Math.Sqrt( m.Luck ) ) / 100.0 ); if (chance <= 0.005) chance = 0.005 + (Math.Sqrt(m.Luck) / 5000.0); chance += .05; if (chance >= .10) chance = .10; return chance > Utility.RandomDouble(); } I was also wondering about the return false in yours? you have it shut off? Also, I was wondering f the = in the two statements was necessary since you were returning it to be that number reguardless?? <= 0.005 and the >= .10?? And Thank you LG, its great to finally see a random ML drop!!!
__________________
Vegetarian, An old Indian word meaning bad hunter. |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#7 (permalink) |
Master of the Internet
|
![]() the return false has to be in there in case one of the items is null in the 1st if statement
if you have just this in there: chance += .05; by itself, that adds 5% no matter what then, should remove it then instead 1 in 10 will probably be 1 in 20 but luck plays a big part too this line if (chance <= 0.005) chance = 0.005 + (Math.Sqrt(m.Luck) / 5000.0); means they will have a min no mater how low the fame of a 1 in 200 chance + luck bonus and this line if (chance >= .10) chance = .10; means they will never have more than a 1 in 10 chance notice the difference in <> in each line
__________________
http://www.AoAUO.com
![]() :) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#8 (permalink) |
Forum Novice
Join Date: Apr 2005
Age: 45
Posts: 242
|
![]() kk, tyvm ! Ive put the return false back in there as suggested and it still works fine, i removed the chance += .05; and tested it, and exactly as you predicted on kill 20 i got a drop, i will let them test this for a while now, but think it is now where i wanted it. (or as close as the "random" can be with this system.)
this line if (chance <= 0.005) chance = 0.005 + (Math.Sqrt(m.Luck) / 5000.0); means they will have a min no mater how low the fame of a 1 in 200 chance + luck bonus i understand basically what this is doing, my question was more geared toward trying to understand why the = was necessary? if chance is less than < or equal to = .005, since you are returning chance is then = to .005 anyhow.. so, wouldnt if (chance < .005) chance = .005... do the same thing? Understand, i am in NO WAY critisizing, Only trying to understand!!!!!! I am old have mercy on me! ![]()
__________________
Vegetarian, An old Indian word meaning bad hunter. |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#9 (permalink) |
Master of the Internet
|
![]() ok - lets break it down
if (chance <= 0.005) chance = 0.005 + (Math.Sqrt(m.Luck) / 5000.0); if (chance <= 0.005) - check to see if the previous formulas cam out less than 0.005 chance = 0.005 this then sets it to .005 + (Math.Sqrt(m.Luck) / 5000.0); and this adds in their luck with, so luck is not wasted so this way even a paragon mongbat has a 1 in 200 chance + their luck bonus of getting an arti (i took this formula from my paragon script)
__________________
http://www.AoAUO.com
![]() :) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#10 (permalink) |
Forum Novice
Join Date: Apr 2005
Age: 45
Posts: 242
|
![]() if (chance <= 0.005) - check to see if the previous formulas cam out less than 0.005
Doesnt that check to see if the previous formula came out to less than or equal to 0.005??? as that was my understanding of how >= and <= worked? and tyvm for answering Lord Grey
__________________
Vegetarian, An old Indian word meaning bad hunter. |
![]() ![]() |
![]() ![]() ![]() |
![]() |
#11 (permalink) |
Master of the Internet
|
![]() correct - if it is less than 0.005 then set it to 0.005 and also add in luck bonus then
__________________
http://www.AoAUO.com
![]() :) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
![]() ![]() |
![]() ![]() ![]() |
![]() |
Bookmarks |
Tags |
None |
Currently Active Users Viewing This Thread: 1 (1 members and 0 guests) | |
Nockar |
|
|