Guest User

Untitled

a guest
May 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.Vault)]
  2. public class DemonHunterVault : PowerScript
  3. {
  4. public override IEnumerable<TickTimer> Run()
  5. {
  6. //StartCooldown(WaitSeconds(10f));
  7.  
  8. Vector3D delta = new Vector3D(TargetPosition - User.Position);
  9. float delta_length = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
  10. Vector3D delta_normal = new Vector3D(delta.X / delta_length, delta.Y / delta_length, delta.Z / delta_length);
  11. float unitsMovedPerTick = 60f;
  12. Vector3D ramp = new Vector3D(delta_normal.X * (delta_length / unitsMovedPerTick),
  13. delta_normal.Y * (delta_length / unitsMovedPerTick),
  14. 0.1f); // usual leap height, possibly different when jumping up/down?
  15.  
  16. // TODO: Generalize this and put it in Actor
  17. User.World.BroadcastIfRevealed(new ACDTranslateArcMessage()
  18. {
  19. ActorId = (int)User.DynamicID,
  20. Start = User.Position,
  21. Velocity = ramp,
  22. //Field3 = 69793, // used for male barb leap
  23. FlyingAnimationTagID = 69792, // used for female dh backflip
  24. LandingAnimationTagID = 69794,
  25. Field6 = -0.1f, // gravity
  26. Field7 = Skills.Skills.DemonHunter.Discipline.Vault,
  27. Field8 = 0,
  28. Field9 = TargetPosition.Z,
  29. }, User);
  30. User.Position = TargetPosition;
  31.  
  32. // wait for leap to hit
  33. yield return WaitSeconds(0.6f);
  34.  
  35. yield break;
  36. }
  37. }
  38. [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.FanOfKnives)]
  39. public class DemonHunterFanOfKnives : PowerScript
  40. {
  41. public override IEnumerable<TickTimer> Run()
  42. {
  43. UsePrimaryResource(20f);
  44. //StartCooldown(WaitSeconds(10f));
  45. AttackPayload attack = new AttackPayload(this);
  46. attack.AddTargets(GetEnemiesInRadius(User.Position, 10));
  47. attack.AddWeaponDamage(0.5f, DamageType.Physical);
  48. attack.OnHit = (hit) =>
  49. {
  50. AddBuff(hit.Target, new DebuffSlowed(WaitSeconds(4f)));
  51. };
  52. attack.Apply();
  53. //WeaponDamage(GetEnemiesInRadius(User.Position, 10f), 1.00f, DamageType.Physical);
  54. User.PlayEffectGroup(77547);
  55. yield break;
  56. }
  57.  
  58. }
Add Comment
Please, Sign In to add comment