Треш банки

jr

Administrator
Команда форума
C#:
using System;
using System.Linq;
using System.Collections.Generic;
using NewWidget.Core;
using NewWidget.Core.Native;
using NewWidget.Core.Scripting;

class Potion {
    public int ItemId;
    public int BuffId;
    
    public Potion(int item, int buff) {
        ItemId = item;
        BuffId = buff;
    }
}

public class Script : ScriptBase {

    // количество бафов, если меньше - будет использовать поушены
    int BuffsCount = 23;

    // массив используемых поушенов
    // у большинства поушенов разные id предмета и баффа !
    Potion[] Pots = new Potion[] {
        new Potion(8786, 2305), // primeval potion
        new Potion(8193, 2274), // fisherman green
        new Potion(9997, 2335), // fire potion
        new Potion(1375, 2035), // atk speed
        new Potion(6036, 2169), // cast speed
        new Potion(1374, 2034), // walk speed
        new Potion(5234, 2103), // mystery potion
        new Potion(4679, 2076)    // bless of eva
    };
    
    public override void OnStart() {
        base.OnStart();
        CreateTimer(200, PotionsUseable, UsePotions);
        Enabled = true;
    }
    
    void UsePotions() {
        var pot = Pots.FirstOrDefault(p => Me.CommonInventory.Any(i => i.Id == p.ItemId) && Me.BuffEndtime(p.BuffId) == 0);
        if (pot != null) {
            Client.UseItem(pot.ItemId);
            Wait(500);
        }
    }
    
    bool PotionsUseable() {
        return !Me.IsDisabled && Me.Buffs.Count(IsBuff) < BuffsCount;
    }
    
    bool IsBuff(L2Effect e) {
        return
            e.Data == null
            ? true
            : e.Data.IsMagic != 3/*sd*/ && e.Data.IsMagic != 4/*trigger*/ && !e.Data.IsDebuff && e.Data.OperationType != OperationTypes.Toggle;
    }
    
}
 

jr

Administrator
Команда форума
вариант при котором используются все банки, если кто то кастует кансел в игрока

C#:
using System;
using System.Linq;
using System.Collections.Generic;
using NewWidget.Core;
using NewWidget.Core.Native;
using NewWidget.Core.Scripting;

public class Script : ScriptBase {

    int[] pots = new[] {
        8786, // primeval potion
        8193, // fisherman green
        9997, // fire potion
        1375, // atk speed
        6036, // cast speed
        1374, // walk speed
        5234, // mystery potion
        4679 // bless of eva
    };

    public override void OnStart() {
        base.OnStart();
        
        CastStarted(
            a => a.Target == Me && (a.Cast.Id == 1056 || a.Cast.Id == 1440), // cancel/steal
            a => {
                foreach (var id in pots)
                    Client.UseItem(id);
            }
        );
    }

}
 

asdf

New member
вариант при котором используются все банки, если кто то кастует кансел в игрока

C#:
using System;
using System.Linq;
using System.Collections.Generic;
using NewWidget.Core;
using NewWidget.Core.Native;
using NewWidget.Core.Scripting;

public class Script : ScriptBase {

    int[] pots = new[] {
        8786, // primeval potion
        8193, // fisherman green
        9997, // fire potion
        1375, // atk speed
        6036, // cast speed
        1374, // walk speed
        5234, // mystery potion
        4679 // bless of eva
    };

    public override void OnStart() {
        base.OnStart();
       
        CastStarted(
            a => a.Target == Me && (a.Cast.Id == 1056 || a.Cast.Id == 1440), // cancel/steal
            a => {
                foreach (var id in pots)
                    Client.UseItem(id);
            }
        );
    }

}
типо после канцела сразу треш баф или как?
 

ZdarovaParni

New member
Подскажите ,
вариант при котором используются все банки, если кто то кастует кансел в игрока

C#:
using System;
using System.Linq;
using System.Collections.Generic;
using NewWidget.Core;
using NewWidget.Core.Native;
using NewWidget.Core.Scripting;

public class Script : ScriptBase {

    int[] pots = new[] {
        8786, // primeval potion
        8193, // fisherman green
        9997, // fire potion
        1375, // atk speed
        6036, // cast speed
        1374, // walk speed
        5234, // mystery potion
        4679 // bless of eva
    };

    public override void OnStart() {
        base.OnStart();
       
        CastStarted(
            a => a.Target == Me && (a.Cast.Id == 1056 || a.Cast.Id == 1440), // cancel/steal
            a => {
                foreach (var id in pots)
                    Client.UseItem(id);
            }
        );
    }

}
Подскажите а в чем может быть проблема ? прожимается только 1 первый шот , ид всех итемов верно .
 
Сверху