Jump to content

Memus

WRobot user
  • Posts

    13
  • Joined

  • Last visited

Posts posted by Memus

  1. Yeah, but that's not what I'm after.

    1. I wan't to see if an object has a quest available with the NpcMarker property.
    2. I wan't to know if we're within interact distance of the object to interact and accept the quest.

    GetDistance isn't reliable since objects can vary ALOT in size. 
    For ex. 4 yards might be perfect for smaller object but unreachable for bigger objects (if the objects radius is wider that 4 yards).
    An alternative to implementing IsGoodInteractDistance for WoWGameObject can be if WRobot can tell us the size (radius) of the object so we can implement it ourselves.

    Clearer now? :)

  2. 31 minutes ago, The Smokie. said:

    Hello @Memus

    to interact with object, you can use one if these run code methods.

    
    wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(x, y, z));
    
    
    
    wManager.Wow.Helpers.Interact.InteractGameObject(ObjectManager.GetWoWGameObjectByEntry(object ID).FirstOrDefault().GetBaseAddress)
    
    
    
    Or 
    
    wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);

    Both should work fine. 

    Thanks, but please read my post again ?

  3. 23 minutes ago, Matenia said:

    Because target guid is a static offset in WotLK.
     

    
    ObjectManager.Me.Target = unit.Guid;

    works, or if you want to set mouseover:

    
    private static void SetMouseoverGuid(ulong guid)
        {
            switch (Usefuls.WowVersion)
            {
                case 5875:
                    Memory.WowMemory.Memory.WriteUInt64((uint)Memory.WowMemory.Memory.MainModuleAddress + 0x74E2C8, guid);
                    break;
                case 8606:
                    Memory.WowMemory.Memory.WriteUInt64((uint)Memory.WowMemory.Memory.MainModuleAddress + 0x86E950, guid);
                    break;
                case 12340:
                    Memory.WowMemory.Memory.WriteUInt64((uint) 0x00BD07A0, guid);
                    break;
                default:
                    throw new Exception("Wow version is not supported!");
            }
        }
    
    private static void SetMouseoverUnit(WoWUnit unit)
        {
            SetMouseoverGuid(unit.Guid);
        }
    
    public static void Target(WoWUnit unit)
        {
            ulong guid = unit.Guid;
    
            if (guid == 0)
            {
                return;
            }
            ulong tmp = Memory.WowMemory.Memory.ReadUInt64((uint)Memory.WowMemory.Memory.MainModuleAddress + 0x74E2C8);
            SetMouseoverUnit(unit);
            Lua.LuaDoString(@"TargetUnit(""mouseover"");");
    		//do something here
            SetMouseoverUnit(tmp);
        }

     

    ObjectManager.Me.Target = unit.Guid;
    Triggers interact/autoattack on hostile/neutral unit which is too annoying to live with.
    The Mouseover solution is what I'm using right now but I consider that as an workaround.
    I want a clean solution, as in Vanilla with the inject code.
  4. On 11/17/2017 at 4:51 PM, iMod said:

    Targeting by guid for vanilla (not tested)

    
            private static readonly object LockTargeting = new object();
    
            public static void TargetUnit(ulong guid)
            {
                // Allocate memory for the target guid
                uint alloc = Memory.WowMemory.Memory.AllocateMemory(8);
    
                // Write guid
                Memory.WowMemory.Memory.WriteUInt64(alloc, guid);
    
                // Create asm
                string[] asm = new string[]
                {
                        $"mov ecx, {alloc}",
                        $"call {0x489A40}",
                        Memory.WowMemory.RetnToHookCode
                };
    
                lock (LockTargeting)
                {
                    // Execute
                    Memory.WowMemory.InjectAndExecute(asm);
                }
    
                // Free memory
                Memory.WowMemory.Memory.FreeMemory(alloc);
            }

     

    Got a working example of this for 3.3.5a?
    Changing $"call {0x489A40}" to $"call {0x524BF0}" does not suffice :S

  5. This code:

    engine = new Engine(false);
    engine.States.Add(new SpellState("Power Word: Fortitude", 11, c => !ObjectManager.Me.HaveBuff("Power Word: Fortitude"), true, false));
    engine.States.Add(new SpellState("Divine Spirit", 10, c => !ObjectManager.Me.HaveBuff("Divine Spirit"), true, false));
    engine.StartEngine(15);

    Only the first/highest prioritized SpellState gets evaluated...
    No matter what.
    How can I make the engine process more than one state of a particular type?

×
×
  • Create New...