Jump to content

Looking to make a grinder profile that moves the bot when a specific spell is cast (crosspost from private)


Recommended Posts

I did not get any responses in the other section, so im shooting wider.

For any of the moderation team, feel free to delete the previous post, I was not allowed to do so.

 

 

Hey, so I am playing on a private server  (wotlk 3.5.5a) and one of its things is, after youve been in combat for a while, your character is forced to cast a spell (not in your spellbook) that drops an aoe that kills you, if you do not move out of it.

 

ive been trying to find a way to do this, but im very new to wrobot and im pretty sure its possible, I have a lua snippet that detects the spell, but i dont know how to make my character move once it happens.

 

 

Any help is much appriciated.

 

 

if eventType == "SPELL_SUMMON" and spellId == 95074 then 
  something to move x yards
end

 

Hello,

You can do this with a C# plugin. Save this as a .cs file in your Plugins folder (no tested):

using System;
using System.Collections.Generic;
using robotManager.Helpful;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using Math = System.Math;

public class Main : wManager.Plugin.IPlugin
{
    private bool _isRunning;

    public void Initialize()
    {
        _isRunning = true;
        EventsLuaWithArgs.OnEventsLuaStringWithArgs += OnCombatLogEvent;
        Logging.Write("[MoveOnSpell] Started.");
    }

    public void Dispose()
    {
        _isRunning = false;
        EventsLuaWithArgs.OnEventsLuaStringWithArgs -= OnCombatLogEvent;
        Logging.Write("[MoveOnSpell] Stopped.");
    }

    public void Settings() { }

    private void OnCombatLogEvent(string eventid, List<string> args)
    {
        if (eventid != "COMBAT_LOG_EVENT_UNFILTERED" || args.Count < 9)
            return;

        string subEvent = args[1];
        string spellId = args[8];

        if (subEvent == "SPELL_SUMMON" && spellId == "95074")
        {
            Logging.Write("[MoveOnSpell] Detected spell 95074, moving away!");
            var me = ObjectManager.Me.Position;
            float angle = (float)(new Random().NextDouble() * Math.PI * 2);
            float dist = 10f;
            var safePos = new Vector3(
                me.X + (float)Math.Cos(angle) * dist,
                me.Y + (float)Math.Sin(angle) * dist,
                me.Z
            );
            MovementManager.Go(new List<Vector3> { safePos });
        }
    }
}

This listens to combat log events and when it sees SPELL_SUMMON with spell ID 95074, it moves 10 yards in a random direction. You can adjust the distance if needed.

If the random direction sometimes sends you into a wall or off a cliff, you could replace the random angle with a backward movement (opposite of your facing direction) instead.

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...