Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 23
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
633
Rhyader
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,644
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 >>