Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a = activator as Player
- World world = a.getWorld()
- var b = a.getHeldItemID()
- var c = a.getSwingsPerTick() * 20 as int
- if b != -1:
- return 0
- float yaw = a.getYaw() + (world.randomGaussian() as float) * 10f
- float pitch = a.getPitch() + (world.randomGaussian() as float) * 10f
- double nx = -sinDegrees(yaw) * cosDegrees(pitch)
- double ny = -sinDegrees(pitch) as double
- double nz = cosDegrees(yaw) * cosDegrees(pitch)
- var affected = <Entity>[]
- double offset = 2.
- a.swingAsWeapon()
- world.getAllInAOE(
- a.getX() + offset * nx,
- a.getY() + offset * ny,
- a.getZ() + offset * nz,
- <Entity>[a],
- affected,
- 3.)
- def onUpdate(Living target, int i):
- return False
- for Entity target in affected:
- if target isa Living:
- for int i in c:
- var combo = (target as Living).getNumberOfEffects("combo") + 1
- a.tell((target as Living).getNumberOfEffects("combo"))
- a.attack(a, target, 1,combo,combo)
- (target as Living).applyTimedEffect(20,"combo",onUpdate($Living, $int))
- return 0
- return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement