Skip to content

Commit

Permalink
more enums
Browse files Browse the repository at this point in the history
  • Loading branch information
qndel authored and AJenbo committed Sep 25, 2019
1 parent b45b33c commit 152573b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3760,21 +3760,15 @@ void SpawnSmith(int lvl)
#ifdef HELLFIRE
ItemStruct holditem;
holditem = item[0];
iCnt = random(50, 15) + 10;
#else
iCnt = random(50, 10) + 10;
#endif
iCnt = random(50, SMITH_ITEMS - 10) + 10;
for (i = 0; i < iCnt; i++) {
do {
item[0]._iSeed = GetRndSeed();
SetRndSeed(item[0]._iSeed);
idata = RndSmithItem(lvl) - 1;
GetItemAttrs(0, idata, lvl);
#ifdef HELLFIRE
} while (item[0]._iIvalue > 200000);
#else
} while (item[0]._iIvalue > 140000);
#endif
} while (item[0]._iIvalue > SMITH_MAX_VALUE);
smithitem[i] = item[0];
smithitem[i]._iCreateInfo = lvl | 0x400;
smithitem[i]._iIdentified = TRUE;
Expand Down Expand Up @@ -3863,7 +3857,7 @@ void SpawnOnePremium(int i, int plvl)
itype = RndPremiumItem(plvl >> 2, plvl) - 1;
GetItemAttrs(0, itype, plvl);
GetItemBonus(0, itype, plvl >> 1, plvl, 1);
} while (item[0]._iIvalue > 140000);
} while (item[0]._iIvalue > SMITH_MAX_PREMIUM_VALUE);
premiumitem[i] = item[0];
premiumitem[i]._iCreateInfo = plvl | 0x800;
premiumitem[i]._iIdentified = TRUE;
Expand Down Expand Up @@ -4307,7 +4301,7 @@ void RecalcStoreStats()
{
int i;

for (i = 0; i < 20; i++) {
for (i = 0; i < SMITH_ITEMS; i++) {
if (smithitem[i]._itype != ITYPE_NONE) {
smithitem[i]._iStatFlag = StoreStatOk(&smithitem[i]);
}
Expand Down
4 changes: 4 additions & 0 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@
#define NUMLEVELS 25
#define SMITH_ITEMS 25
#define SMITH_PREMIUM_ITEMS 15
#define SMITH_MAX_VALUE 200000
#define SMITH_MAX_PREMIUM_VALUE 200000
#else
#define NUMLEVELS 17
#define SMITH_ITEMS 20
#define SMITH_PREMIUM_ITEMS 6
#define SMITH_MAX_VALUE 140000
#define SMITH_MAX_PREMIUM_VALUE 140000
#endif

// from diablo 2 beta
Expand Down

0 comments on commit 152573b

Please sign in to comment.