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
Archived Bug Reports Sheep not shearable anymore? Aug 24, 2017
Archived Bug Reports Stone stairs and walls- more clarification Jul 17, 2017
SA & High Seas More Kings Collection Items Feb 8, 2017
The Back Room no more Runuo Jan 23, 2017
Script Support Giving a mob more than one weapon ability? Jan 6, 2017
Announcements More Bugfixes Dec 21, 2016
Script Support Issues with Multis (houses, boats and more) Dec 15, 2016