scn ACWBladeDmgScript
[COLOR="SeaGreen"]short equipped[/COLOR]
short htoh
short blade
short dex
short str
short hitonce
float dmg
float N
float M
float AR
float absorb
float dif
ref target
[COLOR="SeaGreen"]Begin OnEquip player
set equipped to 1
End
Begin OnUnequip player
set equipped to 0
End
begin GameMode
If equipped == 0
return
Elseif equipped == 1[/COLOR]
set target to getcrosshairref
set htoh to player.getav handtohand
set blade to player.getav blade
set dex to player.getav agility
set str to player.getav strength
set AR to target.getarmorrating/100
set N to ((htoh+blade)/2)/100
set M to ((dex+str)/2)/100
If N > 1
set N to 1
endif
If M > 1
set M to 1
endif
if player.isattacking
if target.isactor
if player.isanimgroupplaying attackleft
set absorb to (((pow dex N)/4)+((pow htoh N)/4)+((pow blade M)/8)+((pow str M)/8))*(AR*-1)
set dif to ((((pow dex N)/4)+((pow htoh N)/4)+((pow blade M)/8)+((pow str M)/8))*-1)-absorb
set dmg to ceil dif
if player.getav health <= dmg
player.kill
else
player.modav2 health dmg
endif
endif
endif
endif
printc "dmg: %.2f dif: %.2f absorb: %.2f", dmg, dif, absorb
[COLOR="SeaGreen"]Endif[/COLOR]
end