Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.37 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Threading.Tasks;
  4. using System.Collections.Generic;
  5. using NewWidget.Core;
  6. using NewWidget.Core.Native;
  7. using NewWidget.Core.Scripting;
  8. using System.Windows.Forms;
  9.  
  10. public class Script : ScriptBase {
  11.  
  12.     int[] OLpriority = new int[]{115};
  13.     int[] BPpriority = new int[]{97};
  14.     int[] SWSpriority = new int[]{100};
  15.     int[] BARDpriority = new int[]{100, 107};
  16.     int time;
  17.     bool OL = true;
  18.     L2Player targetOL;
  19.     L2Player targetBP;
  20.     L2Player targetSWS;
  21.     L2Player targetBARD;
  22.     L2Player Over;
  23.     string uebakName = "tatosyan"; //Бишоп которого бернить
  24.  
  25.     public override void OnStart() {
  26.         base.OnStart();
  27.         Enabled = true;
  28.         CreateTimer(500, OverLord);
  29.         BindKey(System.Windows.Forms.Keys.W, () => !Me.IsDead, burnOL);
  30.        
  31.         CastStarted((actor) => OLpriority.Contains(actor.Class.Id) && checkDistance(actor, 0, 900), (actor) => {
  32.             OL = true;
  33.             time = 3;
  34.             Timer();
  35.         });
  36.     }
  37.  
  38.     void burnOL(){
  39.         if (!Me.IsDisabled){
  40.             var uebak = Players.FirstOrDefault(a => a.Name == uebakName);
  41.             targetOL = Players.Where(p => !p.IsDead && checkTargetConditions(p) && checkDistance(p, 0, 1500) && OLpriority.Contains(p.Class.Id))
  42.                 .OrderBy(p => p.DistanceToUser)
  43.                 .FirstOrDefault();
  44.             targetBP = Players.Where(p => !p.IsDead && checkTargetConditionsTrance(p) && checkDistance(p, 0, 700) && BPpriority.Contains(p.Class.Id))
  45.                 .OrderBy(p => p.DistanceToUser)
  46.                 .FirstOrDefault();
  47.             targetSWS = Players.Where(p => !p.IsDead && checkTargetConditionsTrance(p) && checkDistance(p, 0, 900) && SWSpriority.Contains(p.Class.Id))
  48.                 .OrderBy(p => p.DistanceToUser)
  49.                 .FirstOrDefault();
  50.             if(targetOL != null && OL == true){
  51.                 if (Me.SkillCooltime(1398) < 950){
  52.                     Client.FSetTarget(targetOL);
  53.                     Client.FUseSkill(1398, true); //mana burn
  54.             }
  55.                 else if (Me.SkillCooltime(1399) < 950 && targetOL != null && targetOL.DistanceToUser < 200 && OL == true){
  56.                    
  57.                     Client.FUseSkill(1399, true); //mass burn
  58.            
  59.            
  60.            
  61.                 }
  62.             }
  63.             else if (uebak != null){
  64.                 if (Me.SkillCooltime(1398) < 100 && OL == false){
  65.                     Client.FSetTarget(uebak);
  66.                     Client.FUseSkill(1398, true); //mana burn
  67.             }
  68.                 else if (Me.SkillCooltime(1399) < 950 && uebak != null && uebak.DistanceToUser < 200 && OL == false){
  69.                    
  70.                     Client.FUseSkill(1399, true); //mass burn
  71.             }
  72.            
  73.             else if (targetSWS != null){
  74.                 if (Me.SkillCooltime(1398) < 100){
  75.                     Client.FSetTarget(targetSWS);
  76.                     Client.FUseSkill(1398, true); //mana burn
  77.                     }
  78.         }
  79.     } } }
  80.        
  81.    
  82.    
  83.     void Timer(){
  84.         if (time == 3){
  85.         time = 2;
  86.         Wait (1000);
  87.             if (time == 2){
  88.             time = 1;
  89.             Wait(1000);
  90.                 if (time == 1){
  91.                 time = 0;
  92.                 Wait(1000);
  93.                     if (time == 0){
  94.                     OL = false;
  95.                     }
  96.                 }
  97.             }
  98.         }
  99.     }
  100.    
  101.     void OverLord(){
  102.         Over = Players.FirstOrDefault(p => !p.IsDead && checkDistance(p, 0, 900) && OLpriority.Contains(p.Class.Id));
  103.         if (Over == null){
  104.             OL = true;
  105.         }
  106.     }
  107.  
  108.     bool checkDistance(L2Player p, int d1, int d2)
  109.     {
  110.         return (p.DistanceToUser > d1 && p.DistanceToUser < d2);
  111.     }
  112.  
  113.  
  114.     bool checkTargetConditions(L2Player p)
  115.     {
  116.         return (!p.IsDead && !p.IsMedused && !p.IsCelestialed && p.IsAttackable && p.ZRangeToUser < 500);
  117.        
  118.     }
  119.  
  120.     bool checkTargetConditionsTrance(L2Player p)
  121.     {
  122.         return (!p.IsDead && !p.IsMedused && !p.IsCelestialed && !p.IsTranced && p.IsAttackable && p.ZRangeToUser < 500);
  123.        
  124.     }
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement