Page 2 of 2

Re: [1.10] ptUnit and ptGame structures

Posted: Sat Feb 21, 2004 2:38 pm
by afj666
a few ptItemData members:

Code: Select all

ptItemData
+00	quality
+14	cmdFlags
+18	flags
+28	PlayerClass (What class requirement this item has)
+45	StorePage (BYTE)
+5C	ptNode
	+0C = Page

Re: [1.10] ptUnit and ptGame structures

Posted: Thu Mar 04, 2004 4:42 pm
by Myrdinn
Ok new Speed value

Code: Select all

PtUnit[+3C]Animspeed (DWORD)
PtUnit[+44] Current Frame the animation is (aka Frame counter)
PtUnit[+4C]Animspeed (Word)
PtUnit[+4E]Action Flag (Byte)
{Added to topic -Kingpin}

Re: [1.10] ptUnit and ptGame structures

Posted: Thu Mar 04, 2004 8:18 pm
by Snej
afaik is 3C anim speed a timer for the action (no other action possible during that time)
and 4C anim speed is a timer for the animation

in my examples they are always been set to the same value by the program (common#10376) if 3C is been set

3C is been set for instance in the cast or attack part
not in the run/walk part

Re: [1.10] ptUnit and ptGame structures

Posted: Fri Mar 05, 2004 12:21 pm
by Myrdinn
OK
AFAIK run/walk Part use PtUnit[+40] and not +3C I Agree.
PtUnit [+30] Is also SpeedRelated and specific to few skills

I need more time, it's just speculation at that time :D

Re: [1.10] ptUnit and ptGame structures

Posted: Tue Jul 20, 2004 12:50 pm
by kingpin
Here is some new things:

PlayerData +34 ptArenaUnit
ptGame +1D28 ptArena

Added to top thread ~ by afj666

Re: [1.10] ptUnit and ptGame structures

Posted: Wed Jul 21, 2004 2:48 am
by Myhrginoc
I added a couple of missile-related items to the top listing, ptUnit+94 and ptUnit+98. I am a little tardy adding them... :oops:

Re: [1.10] ptUnit and ptGame structures

Posted: Sun Jul 25, 2004 9:56 pm
by SVR
ptGame +10F0 -

Pointer to structure used in Shrine spawn random generation...

Code: Select all

struct RandUnk {	// * ptGame+10F0
    DWORD seed1;        //+00
    DWORD seed2;        //+04
    DWORD nValues[8];   //+08
    DWORD *pValues[8];  //+28
};
nValues is the number of values in each pValue list.
The pValues ptr's point to lists of numbers that the rand function chooses from for the Shrine.txt "Code" of the newly spawned Shrine.

EDIT: This is the "EffectClass" table for shrines. Each shrine Code is placed in one of the 8 arrays based on the value of EffectClass.

Re: [1.10] ptUnit and ptGame structures

Posted: Mon Nov 01, 2004 4:49 pm
by kingpin
ptPlayerData Structure:

+48 Stores Object Unique_ID (ie. what id the portal has that the player has cast)

EDIT:

Here is a structure for objects.

struct Operate
{
D2Game* ptGame; //+00
Unit* ptObject; //+04
Unit* ptPlayer; //+08
void* PtObject Unique_ID; // +0C
DWORD nObjectID; //+10
};

EDIT2:

Here is more for ptInventory structure.

+34 ptCorpse
+3C next ptCorpse Unique_ID

Max number of corpse a player can have is 15

EDIT3:

Here is another start of a structure.

ptRoom +48 Flag. Tells if the room should spawn new units 0 = spawn new units (monsters, objects e.tc), 1 = don't spawn any new units.

Each time you enter a room you never have visit this flag is set to 1.

EDIT4:

Another one.

ptInventory +28 Socket_Counter - Variable that stores how many sockets your item is currently socketed with

Re: [1.10] ptUnit and ptGame structures

Posted: Fri Feb 25, 2005 4:39 am
by Myhrginoc
We have wondered what ptLock might be for. I don't have the definitive answer, but it does get used with quests. (Maybe SVR already caught this, but the info isn't in this thread.) I found this code section while chasing seals and updated both ptUnit and ptGame.

Code: Select all

6FC93D2B   MOV ECX,DWORD PTR [EBX+1C]   ;  ptLock
6FC93D2E   PUSH 0
6FC93D30   PUSH 5F
6FC93D32   PUSH 6FD3167C                ;  ASCII
           "C:\projects\D2\head\Diablo2\Source\D2Game\QUESTS\QUESTS.CPP"
