Thread: Barrage Timers

Results 1 to 8 of 8
  1. #1 Barrage Timers 
    Woeshie
    Guest
    How do I add barrage timers? (Code?)

    Rep++
    Reply With Quote  
     

  2. #2  
    Brown
    Guest
    As in before you can cast the next one..?
    You can use System.currentTimeMillis() timers.
    In Player.java or Client.java you have a long called lastSpellCast or something.
    Everytime you cast, you check:
    Code:
    if(player.lastSpellCast - System.currentTimeMillis() > (the delay you want)) {
    return; //The barrage code below is never read.
    }
    And once you've successfully casted a spell, you do player.lastSpellCast = System.currentTimeMillis()

    Get it..?
    Reply With Quote  
     

  3. #3  
    Woeshie
    Guest
    Quote Originally Posted by Brown View Post
    As in before you can cast the next one..?
    You can use System.currentTimeMillis() timers.
    In Player.java or Client.java you have a long called lastSpellCast or something.
    Everytime you cast, you check:
    Code:
    if(player.lastSpellCast - System.currentTimeMillis() > (the delay you want)) {
    return; //The barrage code below is never read.
    }
    And once you've successfully casted a spell, you do player.lastSpellCast = System.currentTimeMillis()

    Get it..?
    I don't get it, please explain it some better, like a little C&P tutorial
    Reply With Quote  
     

  4. #4  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    c+p doesnt help you learn, im learnin too, so ill keep analyzing the code til i get some form of an idea of how it works. helps alot
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Oct 2009
    Age
    30
    Posts
    320
    Thanks given
    43
    Thanks received
    45
    Rep Power
    0
    what base?
    Reply With Quote  
     

  6. #6  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    ... wouldnt matter
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    just rip someone elses paraidse base has em for a fact. even tho there 2 slow imo
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jul 2009
    Posts
    475
    Thanks given
    1
    Thanks received
    4
    Rep Power
    56
    Quote Originally Posted by Brown View Post
    As in before you can cast the next one..?
    You can use System.currentTimeMillis() timers.
    In Player.java or Client.java you have a long called lastSpellCast or something.
    Everytime you cast, you check:
    Code:
    if(player.lastSpellCast - System.currentTimeMillis() > (the delay you want)) {
    return; //The barrage code below is never read.
    }
    And once you've successfully casted a spell, you do player.lastSpellCast = System.currentTimeMillis()

    Get it..?
    Yes but System.currentTimeMillis() isnt a good way cuz you cant cast a spell after you hit with meele but u can mass with range.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •