Skip to content

Commit

Permalink
Support new runewords (incomplete) and properties in PTR 2.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
daidodo committed Jan 31, 2023
1 parent 14a26fc commit 892594f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
10 changes: 6 additions & 4 deletions Diablo Edit2/D2Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ const CItemMetaData* CItemInfo::ReadData(CInBitsStream& bs, DWORD version, BOOL
bs >> bHasRand;
if (!bSimple) {
if (bHasRand)
for (auto& i : pTmStFlag.ensure())
for (auto& i : pTimeStampFlag.ensure())
if (bs.Good())
bs >> bits(i, 32);
//Type Specific info
Expand Down Expand Up @@ -587,7 +587,7 @@ void CItemInfo::WriteData(COutBitsStream& bs, const CItemMetaData& itemData, DWO
pGold->WriteData(bs);
bs << bHasRand;
if (bHasRand)
for (auto i : pTmStFlag)
for (auto i : pTimeStampFlag)
if (bs.Good())
bs << bits(i, 32);
if (!bSimple) { //Type Specific info
Expand Down Expand Up @@ -682,8 +682,10 @@ CString CD2Item::ItemName() const {
if (extInfo.wMonsterID.exist())
name.push_front(::theApp.MonsterName(extInfo.wMonsterID));
}
if (extInfo.iQuality <= 3 && IsRuneWord())
name.push_front(::theApp.RuneWordName(RuneWordId()));
if (extInfo.iQuality <= 3 && IsRuneWord()) {
const CString runewordName = ::theApp.RuneWordName(RuneWordId());
name.push_front(runewordName);
}
if (bEthereal)
name.push_back(_T("(ETH)"));
}
Expand Down
3 changes: 2 additions & 1 deletion Diablo Edit2/D2Item.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ struct CItemInfo
MayExist<CExtItemInfo> pExtItemInfo; //如果bSimple == FALSE,则此结构存在
MayExist<CGoldQuantity> pGold; //如果sTypeName == "gld ",则此结构存在
BOOL bHasRand = FALSE;//1 bit
MayExist<DWORD, 3> pTmStFlag; //如果bHasRand == TRUE,则此结构存在
MayExist<DWORD, 4> pTimeStampFlag; //如果bHasRand == TRUE,则此结构存在
//20230131:之前为3个DWORD(未测试),现在改成4个DWORD(已测试)
MayExist<CTypeSpecificInfo> pTpSpInfo; //如果bSimple == FALSE,则此结构存在
//Functions:
explicit CItemInfo(const CItemMetaData * meta = 0);
Expand Down
4 changes: 3 additions & 1 deletion Diablo Edit2/Diablo Edit2.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ class CDiabloEdit2App : public CWinApp
const CString & RareCraftedName(UINT index) const { return String(SectionToIndex(RARE_CRAFTED_NAME, index)); }
const CString & UniqueName(UINT index) const { return String(SectionToIndex(UNIQUE_ITEM_NAME, index)); }
const CString & SetItemName(UINT index) const { return String(SectionToIndex(SET_ITEM_NAME, index)); }
const CString & RuneWordName(UINT index) const { return String(SectionToIndex(RUNE_WORD_NAME, index)); }
const CString & RuneWordName(UINT index) const {
return index < SectionSize(RUNE_WORD_NAME) ? String(SectionToIndex(RUNE_WORD_NAME, index)) : CString();
}
UINT ItemQualityNameSize() const { return SectionSize(ITEM_QUALITY_NAME); }
UINT PropertyNameSize() const { return SectionSize(PROPERTY_NAME); }
UINT TimeNameSize() const { return SectionSize(TIME_NAME); }
Expand Down
2 changes: 1 addition & 1 deletion Diablo Edit2/DlgSuspend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ LONG CDlgSuspend::GetItemInfo(const CD2Item * pItem, int iGems)
}
if (quality <= 3 && pItem->IsRuneWord()) {
int id = pItem->RuneWordId();
CString name = ::theApp.RuneWordName(pItem->RuneWordId());
CString name = ::theApp.RuneWordName(id);
AddMsg(UNIQUE, CSFormat(_T("%s (%d)"), name, id));
color = GRAY;
}
Expand Down
Binary file modified Diablo Edit2/language.dat
Binary file not shown.
Binary file modified Diablo Edit2/property.dat
Binary file not shown.
8 changes: 7 additions & 1 deletion Generate Data/language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@
Scroll of Town Portal 回城卷轴 回城卷軸
Tome of Town Portal 回城之书 回城之書
350 Delirium 迪勒瑞姆 迪勒瑞姆
371 Mark of the Bear 熊之印记 熊之印記
372 Mark of the Wolf 狼之印记 狼之印記
1023 An Evil Force 一股邪恶力量 一股邪惡力量
*=======================角色技能名字
Magic Arrow 魔法箭 魔法箭
Expand Down Expand Up @@ -1653,7 +1655,7 @@
%+d%% Chance to Cast Level %d %s When Death 当死亡时%+d%%机会施展等级%d %s 死亡時%+d%%機會施展等級%d %s
%+d%% Chance to Cast Level %d %s When Striking 当打击时有%+d%%机会施展等级%d %s 打擊時%+d%%機會施展等級%d %s
%+d%% Chance to Cast Level %d %s When Levelup 当升级时%+d%%机会施展等级%d %s 升級時%+d%%機會施展等級%d %s
Unused
%+d%% Chance for Finishing Moves to not Consume Charges %+d%% 几率使终结技不消耗集气的力量 %+d%% 機率使終結技不消耗集氣的力量
%+d%% Chance to Cast Level %d %s When Struck 被击中时有 %+d%% 几率释放 %d级 %s 技能 被擊中時有 %+d%% 几率釋放 %d級 %s 技能
Unused
Unused
Expand Down Expand Up @@ -4762,3 +4764,7 @@
193 Wrath
195 Zephyr
2718 Delirium
2784 Hustle 催促 催促
2785 Hustle 催促 催促
2786 Mosaic 嵌饰 嵌飾
2787 Metamorphosis 变化 變化
2 changes: 1 addition & 1 deletion Generate Data/property.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
197 384 6 10 7
198 384 6 10 7
199 384 6 10 7
200
200 7
201 384 6 10 7
202
203
Expand Down

0 comments on commit 892594f

Please sign in to comment.