Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Collections.Generic;
- using NewWidget.Core;
- using NewWidget.Core.Native;
- using NewWidget.Core.Scripting;
- using System.Windows.Forms;
- public class Script : ScriptBase {
- int[] OLpriority = new int[]{115};
- int[] BPpriority = new int[]{97};
- int[] SWSpriority = new int[]{100};
- int[] BARDpriority = new int[]{100, 107};
- int time;
- bool OL = true;
- L2Player targetOL;
- L2Player targetBP;
- L2Player targetSWS;
- L2Player targetBARD;
- L2Player Over;
- string uebakName = "tatosyan"; //Бишоп которого бернить
- public override void OnStart() {
- base.OnStart();
- Enabled = true;
- CreateTimer(500, OverLord);
- BindKey(System.Windows.Forms.Keys.W, () => !Me.IsDead, burnOL);
- CastStarted((actor) => OLpriority.Contains(actor.Class.Id) && checkDistance(actor, 0, 900), (actor) => {
- OL = true;
- time = 3;
- Timer();
- });
- }
- void burnOL(){
- if (!Me.IsDisabled){
- var uebak = Players.FirstOrDefault(a => a.Name == uebakName);
- targetOL = Players.Where(p => !p.IsDead && checkTargetConditions(p) && checkDistance(p, 0, 1500) && OLpriority.Contains(p.Class.Id))
- .OrderBy(p => p.DistanceToUser)
- .FirstOrDefault();
- targetBP = Players.Where(p => !p.IsDead && checkTargetConditionsTrance(p) && checkDistance(p, 0, 700) && BPpriority.Contains(p.Class.Id))
- .OrderBy(p => p.DistanceToUser)
- .FirstOrDefault();
- targetSWS = Players.Where(p => !p.IsDead && checkTargetConditionsTrance(p) && checkDistance(p, 0, 900) && SWSpriority.Contains(p.Class.Id))
- .OrderBy(p => p.DistanceToUser)
- .FirstOrDefault();
- if(targetOL != null && OL == true){
- if (Me.SkillCooltime(1398) < 950){
- Client.FSetTarget(targetOL);
- Client.FUseSkill(1398, true); //mana burn
- }
- else if (Me.SkillCooltime(1399) < 950 && targetOL != null && targetOL.DistanceToUser < 200 && OL == true){
- Client.FUseSkill(1399, true); //mass burn
- }
- }
- else if (uebak != null){
- if (Me.SkillCooltime(1398) < 100 && OL == false){
- Client.FSetTarget(uebak);
- Client.FUseSkill(1398, true); //mana burn
- }
- else if (Me.SkillCooltime(1399) < 950 && uebak != null && uebak.DistanceToUser < 200 && OL == false){
- Client.FUseSkill(1399, true); //mass burn
- }
- else if (targetSWS != null){
- if (Me.SkillCooltime(1398) < 100){
- Client.FSetTarget(targetSWS);
- Client.FUseSkill(1398, true); //mana burn
- }
- }
- } } }
- void Timer(){
- if (time == 3){
- time = 2;
- Wait (1000);
- if (time == 2){
- time = 1;
- Wait(1000);
- if (time == 1){
- time = 0;
- Wait(1000);
- if (time == 0){
- OL = false;
- }
- }
- }
- }
- }
- void OverLord(){
- Over = Players.FirstOrDefault(p => !p.IsDead && checkDistance(p, 0, 900) && OLpriority.Contains(p.Class.Id));
- if (Over == null){
- OL = true;
- }
- }
- bool checkDistance(L2Player p, int d1, int d2)
- {
- return (p.DistanceToUser > d1 && p.DistanceToUser < d2);
- }
- bool checkTargetConditions(L2Player p)
- {
- return (!p.IsDead && !p.IsMedused && !p.IsCelestialed && p.IsAttackable && p.ZRangeToUser < 500);
- }
- bool checkTargetConditionsTrance(L2Player p)
- {
- return (!p.IsDead && !p.IsMedused && !p.IsCelestialed && !p.IsTranced && p.IsAttackable && p.ZRangeToUser < 500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement