Advertisement
durginsurthin

Unarmed Combo Thing

Apr 12th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. var a = activator as Player
  2. World world = a.getWorld()
  3. var b = a.getHeldItemID()
  4. var c = a.getSwingsPerTick() * 20 as int
  5. if b != -1:
  6. return 0
  7. float yaw = a.getYaw() + (world.randomGaussian() as float) * 10f
  8. float pitch = a.getPitch() + (world.randomGaussian() as float) * 10f
  9. double nx = -sinDegrees(yaw) * cosDegrees(pitch)
  10. double ny = -sinDegrees(pitch) as double
  11. double nz = cosDegrees(yaw) * cosDegrees(pitch)
  12.  
  13. var affected = <Entity>[]
  14. double offset = 2.
  15.  
  16. a.swingAsWeapon()
  17.  
  18. world.getAllInAOE(
  19. a.getX() + offset * nx,
  20. a.getY() + offset * ny,
  21. a.getZ() + offset * nz,
  22. <Entity>[a],
  23. affected,
  24. 3.)
  25. def onUpdate(Living target, int i):
  26. return False
  27. for Entity target in affected:
  28. if target isa Living:
  29. for int i in c:
  30. var combo = (target as Living).getNumberOfEffects("combo") + 1
  31. a.tell((target as Living).getNumberOfEffects("combo"))
  32. a.attack(a, target, 1,combo,combo)
  33. (target as Living).applyTimedEffect(20,"combo",onUpdate($Living, $int))
  34. return 0
  35.  
  36.  
  37. return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement