|
|
|
|
@ -610,7 +610,7 @@ void CheckInvPaste(int pnum, Point cursorPosition)
|
|
|
|
|
if (ig <= MaxGold) { |
|
|
|
|
player.InvList[invIndex]._ivalue = ig; |
|
|
|
|
player._pGold += player.HoldItem._ivalue; |
|
|
|
|
SetPlrHandGoldCurs(&player.InvList[invIndex]); |
|
|
|
|
SetPlrHandGoldCurs(player.InvList[invIndex]); |
|
|
|
|
} else { |
|
|
|
|
ig = MaxGold - gt; |
|
|
|
|
player._pGold += ig; |
|
|
|
|
@ -627,7 +627,7 @@ void CheckInvPaste(int pnum, Point cursorPosition)
|
|
|
|
|
player._pNumInv++; |
|
|
|
|
player.InvGrid[ii] = player._pNumInv; |
|
|
|
|
player._pGold += player.HoldItem._ivalue; |
|
|
|
|
SetPlrHandGoldCurs(&player.InvList[invIndex]); |
|
|
|
|
SetPlrHandGoldCurs(player.InvList[invIndex]); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (it == 0) { |
|
|
|
|
@ -939,8 +939,8 @@ void CheckNaKrulNotes(PlayerStruct &player)
|
|
|
|
|
int itemNum = ActiveItems[0]; |
|
|
|
|
ItemStruct tmp = Items[itemNum]; |
|
|
|
|
memset(&Items[itemNum], 0, sizeof(*Items)); |
|
|
|
|
GetItemAttrs(itemNum, IDI_FULLNOTE, 16); |
|
|
|
|
SetupItem(itemNum); |
|
|
|
|
GetItemAttrs(Items[itemNum], IDI_FULLNOTE, 16); |
|
|
|
|
SetupItem(Items[itemNum]); |
|
|
|
|
player.HoldItem = Items[itemNum]; |
|
|
|
|
Items[itemNum] = tmp; |
|
|
|
|
} |
|
|
|
|
@ -1468,7 +1468,7 @@ bool GoldAutoPlace(PlayerStruct &player)
|
|
|
|
|
player.InvList[i]._ivalue += player.HoldItem._ivalue; |
|
|
|
|
if (player.InvList[i]._ivalue > MaxGold) { |
|
|
|
|
player.HoldItem._ivalue = player.InvList[i]._ivalue - MaxGold; |
|
|
|
|
SetPlrHandGoldCurs(&player.HoldItem); |
|
|
|
|
SetPlrHandGoldCurs(player.HoldItem); |
|
|
|
|
player.InvList[i]._ivalue = MaxGold; |
|
|
|
|
if (gbIsHellfire) |
|
|
|
|
GetPlrHandSeed(&player.HoldItem); |
|
|
|
|
@ -1477,7 +1477,7 @@ bool GoldAutoPlace(PlayerStruct &player)
|
|
|
|
|
done = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SetPlrHandGoldCurs(&player.InvList[i]); |
|
|
|
|
SetPlrHandGoldCurs(player.InvList[i]); |
|
|
|
|
player._pGold = CalculateGold(player); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1523,12 +1523,13 @@ bool GoldAutoPlaceInInventorySlot(PlayerStruct &player, int slotIndex)
|
|
|
|
|
|
|
|
|
|
void CheckInvSwap(int pnum, BYTE bLoc, int idx, uint16_t wCI, int seed, bool bId, uint32_t dwBuff) |
|
|
|
|
{ |
|
|
|
|
memset(&Items[MAXITEMS], 0, sizeof(*Items)); |
|
|
|
|
RecreateItem(MAXITEMS, idx, wCI, seed, 0, (dwBuff & CF_HELLFIRE) != 0); |
|
|
|
|
auto &item = Items[MAXITEMS]; |
|
|
|
|
memset(&item, 0, sizeof(item)); |
|
|
|
|
RecreateItem(item, idx, wCI, seed, 0, (dwBuff & CF_HELLFIRE) != 0); |
|
|
|
|
|
|
|
|
|
auto &player = Players[pnum]; |
|
|
|
|
|
|
|
|
|
player.HoldItem = Items[MAXITEMS]; |
|
|
|
|
player.HoldItem = item; |
|
|
|
|
|
|
|
|
|
if (bId) { |
|
|
|
|
player.HoldItem._iIdentified = true; |
|
|
|
|
@ -1648,7 +1649,7 @@ void AutoGetItem(int pnum, ItemStruct *item, int ii)
|
|
|
|
|
done = GoldAutoPlace(player); |
|
|
|
|
if (!done) { |
|
|
|
|
item->_ivalue = player.HoldItem._ivalue; |
|
|
|
|
SetPlrHandGoldCurs(item); |
|
|
|
|
SetPlrHandGoldCurs(*item); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
done = AutoEquipEnabled(player, player.HoldItem) && AutoEquip(pnum, player.HoldItem); |
|
|
|
|
@ -1835,29 +1836,30 @@ int SyncPutItem(PlayerStruct &player, Point position, int idx, uint16_t icreatei
|
|
|
|
|
assert(CanPut(position)); |
|
|
|
|
|
|
|
|
|
int ii = AllocateItem(); |
|
|
|
|
auto &item = Items[ii]; |
|
|
|
|
|
|
|
|
|
dItem[position.x][position.y] = ii + 1; |
|
|
|
|
|
|
|
|
|
if (idx == IDI_EAR) { |
|
|
|
|
RecreateEar(ii, icreateinfo, iseed, id, dur, mdur, ch, mch, ivalue, ibuff); |
|
|
|
|
RecreateEar(item, icreateinfo, iseed, id, dur, mdur, ch, mch, ivalue, ibuff); |
|
|
|
|
} else { |
|
|
|
|
RecreateItem(ii, idx, icreateinfo, iseed, ivalue, (ibuff & CF_HELLFIRE) != 0); |
|
|
|
|
RecreateItem(item, idx, icreateinfo, iseed, ivalue, (ibuff & CF_HELLFIRE) != 0); |
|
|
|
|
if (id != 0) |
|
|
|
|
Items[ii]._iIdentified = true; |
|
|
|
|
Items[ii]._iDurability = dur; |
|
|
|
|
Items[ii]._iMaxDur = mdur; |
|
|
|
|
Items[ii]._iCharges = ch; |
|
|
|
|
Items[ii]._iMaxCharges = mch; |
|
|
|
|
Items[ii]._iPLToHit = toHit; |
|
|
|
|
Items[ii]._iMaxDam = maxDam; |
|
|
|
|
Items[ii]._iMinStr = minStr; |
|
|
|
|
Items[ii]._iMinMag = minMag; |
|
|
|
|
Items[ii]._iMinDex = minDex; |
|
|
|
|
Items[ii]._iAC = ac; |
|
|
|
|
Items[ii].dwBuff = ibuff; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Items[ii].position = position; |
|
|
|
|
item._iIdentified = true; |
|
|
|
|
item._iDurability = dur; |
|
|
|
|
item._iMaxDur = mdur; |
|
|
|
|
item._iCharges = ch; |
|
|
|
|
item._iMaxCharges = mch; |
|
|
|
|
item._iPLToHit = toHit; |
|
|
|
|
item._iMaxDam = maxDam; |
|
|
|
|
item._iMinStr = minStr; |
|
|
|
|
item._iMinMag = minMag; |
|
|
|
|
item._iMinDex = minDex; |
|
|
|
|
item._iAC = ac; |
|
|
|
|
item.dwBuff = ibuff; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
item.position = position; |
|
|
|
|
RespawnItem(&Items[ii], true); |
|
|
|
|
|
|
|
|
|
if (currlevel == 21 && position == CornerStone.position) { |
|
|
|
|
|