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!

[SimplePlugin] CombatDismount

randomstraw

Community Developer
Joined
Jul 17, 2012
Messages
1,611
This Thread shall be deleted if the problem no longer exists.

Warning: This will not work well with profiles that use the RunLikeHell Behaviour etc.
Very simple Plugin meant for the use with Plugins like IWantMovement in conjunction with CombatRoutines that have a "if (Mounted) then do nothing" switch.

This Plugin will dismount once you are mounted & in combat.

Instructions: copy/paste the code to -> "%Honorbuddy%\Plugins\thanksrandomstraw\iks.cs"

contents
Code:
using Bots.BGBuddy.Helpers;
using Styx;
using Styx.Plugins;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace CombatDismount
{
    internal class IWantMovement : HBPlugin
    {
        private static LocalPlayer Me { get { return StyxWoW.Me; } }
        private static bool _initialized;

        #region Default Overrides
        public override string Author { get { return "randomstraw"; }}
        public override string ButtonText { get { return "magic"; }}
        public override string Name { get { return "CombatDismount"; }}
        public override bool WantButton { get { return false; }}
        public override Version Version { get { return new Version(1,0,0); }}
        #endregion Default Overrides

        public override void OnButtonPress()
        {
            //empty
        }

        public override void Initialize()
        {
            if (!_initialized) // prevent init twice. like millz.
            {
                _initialized = true;
                Logger.Write(Colors.Gold, "## {0} active", Name);
                Logger.Write(Colors.Gold, "## your toon will dismount if in combat & mounted");
            }
        }
        
        public override void Pulse() 
        {
            if (Me.Mounted && Me.Combat && Me.CurrentTarget != null)
            {
                Lua.DoString("RunMacroText(\"" + RealLuaEscape("/dismount") + "\")");
                Logger.Write(Colors.Gold, "## dismount");
            }
        }

        #region Run Macro text - Thanks alxaw
        public static string RealLuaEscape(string luastring)
        {
            var bytes = Encoding.UTF8.GetBytes(luastring);
            return bytes.Aggregate(String.Empty, (current, b) => current + ("\\" + b));
        }
        #endregion
    }
}
 
Back
Top