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

Function RndPremiumItem

Source/items.cpp:3419–3437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3417}
3418
3419int RndPremiumItem(int minlvl, int maxlvl)
3420{
3421 int i, ri;
3422 int ril[512];
3423
3424 ri = 0;
3425 for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
3426 if (AllItemsList[i].iRnd) {
3427 if (PremiumItemOk(i)) {
3428 if (AllItemsList[i].iMinMLvl >= minlvl && AllItemsList[i].iMinMLvl <= maxlvl) {
3429 ril[ri] = i;
3430 ri++;
3431 }
3432 }
3433 }
3434 }
3435
3436 return ril[random_(50, ri)] + 1;
3437}
3438
3439void SpawnOnePremium(int i, int plvl)
3440{

Callers 2

SpawnOnePremiumFunction · 0.85
RecreatePremiumItemFunction · 0.85

Calls 2

PremiumItemOkFunction · 0.85
random_Function · 0.85

Tested by

no test coverage detected