Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hits to Kill Script
#21
Okay, got it.

Do I do skills before or after subtracting defense?

Like, for Corkscrew for instance, 420% onto my range, then do the max/min defense reduc?

Would it even matter?
Reply
#22
Order of Operations says it all, but subtract defense first.

And tbh it wouldn't work very well for a Brawler because they don't spam skills.
Reply
#23
Okay, I did that.

How come nothing is coming up now?

It says

"Mean:" And then blankness.

I put 16000 for hp
1742 for Min
3401 for max

1 hit per attack
Reply
#24
Hm. I'm getting a result, 6.74 hits on average. It might not work on your browser, I didn't check for that. I'm using Firefox 3.

Critical damage is unchecked, right?

Edit: Works on IE as well, but the mean damage displays in the wrong place. The result is still the same, though.
Reply
#25
I'm on Opera - that's probably why.
And yes, it's unchecked.
Reply
#26
So what's the formula you ended up using?

I'm quite curious
Reply
#27
Copypasta:

Code:
/* probability to deal x or greater damage in n hits with damage range a to b */
function dicecdf(x,a,b,n) {
    var result = 0;
    var c;
    for(k=0;k<=n;k++) {
        c = a*(n-k)+b*k;
        if(x>=c) [b]result += choose(n,k)*Math.pow(-1,k)*Math.pow(x-c,n)[/b];
    }
    result = [b]1-result/Math.pow(b-a,n)/factorial(n)[/b];
    if(result < 0) result = 0;
    return result;
}

/* factorial function */
function factorial(x) {
    var result = 1;
    for(i=1;i<=x;i++) {
        result *= i;
    }
    return result;
}

/* choose function */
function choose(a,b) {
    var result = 1;
    for(i=1;i<=b;i++) {
        result *= (a-i+1)/i;
    }
    return result;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)