Results 1 to 5 of 5
  1. #1

    Retired Prophet
    ToxicJew.'s Avatar
    Join Date
    Mar 2011
    Location
    S̢͎̳̞̲͈̪̳̻ͮͩt̟̳̏ͬ̔&#
    Posts
    7,782
    Points
    7,587
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    S̢͎̳̞̲͈̪̳̻ͮͩt̟̳̏ͬ̔&#
    Posts
    7,782
    Points
    7,587

    Contact info:

    Youtube Channel: http://www.youtube.com/kennethbgoodin

    Default Algorithm I wrote.

    This is an algorithm I wrote a while ago for a plugin I'm working on, and I'm pretty proud of it.





    Basically, it takes a player's current level, and how much a potion the player will drink will drop that level, and if that amount is below the next multiple of ten (i.e. 20, 30, 40, etc.), it will only drop the player's level down to that multiple of ten.

    To explain better, say the player's level is 43. And he drinks a potion that would drop his level 5 points normally. This method calculates that he can only drop 3 levels before hitting a multiple of ten, which is a no-no.

    The point of this was to enforce one of the rules of the game.

    4 Not allowed! Not allowed!
    ส็็็็็็็็็็็็็็็็็็็็็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้ส็็็็็็็็็็็็็็็็็็็็ ็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้

  2. #2
    Penish
    Join Date
    Feb 2012
    Posts
    1,540
    Points
    2,647
         User Info     Contact     Gamer ID
    Join Date
    Feb 2012
    Posts
    1,540
    Points
    2,647

    Default

    That's really cool man

    I wish I had the patients to do that kind of shit

    0 Not allowed! Not allowed!

  3. #3
    I agree. MatthewH's Avatar
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    3,481
    Points
    15,810
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    3,481
    Points
    15,810

    Default

    And what is the rule this algorithm is enforcing?
    It looks very good either way.

    0 Not allowed! Not allowed!


  4. #4

    Retired Prophet
    ToxicJew.'s Avatar
    Join Date
    Mar 2011
    Location
    S̢͎̳̞̲͈̪̳̻ͮͩt̟̳̏ͬ̔&#
    Posts
    7,782
    Points
    7,587
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    S̢͎̳̞̲͈̪̳̻ͮͩt̟̳̏ͬ̔&#
    Posts
    7,782
    Points
    7,587

    Contact info:

    Youtube Channel: http://www.youtube.com/kennethbgoodin

    Default

    I would think it's evident from the OP; basically, once a multiple of ten level is reached, a player physically can't drop below that level, and this ensures that it never happens.

    0 Not allowed! Not allowed!
    ส็็็็็็็็็็็็็็็็็็็็็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้ส็็็็็็็็็็็็็็็็็็็็ ็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้

  5. #5
    I agree. MatthewH's Avatar
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    3,481
    Points
    15,810
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    3,481
    Points
    15,810

    Default

    Quote Originally Posted by ToxicJew. View Post
    I would think it's evident from the OP; basically, once a multiple of ten level is reached, a player physically can't drop below that level, and this ensures that it never happens.
    Well I was thinking some different. But I got you. Just checking.

    0 Not allowed! Not allowed!


Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 05:39 PM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.