-
The regeneration spell is buggy when placed on objects because it's missing a few components. My first official bug fix, the corrected version:
[code]
void spell_regeneration(int sn,int level,CHAR_DATA *ch,void *vo, int target)
{
CHAR_DATA *gch;
AFFECT_DATA af;
bool perm = FALSE;
gch = (CHAR_DATA *) vo;
if (level > 9000); //Is an obj
{
level -= 9000;
perm = TRUE;
}
if (IS_AFFECTED2(gch, AFF2_HEALING_AURA))
{
if (gch == ch)
send_to_char("You are already affected by regeneration.\n\r",ch);
else
act("$N is already regenerating.",ch,NULL,gch,TO_CHAR);
}
else
{
af.where = TO_AFFECTS;
af.type = sn;
af.level = level;
if (perm == TRUE)
af.duration = -1;
else
af.duration = 6;
af.location = 0;
af.modifier = -1;
af.bitvector = AFF_REGENERATION;
af.bitvector2 = 0;
affect_to_char(gch, &af);
send_to_char("You feel yourself regenerating.\n\r", gch);
if (ch != gch)
act("$N glows warmly.",ch,NULL,gch,TO_CHAR);
}
return;
}
[/code]
-
Congrats! :) Since I have the "active" copy of the code right now, I've replaced the old function with the corrected one to be incorporated when I gather a few more changes to make an update - I'll let you post your own changes on the next update so people can know you are officially in the implementing world.
Obviously, when Ryan and Aaron have an internet connection and some coding time (and I have a little time to fiddle with my slackware box) I will get SVN installed so that this stuff can be taken care of automatically. For now, we can diff/merge the changes together.
Continue messing with the code at your will. If you need any help, whether with a specific bug or general C programming concepts, this board is a great place to ask since other coders besides myself can answer (although since I've been working with this code longer than anyone else here, I'd be the best person to give you code file and line numbers to look at).
-
So it wasn't quite right. The af.modifier should be 0 instead of -1.