What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[REQUEST]Plugin to loot if 3 or more mobs are dead with loot

tozededao

Community Developer
Joined
Jan 15, 2010
Messages
1,225
Currently I'm griding a nonstop spawning mob, it would be awesome if there was a plugin that would force loot even if we are in combat if there are 3 or more mobs dead on the ground.

Thanks in advance.
 
It doesnt even need to be if there are more than 3 corpses, just want something to replace loot over compat in priorities.
 
Ive been looking through forum and I was able to edit Kamilche's LootItAll in order to work in combat, it tries to loot but since it doesnt pause the bot for a bit it doesn't loot can anyone help?

Code:
/* * LootItAll by Kamilche
 * 
 * This is an add-on that will 
 * 
 *   1. Loot all mobs
 *   2. Skin all mobs
 *
 * 2012/09/14  v1.0.0.0 - First version.
 * 
 */
using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.POI;
using Styx.Helpers;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Styx.Plugins;


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Windows.Forms;


namespace LootItAll
{


    public class LootItAll : HBPlugin
    {
        public override string Name { get { return "LootItAll"; } }
        public override string Author { get { return "Kamilche"; } }
        public override Version Version { get { return _version; } }
        private readonly Version _version = new Version(1, 0, 0, 0);
        private static DateTime NextTime = DateTime.Now;
        private int CheckFrequency = 2;


        public override void Pulse()
        {


            


            NextTime = DateTime.Now.AddSeconds(CheckFrequency);


            CheckForLoot();
            CheckForSkin();
        }




        public void CheckForLoot()
        {
            WoWUnit target = null;
            if (CharacterSettings.Instance.LootMobs == true && BotPoi.Current.Type == PoiType.None)
            {
                target = (from u in ObjectManager.GetObjectsOfType<WoWUnit>(false, false)
                          where u.Distance < 20 && u.IsDead && u.CanLoot && !Blacklist.Contains(u)
                          orderby u.Distance ascending
                          select u).ToList().FirstOrDefault();
                if (target != null)
                {
                    log("[LootItAll] Setting {0} as lootable", target.Name);
                    BotPoi.Current = new BotPoi(target, PoiType.Loot);
                }
            }
        }


        public void CheckForSkin()
        {
            WoWUnit target = null;
            if (CharacterSettings.Instance.SkinMobs == true && BotPoi.Current.Type == PoiType.None)
            {
                target = (from u in ObjectManager.GetObjectsOfType<WoWUnit>(false, false)
                          where u.Distance < 20 && u.IsDead && !u.CanLoot && u.CanSkin && !Blacklist.Contains(u)
                          orderby u.Distance ascending
                          select u).ToList().FirstOrDefault();
                if (target != null)
                {
                    log("[LootItAll] Setting {0} as skinnable", target.Name);
                    BotPoi.Current = new BotPoi(target, PoiType.Skin);
                }
            }
        }


        private void log(String fmt, params object[] args)
        {
            String s = String.Format(fmt, args);
            log(Color.CornflowerBlue, fmt, args);
        }


        private void log(Color color, String fmt, params object[] args)
        {
            String s = String.Format(fmt, args);
            Logging.Write(System.Windows.Media.Color.FromRgb(color.R, color.G, color.B), String.Format("[{0}]: {1}", Name, s));
            fmt = @"getglobal(""ChatFrame1""):AddMessage(""{0}"", {1}, {2}, {3}, 0);";
            Lua.DoString(string.Format(fmt, s, color.R / 255.0, color.G / 255.0, color.B / 255.0));
        }


    }


}
 
Back
Top