Player hp/mana....like unit struct menu

User Tag List

Results 1 to 5 of 5
  1. #1
    unbekannt1's Avatar Member
    Reputation
    -6
    Join Date
    Apr 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Player hp/mana....like unit struct

    Hello,
    when i have the baseaddress of a wow unit, i can easily read the unit hp,mana and so on by using the wowUnit enums or structs.

    My question is how can i do that for a player, because the enums or structs don't include fields for hp and so on?

    Player hp/mana....like unit struct
  2. #2
    Evieh's Avatar Contributor
    Reputation
    92
    Join Date
    Aug 2006
    Posts
    191
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you use the same which you use on units..

    read from (pStorage + UNIT_FIELD_HEALTH * 4)

  3. #3
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look up inheritance.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  4. #4
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As Robske pointed out, use class inheritance for this:

    Inheritance (C# Programming Guide)

    What Evieh said is also true, the health field and so on are shared between units and players (because players are effectively units).

    If you like to learn by looking at code; there are many object manager threads around the forums which demonstrate this perfectly:

    Code:
    public class WowPlayer : WowUnit
        {
            public WowPlayer(uint baseAddress)
                : base(baseAddress)
            {
            }
    And WowUnit on its turn:

    Code:
    public class WowUnit : WowObject
        {
            public WowUnit(uint baseAddress)
                : base(baseAddress)
            {
            }
    So basically, WowPlayer inherits all the properties from WowUnit, and its constructor. WowUnit on its turn inherits WowObject, which means WowUnit inherits all properties and methods defined in WowObject.

    The idea behind this is that WowPlayer is a Unit, and a Unit is an Object (Player -> Unit -> Object is the inheritance hierarchy)

    This is covered in C# here:
    trunk - blackrainobjects - Project Hosting on Google Code

  5. #5
    barthen's Avatar Contributor Authenticator enabled
    Reputation
    84
    Join Date
    Apr 2007
    Posts
    111
    Thanks G/R
    4/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you need info on how a class tree looks like in memory: Reversing Microsoft Visual C++ Part II: Classes, Methods

Similar Threads

  1. [WoW] Oblivion [ wotlk 3.3.2 blizz like and fun server /w player bots
    By leonne in forum WoW Emulator Server Listings
    Replies: 0
    Last Post: 03-24-2010, 01:00 PM
  2. Moonkin To Look like normal player
    By Eulekin88 in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 06-04-2009, 09:15 AM
  3. Unit/Player Facing for Z axis
    By g3gg0 in forum WoW Memory Editing
    Replies: 15
    Last Post: 01-17-2009, 09:53 AM
  4. friendly/neutral/enemy Player or Units? How to find out?
    By deadbeef in forum WoW Memory Editing
    Replies: 3
    Last Post: 01-08-2009, 04:44 PM
  5. Bg mod to help botters look like players
    By mightytank in forum World of Warcraft Bots and Programs
    Replies: 13
    Last Post: 03-16-2008, 09:13 AM
All times are GMT -5. The time now is 05:10 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