void raw_kill (CHAR_DATA * victim)
{
int i;
stop_fighting (victim, TRUE);
death_cry (victim);
make_corpse (victim);
if (IS_NPC (victim))
{
victim->pIndexData->killed++;
kill_table[URANGE (0, victim->level, MAX_LEVEL - 1)].killed++;
extract_char (victim, TRUE);
return;
}
extract_char (victim, FALSE);
while (victim->affected)
affect_remove (victim, victim->affected);
victim->affected_by = race_table[victim->race].aff;
while (victim->affected2) /*added to original*/
affect_remove (victim, victim->affected2); /*added to original*/
victim->affected2_by = race_table[victim->race].aff2; /*added to original*/
for (i = 0; i < 4; i++)
victim->armor[i] = 100;
victim->position = POS_RESTING;
victim->hit = UMAX (1, victim->hit);
victim->mana = UMAX (1, victim->mana);
victim->move = UMAX (1, victim->move);
/* save_char_obj( victim ); we're stable enough to not need this :) */
return;
}
long affected_by;
long affected_by2;
const struct race_type race_table[] = {
/*
{
name, pc_race?,
act bits, aff_by bits, off bits,
imm, res, vuln,
form, parts
},
*/
{
"elf", TRUE,
0, AFF_INFRARED, 0,
0, RES_CHARM, VULN_IRON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},
/*
{
name, pc_race?,
act bits, aff_by bits, aff2_by bits, off bits,
imm, res, vuln,
form, parts
},
*/
{
"elf", TRUE,
0, AFF_INFRARED, AFF_CREEP, 0,
0, RES_CHARM, VULN_IRON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},
while (victim->affected2) /*line 1737*/
affect_remove (victim, victim->affected2); /*line 1738*/
victim->affected2_by = race_table[victim->race].aff2;
while (victim->affected2) /*line 1737*/
affect_remove (victim, victim->affected2); /*line 1738*/
victim->affected2_by = race_table[victim->race].aff2;
if (IS_AFFECTED (ch, AFF_CONFUSE))
if(is_affected(ch,skill_lookup("confuse")))
af.where = TO_AFFECTS;
af.type = gsn_confused;
af.level = ch->level;
af.location = 0;
af.modifier = 1;
af.duration = number_range(1, 3);
af.bitvector = 0;
affect_to_char(victim,&af);
#define IS_AFFECTED(ch, sn) (IS_SET((ch)->affected_by, (sn)))
/*
* Return true if a char is affected by a spell.
*/
bool is_affected( CHAR_DATA *ch, int sn )
{
AFFECT_DATA *paf;
for ( paf = ch->affected; paf != NULL; paf = paf->next )
{
if ( paf->type == sn )
return TRUE;
}
return FALSE;
}
if (IS_AFFECTED (ch, AFF_CONFUSE))
if(is_affected(ch,skill_lookup("confuse")))
else if (letter == 'F')
{
AFFECT_DATA *paf;
paf = alloc_perm (sizeof (*paf));
letter = fread_letter (fp);
switch (letter)
{
case 'A':
paf->where = TO_AFFECTS;
break;
case 'I':
paf->where = TO_IMMUNE;
break;
case 'R':
paf->where = TO_RESIST;
break;
case 'V':
paf->where = TO_VULN;
break;
default:
bug ("Load_objects: Bad where on flag set.", 0);
exit (1);
}
else if (letter == 'F')
{
AFFECT_DATA *paf;
paf = alloc_perm (sizeof (*paf));
letter = fread_letter (fp);
switch (letter)
{
case 'A':
paf->where = TO_AFFECTS;
break;
case 'I':
paf->where = TO_IMMUNE;
break;
case 'R':
paf->where = TO_RESIST;
break;
case 'V':
paf->where = TO_VULN;
break;
default:
bug ("Load_objects: Bad where on flag set.", 0);
exit (1);
}
#904
sandals winged~
a pair of winged sandals~
A pair of well made sandals lies here.~
oldstyle~
armor FGK AG
8 8 8 4 0
25 50 2200 P
F //This is the start of the 'flag' effect
A 0 0 T //The A is affected_by and T is AFF_FLYING
F
A 2 3 T
else if (letter == 'F')
{
AFFECT_DATA *paf;
paf = alloc_perm (sizeof (*paf));
letter = fread_letter (fp);
switch (letter)
{
case 'A':
paf->where = TO_AFFECTS;
break;
case 'E':
paf->where = TO_AFFECTS2;
break;
case 'I':
paf->where = TO_IMMUNE;
break;
case 'R':
paf->where = TO_RESIST;
break;
case 'V':
paf->where = TO_VULN;
break;
default:
bug ("Load_objects: Bad where on flag set.", 0);
exit (1);
}
Current Problem:
Affect2 affects are not being removed when a character dies..
Do I just add this to 'raw_kill':