6FC93D37   MOV EDX,8
6FC93D3C   CALL <JMP.&Fog.#10045>
6FC93D41   MOV DWORD PTR [EAX],EDI      ;  ptQuestInfo --> ptLock+00
6FC93D43   MOV ECX,DWORD PTR [ESI+74]   ;  get ptUnit+74
6FC93D46   MOV DWORD PTR [EAX+4],ECX    ;  ptUnit+74 --> ptLock+04
6FC93D49   MOV DWORD PTR [ESI+74],EAX   ;  ptLock --> ptUnit+74

Re: [1.10] ptUnit and ptGame structures

Posted: Sat Feb 26, 2005 1:48 pm
by SVR
I have ptGame+1C as MemoryPool. (ptLock as +18).

sounds right cause Fog.#10045 takes that as it's first arg (ECX).

So that would make ptUnit+74 a linked list of ptrs to QuestInfo structs.
Could be the units active quest list, and this code is allocating a new node.

Re: [1.10] ptUnit and ptGame structures

Posted: Sat Feb 26, 2005 3:05 pm
by kingpin
You are right ptGame+1C is memorypool (or a pointer to allocated memory)

Re: [1.10] ptUnit and ptGame structures

Posted: Tue Mar 01, 2005 2:32 am
by Myhrginoc
[ /me goes out and gets his eyes examined, tested at 20/800, is declared legally blind. ]

Re: [1.10] ptUnit and ptGame structures

Posted: Mon Mar 14, 2005 2:45 pm
by kingpin
some more info:

ptGame
+2C UniqueID (owner ID of minions is stored here) (Monsters are stored with -1)
+30 UnitType (owner Type of minions is stored here)

MonsterData
+28 ptGame

Re: [1.10] ptUnit and ptGame structures

Posted: Thu May 12, 2005 12:00 pm
by RicFaith
Erm.. I've been sitting on this a while, been busy :P so I'm just gonna dump.

Code: Select all

[color=#ff0000][b]PtUnit[/b][/color]
+2C   hPath (no internal changes?) 
   +0C   PosX (stationary object)      
   +10   PosY (stationary object)      
   +3C   eType (movement Path I think) 
   +40   ePrevType                     
	= 02 - PATH_TYPE_TOWARD
	= 04 - PATH_TYPE_MISSILE
	= 08 - PATH_TYPE_KNOCKBACK_SERVER
	= 0B - PATH_TYPE_KNOCKBACK_CLIENT
   +58   ptUnitTarget                  
   +5C   ptUnitTarget.Type             
   +60   ptUnitTarget.unID             

+A8   ptInfo 
   +04 = ptr to first hSkill Linked List		
      +00   ptr to skillTXT entry			
      +04   Next hSkill					
      +34   FFFFFFFF ? Checked by D2Common.#10949	
+E4   next ptUnit of Type 
+E8   ptRoomNext 

Code: Select all

[color=#ff0000][b]PtItemData[/b][/color]
+04   low seed 
+08   high seed 
+10   starting seed set by D2Common.#10694 with arg9 of D2Game.6FC501A0 
+30   CurrentGameVersion (matches ptGame+78)

Code: Select all

[color=#ff0000][b]ptInventory[/b][/color]
+04 Memory Pool (ptGame+1C)

Code: Select all

[color=#ff0000][b]ptGame[/b][/color]
+00BC   ptAct[0]   
  +8      Another Level Related ptr (size 200h)
    +004    LevelID
    +22C    Previous Level Related ptr
+00C0   ptAct[1]   
+00C4   ptAct[2]   
+00C8   ptAct[3]   
+00CC   ptAct[4]   

+1720   ptUnit (item) list (80h dword)    // swap them once and for all?
+1920   ptUnit (missile) list (80h dword) 

Code: Select all

[color=#ff0000][b]ptClient[/b][/color]
+16C   Unit Type 
+170   Unit Unid 
+1A8   ptGame    
+1AC   Act
edit: reminds himself to dump in 'code' :P else all the spaces go somewhere else fun.

Re: [1.10] ptUnit and ptGame structures

Posted: Fri Aug 01, 2008 4:43 pm
by kingpin
This is known in 1.11b. Is minor difference however in the function. The function takes only 2 params om 1.10.

ptStatList
+38 - fpStatExpires(); - function to call when the list is removed (void * __fastcall)(pUnit,stateNo);