MCPcopy Create free account
hub / github.com/diasurgical/devilution / SpawnSmith

Function SpawnSmith

Source/items.cpp:3372–3393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3370}
3371
3372void SpawnSmith(int lvl)
3373{
3374 int i, iCnt, idata;
3375
3376 iCnt = random_(50, SMITH_ITEMS - 10) + 10;
3377 for (i = 0; i < iCnt; i++) {
3378 do {
3379 item[0]._iSeed = GetRndSeed();
3380 SetRndSeed(item[0]._iSeed);
3381 idata = RndSmithItem(lvl) - 1;
3382 GetItemAttrs(0, idata, lvl);
3383 } while (item[0]._iIvalue > SMITH_MAX_VALUE);
3384 smithitem[i] = item[0];
3385 smithitem[i]._iCreateInfo = lvl | 0x400;
3386 smithitem[i]._iIdentified = TRUE;
3387 smithitem[i]._iStatFlag = StoreStatOk(&smithitem[i]);
3388 }
3389 for (i = iCnt; i < SMITH_ITEMS; i++)
3390 smithitem[i]._itype = ITYPE_NONE;
3391
3392 SortSmith();
3393}
3394
3395BOOL PremiumItemOk(int i)
3396{

Callers 1

SetupTownStoresFunction · 0.85

Calls 7

random_Function · 0.85
GetRndSeedFunction · 0.85
SetRndSeedFunction · 0.85
RndSmithItemFunction · 0.85
GetItemAttrsFunction · 0.85
StoreStatOkFunction · 0.85
SortSmithFunction · 0.85

Tested by

no test coverage detected