Wondering why your players are getting slaughtered by mobs using spellshields?
Right at the end of the one_hit() function in fight.c, find the following code:
if ( IS_AFFECTED( victim, AFF_BLADEBARRIER ) && !IS_AFFECTED( ch, AFF_BLADEBARRIER ) )
retcode = damage(victim, ch, dam, skill_lookup( "blades" ));
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
if ( IS_AFFECTED( victim, AFF_FIRESHIELD ) && !IS_AFFECTED( ch, AFF_FIRESHIELD ) )
retcode = damage(victim, ch, dam, skill_lookup( "flare" ));
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
if ( IS_AFFECTED( victim, AFF_ICESHIELD ) && !IS_AFFECTED( ch, AFF_ICESHIELD ) )
retcode = damage(victim, ch, dam, skill_lookup( "iceshard" ));
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
if ( IS_AFFECTED( victim, AFF_SHOCKSHIELD ) && !IS_AFFECTED( ch, AFF_SHOCKSHIELD ) )
retcode = damage(victim, ch, dam, skill_lookup( "torrent" ));
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
if ( IS_AFFECTED( victim, AFF_ACIDMIST ) && !IS_AFFECTED( ch, AFF_ACIDMIST ) )
retcode = damage(victim, ch, dam, skill_lookup( "acidshot" ));
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
if ( IS_AFFECTED( victim, AFF_VENOMSHIELD ) && !IS_AFFECTED( ch, AFF_VENOMSHIELD ) )
retcode = damage(victim, ch, dam, skill_lookup( "venomshot" ));
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
The dam variable being passed to damage() is still refering to the damage being dealt by the attacker. Therefore each of the shields is essentially reflecting back all the damage being dealt by the player each hit. Obviously this isn't a good thing (ex. a player using backstab will nearly kill themselves in the process). I changed each of the if-checks in the following way, now making a call to spell_smaug():
if ( IS_AFFECTED( victim, AFF_BLADEBARRIER ) && !IS_AFFECTED( ch, AFF_BLADEBARRIER ) )
retcode = spell_smaug( skill_lookup( "blades" ), victim->level, victim, ch );
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
If someone sees a problem with this solution, feel free to reply.