Spell bug, iceshield

Posted by Zeno on Wed 11 May 2005 11:31 PM — 11 posts, 36,622 views.

USA #0
#SKILL 
 Name         iceshield~ 
 Type         Spell 
 Info         0 
 Flags        0 
 Target       2 
 Minpos       112 
 Slot         221 
 Mana         85 
 Rounds       12 
 Code         spell_smaug 
 Dammsg       ~ 
 Wearoff      The hail of ice rapidly melts and evaporates into nothingness.~ 
 Hitchar      A glistening hail of ice encompasses $N.~ 
 Hitvict      A glistening hail of ice encompasses you.~ 
 Hitroom      A glistening hail of ice encompasses $N.~ 
 Affect       '(l*4)+8' 26 'iceshield' 28 
 Minlevel     101 
 End 


When something with this affect on it is attacked, this bug comes up:
Log: [*****] BUG: spell_smaug: Called with a null skill for sn -1


Does anyone see anything wrong with the skill or what is wrong?

[EDIT] Turns out the spell calls iceshard. Does anyone see where it shows that?
Amended on Wed 11 May 2005 11:41 PM by Zeno
USA #1
Hrmm. Just tried this repeatedly, can't seem to reproduce it. :(
USA #2
Yeah I know. This is my mud where I took out a lot of skills. I had to put back in iceshard.
USA #3

   if( vic->has_aflag( AFF_ICESHIELD ) && !ch->has_aflag( AFF_ICESHIELD ) )
      retcode = spell_smaug( skill_lookup( "iceshard" ), vic->level, vic, ch );


You should have something like that in your fight.c file. If the target has an iceshield, and is hit, the reflected damage is done by the iceshard spell with the above code.
USA #4
Ahhh. Tch, hardcoded eh? *mutter* Thanks though.
USA #5
Thats a problem with SMAUG. All the spells are hardcoded into the system, which makes it a pain to alter them...
USA #6
While a bunch of the spells are coded into the system, not all of them are. Many of the spells are just spell_smaug rather than spell_<coded spell name>.
USA #7
Well I meant hard coded as in the effect calling iceshard. They aren't hard to alter, just issues like this that'll arise.
USA #8
Hard-coded spells are the least of your worries, I've found. It seems that almost everything is hard-coded. There can be lots of little problems that crop up because of that in lots of unexpected places in the code. This is a good example of one of them.
USA #9
Nah, that's what I mean, a bunch of them are not hard-coded, even effects, they're entirely editable/creatable online using the sset and slookup commands with the help category of smaugspells... on the other hand, yes, this one is hard-coded and is just one of the many things that are hard-coded and can give you all sorts of headaches along the way. But it's not as bad as some would have you believe either.
USA #10
I wasn't talking about skills and spells. I was talking about all the hard-coded, hidden dependencies in SMAUG. This iceshard thing is an example of a hidden, hard-coded dependency, but there are many more. It's to be expected; the codebase grew from accretion and it seems that nobody ever took the time to go in and clean up the house.