I need someone who's better at deciphering ASM than I am. I've come as far as I can go, tonight, and am starting to get a headache with all of this reverse-engineering. Kynox, anyone, help me out!
Okay, so I've been working on how to determine how an enemy reacts to me (aggressive, neutral, friendly, etc.) and have started, but not finished, reverse-engineering the class method CUnit->GetUnitReaction(CUnit unit) (thanks to Kynox for the address, supplied in his InProcess Object Dumper). Here is what I've found:
CUnit->GetUnitReaction grabs the faction for unit1--faction is held at [[unit1+0x120]+0x74]--(the class object from which the method has been called) and the base address for unit2 (the unit against which unit1 is being compared) and passes them as arguments to a subroutine I've affectionately named GetFactionReaction(DWORD unit1faction, DWORD unit2).
GetFactionReaction then gleans unit2's faction using the same method as above and gets two addresses representing the two factions in a list (linked-list?) held in memory. It then passes these two addresses to another subroutine (hereafter known as CompareFactionHash, for lack of a better name) and THIS is the part that I have trouble following. CompareFactionHash is 0x005C8900.
Here's the relevant ASM for GetFactionReaction:
NoMorePasting.com
And CompareFactionHash (WARNING: this is a long text-bomb, which is why I'm having such trouble with it).
NoMorePasting.com
Thanks to whomever attempts to help. I'm really in the dark as to how it compares the two factions and gets how one reacts to the other.
Note: If you are debugging and you want to see what faction is what, convert your faction to decimal and go to http://www.thottbot.com/f#### where #### is the number of your faction. For instance, http://www.thottbot.com/f6 is the Tauren faction.