I'm using smaug1.4a_mxp.tgz and I'm compiling with Cygwin. I'm still new to this coding stuff, and I didn't alter the code. I used the Area Editor program to change the target of fireball to ignore, then logged on and tried it. Dropped the core segment. I tried the same with acid breath, since I know that gas breath works on an ignore target. Changed acid breath's target and lost the core segment too. I attempted to change the code for lightning breath to work like gas breath in magic.c in an attempt to make them work alike:
ch_ret spell_gas_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *vch;
CHAR_DATA *vch_next;
int dam;
int hpch;
bool ch_died;
ch_died = FALSE;
if ( IS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
{
set_char_color( AT_MAGIC, ch );
send_to_char( "You fail to breathe.\n\r", ch );
return rNONE;
}
for ( vch = ch->in_room->first_person; vch; vch = vch_next )
{
vch_next = vch->next_in_room;
if ( !IS_NPC( vch ) && xIS_SET( vch->act, PLR_WIZINVIS )
&& vch->pcdata->wizinvis >= LEVEL_IMMORTAL )
continue;
if ( IS_NPC(ch) ? !IS_NPC(vch) : IS_NPC(vch) )
{
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_breath( level, vch ) )
dam /= 2;
if ( damage( ch, vch, dam, sn ) == rCHAR_DIED || char_died(ch) )
ch_died = TRUE;
}
}
if ( ch_died )
return rCHAR_DIED;
else
return rNONE;
}
------------------------------------------------
ch_ret spell_lightning_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
int dam;
int hpch;
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_breath( level, victim ) )
dam /= 2;
return damage( ch, victim, dam, sn );
}
changed to:
ch_ret spell_lightning_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *vch;
CHAR_DATA *vch_next;
int dam;
int hpch;
bool ch_died;
ch_died = FALSE;
if ( IS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
{
set_char_color( AT_MAGIC, ch );
send_to_char( "You fail to breathe.\n\r", ch );
return rNONE;
}
for ( vch = ch->in_room->first_person; vch; vch = vch_next )
{
vch_next = vch->next_in_room;
if ( !IS_NPC( vch ) && xIS_SET( vch->act, PLR_WIZINVIS )
&& vch->pcdata->wizinvis >= LEVEL_IMMORTAL )
continue;
if ( IS_NPC(ch) ? !IS_NPC(vch) : IS_NPC(vch) )
{
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_breath( level, vch ) )
dam /= 2;
if ( damage( ch, vch, dam, sn ) == rCHAR_DIED || char_died(ch) )
ch_died = TRUE;
}
}
if ( ch_died )
return rCHAR_DIED;
else
return rNONE;
}
didn't quite work they way I wanted it to. I don't know if this is gonna be any help Nick, but it's the best I can do. :)
-Alexander
Amended by Nick to add forum codes for readability |