Skip to content

Commit 892594f

Browse files
committed
Support new runewords (incomplete) and properties in PTR 2.6.
#57
1 parent 14a26fc commit 892594f

File tree

8 files changed

+20
-9
lines changed

8 files changed

+20
-9
lines changed

Diablo Edit2/D2Item.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ const CItemMetaData* CItemInfo::ReadData(CInBitsStream& bs, DWORD version, BOOL
545545
bs >> bHasRand;
546546
if (!bSimple) {
547547
if (bHasRand)
548-
for (auto& i : pTmStFlag.ensure())
548+
for (auto& i : pTimeStampFlag.ensure())
549549
if (bs.Good())
550550
bs >> bits(i, 32);
551551
//Type Specific info
@@ -587,7 +587,7 @@ void CItemInfo::WriteData(COutBitsStream& bs, const CItemMetaData& itemData, DWO
587587
pGold->WriteData(bs);
588588
bs << bHasRand;
589589
if (bHasRand)
590-
for (auto i : pTmStFlag)
590+
for (auto i : pTimeStampFlag)
591591
if (bs.Good())
592592
bs << bits(i, 32);
593593
if (!bSimple) { //Type Specific info
@@ -682,8 +682,10 @@ CString CD2Item::ItemName() const {
682682
if (extInfo.wMonsterID.exist())
683683
name.push_front(::theApp.MonsterName(extInfo.wMonsterID));
684684
}
685-
if (extInfo.iQuality <= 3 && IsRuneWord())
686-
name.push_front(::theApp.RuneWordName(RuneWordId()));
685+
if (extInfo.iQuality <= 3 && IsRuneWord()) {
686+
const CString runewordName = ::theApp.RuneWordName(RuneWordId());
687+
name.push_front(runewordName);
688+
}
687689
if (bEthereal)
688690
name.push_back(_T("(ETH)"));
689691
}

Diablo Edit2/D2Item.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ struct CItemInfo
163163
MayExist<CExtItemInfo> pExtItemInfo; //如果bSimple == FALSE,则此结构存在
164164
MayExist<CGoldQuantity> pGold; //如果sTypeName == "gld ",则此结构存在
165165
BOOL bHasRand = FALSE;//1 bit
166-
MayExist<DWORD, 3> pTmStFlag; //如果bHasRand == TRUE,则此结构存在
166+
MayExist<DWORD, 4> pTimeStampFlag; //如果bHasRand == TRUE,则此结构存在
167+
//20230131:之前为3个DWORD(未测试),现在改成4个DWORD(已测试)
167168
MayExist<CTypeSpecificInfo> pTpSpInfo; //如果bSimple == FALSE,则此结构存在
168169
//Functions:
169170
explicit CItemInfo(const CItemMetaData * meta = 0);

Diablo Edit2/Diablo Edit2.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ class CDiabloEdit2App : public CWinApp
101101
const CString & RareCraftedName(UINT index) const { return String(SectionToIndex(RARE_CRAFTED_NAME, index)); }
102102
const CString & UniqueName(UINT index) const { return String(SectionToIndex(UNIQUE_ITEM_NAME, index)); }
103103
const CString & SetItemName(UINT index) const { return String(SectionToIndex(SET_ITEM_NAME, index)); }
104-
const CString & RuneWordName(UINT index) const { return String(SectionToIndex(RUNE_WORD_NAME, index)); }
104+
const CString & RuneWordName(UINT index) const {
105+
return index < SectionSize(RUNE_WORD_NAME) ? String(SectionToIndex(RUNE_WORD_NAME, index)) : CString();
106+
}
105107
UINT ItemQualityNameSize() const { return SectionSize(ITEM_QUALITY_NAME); }
106108
UINT PropertyNameSize() const { return SectionSize(PROPERTY_NAME); }
107109
UINT TimeNameSize() const { return SectionSize(TIME_NAME); }

Diablo Edit2/DlgSuspend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ LONG CDlgSuspend::GetItemInfo(const CD2Item * pItem, int iGems)
139139
}
140140
if (quality <= 3 && pItem->IsRuneWord()) {
141141
int id = pItem->RuneWordId();
142-
CString name = ::theApp.RuneWordName(pItem->RuneWordId());
142+
CString name = ::theApp.RuneWordName(id);
143143
AddMsg(UNIQUE, CSFormat(_T("%s (%d)"), name, id));
144144
color = GRAY;
145145
}

Diablo Edit2/language.dat

181 Bytes
Binary file not shown.

Diablo Edit2/property.dat

2 Bytes
Binary file not shown.

Generate Data/language.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@
545545
Scroll of Town Portal 回城卷轴 回城卷軸
546546
Tome of Town Portal 回城之书 回城之書
547547
350 Delirium 迪勒瑞姆 迪勒瑞姆
548+
371 Mark of the Bear 熊之印记 熊之印記
549+
372 Mark of the Wolf 狼之印记 狼之印記
548550
1023 An Evil Force 一股邪恶力量 一股邪惡力量
549551
*=======================角色技能名字
550552
Magic Arrow 魔法箭 魔法箭
@@ -1653,7 +1655,7 @@
16531655
%+d%% Chance to Cast Level %d %s When Death 当死亡时%+d%%机会施展等级%d %s 死亡時%+d%%機會施展等級%d %s
16541656
%+d%% Chance to Cast Level %d %s When Striking 当打击时有%+d%%机会施展等级%d %s 打擊時%+d%%機會施展等級%d %s
16551657
%+d%% Chance to Cast Level %d %s When Levelup 当升级时%+d%%机会施展等级%d %s 升級時%+d%%機會施展等級%d %s
1656-
Unused
1658+
%+d%% Chance for Finishing Moves to not Consume Charges %+d%% 几率使终结技不消耗集气的力量 %+d%% 機率使終結技不消耗集氣的力量
16571659
%+d%% Chance to Cast Level %d %s When Struck 被击中时有 %+d%% 几率释放 %d级 %s 技能 被擊中時有 %+d%% 几率釋放 %d級 %s 技能
16581660
Unused
16591661
Unused
@@ -4762,3 +4764,7 @@
47624764
193 Wrath
47634765
195 Zephyr
47644766
2718 Delirium
4767+
2784 Hustle 催促 催促
4768+
2785 Hustle 催促 催促
4769+
2786 Mosaic 嵌饰 嵌飾
4770+
2787 Metamorphosis 变化 變化

Generate Data/property.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
197 384 6 10 7
207207
198 384 6 10 7
208208
199 384 6 10 7
209-
200
209+
200 7
210210
201 384 6 10 7
211211
202
212212
203

0 commit comments

Comments
 (0)