Message
| To find things like going in all one direction, check the scan command.. it should have what you need, just need to adjust it a bit.
I was bored.. so I did most of it.. you need to create a skill called dash, with code do_dash.
void do_dash( CHAR_DATA *ch, char *argument )
{
ROOM_INDEX_DATA *was_in_room;
EXIT_DATA *pexit;
sh_int dir = -1;
sh_int dist;
sh_int max_dist = 100;
set_char_color( AT_ACTION, ch );
if ( IS_AFFECTED( ch, AFF_BLIND ) )
{
send_to_char( "Not very effective when you're blind...\n\r", ch );
return;
}
if ( ( dir = get_door( argument ) ) == -1 )
{
send_to_char( "dash in WHAT direction?\n\r", ch );
return;
}
was_in_room = ch->in_room;
act( AT_GREY, "Dashing $t...", ch, dir_name[dir], NULL, TO_CHAR );
act( AT_GREY, "$n dashs $t.", ch, dir_name[dir], NULL, TO_ROOM );
if ( !can_use_skill(ch, number_percent(), gsn_dash ) )
{
act( AT_GREY, "You stop dashing $t as your legs fall from under you.", ch,
dir_name[dir], NULL, TO_CHAR );
learn_from_failure( ch, gsn_dash );
return;
}
if ( IS_VAMPIRE( ch ) )
{
if ( time_info.hour < 21 && time_info.hour > 5 )
{
send_to_char( "You trip in fall, blinded by all the "
"light.\n\r", ch );
max_dist = 20;
}
}
if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
{
act( AT_GREY, "You can't dash $t.", ch, dir_name[dir], NULL, TO_CHAR );
return;
}
if ( ch->perm_dex < 20 ) --max_dist;
if ( ch->perm_dex < 15 ) --max_dist;
if ( ch->perm_dex < 10 ) --max_dist;
for ( dist = 1; dist <= max_dist; )
{
if ( IS_SET(pexit->exit_info, EX_CLOSED) )
{
if ( IS_SET(pexit->exit_info, EX_SECRET)
|| IS_SET(pexit->exit_info, EX_DIG) )
act( AT_GREY, "Your dash $t is blocked by a wall. **SMACK**", ch,
dir_name[dir], NULL, TO_CHAR );
else
act( AT_GREY, "Your dash $t is blocked by a door. **WHACK**", ch,
dir_name[dir], NULL, TO_CHAR );
break;
}
if ( room_is_private( pexit->to_room )
&& ch->level < LEVEL_GREATER )
{
act( AT_GREY, "Your dash $t is blocked by a private room.", ch,
dir_name[dir], NULL, TO_CHAR );
break;
}
char_from_room( ch );
char_to_room( ch, pexit->to_room );
set_char_color( AT_RMNAME, ch );
do_look(ch, "")
send_to_char( "\n\r", ch );
switch( ch->in_room->sector_type )
{
default: dist++; break;
case SECT_AIR:
if ( number_percent() < 80 ) dist++; break;
case SECT_INSIDE:
case SECT_FIELD:
case SECT_UNDERGROUND:
dist++; break;
case SECT_FOREST:
case SECT_CITY:
case SECT_DESERT:
case SECT_HILLS:
dist += 2; break;
case SECT_WATER_SWIM:
case SECT_WATER_NOSWIM:
dist += 3; break;
case SECT_MOUNTAIN:
case SECT_UNDERWATER:
case SECT_OCEANFLOOR:
dist += 4; break;
}
if ( dist >= max_dist )
{
act( AT_GREY, "Your legs grow weak as you can no longer run any "
"farther $t.", ch, dir_name[dir], NULL, TO_CHAR );
break;
}
if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
{
act( AT_GREY, "Your dash $t is blocked by a wall **WHAM**.", ch,
dir_name[dir], NULL, TO_CHAR );
break;
}
}
char_from_room( ch );
learn_from_success( ch, gsn_dash );
return;
}
|
Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.
-Txzeenath
telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!
Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a) | Top |
|