Question from Empathe on Warlock Pets menu

User Tag List

Results 1 to 5 of 5
  1. #1
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question from Empathe on Warlock Pets

    hi

    i'm a old player world of warcraft,

    i've already create a autobot-heal on vanilla server in 32bits.
    i play now on official server but they have so many change about vanillia.

    i'll create a bot for automatic dps on warlock, i've already created
    but for the best way i'll need to use "Number of my pet alive"

    i've already listed all entityList but i don't understand in Legion how to use "CreatedBy" ? or SummonedBy ?
    The active pet for a warlock is listed in the entity list.

    The CGGuid of the pet is stored in the Local Player UnitField.Summon descriptor.

    So you traverse the entityList looking for a unit that has the CGGuid sorted in the descriptor referenced above.

    Code:
            public CGGuid128 Summon
            {
                get
                {
                    return GetDescriptor<CGGuid128>((uint)UnitFields.Summon);
                }
            }
    
            public CGUnit Pet
            {
                get
                {
                    foreach (CGUnit unit in Wow.Units)
                    {
                        if (unit.CGGuid != Summon)
                            continue;
                        return unit;
                    }
                    return null;
                }
            }
    
        [StructLayout(LayoutKind.Sequential)]
        public struct CGGuid128
        {
            private UInt64 _low;
            private UInt64 _high;
    
            public CGGuid128(CGGuid128 g)
            {
                _low = g.Low;
                _high = g.High;
            }
    
            public UInt64 Low { get { return _low; } }
    
            public UInt64 High { get { return _high; } }
    
            public UInt32 DW0
            {
                get
                {
                    UInt32 result = (UInt32)(_low & 0xffffffff);
                    return result;
                }
            }
    
            public UInt32 DW1
            {
                get
                {
                    UInt32 result = (UInt32)(_low >> 32);
                    return result;
                }
            }
    
            public UInt32 DW2
            {
                get
                {
                    UInt32 result = (UInt32)(_high & 0xffffffff);
                    return result;
                }
            }
    
            public UInt32 DW3
            {
                get
                {
                    UInt32 result = (UInt32)(_high >> 32);
                    return result;
                }
            }
    
            public static bool operator ==(CGGuid128 g1, CGGuid128 g2)
            {
                if (g1._high == g2._high)
                {
                    if (g1._low == g2._low)
                    {
                        return true;
                    }
                }
                return false;
            }
    
            //public static bool operator !(CGGuid128 g1)
            //{
            //    if (g1._high == 0)
            //        return true;
    
            //    if (g1._low == 0)
            //        return true;
    
            //    return false;
            //}
    
            public static bool operator !=(CGGuid128 g1, CGGuid128 g2)
            {
                if (g1._high != g2._high)
                    return true;
    
                if (g1._low != g2._low)
                    return true;
    
                return false;
            }
    
            public bool IsZero
            {
                get
                {
                    if (_high != 0)
                        return false;
    
                    if (_low != 0)
                        return false;
    
                    return true;
                }
            }
    
            public override string ToString()
            {
                return DW3.ToString("X") + " | " + DW2.ToString("X") + " | " + DW1.ToString("X") + " | " + DW0.ToString("X");
            }
    
            public CGObject ToObject
            {
                get
                {
                    foreach(CGObject obj in Wow.Objects)
                    {
                        if (obj.CGGuid == this)
                            return obj;
                    }
    
                    return null;
                }
            }
        }
    Hope this helps.

    Question from Empathe on Warlock Pets
  2. Thanks empathe (1 members gave Thanks to counted for this useful post)
  3. #2
    empathe's Avatar Member
    Reputation
    1
    Join Date
    Mar 2016
    Posts
    33
    Thanks G/R
    42/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh good, i'hve create a schéma,
    it's good ?
    Question from Empathe on Warlock Pets-1mpxvr7-gif

  4. #3
    Zazazu's Avatar Contributor
    Reputation
    191
    Join Date
    Jun 2016
    Posts
    390
    Thanks G/R
    5/143
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GUID not int[16], is byte[16] (or int[4] or long[2]). U can write own struct as in sample counted.

  5. #4
    tutrakan's Avatar Contributor
    Reputation
    134
    Join Date
    Feb 2013
    Posts
    175
    Thanks G/R
    124/52
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Zazazu View Post
    GUID not int[16], is byte[16] (or int[4] or long[2]). U can write own struct as in sample counted.
    Come again please? What GUID not int[16]means? :confused:
    Last edited by tutrakan; 01-15-2017 at 02:22 AM.

  6. #5
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by tutrakan View Post
    Come again please? What GUID not int[16]means? :confused:
    Look at the struct i posted above.

    CGGuid is a 128 bit [ (2) 64 bit ] unique identifier for objects in wow.

Similar Threads

  1. Warlock Pet Bug
    By ub3rst4r in forum World of Warcraft Exploits
    Replies: 12
    Last Post: 06-07-2007, 11:04 AM
  2. Warlock pet/mount bug abuse =)
    By aXon in forum World of Warcraft Exploits
    Replies: 14
    Last Post: 06-03-2007, 01:20 AM
  3. cool warlock pet edits by gruk
    By Adrenalin3 in forum World of Warcraft Model Editing
    Replies: 7
    Last Post: 05-16-2007, 06:02 AM
  4. Warlock Pet Emotes
    By voconl in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 04-19-2007, 09:17 PM
  5. IMP(warlock pet)
    By sportstud10124 in forum World of Warcraft Model Editing
    Replies: 8
    Last Post: 12-13-2006, 11:49 PM
All times are GMT -5. The time now is 09:22 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search