1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

More like math support :P

Discussion in 'Script Support' started by RoninGT, Aug 29, 2013.

  1. RoninGT
    Offline

    RoninGT Active Member

    Joined:
    Aug 15, 2013
    Messages:
    119
    Likes Received:
    35
    Ok so I wont lie and say math is not my strong suit. So below is my problem

    Code (C#):
    1.  
    2. if ( FSHSR.HSRTournamentSystem.TournamentRunning() && skillValue >= 60.0 )
    3. {
    4.                 double chance = ( skillValue - 60.0 ) / ( 560.0 - 60.0 ); // Default 12% Chance at 120??? Will Confirm.
    5.              
    6.                 if ( DateTime.Now.DayOfWeek == FSHSR.HSRTournamentSystem.TournyOne && dungeon == true && chance > Utility.RandomDouble() )
    7.                 {
    8.                     return typeof( ToxicTrout );
    9.                 }
    10.                 else if ( DateTime.Now.DayOfWeek == FSHSR.HSRTournamentSystem.TournyTwo && deepWater == true && chance > Utility.RandomDouble() )
    11.                 {
    12.                     return typeof( CottonCandySwordfish );
    13.                 }
    14. }
    15.  
    So if a player had say 120 skill (skillValue) and that math formula above... Would it not be a 12% chance??? or do I maybe need to go back to school :)

    Ronin
     
    #1 RoninGT, Aug 29, 2013
    Last edited: Aug 29, 2013
  2. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Code (C#):
    1.  
    2. double chance = ( skillValue - 60.0 ) / ( 560.0 - 60.0 );
    3.  
    Why start with 560 and subtract 60 before dividing? Why not just divide by 500 to begin with?

    But yes, the min and max range for this formula would be 0.0-0.12
     
    • Like Like x 1
  3. RoninGT
    Offline

    RoninGT Active Member

    Joined:
    Aug 15, 2013
    Messages:
    119
    Likes Received:
    35
    It was just a copy of the formula used in fishing.cs and thank you
     
Similar Threads: More math
Forum Title Date
Script Support I rly don't know more what try Apr 11, 2018
General Discussion Scripts, Scripts, and... More Scripts Mar 23, 2018
Archived Bug Reports More Issues with Injected Strike Feb 3, 2018
Archived Bug Reports This Is More Of A Fix For Ioseph : MondainQuester Jan 31, 2018
Archived Bug Reports Staff triggers the gauntlet to create more spawn Jan 14, 2018
Script Support Trying to make bod reward runic hammer have more charge. Nov 21, 2017
Archived Bug Reports Sheep not shearable anymore? Aug 24, 2017