|
|
|
|
@ -332,7 +332,7 @@ int premiumlvladd[SMITH_PREMIUM_ITEMS] = {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
int items_4231CA(int i) |
|
|
|
|
int get_ring_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -349,7 +349,7 @@ int items_4231CA(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_423230(int i) |
|
|
|
|
int get_bow_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -366,7 +366,7 @@ int items_423230(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_423296(int i) |
|
|
|
|
int get_staff_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -383,7 +383,7 @@ int items_423296(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_4232FC(int i) |
|
|
|
|
int get_sword_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -400,7 +400,7 @@ int items_4232FC(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_423362(int i) |
|
|
|
|
int get_helm_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -417,7 +417,7 @@ int items_423362(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_4233C8(int i) |
|
|
|
|
int get_shield_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -434,7 +434,7 @@ int items_4233C8(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_42342E(int i) |
|
|
|
|
int get_armor_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -455,7 +455,7 @@ int items_42342E(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_4234B2(int i) |
|
|
|
|
int get_mace_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -472,7 +472,7 @@ int items_4234B2(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_423518(int i) |
|
|
|
|
int get_amulet_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -489,7 +489,7 @@ int items_423518(int i)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int items_42357E(int i) |
|
|
|
|
int get_axe_max_value(int i) |
|
|
|
|
{ |
|
|
|
|
int j, res; |
|
|
|
|
|
|
|
|
|
@ -726,9 +726,9 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
ItemStruct *itm = &plr[p].InvBody[i]; |
|
|
|
|
if (itm->_itype != ITYPE_NONE && itm->_iStatFlag) { |
|
|
|
|
|
|
|
|
|
tac += itm->_iAC; |
|
|
|
|
mind += itm->_iMinDam; |
|
|
|
|
maxd += itm->_iMaxDam; |
|
|
|
|
tac += itm->_iAC; |
|
|
|
|
|
|
|
|
|
if (itm->_iSpell != SPL_NULL) { |
|
|
|
|
spl |= SPELLBIT(itm->_iSpell); |
|
|
|
|
@ -738,14 +738,16 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
bdam += itm->_iPLDam; |
|
|
|
|
btohit += itm->_iPLToHit; |
|
|
|
|
if (itm->_iPLAC) { |
|
|
|
|
int tmpac = itm->_iPLAC * itm->_iAC / 100; |
|
|
|
|
int tmpac = itm->_iAC; |
|
|
|
|
tmpac *= itm->_iPLAC; |
|
|
|
|
tmpac /= 100; |
|
|
|
|
if (tmpac == 0) |
|
|
|
|
tmpac = 1; |
|
|
|
|
bac += tmpac; |
|
|
|
|
} |
|
|
|
|
iflgs |= itm->_iFlags; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
pDamAcFlags |= plr[p].pDamAcFlags; |
|
|
|
|
pDamAcFlags |= itm->_iDamAcFlags; |
|
|
|
|
#endif |
|
|
|
|
sadd += itm->_iPLStr; |
|
|
|
|
madd += itm->_iPLMag; |
|
|
|
|
@ -783,10 +785,8 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
|
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_MONK) { |
|
|
|
|
if (plr[p]._pLevel >> 1 >= 1) |
|
|
|
|
mind = plr[p]._pLevel >> 1; |
|
|
|
|
if (maxd <= plr[p]._pLevel) |
|
|
|
|
maxd = plr[p]._pLevel; |
|
|
|
|
mind = max(mind, plr[p]._pLevel >> 1); |
|
|
|
|
maxd = max(maxd, plr[p]._pLevel); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
@ -827,11 +827,10 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
if (plr[p]._pLightRad != lrad && p == myplr) { |
|
|
|
|
ChangeLightRadius(plr[p]._plid, lrad); |
|
|
|
|
|
|
|
|
|
pvid = plr[p]._pvid; |
|
|
|
|
if (lrad >= 10) { |
|
|
|
|
ChangeVisionRadius(pvid, lrad); |
|
|
|
|
if (lrad < 10) { |
|
|
|
|
ChangeVisionRadius(plr[p]._pvid, 10); |
|
|
|
|
} else { |
|
|
|
|
ChangeVisionRadius(pvid, 10); |
|
|
|
|
ChangeVisionRadius(plr[p]._pvid, lrad); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plr[p]._pLightRad = lrad; |
|
|
|
|
@ -936,24 +935,36 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
|
|
|
|
|
if (mr > MAXRESIST) |
|
|
|
|
mr = MAXRESIST; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else if (mr < 0) |
|
|
|
|
mr = 0; |
|
|
|
|
#endif |
|
|
|
|
plr[p]._pMagResist = mr; |
|
|
|
|
|
|
|
|
|
if (fr > MAXRESIST) |
|
|
|
|
fr = MAXRESIST; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else if (fr < 0) |
|
|
|
|
fr = 0; |
|
|
|
|
#endif |
|
|
|
|
plr[p]._pFireResist = fr; |
|
|
|
|
|
|
|
|
|
if (lr > MAXRESIST) |
|
|
|
|
lr = MAXRESIST; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else if (lr < 0) |
|
|
|
|
lr = 0; |
|
|
|
|
#endif |
|
|
|
|
plr[p]._pLghtResist = lr; |
|
|
|
|
|
|
|
|
|
if (plr[p]._pClass == PC_WARRIOR) { |
|
|
|
|
vadd *= 2; |
|
|
|
|
vadd <<= 1; |
|
|
|
|
} |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_BARBARIAN) { |
|
|
|
|
vadd *= 3; |
|
|
|
|
} |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) { |
|
|
|
|
else if (plr[p]._pClass == PC_BARBARIAN) { |
|
|
|
|
vadd += vadd; |
|
|
|
|
vadd += (vadd >> 2); |
|
|
|
|
} else if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) { |
|
|
|
|
#else |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE) { |
|
|
|
|
#endif |
|
|
|
|
@ -962,7 +973,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
ihp += (vadd << 6); |
|
|
|
|
|
|
|
|
|
if (plr[p]._pClass == PC_SORCERER) { |
|
|
|
|
madd *= 2; |
|
|
|
|
madd <<= 1; |
|
|
|
|
} |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK) { |
|
|
|
|
@ -973,7 +984,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|
|
|
|
} |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else if (plr[p]._pClass == PC_BARD) { |
|
|
|
|
madd += madd >> 2 + madd >> 1; |
|
|
|
|
madd += (madd >> 2) + (madd >> 1); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
imana += (madd << 6); |
|
|
|
|
@ -3770,7 +3781,7 @@ void PrintItemOil(char IDidx)
|
|
|
|
|
switch (IDidx) { |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
case IMISC_OILACC: |
|
|
|
|
strcpy(tempstr, "increases a weapon\'s"); |
|
|
|
|
strcpy(tempstr, "increases a weapon's"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
strcpy(tempstr, "chance to hit"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
@ -3778,17 +3789,17 @@ void PrintItemOil(char IDidx)
|
|
|
|
|
case IMISC_OILMAST: |
|
|
|
|
strcpy(tempstr, "greatly increases a"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
strcpy(tempstr, "weapon\'s chance to hit"); |
|
|
|
|
strcpy(tempstr, "weapon's chance to hit"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
break; |
|
|
|
|
case IMISC_OILSHARP: |
|
|
|
|
strcpy(tempstr, "increases a weapon\'s"); |
|
|
|
|
strcpy(tempstr, "increases a weapon's"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
strcpy(tempstr, "damage potential"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
break; |
|
|
|
|
case IMISC_OILDEATH: |
|
|
|
|
strcpy(tempstr, "greatly increases a weapon\'s"); |
|
|
|
|
strcpy(tempstr, "greatly increases a weapon's"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
strcpy(tempstr, "damage potential - not bows"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
@ -3802,11 +3813,11 @@ void PrintItemOil(char IDidx)
|
|
|
|
|
case IMISC_OILBSMTH: |
|
|
|
|
strcpy(tempstr, "restores 20% of an"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
strcpy(tempstr, "item\'s durability"); |
|
|
|
|
strcpy(tempstr, "item's durability"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
break; |
|
|
|
|
case IMISC_OILFORT: |
|
|
|
|
strcpy(tempstr, "increases an item\'s"); |
|
|
|
|
strcpy(tempstr, "increases an item's"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
strcpy(tempstr, "current and max durability"); |
|
|
|
|
AddPanelString(tempstr, TRUE); |
|
|
|
|
@ -3928,9 +3939,6 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
break; |
|
|
|
|
case IPL_TOHIT_DAMP: |
|
|
|
|
case IPL_TOHIT_DAMP_CURSE: |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
case IPL_DOPPELGANGER: |
|
|
|
|
#endif |
|
|
|
|
sprintf(tempstr, "to hit: %+i%%, %+i%% damage", x->_iPLToHit, x->_iPLDam); |
|
|
|
|
break; |
|
|
|
|
case IPL_ACP: |
|
|
|
|
@ -3949,7 +3957,11 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
#endif |
|
|
|
|
if (x->_iPLFR < 75) |
|
|
|
|
sprintf(tempstr, "Resist Fire : %+i%%", x->_iPLFR); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else |
|
|
|
|
#else |
|
|
|
|
if (x->_iPLFR >= 75) |
|
|
|
|
#endif |
|
|
|
|
sprintf(tempstr, "Resist Fire : 75%% MAX"); |
|
|
|
|
break; |
|
|
|
|
case IPL_LIGHTRES: |
|
|
|
|
@ -3958,7 +3970,11 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
#endif |
|
|
|
|
if (x->_iPLLR < 75) |
|
|
|
|
sprintf(tempstr, "Resist Lightning : %+i%%", x->_iPLLR); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else |
|
|
|
|
#else |
|
|
|
|
if (x->_iPLLR >= 75) |
|
|
|
|
#endif |
|
|
|
|
sprintf(tempstr, "Resist Lightning : 75%% MAX"); |
|
|
|
|
break; |
|
|
|
|
case IPL_MAGICRES: |
|
|
|
|
@ -3967,7 +3983,11 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
#endif |
|
|
|
|
if (x->_iPLMR < 75) |
|
|
|
|
sprintf(tempstr, "Resist Magic : %+i%%", x->_iPLMR); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
else |
|
|
|
|
#else |
|
|
|
|
if (x->_iPLMR >= 75) |
|
|
|
|
#endif |
|
|
|
|
sprintf(tempstr, "Resist Magic : 75%% MAX"); |
|
|
|
|
break; |
|
|
|
|
case IPL_ALLRES: |
|
|
|
|
@ -3983,18 +4003,19 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
if (x->_iSplLvlAdd == 1) |
|
|
|
|
strcpy(tempstr, "spells are increased 1 level"); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (x->_iSplLvlAdd > 1) |
|
|
|
|
else if (x->_iSplLvlAdd > 1) |
|
|
|
|
sprintf(tempstr, "spells are increased %i levels", x->_iSplLvlAdd); |
|
|
|
|
else if (x->_iSplLvlAdd == -1) |
|
|
|
|
#else |
|
|
|
|
if (x->_iSplLvlAdd == 2) |
|
|
|
|
strcpy(tempstr, "spells are increased 2 levels"); |
|
|
|
|
#endif |
|
|
|
|
if (x->_iSplLvlAdd < 1) |
|
|
|
|
#endif |
|
|
|
|
strcpy(tempstr, "spells are decreased 1 level"); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (x->_iSplLvlAdd < -1) |
|
|
|
|
sprintf(tempstr, "spells are decreased %i levels", x->_iSplLvlAdd); |
|
|
|
|
if (x->_iSplLvlAdd == 0) |
|
|
|
|
else if (x->_iSplLvlAdd < -1) |
|
|
|
|
sprintf(tempstr, "spells are decreased %i levels", -x->_iSplLvlAdd); |
|
|
|
|
else if (x->_iSplLvlAdd == 0) |
|
|
|
|
strcpy(tempstr, "spell levels unchanged (?)"); |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
@ -4069,7 +4090,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
break; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
case IPL_MULT_ARROWS: |
|
|
|
|
strcpy(tempstr, "multiple arrows per shot"); |
|
|
|
|
sprintf(tempstr, "multiple arrows per shot"); |
|
|
|
|
break; |
|
|
|
|
#endif |
|
|
|
|
case IPL_FIRE_ARROWS: |
|
|
|
|
@ -4088,6 +4109,14 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
#endif |
|
|
|
|
sprintf(tempstr, "lightning arrows damage %i-%i", x->_iLMinDam, x->_iLMaxDam); |
|
|
|
|
break; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
case IPL_FIREBALL: |
|
|
|
|
if (x->_iFMinDam == x->_iFMaxDam) |
|
|
|
|
sprintf(tempstr, "fireball damage: %i", x->_iFMinDam); |
|
|
|
|
else |
|
|
|
|
sprintf(tempstr, "fireball damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); |
|
|
|
|
break; |
|
|
|
|
#endif |
|
|
|
|
case IPL_THORNS: |
|
|
|
|
strcpy(tempstr, "attacker takes 1-3 damage"); |
|
|
|
|
break; |
|
|
|
|
@ -4097,14 +4126,6 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
case IPL_NOHEALPLR: |
|
|
|
|
strcpy(tempstr, "you can't heal"); |
|
|
|
|
break; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
case IPL_FIREBALL: |
|
|
|
|
if (x->_iFMinDam != x->_iFMaxDam) |
|
|
|
|
sprintf(tempstr, "fireball damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); |
|
|
|
|
else |
|
|
|
|
sprintf(tempstr, "fireball damage: %i", x->_iFMinDam); |
|
|
|
|
break; |
|
|
|
|
#endif |
|
|
|
|
case IPL_ABSHALFTRAP: |
|
|
|
|
strcpy(tempstr, "absorbs half of trap damage"); |
|
|
|
|
break; |
|
|
|
|
@ -4134,7 +4155,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
break; |
|
|
|
|
case IPL_TARGAC: |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
strcpy(tempstr, "penetrates target\'s armor"); |
|
|
|
|
strcpy(tempstr, "penetrates target's armor"); |
|
|
|
|
#else |
|
|
|
|
strcpy(tempstr, "damages target's armor"); |
|
|
|
|
#endif |
|
|
|
|
@ -4195,11 +4216,10 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
break; |
|
|
|
|
case IPL_ADDACLIFE: |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (x->_iFMinDam != x->_iFMaxDam) { |
|
|
|
|
sprintf(tempstr, "lightning: %i-%i", x->_iFMinDam, x->_iFMaxDam); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
sprintf(tempstr, "lightning damage: %i", x->_iFMinDam); |
|
|
|
|
if (x->_iFMinDam == x->_iFMaxDam) |
|
|
|
|
sprintf(tempstr, "lightning damage: %i", x->_iFMinDam); |
|
|
|
|
else |
|
|
|
|
sprintf(tempstr, "lightning damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); |
|
|
|
|
#else |
|
|
|
|
strcpy(tempstr, "Armor class added to life"); |
|
|
|
|
#endif |
|
|
|
|
@ -4233,17 +4253,20 @@ void PrintItemPower(char plidx, ItemStruct *x)
|
|
|
|
|
case IPL_CRYSTALLINE: |
|
|
|
|
sprintf(tempstr, "low dur, %+i%% damage", x->_iPLDam); |
|
|
|
|
break; |
|
|
|
|
case IPL_DOPPELGANGER: |
|
|
|
|
sprintf(tempstr, "to hit: %+i%%, %+i%% damage", x->_iPLToHit, x->_iPLDam); |
|
|
|
|
break; |
|
|
|
|
case IPL_ACDEMON: |
|
|
|
|
strcpy(tempstr, "extra AC vs demons"); |
|
|
|
|
sprintf(tempstr, "extra AC vs demons"); |
|
|
|
|
break; |
|
|
|
|
case IPL_ACUNDEAD: |
|
|
|
|
strcpy(tempstr, "extra AC vs undead"); |
|
|
|
|
sprintf(tempstr, "extra AC vs undead"); |
|
|
|
|
break; |
|
|
|
|
case IPL_MANATOLIFE: |
|
|
|
|
strcpy(tempstr, "50%% Mana moved to Health"); |
|
|
|
|
sprintf(tempstr, "50%% Mana moved to Health"); |
|
|
|
|
break; |
|
|
|
|
case IPL_LIFETOMANA: |
|
|
|
|
strcpy(tempstr, "40%% Health moved to Mana"); |
|
|
|
|
sprintf(tempstr, "40%% Health moved to Mana"); |
|
|
|
|
break; |
|
|
|
|
#endif |
|
|
|
|
default: |
|
|
|
|
@ -4524,9 +4547,17 @@ void UseItem(int p, int Mid, int spl)
|
|
|
|
|
case IMISC_MEAT: |
|
|
|
|
j = plr[p]._pMaxHP >> 8; |
|
|
|
|
l = ((j >> 1) + random_(39, j)) << 6; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN) |
|
|
|
|
#else |
|
|
|
|
if (plr[p]._pClass == PC_WARRIOR) |
|
|
|
|
l *= 2; |
|
|
|
|
#endif |
|
|
|
|
l <<= 1; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) |
|
|
|
|
#else |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE) |
|
|
|
|
#endif |
|
|
|
|
l += l >> 1; |
|
|
|
|
plr[p]._pHitPoints += l; |
|
|
|
|
if (plr[p]._pHitPoints > plr[p]._pMaxHP) |
|
|
|
|
@ -4545,8 +4576,12 @@ void UseItem(int p, int Mid, int spl)
|
|
|
|
|
j = plr[p]._pMaxMana >> 8; |
|
|
|
|
l = ((j >> 1) + random_(40, j)) << 6; |
|
|
|
|
if (plr[p]._pClass == PC_SORCERER) |
|
|
|
|
l *= 2; |
|
|
|
|
l <<= 1; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) |
|
|
|
|
#else |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE) |
|
|
|
|
#endif |
|
|
|
|
l += l >> 1; |
|
|
|
|
if (!(plr[p]._pIFlags & ISPL_NOMANA)) { |
|
|
|
|
plr[p]._pMana += l; |
|
|
|
|
@ -4570,18 +4605,32 @@ void UseItem(int p, int Mid, int spl)
|
|
|
|
|
break; |
|
|
|
|
case IMISC_ELIXMAG: |
|
|
|
|
ModifyPlrMag(p, 1); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
plr[p]._pMana = plr[p]._pMaxMana; |
|
|
|
|
plr[p]._pManaBase = plr[p]._pMaxManaBase; |
|
|
|
|
drawmanaflag = TRUE; |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
case IMISC_ELIXDEX: |
|
|
|
|
ModifyPlrDex(p, 1); |
|
|
|
|
break; |
|
|
|
|
case IMISC_ELIXVIT: |
|
|
|
|
ModifyPlrVit(p, 1); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
plr[p]._pHitPoints = plr[p]._pMaxHP; |
|
|
|
|
plr[p]._pHPBase = plr[p]._pMaxHPBase; |
|
|
|
|
drawhpflag = TRUE; |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
case IMISC_REJUV: |
|
|
|
|
j = plr[p]._pMaxHP >> 8; |
|
|
|
|
l = ((j >> 1) + random_(39, j)) << 6; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN) |
|
|
|
|
#else |
|
|
|
|
if (plr[p]._pClass == PC_WARRIOR) |
|
|
|
|
l *= 2; |
|
|
|
|
#endif |
|
|
|
|
l <<= 1; |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE) |
|
|
|
|
l += l >> 1; |
|
|
|
|
plr[p]._pHitPoints += l; |
|
|
|
|
@ -4594,7 +4643,7 @@ void UseItem(int p, int Mid, int spl)
|
|
|
|
|
j = plr[p]._pMaxMana >> 8; |
|
|
|
|
l = ((j >> 1) + random_(40, j)) << 6; |
|
|
|
|
if (plr[p]._pClass == PC_SORCERER) |
|
|
|
|
l *= 2; |
|
|
|
|
l <<= 1; |
|
|
|
|
if (plr[p]._pClass == PC_ROGUE) |
|
|
|
|
l += l >> 1; |
|
|
|
|
if (!(plr[p]._pIFlags & ISPL_NOMANA)) { |
|
|
|
|
@ -4691,7 +4740,7 @@ void UseItem(int p, int Mid, int spl)
|
|
|
|
|
if (!invflag) { |
|
|
|
|
invflag = TRUE; |
|
|
|
|
} |
|
|
|
|
SetCursor_(CURSOR_OIL); |
|
|
|
|
NewCursor(CURSOR_OIL); |
|
|
|
|
break; |
|
|
|
|
#endif |
|
|
|
|
case IMISC_SPECELIX: |
|
|
|
|
@ -4705,31 +4754,31 @@ void UseItem(int p, int Mid, int spl)
|
|
|
|
|
plr[p]._pTSpell = SPL_RUNEFIRE; |
|
|
|
|
plr[p]._pTSplType = RSPLTYPE_INVALID; |
|
|
|
|
if (p == myplr) |
|
|
|
|
SetCursor_(CURSOR_TELEPORT); |
|
|
|
|
NewCursor(CURSOR_TELEPORT); |
|
|
|
|
break; |
|
|
|
|
case IMISC_RUNEL: |
|
|
|
|
plr[p]._pTSpell = SPL_RUNELIGHT; |
|
|
|
|
plr[p]._pTSplType = RSPLTYPE_INVALID; |
|
|
|
|
if (p == myplr) |
|
|
|
|
SetCursor_(CURSOR_TELEPORT); |
|
|
|
|
NewCursor(CURSOR_TELEPORT); |
|
|
|
|
break; |
|
|
|
|
case IMISC_GR_RUNEL: |
|
|
|
|
plr[p]._pTSpell = SPL_RUNENOVA; |
|
|
|
|
plr[p]._pTSplType = RSPLTYPE_INVALID; |
|
|
|
|
if (p == myplr) |
|
|
|
|
SetCursor_(CURSOR_TELEPORT); |
|
|
|
|
NewCursor(CURSOR_TELEPORT); |
|
|
|
|
break; |
|
|
|
|
case IMISC_GR_RUNEF: |
|
|
|
|
plr[p]._pTSpell = SPL_RUNEIMMOLAT; |
|
|
|
|
plr[p]._pTSplType = RSPLTYPE_INVALID; |
|
|
|
|
if (p == myplr) |
|
|
|
|
SetCursor_(CURSOR_TELEPORT); |
|
|
|
|
NewCursor(CURSOR_TELEPORT); |
|
|
|
|
break; |
|
|
|
|
case IMISC_RUNES: |
|
|
|
|
plr[p]._pTSpell = SPL_RUNESTONE; |
|
|
|
|
plr[p]._pTSplType = RSPLTYPE_INVALID; |
|
|
|
|
if (p == myplr) |
|
|
|
|
SetCursor_(CURSOR_TELEPORT); |
|
|
|
|
NewCursor(CURSOR_TELEPORT); |
|
|
|
|
break; |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
@ -4933,6 +4982,31 @@ static void SpawnOnePremium(int i, int plvl)
|
|
|
|
|
ItemStruct holditem; |
|
|
|
|
|
|
|
|
|
holditem = item[0]; |
|
|
|
|
|
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
int ivalue; |
|
|
|
|
int count = 0; |
|
|
|
|
|
|
|
|
|
int strength = get_max_strength(plr[myplr]._pClass); |
|
|
|
|
int dexterity = get_max_dexterity(plr[myplr]._pClass); |
|
|
|
|
int magic = get_max_magic(plr[myplr]._pClass); |
|
|
|
|
|
|
|
|
|
if (strength < plr[myplr]._pStrength) { |
|
|
|
|
strength = plr[myplr]._pStrength; |
|
|
|
|
} |
|
|
|
|
strength *= 1.2; |
|
|
|
|
|
|
|
|
|
if (dexterity < plr[myplr]._pDexterity) { |
|
|
|
|
dexterity = plr[myplr]._pDexterity; |
|
|
|
|
} |
|
|
|
|
dexterity *= 1.2; |
|
|
|
|
|
|
|
|
|
if (magic < plr[myplr]._pMagic) { |
|
|
|
|
magic = plr[myplr]._pMagic; |
|
|
|
|
} |
|
|
|
|
magic *= 1.2; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (plvl > 30) |
|
|
|
|
plvl = 30; |
|
|
|
|
if (plvl < 1) |
|
|
|
|
@ -4943,11 +5017,59 @@ static void SpawnOnePremium(int i, int plvl)
|
|
|
|
|
itype = RndPremiumItem(plvl >> 2, plvl) - 1; |
|
|
|
|
GetItemAttrs(0, itype, plvl); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, FALSE); |
|
|
|
|
GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, noSpells); |
|
|
|
|
#else |
|
|
|
|
GetItemBonus(0, itype, plvl >> 1, plvl, TRUE); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
ivalue = 0; |
|
|
|
|
switch (item[0]._itype) { |
|
|
|
|
case ITYPE_LARMOR: |
|
|
|
|
case ITYPE_MARMOR: |
|
|
|
|
case ITYPE_HARMOR: |
|
|
|
|
ivalue = get_armor_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_SHIELD: |
|
|
|
|
ivalue = get_shield_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_AXE: |
|
|
|
|
ivalue = get_axe_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_BOW: |
|
|
|
|
ivalue = get_bow_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_MACE: |
|
|
|
|
ivalue = get_mace_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_SWORD: |
|
|
|
|
ivalue = get_sword_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_HELM: |
|
|
|
|
ivalue = get_helm_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_STAFF: |
|
|
|
|
ivalue = get_staff_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_RING: |
|
|
|
|
ivalue = get_ring_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_AMULET: |
|
|
|
|
ivalue = get_amulet_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
ivalue *= 0.8; |
|
|
|
|
|
|
|
|
|
count++; |
|
|
|
|
} while ((item[0]._iIvalue > SMITH_MAX_PREMIUM_VALUE |
|
|
|
|
|| item[0]._iMinStr > strength |
|
|
|
|
|| item[0]._iMinMag > magic |
|
|
|
|
|| item[0]._iMinDex > dexterity |
|
|
|
|
|| item[0]._iIvalue < ivalue) |
|
|
|
|
&& count < 150); |
|
|
|
|
#else |
|
|
|
|
} while (item[0]._iIvalue > SMITH_MAX_PREMIUM_VALUE); |
|
|
|
|
#endif |
|
|
|
|
premiumitem[i] = item[0]; |
|
|
|
|
premiumitem[i]._iCreateInfo = plvl | CF_SMITHPREMIUM; |
|
|
|
|
premiumitem[i]._iIdentified = TRUE; |
|
|
|
|
@ -5112,9 +5234,15 @@ void WitchBookLevel(int ii)
|
|
|
|
|
|
|
|
|
|
void SpawnWitch(int lvl) |
|
|
|
|
{ |
|
|
|
|
int i, iCnt; |
|
|
|
|
int i, j, iCnt; |
|
|
|
|
int idata, maxlvl; |
|
|
|
|
|
|
|
|
|
j = 3; |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
iCnt = random_(51, 15) + 10; |
|
|
|
|
int books = random_(3, 4); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
GetItemAttrs(0, IDI_MANA, 1); |
|
|
|
|
witchitem[0] = item[0]; |
|
|
|
|
witchitem[0]._iCreateInfo = lvl; |
|
|
|
|
@ -5127,9 +5255,31 @@ void SpawnWitch(int lvl)
|
|
|
|
|
witchitem[2] = item[0]; |
|
|
|
|
witchitem[2]._iCreateInfo = lvl; |
|
|
|
|
witchitem[2]._iStatFlag = TRUE; |
|
|
|
|
|
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
int bCnt; |
|
|
|
|
for (i = 114, bCnt = 0; i <= 117 && bCnt < books; ++i) { |
|
|
|
|
if (WitchItemOk(i) |
|
|
|
|
&& lvl >= AllItemsList[i].iMinMLvl) { |
|
|
|
|
item[0]._iSeed = GetRndSeed(); |
|
|
|
|
SetRndSeed(item[0]._iSeed); |
|
|
|
|
volatile int junk = random_(0, 1); |
|
|
|
|
|
|
|
|
|
GetItemAttrs(0, i, lvl); |
|
|
|
|
witchitem[j] = item[0]; |
|
|
|
|
witchitem[j]._iCreateInfo = lvl | CF_WITCH; |
|
|
|
|
witchitem[j]._iIdentified = TRUE; |
|
|
|
|
WitchBookLevel(j); |
|
|
|
|
witchitem[j]._iStatFlag = StoreStatOk(&witchitem[j]); |
|
|
|
|
j++; |
|
|
|
|
bCnt++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
iCnt = random_(51, 8) + 10; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
for (i = 3; i < iCnt; i++) { |
|
|
|
|
for (i = j; i < iCnt; i++) { |
|
|
|
|
do { |
|
|
|
|
item[0]._iSeed = GetRndSeed(); |
|
|
|
|
SetRndSeed(item[0]._iSeed); |
|
|
|
|
@ -5146,7 +5296,7 @@ void SpawnWitch(int lvl)
|
|
|
|
|
#else |
|
|
|
|
GetItemBonus(0, idata, maxlvl >> 1, maxlvl, TRUE); |
|
|
|
|
#endif |
|
|
|
|
} while (item[0]._iIvalue > 140000); |
|
|
|
|
} while (item[0]._iIvalue > WITCH_MAX_VALUE); |
|
|
|
|
witchitem[i] = item[0]; |
|
|
|
|
witchitem[i]._iCreateInfo = lvl | CF_WITCH; |
|
|
|
|
witchitem[i]._iIdentified = TRUE; |
|
|
|
|
@ -5154,7 +5304,7 @@ void SpawnWitch(int lvl)
|
|
|
|
|
witchitem[i]._iStatFlag = StoreStatOk(&witchitem[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (i = iCnt; i < 20; i++) |
|
|
|
|
for (i = iCnt; i < WITCH_ITEMS; i++) |
|
|
|
|
witchitem[i]._itype = ITYPE_NONE; |
|
|
|
|
|
|
|
|
|
SortWitch(); |
|
|
|
|
@ -5184,6 +5334,31 @@ void SpawnBoy(int lvl)
|
|
|
|
|
{ |
|
|
|
|
int itype; |
|
|
|
|
|
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
int ivalue; |
|
|
|
|
int count = 0; |
|
|
|
|
|
|
|
|
|
int strength = get_max_strength(plr[myplr]._pClass); |
|
|
|
|
int dexterity = get_max_dexterity(plr[myplr]._pClass); |
|
|
|
|
int magic = get_max_magic(plr[myplr]._pClass); |
|
|
|
|
int pc = plr[myplr]._pClass; |
|
|
|
|
|
|
|
|
|
if (strength < plr[myplr]._pStrength) { |
|
|
|
|
strength = plr[myplr]._pStrength; |
|
|
|
|
} |
|
|
|
|
strength *= 1.2; |
|
|
|
|
|
|
|
|
|
if (dexterity < plr[myplr]._pDexterity) { |
|
|
|
|
dexterity = plr[myplr]._pDexterity; |
|
|
|
|
} |
|
|
|
|
dexterity *= 1.2; |
|
|
|
|
|
|
|
|
|
if (magic < plr[myplr]._pMagic) { |
|
|
|
|
magic = plr[myplr]._pMagic; |
|
|
|
|
} |
|
|
|
|
magic *= 1.2; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (boylevel < (lvl >> 1) || boyitem._itype == ITYPE_NONE) { |
|
|
|
|
do { |
|
|
|
|
item[0]._iSeed = GetRndSeed(); |
|
|
|
|
@ -5192,10 +5367,87 @@ void SpawnBoy(int lvl)
|
|
|
|
|
GetItemAttrs(0, itype, lvl); |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
GetItemBonus(0, itype, lvl, 2 * lvl, TRUE, TRUE); |
|
|
|
|
|
|
|
|
|
ivalue = 0; |
|
|
|
|
|
|
|
|
|
int itemType = item[0]._itype; |
|
|
|
|
|
|
|
|
|
switch (itemType) { |
|
|
|
|
case ITYPE_LARMOR: |
|
|
|
|
case ITYPE_MARMOR: |
|
|
|
|
case ITYPE_HARMOR: |
|
|
|
|
ivalue = get_armor_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_SHIELD: |
|
|
|
|
ivalue = get_shield_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_AXE: |
|
|
|
|
ivalue = get_axe_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_BOW: |
|
|
|
|
ivalue = get_bow_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_MACE: |
|
|
|
|
ivalue = get_mace_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_SWORD: |
|
|
|
|
ivalue = get_sword_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_HELM: |
|
|
|
|
ivalue = get_helm_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_STAFF: |
|
|
|
|
ivalue = get_staff_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_RING: |
|
|
|
|
ivalue = get_ring_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
case ITYPE_AMULET: |
|
|
|
|
ivalue = get_amulet_max_value(myplr); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
ivalue *= 0.8; |
|
|
|
|
|
|
|
|
|
count++; |
|
|
|
|
|
|
|
|
|
if (count < 200) { |
|
|
|
|
switch (pc) { |
|
|
|
|
case PC_WARRIOR: |
|
|
|
|
if (itemType == ITYPE_BOW || itemType == ITYPE_STAFF) |
|
|
|
|
ivalue = INT_MAX; |
|
|
|
|
break; |
|
|
|
|
case PC_ROGUE: |
|
|
|
|
if (itemType == ITYPE_SWORD || itemType == ITYPE_STAFF || itemType == ITYPE_AXE || itemType == ITYPE_MACE || itemType == ITYPE_SHIELD) |
|
|
|
|
ivalue = INT_MAX; |
|
|
|
|
break; |
|
|
|
|
case PC_SORCERER: |
|
|
|
|
if (itemType == ITYPE_STAFF || itemType == ITYPE_AXE || itemType == ITYPE_BOW || itemType == ITYPE_MACE) |
|
|
|
|
ivalue = INT_MAX; |
|
|
|
|
break; |
|
|
|
|
case PC_MONK: |
|
|
|
|
if (itemType == ITYPE_BOW || itemType == ITYPE_MARMOR || itemType == ITYPE_SHIELD || itemType == ITYPE_MACE) |
|
|
|
|
ivalue = INT_MAX; |
|
|
|
|
break; |
|
|
|
|
case PC_BARD: |
|
|
|
|
if (itemType == ITYPE_AXE || itemType == ITYPE_MACE || itemType == ITYPE_STAFF) |
|
|
|
|
ivalue = INT_MAX; |
|
|
|
|
break; |
|
|
|
|
case PC_BARBARIAN: |
|
|
|
|
if (itemType == ITYPE_BOW || itemType == ITYPE_STAFF) |
|
|
|
|
ivalue = INT_MAX; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} while ((item[0]._iIvalue > BOY_MAX_VALUE |
|
|
|
|
|| item[0]._iMinStr > strength |
|
|
|
|
|| item[0]._iMinMag > magic |
|
|
|
|
|| item[0]._iMinDex > dexterity |
|
|
|
|
|| item[0]._iIvalue < ivalue) |
|
|
|
|
&& count < 250); |
|
|
|
|
#else |
|
|
|
|
GetItemBonus(0, itype, lvl, 2 * lvl, TRUE); |
|
|
|
|
} while (item[0]._iIvalue > BOY_MAX_VALUE); |
|
|
|
|
#endif |
|
|
|
|
} while (item[0]._iIvalue > 90000); |
|
|
|
|
boyitem = item[0]; |
|
|
|
|
boyitem._iCreateInfo = lvl | CF_BOY; |
|
|
|
|
boyitem._iIdentified = TRUE; |
|
|
|
|
|