I found this is plugin is more effective when I lower the kill and loot radius outside the cellar. Because pathing is so slow, the bot gets killed a lot standing there either TP'ing or pathing. You can do this easily by editing the if statements in the OnPulse() function using the following properties:
Zeta.CommonBot.Settings.CharacterSettings.Instance.KillRadius
Zeta.CommonBot.Settings.CharacterSettings.Instance.LootRadius
I hard code the radius values in the plugin itself. I tried reading and storing the values that were set in the main UI but I ran into some weird bugs.. I'll try and fix that later.
My bots are performing much faster at between 290-300 gph where as they were previously at 200. I have about 250% GF with both a WD and a DH. DPS: 19k, MS: 18%
edit: Thanks to all the prior plugin coders. Got a good understanding of the eventing structure.
Code:
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;
//Created by: adx
//Credit to: w3eZle (http://www.thebuddyforum.com/members/144563-w3ezle.html)
// eax (http://www.thebuddyforum.com/members/144149-eax.html)
// No1KnowsY (http://www.thebuddyforum.com/members/11607-no1knowsy.html)
//Script based on their original work
//Created Date: 14June2012
namespace Sarkoth
{
public class Sarkoth : IPlugin
{
private bool IsRestarting { get; set; }
public Version Version { get { return new Version(0, 1); } }
public string Author { get { return "adx"; } }
public string Description { get { return "reduce monster kill radius."; } }
public string Name { get { return "Sarkoth Kill Reduce" + Version; } }
//hard coding for now...
private float originalKillRadius = 40; //store original kill radius
private float reducedKillRadius = 10; //reduced radius
private float originalLootRadius = 30; //store original kill radius
private float reducedLootRadius = 10; //reduced radius
public Window DisplayWindow
{
get
{
return null;
}
}
private void Log(string message)
{
Logging.Write(string.Format("[{0}] {1}", Name, message));
}
public void OnInitialize()
{
IsRestarting = false;
}
public void OnPulse()
{
// if we're not in game and not in the process of restarting, do nothing
if (!ZetaDia.IsInGame || !ZetaDia.Me.IsValid || IsRestarting)
{
return;
}
//Outside of Dank Cellar, reduce kill radius
if (Zeta.CommonBot.Settings.CharacterSettings.Instance.KillRadius != reducedKillRadius
&& ZetaDia.CurrentWorldDynamicId == 1999503360)
{
Log("Reducing kill and loot radius");
Zeta.CommonBot.Settings.CharacterSettings.Instance.KillRadius = reducedKillRadius;
Zeta.CommonBot.Settings.CharacterSettings.Instance.LootRadius = reducedLootRadius;
return;
}
//Inside of Dank Cellar, Enable Kill Monsters
if (Zeta.CommonBot.Settings.CharacterSettings.Instance.KillRadius != originalKillRadius
&& ZetaDia.CurrentWorldDynamicId == 1999568897)
{
Log("Restoring kill and loot radius to " + originalKillRadius);
Zeta.CommonBot.Settings.CharacterSettings.Instance.KillRadius = originalKillRadius;
Zeta.CommonBot.Settings.CharacterSettings.Instance.LootRadius = originalLootRadius;
return;
}
}
public void OnShutdown()
{
}
public void OnEnabled()
{
Log("Enabled.");
//originalKillRadius = Zeta.CommonBot.Settings.CharacterSettings.Instance.KillRadius;
}
public void OnDisabled()
{
Log("Disabled.");
}
public bool Equals(IPlugin other)
{
return (other.Name == Name) && (other.Version == Version);
}
}
}