Jump to content

Recommended Posts

Hello, try this plugin :

using System.Linq;
using wManager.Wow.Helpers;

public class Main : wManager.Plugin.IPlugin
{
    public void Initialize()
    {
        robotManager.Events.Events.OnCustomEvent += (eventName, args, cancelEvent) =>
        {
            try
            {
                if (eventName =="SpellManager.CastSpellByNameOn" &&
                    args != null &&
                    args.Length == 2 &&
                    args[0] != null &&
                    args[0] is string &&
                    args[1] != null &&
                    args[1] is string)
                {
                    var spellName = (string)args[0];
                    var luaUnitId = (string)args[1];

                    var spell = SpellManager.SpellBook().FirstOrDefault(s => s.NameInGame == spellName);
                    if (spell != null)
                    {
                        var englishSpellName = spell.Name;
                        if (!string.IsNullOrWhiteSpace(englishSpellName))
                        {
                            Lua.LuaDoString(string.Format("CastSpellByName('{0}', '{1}');", englishSpellName.Replace("'", @"\'"), luaUnitId.Replace("'", @"\'")));
                            cancelEvent.Cancel = true;
                        }
                    }
                }
            } catch{}
        };
    }

    public void Dispose()
    {
    }

    public void Settings()
    {
    }
}

 

Main.cs

Link to comment
https://wrobot.eu/forums/topic/15588-wrong-wow-language/#findComment-69837
Share on other sites

On 1/10/2025 at 6:48 AM, Droidz said:

Hello, try this plugin :

using System.Linq;
using wManager.Wow.Helpers;

public class Main : wManager.Plugin.IPlugin
{
    public void Initialize()
    {
        robotManager.Events.Events.OnCustomEvent += (eventName, args, cancelEvent) =>
        {
            try
            {
                if (eventName =="SpellManager.CastSpellByNameOn" &&
                    args != null &&
                    args.Length == 2 &&
                    args[0] != null &&
                    args[0] is string &&
                    args[1] != null &&
                    args[1] is string)
                {
                    var spellName = (string)args[0];
                    var luaUnitId = (string)args[1];

                    var spell = SpellManager.SpellBook().FirstOrDefault(s => s.NameInGame == spellName);
                    if (spell != null)
                    {
                        var englishSpellName = spell.Name;
                        if (!string.IsNullOrWhiteSpace(englishSpellName))
                        {
                            Lua.LuaDoString(string.Format("CastSpellByName('{0}', '{1}');", englishSpellName.Replace("'", @"\'"), luaUnitId.Replace("'", @"\'")));
                            cancelEvent.Cancel = true;
                        }
                    }
                }
            } catch{}
        };
    }

    public void Dispose()
    {
    }

    public void Settings()
    {
    }
}

 

Main.cs 1.42 kB · 2 downloads

Where would you apply this?

Link to comment
https://wrobot.eu/forums/topic/15588-wrong-wow-language/#findComment-69848
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...