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 tick = Environment.TickCount;
int delay = 8000;
public override void OnStart() {
base.OnStart();
CreateTimer(300, kura);
CastStarted(timeout);
}
void timeout(L2Player actor)
{
int[] casts = {1401, 1013, 1553, 1016};
if(actor == Me && casts.Contains(Me.Cast.Id))
{
tick = Environment.TickCount;
}
}
void kura()
{
if(Me.Pet == null || Environment.TickCount < tick + delay)
{
return;
}
if(Me.MP < 50 && Me.Pet.Id == 16035 && Me.Cast.Id == 0 && Me.Pet.Cast.Id == 0 &&
!Me.IsInCombat && !Me.IsDead && !Me.Pet.IsDead)
{
var target = Me.Target;
if(Client.SetTarget(Me.Pet) || Me.Target == Me.Pet)
{
Client.UseSkill(1539, true);
}
if(target != null)
{
Client.SetTarget(target);
}
}
}
}