JustPaste.it

Sub VG()


Dim crit_chance As Double
Dim crit_dmg As Double
Dim lifesteal As Double
Dim lifesteal_tab(1 To 30) As Double
Dim lifesteal_sum As Double
Dim wp As Double
Dim dmg_stacks As Double
Dim pierce As Double
Dim pierce1 As Double
Dim shred As Double
Dim shred1 As Double
Dim shred_tab(1 To 30) As Double
Dim tb1 As Double
Dim tb_tab(1 To 30) As Double
Dim tb_timer As Double
Dim bp_type As Double
Dim bp_tab(1 To 30) As Double
Dim armor As Double
Dim item(1 To 6) As Double
Dim dmg(1 To 30) As Double
Dim index As Double
Dim sum_dmg As Double
Dim attack_cd As Double
Dim attack_speed As Double
Dim basic_speed As Double
Dim speed_tab(1 To 30) As Double
Dim cost As Double
Dim a As Byte

 


crit_dmg = 1.5
crit_chance = 0
lifesteal = 0
pierce = 0
shred = 0
lifesteal_sum = 0
cost = 0


wp = InputBox("DEFINE HERO'S BASIC WEAPON DAMAGE" & vbNewLine & "(lvl 12 average is 143)")
armor = InputBox("DEFINE ENEMY'S ARMOR:" & vbNewLine & "" & vbNewLine & "Average level 12 without items: 86" & vbNewLine & "Average level 12 with Aegis/MJ: 286" & vbNewLine & "Joule lvl 12 (front) with Aegis/MJ/FoR: 464")
attack_speed = InputBox("DEFINE HERO'S ATTACK SPEED" & vbNewLine & "(lvl 12 average is 1.26)")
basic_speed = InputBox("DEFINE HERO'S BASIC ATTACK COOLDOWN" & vbNewLine & "(time between two constructive attacks for lvl 1 hero - usually 1.2 sec)")
a = InputBox("How many WP items do you want to have?" & vbNewLine & "(1 - 6)")

pierce1 = 0
tb1 = 0
stacks1 = 0
shred1 = 0
bp1 = 0

sum_dmg = 0

 

For i = 1 To a
item(i) = InputBox("Tornado Trigger=1" & vbNewLine & "Tyrant's Monocle=2" & vbNewLine & "Poisoned Shiv=3" & vbNewLine & "Sorrowblade=4" & vbNewLine & "Breaking Point=5" & vbNewLine & "Bonesaw=6" & vbNewLine & "Tension Bow=7" & vbNewLine & "Serpent Mask=8" & vbNewLine & "Barbed Needle=9" & vbNewLine & "Blazing Salvo=10" & vbNewLine & "Heavy Steel=11" & vbNewLine & "Lucky Strike=12" & vbNewLine & "Piercing Spear=13" & vbNewLine & "Six Sins=14" & vbNewLine & "Book of Eulogies=15" & vbNewLine & "Minion's Foot=16" & vbNewLine & "Swift Shooter=17" & vbNewLine & "Weapon Blade=18")
Next i

 


For i = 1 To a
If item(i) = 1 Then
attack_speed = attack_speed + 0.4
crit_chance = crit_chance + 0.35
crit_dmg = crit_dmg + 0.2
cost = cost + 2800
End If

If item(i) = 2 Then
wp = wp + 60
crit_chance = crit_chance + 0.35
crit_dmg = crit_dmg + 0.15
cost = cost + 2750
End If

If item(i) = 3 Then
attack_speed = attack_speed + 0.35
wp = wp + 35
lifesteal = lifesteal + 0.1
cost = cost + 2250
End If

If item(i) = 4 Then
wp = wp + 150
cost = cost + 3100
End If

If item(i) = 5 Then
attack_speed = attack_speed + 0.2
wp = wp + 55
cost = cost + 2600
bp1 = 1
bp_type = InputBox("Breaking Point type 1=melee, 2=ranged")
If bp_type = 1 Then
For j = 2 To 20
bp_tab(1) = 140
bp_tab(j) = bp_tab(j - 1) + 140 + 5 * (j - 1)
Next j
For j = 21 To 30
bp_tab(j) = bp_tab(j - 1)
Next j
End If
If bp_type = 2 Then
For k = 2 To 20
bp_tab(1) = 140
bp_tab(k) = bp_tab(k - 1) + 140 + 10 * (k - 1)
Next k
For k = 21 To 30
bp_tab(k) = bp_tab(k - 1)
Next k
End If
End If

If item(i) = 6 Then
attack_speed = attack_speed + 0.25
wp = wp + 15
pierce = pierce + 0.08
pierce1 = 1
shred1 = 1
cost = cost + 2700
End If

