Code: Select all
DWORD dwCode = *(DWORD*)(&pData[nPosition]);
Code: Select all
char szCode[5] = {0}; (DWORD)szCode = *(DWORD*)(&pData[nPosition]);
Moderators: Nefarius, Havvoric
Code: Select all
DWORD dwCode = *(DWORD*)(&pData[nPosition]);
Code: Select all
char szCode[5] = {0}; (DWORD)szCode = *(DWORD*)(&pData[nPosition]);
Just to clarify a bit. ASC8 means each 8 bits can be interpreted as an ascii character. Not necessarily null terminated. The bits column is the number of ASC8 'entities' there are.Gamall" wrote: A strange thing I have just run into is that item types are noted here http://home.roadrunner.com/~svr/formats/extend.htm as ASC8, that's to say null(\0)-terminated strings, while in fact it seems to be space (0x20)-terminated. I don't recall reading this anywhere.
I made that remark on this topic precisely because this is not what your formats page says:SVR" wrote: Just to clarify a bit. ASC8 means each 8 bits can be interpreted as an ascii character. Not necessarily null terminated. The bits column is the number of ASC8 'entities' there are.
ASC8 8 bit per character null terminated string. The bits field is max number of characters. Displays as text.
I know; I read the topic before I started coding, and I didn't have any problem with binary streams thanks to those discussions.SVR" wrote:All defs are from the point of view of the binary stream and not any fixed position type you can relate to memory position. Refer to binary stream discussions throughout this thread for more info.
Code: Select all
#pragma pack(1)
struct D2SkillKeyStrc
{
WORD nSkill; //+00
union
{
struct
{
BYTE nKey; //+02
BYTE nKeyEx; //+03
};
WORD wItemSlot; //+02
};
};
enum eD2MercSaveFlags
{
MERCSAVE_DEAD = 0x100000,
};
struct D2MercSaveStrc
{
DWORD fFlags; // +0AF
DWORD dwSeed; // +0B3
WORD wName; // +0B7
WORD wType; // +0B9
DWORD dwExperience; // +0BB
};
struct D2SaveHeaderStrc //sizeof 0x14F
{
DWORD dwMagic; // +000 = 0xAA55AA55
DWORD dwVersion; // +004
DWORD dwSize; // +008
DWORD dwSum; // +00C
DWORD dwWeaponSet; // +010
char szName[16]; // +014
DWORD fFlags; // +024
BYTE nClass; // +028
BYTE nStats; // +029 - set to a static 16 stats...
BYTE nSkills; // +02A - set to amozon skill count
BYTE nLevel; // +02B
DWORD dwCreateTime; // +02C
DWORD dwLastTime; // +030
DWORD dwPlayTime; // +034 = 0xFFFFFFFF, only on realms
D2SkillKeyStrc pSkillKeys[16]; // +038
D2SkillKeyStrc pButtonSkills[4]; // +078 / +07C / +080 / + 084
BYTE nComp[16]; // +088
BYTE nColor[16]; // +098
BYTE nTown[3]; // +0A8
DWORD dwMapSeed; // +0AB
D2MercSaveStrc pMercData; // +0AF
BYTE nRealmData[16]; // +0BF
BYTE nSaveField; // +0CF - used by client, realm only I'd say
DWORD dwLastLevel; // +0D0 - realm as well
DWORD dwLastTown; // +0D4 - ditto
BYTE nLastDiff; // +0D8 - ditto
BYTE nRealmDataEx[118]; // +0D9
};
struct D2QuestSaveStrc //sizeof 0x12A
{
DWORD dwSection; //+00
DWORD dwVersion; //+04
WORD wSize; //+08
BYTE nQuestData[MAX_DIFFICULTY][MAX_QUESTFLAGS]; //+0A / +6A / +CA
};
struct D2WaypointSaveStrc //sizeof 0x50
{
WORD wSection; //+00
WORD wSize; //+02
DWORD dwVersion; //+04
D2WaypointStrc nWaypointData[MAX_DIFFICULTY]; //+08 / +20 / +38
};
struct D2NPCIntroSaveStrc //sizeof 0x34
{
WORD wSection; //+00
WORD wSize; //+02
BYTE nIntroData[2][MAX_DIFFICULTY][MAX_NPC_INTRO]; //+04 / +14 / +24
};
struct D2CorpseSaveStrc //sizeof 0x10
{
WORD wSection; //+00
WORD bItems; //+02
DWORD dwUnused; //+04 - this is totally {filtered} by the setting code...
D2CoordStrc pPosition; //+08
};
Code: Select all
D2ItemDataStrc* pItemData = GetItemData(pItem);
BOOL bError = 0;
ITEMSAVE_WriteLocationToStream( hStream, pItem );
ItemsTXTStrc* pItemsTxt = D2GetItemRecord( pItem->nIndex );
ASSERT( pItemsTxt );
if ( bGamble )
{
DWORD dwCode = pItemsTxt->NormCode;
if ( dwCode == CODE_BLANK || !dwCode )
{
dwCode = pItemsTxt->Code;
}
hStream->write_s( dwCode, 32 );
return;
}
hStream->write_s( pItemsTxt->Code, 32 );
hStream->write_s( ITEMS_GetFilledSockets( pItem ), 3 );
Code: Select all
{0x6FC438E4,(DWORD)ITEMSAVE_WriteItemToStreamEx,4},
{0x6FC44A74,(DWORD)ITEMSAVE_WriteItemToStreamEx,4},
{0x6FC44E80,(DWORD)ITEMSAVE_WriteItemToStreamEx,4},
{0x6FCC1C3E,(DWORD)ITEMSAVE_WriteItemToStreamEx,4},
{0x6FCC4790,(DWORD)ITEMSAVE_WriteItemToStreamEx,4},
{0x6FCF043D,(DWORD)ITEMSAVE_WriteItemToStreamEx,4},
{0x6FC45DB5,(DWORD)ITEMSAVE_ReadInfoFromStream,4},
{0x6FC45E6D,(DWORD)ITEMSAVE_ReadInfoFromStream,4},
{0x6FC49C92,(DWORD)ITEMSAVE_ReadInfoFromStream,4},
{0x6FC49CF5,(DWORD)ITEMSAVE_ReadInfoFromStream,4},
You should always search in this order: Patchstring.tbl / expansionstring.tbl / string.tblWhat am I doing wrong in this case? I am using expansionstring.tbl and string.tbl in case there are more needed. The order I use is search in expansion first and if not found, search in string.
Code: Select all
<item>
<majic>JM</majic>
<bQuest>False</bQuest>
<unk21>0</unk21>
<bId>True</bId>
<unk25>0</unk25>
<bIllegal1>False</bIllegal1>
<unk31>0</unk31>
<bDup>False</bDup>
<bSocketed>False</bSocketed>
<unk34>0</unk34>
<bIllegal>False</bIllegal>
<unk37>0</unk37>
<bEar>0</bEar>
<bStarter>False</bStarter>
<unk42>0</unk42>
<unk44>0</unk44>
<bSimple>False</bSimple>
<bEthereal>False</bEthereal>
<unk47>1</unk47>
<bInscribed>False</bInscribed>
<unk51>0</unk51>
<bRuneWord>False</bRuneWord>
<unk53>0</unk53>
<unk60>101</unk60>
<iLoc>0</iLoc>
<iPos>0</iPos>
<iCol>0</iCol>
<iRow>0</iRow>
<iStoredIn>1</iStoredIn>
<dwType>skp </dwType>
<nGems>0</nGems>
<dwGUID>3256562386</dwGUID>
<iLevel>5</iLevel>
<iQual>3</iQual>
<bVarGfx>False</bVarGfx>
<bClass>False</bClass>
<hiQual>7</hiQual>
<bHasRand>0</bHasRand>
<iDef>22</iDef>
<iMaxDur>18</iMaxDur>
<iCurDur>19</iCurDur>
<prop1>((16, 9), (75, 31))</prop1>
</item>
its calculated at runtime in the itemreq evaulator, iirc when I replaced this the reduction was a fixed 40%ciuly" wrote:ok, thanks. I'll try to pickup a lot of different ethereal's, maybe I can deduce it; or somebody who knows it shares it in the meanwhile
that accounts for 50%, but I'm still missing a 100 :|maces have a hardcoded +50% damage to undead