Hi first I would like to thank Remcon for all his fantastic help.
I figured instead of posting on a topic about a loadcrash I may as well make a new topic
Here's the code I'm working with I'll explain the changes I would like to make after the code
void do_flood( CHAR_DATA * ch, char *argument )
{
CHAR_DATA * victim;
CHAR_DATA * next_vict;
int n = 0;
if( IS_SET( ch->in_room->room_flags, ROOM_NOFLOOR )
||( ch->curr_talent[TAL_WATER] < 1 && !IS_NPC( ch ) ) )
{
huh( ch );
return;
}
if( ch->curr_talent[TAL_WATER] > 10
&&ch->in_room->curr_water < 100 )
{
act( AT_BLUE, "Water floods the room!",
ch, NULL, NULL, TO_CHAR );
act( AT_BLUE, "Water floods the room!",
ch, NULL, NULL, TO_ROOM );
//if( IS_SET( ch->in_room->room_flags, ROOM_INDOORS ) )
ch->in_room->curr_water += TALENT( ch, TAL_WATER ) / 10;
}
if( !str_cmp( argument, "all" ) )
{
for( victim = ch->in_room->first_person; victim; victim = next_vict )
{
next_vict = victim->next_in_room;
n++;
if( victim == ch )
continue;
magic_damage( victim, ch, TALENT( ch, TAL_WATER ),
MAG_WATER, TAL_WATER, FALSE );
}
use_magic( ch, TAL_WATER, n * TALENT( ch, TAL_WATER ) );
return;
}
victim = find_target( ch, argument, TRUE );
if( !victim )
return;
magic_damage( victim, ch,
( TALENT( ch, TAL_WATER ) * 2 + ch->in_room->curr_water ) / 3,
MAG_WATER, TAL_WATER, FALSE );
}
This is the section of code I'm looking at the part that adds water to the room
void do_flood( CHAR_DATA * ch, char *argument )
{
CHAR_DATA * victim;
CHAR_DATA * next_vict;
int n = 0;
if( IS_SET( ch->in_room->room_flags, ROOM_NOFLOOR )
||( ch->curr_talent[TAL_WATER] < 1 && !IS_NPC( ch ) ) )
{
huh( ch );
return;
}
if( ch->curr_talent[TAL_WATER] > 10
&&ch->in_room->curr_water < 100 )
{
act( AT_BLUE, "Water floods the room!",
ch, NULL, NULL, TO_CHAR );
act( AT_BLUE, "Water floods the room!",
ch, NULL, NULL, TO_ROOM );
//if( IS_SET( ch->in_room->room_flags, ROOM_INDOORS ) )
ch->in_room->curr_water += TALENT( ch, TAL_WATER ) / 10;
}
I would like to add a time limit to the amount of time that the water is in the room, showing that water that is not supposed to be there will dry up.
The whole reason I have command is because water mages need water to cast a lot of their spells and this gives them a way to prepare a room before they start casting.