Advertisement
Guest User

Untitled

a guest
May 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. function PLUGIN:EntityTakeDamage( target, dmginfo )
  2. -- orig helix plugin
  3. /* if ( target:IsPlayer() ) then
  4. if ( target:GetNetVar("resistance") == true ) then
  5. if (dmginfo:IsDamageType(DMG_BULLET)) then
  6. dmginfo:ScaleDamage(target:GetNWFloat("dmg_bullet"))
  7. elseif (dmginfo:IsDamageType(DMG_SLASH)) then
  8. dmginfo:ScaleDamage(target:GetNWFloat("dmg_slash"))
  9. elseif (dmginfo:IsDamageType(DMG_SHOCK)) then
  10. dmginfo:ScaleDamage(target:GetNWFloat("dmg_shock"))
  11. elseif (dmginfo:IsDamageType(DMG_BURN)) then
  12. dmginfo:ScaleDamage(target:GetNWFloat("dmg_burn"))
  13. elseif (dmginfo:IsDamageType(DMG_RADIATION)) then
  14. dmginfo:ScaleDamage(target:GetNWFloat("dmg_radiation"))
  15. elseif (dmginfo:IsDamageType(DMG_ACID)) then
  16. dmginfo:ScaleDamage(target:GetNWFloat("dmg_acid"))
  17. elseif (dmginfo:IsExplosionDamage()) then
  18. dmginfo:ScaleDamage(target:GetNWFloat("dmg_explosive"))
  19. end
  20. end
  21. end*/
  22.  
  23. --original suit plugin from NS
  24. -- Bullet resistance
  25. if ( target:IsPlayer() and dmginfo:IsDamageType(DMG_BULLET)) then
  26. local damage = dmginfo:GetDamage()
  27. local perRes = target:GetNWFloat("ixperbulletres")
  28. local flatRes = target:GetNWInt("ixflatbulletres")
  29. local suitDuraDmg = damage / 100
  30. local suit = target:getEquippedBodyArmor()
  31.  
  32. if suit != nil then
  33. suit:SetData("durability", math.Clamp(suit:getData("durability", 100) - suitDuraDmg, 0, 100))
  34. end
  35.  
  36. damage = damage * (1-perRes)
  37. damage = damage - flatRes
  38.  
  39. dmginfo:SetDamage(damage)
  40. end
  41.  
  42. --Anomaly resistance
  43. local anomtypes = {}
  44. anomtypes[DMG_SHOCK] = true
  45. anomtypes[DMG_BURN] = true
  46. anomtypes[DMG_ACID] = true
  47. anomtypes[DMG_BLAST] = true
  48. anomtypes[DMG_SONIC] = true
  49.  
  50. if ( entity:IsPlayer() and anomtypes[dmginfo:GetDamageType()]) then
  51. local damage = dmgInfo:GetDamage()
  52. local perRes = target:GetNWFloat("ixperanomres")
  53. local flatRes = target:GetNWInt("ixflatanomres")
  54. local suitDuraDmg = damage / 50
  55. local suit = entity:getEquippedBodyArmor()
  56.  
  57. if suit != nil then
  58. suit:SetData("durability", math.Clamp(suit:getData("durability", 100) - suitDuraDmg, 0, 100))
  59. end
  60.  
  61. damage = damage * (1-perRes)
  62. damage = damage - flatRes
  63.  
  64. dmgInfo:SetDamage(damage)
  65. end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement