| 2572 | } |
| 2573 | |
| 2574 | void DoRecharge(int pnum, int cii) |
| 2575 | { |
| 2576 | PlayerStruct *p; |
| 2577 | ItemStruct *pi; |
| 2578 | int r; |
| 2579 | |
| 2580 | p = &plr[pnum]; |
| 2581 | if (cii >= NUM_INVLOC) { |
| 2582 | pi = &p->InvList[cii - NUM_INVLOC]; |
| 2583 | } else { |
| 2584 | pi = &p->InvBody[cii]; |
| 2585 | } |
| 2586 | if (pi->_itype == ITYPE_STAFF && pi->_iSpell) { |
| 2587 | r = spelldata[pi->_iSpell].sBookLvl; |
| 2588 | r = random_(38, p->_pLevel / r) + 1; |
| 2589 | RechargeItem(pi, r); |
| 2590 | CalcPlrInv(pnum, TRUE); |
| 2591 | } |
| 2592 | |
| 2593 | if (pnum == myplr) |
| 2594 | SetCursor_(CURSOR_HAND); |
| 2595 | } |
| 2596 | |
| 2597 | void RechargeItem(ItemStruct *i, int r) |
| 2598 | { |
no test coverage detected