If item(i) = 7 Then
pierce = pierce + 0.12
wp = wp + 45
tb1 = 1
cost = cost + 2150
End If

If item(i) = 8 Then
lifesteal = lifesteal + 0.35
wp = wp + 85
cost = cost + 2800
End If

If item(i) = 9 Then
lifesteal = lifesteal + 0.1
wp = wp + 12
cost = cost + 800
End If

If item(i) = 10 Then
attack_speed = attack_speed + 0.2
cost = cost + 700
End If

If item(i) = 11 Then
wp = wp + 55
cost = cost + 1150
End If

If item(i) = 12 Then
crit_dmg = crit_dmg + 0.15
crit_chance = crit_chance + 0.2
cost = cost + 900
End If

If item(i) = 13 Then
pierce = pierce + 0.08
cost = cost + 900
wp = wp + 15
End If

If item(i) = 14 Then
wp = wp + 30
cost = cost + 650
End If

If item(i) = 15 Then
wp = wp + 5
cost = cost + 300
End If

If item(i) = 16 Then
crit_chance = crit_chance + 0.1
crit_dmg = crit_dmg + 0.1
cost = cost + 300
End If

If item(i) = 17 Then
attack_speed = attack_speed + 0.1
cost = cost + 300
End If

If item(i) = 18 Then
wp = wp + 15
cost = cost + 300
End If

Next i


'----------------------------------Other-----------------------------------------
If crit_chance > 1 Then
crit_chance = 1
End If


Cells(33, 2) = wp
Cells(34, 2) = attack_speed
Cells(35, 2) = crit_chance
Cells(36, 2) = crit_dmg
Cells(37, 2) = lifesteal
Cells(38, 2) = pierce
Cells(40, 2) = cost

'----------------------------------DAMAGE CALCULATION-----------------------------------


'----------------------------------ATTACK SPEED-----------------------------------------

attack_cd = basic_speed / attack_speed

For i = 1 To 30
speed_tab(i) = (i - 1) * attack_cd
Next i

For i = 1 To 30
Cells(i + 1, 2) = speed_tab(i)
Next i

dmg_stacks = 0
tb_timer = 0

For i = 1 To 30
Cells(i + 1, 1) = i
Next i

'----------------------------------BONESAW CALCULATION---------------------------------

For i = 1 To 7
shred_tab(i) = 0.05 * i * shred1
Next i

For i = 8 To 30
shred_tab(i) = 0.4 * shred1
Next i


For i = 1 To 30
Cells(i + 1, 6) = shred_tab(i)
Next i

'----------------------------------DAMAGE FORMULA-------------------------------------


For n = 0 To 29
If tb_timer <= 0 Then
dmg(n + 1) = pierce * (crit_chance * crit_dmg * (wp + dmg_stacks * bp1 + 180 * tb1) + (1 - crit_chance) * (wp + dmg_stacks * bp1 + 180 * tb1)) + (1 - pierce) * ((crit_chance * crit_dmg * (wp + dmg_stacks * bp1 + 180 * tb1)) / (1 + (armor / 100) - (shred1 * shred_tab(n + 1) * armor / 100)) + (1 - crit_chance) * (wp + dmg_stacks * bp1 + 180 * tb1) / (1 + (armor / 100) - (shred1 * shred_tab(n + 1) * armor / 100)))
tb_timer = 6
Else
dmg(n + 1) = pierce * (crit_chance * crit_dmg * (wp + dmg_stacks * bp1) + (1 - crit_chance) * (wp + dmg_stacks * bp1)) + (1 - pierce) * ((crit_chance * crit_dmg * (wp + dmg_stacks * bp1)) / (1 + (armor / 100) - (shred1 * shred_tab(n + 1) * armor / 100)) + (1 - crit_chance) * (wp + dmg_stacks * bp1) / (1 + (armor / 100) - (shred1 * shred_tab(n + 1) * armor / 100)))
End If
lifesteal_tab(n + 1) = dmg(n + 1) * lifesteal
Cells(n + 2, 7) = lifesteal_tab(n + 1)
Cells(n + 2, 3) = dmg(n + 1)
lifesteal_sum = lifesteal_sum + lifesteal_tab(n + 1)
Cells(n + 2, 8) = lifesteal_sum
dmg_stacks = 0
sum_dmg = sum_dmg + dmg(n + 1)
Cells(n + 2, 4) = sum_dmg
For m = 1 To 20
If sum_dmg > bp_tab(m) Then
index = m
End If
Next m
dmg_stacks = index * 10
Cells(n + 2, 5) = index * bp1
tb_timer = tb_timer - attack_cd
Next n

 

 

 

End Sub