[1.10] ptUnit and ptGame structures

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

User avatar
afj666
Retired staff
Champion of the Light
Posts: 479
Joined: Sun Apr 20, 2003 10:15 pm
Location: Hvam St. (very small town)
Contact:

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by afj666 » Sat Feb 21, 2004 2:38 pm

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
Diabolic Studios website
Extended Levels Plugin | Extended Object | Plugin | CustomTbl Plugin
Your Weight Is Appropriate.... For A Medium Sized Russian Tank
Avatar Created By Go][um

User avatar
Myrdinn
Posts: 49
Joined: Tue Dec 31, 2002 1:14 pm
Location: Limoges Fourches, FRANCE

Re: [1.10] ptUnit and ptGame structures

Post by Myrdinn » Thu Mar 04, 2004 4:42 pm

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}
Last edited by Myrdinn on Thu Mar 04, 2004 6:14 pm, edited 1 time in total.

Snej
Posts: 6
Joined: Thu Feb 19, 2004 6:14 am

Re: [1.10] ptUnit and ptGame structures

Post by Snej » Thu Mar 04, 2004 8:18 pm

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

User avatar
Myrdinn
Posts: 49
Joined: Tue Dec 31, 2002 1:14 pm
Location: Limoges Fourches, FRANCE

Re: [1.10] ptUnit and ptGame structures

Post by Myrdinn » Fri Mar 05, 2004 12:21 pm

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

User avatar
kingpin
Site Admin
Cherub
Posts: 10865
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by kingpin » Tue Jul 20, 2004 12:50 pm

Here is some new things:

PlayerData +34 ptArenaUnit
ptGame +1D28 ptArena

Added to top thread ~ by afj666
Last edited by kingpin on Tue Jul 20, 2004 7:55 pm, edited 1 time in total.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by Myhrginoc » Wed Jul 21, 2004 2:48 am

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:
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
SVR
Retired staff
Arch-Angel
Posts: 1449
Joined: Sat Nov 02, 2002 11:04 pm
Location: Texas
Contact:

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by SVR » Sun Jul 25, 2004 9:56 pm

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.
Last edited by SVR on Tue Jul 27, 2004 3:09 pm, edited 1 time in total.

User avatar
kingpin
Site Admin
Cherub
Posts: 10865
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by kingpin » Mon Nov 01, 2004 4:49 pm

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
Last edited by kingpin on Wed Feb 02, 2005 2:01 am, edited 4 times in total.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by Myhrginoc » Fri Feb 25, 2005 4:39 am

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
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
SVR
Retired staff
Arch-Angel
Posts: 1449
Joined: Sat Nov 02, 2002 11:04 pm
Location: Texas
Contact:

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by SVR » Sat Feb 26, 2005 1:48 pm

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.

User avatar
kingpin
Site Admin
Cherub
Posts: 10865
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by kingpin » Sat Feb 26, 2005 3:05 pm

You are right ptGame+1C is memorypool (or a pointer to allocated memory)

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by Myhrginoc » Tue Mar 01, 2005 2:32 am

[ /me goes out and gets his eyes examined, tested at 20/800, is declared legally blind. ]
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
kingpin
Site Admin
Cherub
Posts: 10865
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by kingpin » Mon Mar 14, 2005 2:45 pm

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

User avatar
RicFaith
Retired staff
Arch-Angel
Posts: 1576
Joined: Fri May 24, 2002 7:12 am
Location: Back where the weather is too hot
Contact:

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by RicFaith » Thu May 12, 2005 12:00 pm

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.
Last edited by RicFaith on Thu May 12, 2005 12:09 pm, edited 1 time in total.

User avatar
kingpin
Site Admin
Cherub
Posts: 10865
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: [1.10] ptUnit and ptGame structures

Post by kingpin » Fri Aug 01, 2008 4:43 pm

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);

Post Reply

Return to “Code Editing”