Guest User

Untitled

a guest
Jan 12th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using NewWidget.Core;
  5. using NewWidget.Core.Native;
  6. using NewWidget.Core.Scripting;
  7.  
  8. public class Script : ScriptBase {
  9.  
  10.  
  11. const int skilluse = 1436; //скилл которым сбивать
  12. const int distance = 900; //дистанция до цели
  13. //id скилов которые сбивать
  14. readonly int[] High = new int[] {1419};
  15. readonly int[] Medium = new int[] {1419};
  16. readonly int[] Low = new int[] {1419};
  17. public uint _castEndTime;
  18. public bool isHighPrioritet;
  19. public bool isMediumhPrioritet;
  20. public bool isLowPrioritet;
  21. public override void OnStart() {
  22.  
  23. base.OnStart();
  24. CastStarted(sopInterruptHigh);
  25. CastStarted(sopInterruptMedium);
  26. CastStarted(sopInterruptLow);
  27.  
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. void sopInterruptHigh () {
  36. var enemy = Players.FirstOrDefault(m => m.IsValid && m.IsAttackable );
  37.  
  38. if ( shouldInterruptHigh(enemy) && cancast ) {
  39. if ( !Me.Target
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. public bool shouldInterruptHigh(L2Live actor){
  55. if ( (actor.Cast.EndTime > 0) && (High.Contains(actor.Cast.Id) ) )
  56. {
  57. isHighPrioritet = true;
  58. return true;
  59. }
  60. else
  61. return false;
  62. }
  63.  
  64.  
  65. public bool shouldInterruptMedium(L2Live actor){
  66. if ( (actor.Cast.EndTime > 550 ) && (Medium.Contains(actor.Cast.Id) ) )
  67. {
  68. isMediumhPrioritet = true;
  69. return true;
  70. }
  71. else
  72. return false;
  73. }
  74.  
  75. public bool shouldInterruptLow(L2Live actor){
  76. if ( (actor.Cast.EndTime > 550 ) && (Low.Contains(actor.Cast.Id) ) )
  77. {
  78. isLowPrioritet = true;
  79. return true;
  80. }
  81. else
  82. return false;
  83. }
  84.  
  85. public bool isInterrupted(L2live obj){
  86.  
  87. if ( (obj.Cast.EndTime = 0) && ( GetTickCount() < _castEndTime) ) {
  88. return true;
  89. }
  90. }
  91.  
  92.  
  93.  
  94. public bool cancast()
  95. {
  96. int[] celesids = {1418, 1427};
  97. if (!Me.IsAffraid || !Me.IsTranced || !Me.IsDead || !Me.IsAnchored || !Me.IsMedused ||
  98. !Me.IsDead || ( !Me.Buffs.Any(b1 => celesids.Contains(b1.Id) ) )|| !Me.IsSilenced )
  99. return true;
  100. }
  101.  
  102.  
  103. }
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. }
Advertisement
Add Comment
Please, Sign In to add comment