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

Function CreateTypeItem

Source/items.cpp:2216–2239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2214}
2215
2216void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL sendmsg, BOOL delta)
2217{
2218 int idx, ii;
2219
2220 if (itype != ITYPE_GOLD)
2221 idx = RndTypeItems(itype, imisc);
2222 else
2223 idx = 0;
2224
2225 if (numitems < MAXITEMS) {
2226 ii = itemavail[0];
2227 GetSuperItemSpace(x, y, ii);
2228 itemavail[0] = itemavail[MAXITEMS - numitems - 1];
2229 itemactive[numitems] = ii;
2230 SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, onlygood, FALSE, delta);
2231
2232 if (sendmsg)
2233 NetSendCmdDItem(FALSE, ii);
2234 if (delta)
2235 DeltaAddItem(ii);
2236
2237 numitems++;
2238 }
2239}
2240
2241void RecreateItem(int ii, int idx, WORD icreateinfo, int iseed, int ivalue)
2242{

Callers 8

OperateShrineFunction · 0.85
OperateSkelBookFunction · 0.85
OperateBookCaseFunction · 0.85
OperateArmorStandFunction · 0.85
OperateWeaponRackFunction · 0.85
MonstStartKillFunction · 0.85
M_DoTalkFunction · 0.85
Theme_TreasureFunction · 0.85

Calls 6

RndTypeItemsFunction · 0.85
GetSuperItemSpaceFunction · 0.85
SetupAllItemsFunction · 0.85
GetRndSeedFunction · 0.85
NetSendCmdDItemFunction · 0.85
DeltaAddItemFunction · 0.85

Tested by

no test coverage detected