Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Spellshields
Forum Rules | Mark all | Recent Posts

Spellshields
< Newer Topic :: Older Topic > Incorrect damage assigned

Pages:<< prev 1 next >>
Post is unread #1 May 8, 2004, 7:49 am   Last edited Nov 18, 2007, 4:57 pm by Samson
Go to the top of the page
Go to the bottom of the page

Chrysaor

GroupMembers
Posts2
JoinedMay 4, 2004

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.
       
Post is unread #2 May 9, 2004, 8:23 am   Last edited Nov 18, 2007, 4:57 pm by Samson
Go to the top of the page
Go to the bottom of the page

cynshard

GroupMembers
Posts95
JoinedNov 19, 2003

I changed this also, but instead of just calling the spell for damage I just divide the value, like so:
if ( IS_AFFECTED( victim, AFF_FIRESHIELD ) && !IS_AFFECTED( ch, AFF_FIRESHIELD ) )
       retcode = damage(victim, ch, (dam/2), skill_lookup( "flare" ));

This way players will receive half the damage that they do when attacking a fireshield. I made similar adjustments to the other shields.

Just another way of dealing with this.

Cynshard
       
Post is unread #3 May 9, 2004, 11:48 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

In looking at this and checking the stats of the various spells used, I'm led to conlclude Chrysaor's assessment is actually right. The damage values listed for the shield spells should not have been reflecting back collosall amounts of damage, and indeed the helpfiles for them imply "small" versions of the protective magic will be flung back on the attacker.

Simple solution then is to go with what Chrysaor suggests, and if the damage isn't suitable to your mud, tweak the spells to do different damage amounts. This can be done easily with the sset command and reduces the load on coders' time.
       
Pages:<< prev 1 next >>