using System;using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Xml.Linq;
using Styx;
using Styx.Combat;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.AreaManagement;
using Styx.CommonBot.Inventory;
using Styx.CommonBot.Profiles;
using Styx.CommonBot.POI;
using Styx.Helpers;
using Styx.Pathing;
using Styx.Plugins;
using Styx.WoWInternals;
using Styx.WoWInternals.Misc;
using Styx.WoWInternals.World;
using Styx.WoWInternals.WoWObjects;
namespace LootFixer
{
class LootFixer : HBPlugin
{
private LocalPlayer Me { get { return (ObjectManager.Me); } }
public override string Name { get { return "eLoot Fixer"; } }
public override string Author { get { return "Echelon17"; } }
public override Version Version { get { return new Version(2, 7, 0); } }
public static WoWUnit enemy;
public override void Pulse()
{
try
{
if (CharacterSettings.Instance.LootMobs == true) { // If loot mobs is enabled, otherwise don't bother
ObjectManager.Update(); // Update game objects
if (Me.GotTarget && Me.CurrentTarget.IsHostile && !Me.CurrentTarget.IsPet && !Me.CurrentTarget.IsPlayer) { // If I have an enemy target that isn't a pet
enemy = Me.CurrentTarget; // Set enemy to temp variable
}
if (enemy != null && enemy.IsDead) { // If my target is valid and dead
if (BotPoi.Current.Type == PoiType.None) { // ...and I'm not doing anything else
if (enemy.CanLoot)
{
BotPoi.Current = new BotPoi(enemy, PoiType.Loot); // Set new POI to the corpse we just created for looting ;)
Logging.Write("[eLootFixer] Setting new Loot POI to {0}", enemy.Name);
}
else if (!enemy.CanLoot && enemy.Skinnable) {
BotPoi.Current = new BotPoi(enemy, PoiType.Skin); // Set new POI to the corpse we just created for skinning ;)
Logging.Write("[eLootFixer] Setting new Skin POI to {0}", enemy.Name);
}
else { if (enemy != null) { enemy = null; } }
}
else {
// We're busy - do nothing
}
}
return;
}
}
catch (InvalidOperationException ee)
{
}
catch (Exception ee)
{
}
}
}
}