PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Common.Plugins;
using Zeta.Internals;
using Zeta.Internals.Actors;
using Zeta.Internals.Service;
using Action = System.Action;
//Created by: w3eZle
//Credit to: eax (http://www.thebuddyforum.com/members/144149-eax.html) No1KnowsY (http://www.thebuddyforum.com/members/11607-no1knowsy.html)
//Based script on these guys work
//Created Date: 12June2012
namespace Sarkoth
{
public class Sarkoth : IPlugin
{
private bool IsRestarting { get; set; }
private List<Vector3> LoggedPositions { get; set; }
public Version Version { get { return new Version(0, 1); } }
public string Author { get { return "Mduhb"; } }
public string Description { get { return "Disable KillMonsters unless in DankCellar."; } }
public string Name { get { return "Sarkoth Kill Wait v" + Version; } }
public Window DisplayWindow
{
get
{
return null;
}
}
private void Log(string message)
{
Logging.Write(string.Format("[{0}] {1}", Name, message));
}
public void OnInitialize()
{
LoggedPositions = new List<Vector3>();
IsRestarting = false;
}
public void OnPulse()
{
/*
var porra = ZetaDia.Actors.GetActorsOfType<DiaObject>().Where(u => u.ActorSNO == 112245);
foreach (var a in ZetaDia.Actors.GetActorsOfType<DiaObject>())
{
//Log(a.Distance.ToString());
}
*/
// if we're not in game and not in the process of restarting, do nothing
if (!ZetaDia.IsInGame || !ZetaDia.Me.IsValid || IsRestarting)
{
LoggedPositions.Clear();
return;
}
//Logging.Write("Checando Tempo: {0}", LoggedPositions.Count());
/*
if (LoggedPositions.Count > 20)
{
if (porra.Count() == 0)
{
//ZetaDia.Me.UseTownPortal();
//Thread.Sleep(7000);
//Zeta.CommonBot.Profile.Common.LeaveGameTag;
}
}
*/
if (ZetaDia.Actors.Me.HitpointsCurrentPct < 0.60 && ProfileManager.CurrentProfile.KillMonsters == false)
{
Log("Turning on KillMonsters -Health to low");
ProfileManager.CurrentProfile.KillMonsters = true;
return;
}
//Outside of DankC ellar, Diable Kill Monsters
if (ZetaDia.Actors.Me.HitpointsCurrentPct > 0.60 && ProfileManager.CurrentProfile.KillMonsters == true && ZetaDia.CurrentWorldDynamicId == 1999503360)
{
Log("Disabeling KillMonsters & PickupLoot");
ProfileManager.CurrentProfile.KillMonsters = false;
ProfileManager.CurrentProfile.PickupLoot = false;
return;
}
//Inside of Dank Cellar, Enable Kill Monsters
if (ProfileManager.CurrentProfile.KillMonsters == false && ZetaDia.CurrentWorldDynamicId == 1999568897)
{
Verificando();
Log("Enabeling KillMonsters & PickupLoot");
ProfileManager.CurrentProfile.KillMonsters = true;
ProfileManager.CurrentProfile.PickupLoot = true;
return;
}
}
public void Verificando()
{
var mobs = ZetaDia.Actors.GetActorsOfType<DiaUnit>().Where(u => u.IsAttackable);
var items = ZetaDia.Actors.GetActorsOfType<DiaItem>().Where(u => u.IsValid);
Logging.Write("Mobs: {0}", mobs.Count());
Logging.Write("Item: {0}", items.Count());
if (mobs.Count() == 0)
{
if (items.Count() <= 3)
{
ZetaDia.Me.UseTownPortal();
}
}
}
public void OnShutdown()
{
}
public void OnEnabled()
{
Logging.Write("Enabled.");
}
public void OnDisabled()
{
Logging.Write("Disabled.");
}
public bool Equals(IPlugin other)
{
return (other.Name == Name) && (other.Version == Version);
}
}
}