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

Function RecreateWitchItem

Source/items.cpp:3823–3845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3821}
3822
3823void RecreateWitchItem(int ii, int idx, int lvl, int iseed)
3824{
3825 int iblvl, itype;
3826
3827 if (idx == IDI_MANA || idx == IDI_FULLMANA || idx == IDI_PORTAL) {
3828 GetItemAttrs(ii, idx, lvl);
3829 } else {
3830 SetRndSeed(iseed);
3831 itype = RndWitchItem(lvl) - 1;
3832 GetItemAttrs(ii, itype, lvl);
3833 iblvl = -1;
3834 if (random_(51, 100) <= 5)
3835 iblvl = 2 * lvl;
3836 if (iblvl == -1 && item[ii]._iMiscId == IMISC_STAFF)
3837 iblvl = 2 * lvl;
3838 if (iblvl != -1)
3839 GetItemBonus(ii, itype, iblvl >> 1, iblvl, TRUE);
3840 }
3841
3842 item[ii]._iSeed = iseed;
3843 item[ii]._iCreateInfo = lvl | 0x2000;
3844 item[ii]._iIdentified = TRUE;
3845}
3846
3847void RecreateHealerItem(int ii, int idx, int lvl, int iseed)
3848{

Callers 1

RecreateTownItemFunction · 0.85

Calls 5

GetItemAttrsFunction · 0.85
SetRndSeedFunction · 0.85
RndWitchItemFunction · 0.85
random_Function · 0.85
GetItemBonusFunction · 0.85

Tested by

no test coverage detected