hunt.new.diff
./hunt/hunt.new.diff · 11.0 KB
From the archive huntfix.tar.gz
Download the archive « Back to the archive contents
diff -r -c -N ../vw.old.source/act_move.c ./act_move.c
*** ../vw.old.source/act_move.c Mon Sep 10 19:04:28 2001
--- ./act_move.c Mon Sep 10 19:02:58 2001
***************
*** 380,386 ****
if(!IS_NPC(ch) && IS_AFFECTED(ch, AFF_TRACKING))
{
if(ch->pcdata->hunting != NULL)
! do_hunt( ch, ch->pcdata->hunting);
}
if( (ch->in_room->bomb > 0) && !IS_NPC(ch))
--- 380,386 ----
if(!IS_NPC(ch) && IS_AFFECTED(ch, AFF_TRACKING))
{
if(ch->pcdata->hunting != NULL)
! plr_hunt( ch );
}
if( (ch->in_room->bomb > 0) && !IS_NPC(ch))
***************
*** 2370,2376 ****
! do_hunt(ch, argument);
return;
}
--- 2370,2376 ----
! plr_hunt(ch );
return;
}
diff -r -c -N ../vw.old.source/act_wiz.c ./act_wiz.c
*** ../vw.old.source/act_wiz.c Mon Sep 10 19:04:28 2001
--- ./act_wiz.c Mon Sep 10 19:02:58 2001
***************
*** 1064,1071 ****
send_to_char( buf, ch);
snprintf( buf, MAX_STRING_LENGTH, "Email address: %s\n\r", victim->pcdata->email);
send_to_char( buf,ch);
! snprintf( buf, MAX_STRING_LENGTH, "HUNTING : %s ", victim->pcdata->hunting);
! send_to_char( buf, ch);
snprintf( buf, MAX_STRING_LENGTH, "Password: %s \n\r", crypt(victim->pcdata->pwd, victim->name) );
send_to_char( buf, ch);
}
--- 1064,1071 ----
send_to_char( buf, ch);
snprintf( buf, MAX_STRING_LENGTH, "Email address: %s\n\r", victim->pcdata->email);
send_to_char( buf,ch);
! /* snprintf( buf, MAX_STRING_LENGTH, "HUNTING : %s ", victim->pcdata->hunting);
! send_to_char( buf, ch); */
snprintf( buf, MAX_STRING_LENGTH, "Password: %s \n\r", crypt(victim->pcdata->pwd, victim->name) );
send_to_char( buf, ch);
}
diff -r -c -N ../vw.old.source/db.c ./db.c
*** ../vw.old.source/db.c Mon Sep 10 19:04:28 2001
--- ./db.c Mon Sep 10 19:02:58 2001
***************
*** 1750,1756 ****
{
free_string( ch->pcdata->pwd );
free_string( ch->pcdata->email );
! free_string( ch->pcdata->hunting );
free_string( ch->pcdata->bamfin );
free_string( ch->pcdata->bamfout );
free_string( ch->pcdata->title );
--- 1750,1756 ----
{
free_string( ch->pcdata->pwd );
free_string( ch->pcdata->email );
! ch->pcdata->hunting = char_free;
free_string( ch->pcdata->bamfin );
free_string( ch->pcdata->bamfout );
free_string( ch->pcdata->title );
diff -r -c -N ../vw.old.source/hunt.c ./hunt.c
*** ../vw.old.source/hunt.c Mon Sep 10 19:04:28 2001
--- ./hunt.c Mon Sep 10 19:02:58 2001
***************
*** 15,20 ****
--- 15,27 ----
*/
/*
+ * This is modified version of the hunt code for Vampire-Wars by Vigo.
+ *
+ * Now the mud remembers the mob you mean, instead of taking the first
+ * mob with matching name.
+ */
+
+ /*
* Some systems don't have bcopy and bzero functions in their linked libraries.
* If compilation fails due to missing of either of these functions,
* define NO_BCOPY or NO_BZERO accordingly. -- Turtle 31-Jan-95
***************
*** 446,472 ****
}
!
void do_hunt( CHAR_DATA *ch, char *argument )
{
! char buf[MAX_STRING_LENGTH];
char arg[MAX_STRING_LENGTH];
char colour[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
- int direction;
one_argument( argument, arg, MAX_STRING_LENGTH );
if( IS_NPC(ch)) return;
-
- /* if( ch->level < skill_table[gsn_hunt].skill_level[ch->class] )
- {
- send_to_char("You had better practice that first.\n\r", ch );
- return;
- }
- */
-
if( arg[0] == '\0' )
{
send_to_char( "Whom are you trying to hunt?\n\r", ch );
--- 453,485 ----
}
! /*
! * Vigo:
! * Fixed the problem in Joker's code where
! * not the characters adres was copied to the
! * ch->hunting, but only the name
! *
! * The problem with this was that always the first
! * PC or NPC with that name was taken.
! *
! * With this new code the player adres is copied
! * to ch->hunting so it will always take the same (N)PC
! *
! * Note: player hunting is still disabled
! *
! */
void do_hunt( CHAR_DATA *ch, char *argument )
{
! AFFECT_DATA af;
!
char arg[MAX_STRING_LENGTH];
char colour[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
one_argument( argument, arg, MAX_STRING_LENGTH );
if( IS_NPC(ch)) return;
if( arg[0] == '\0' )
{
send_to_char( "Whom are you trying to hunt?\n\r", ch );
***************
*** 478,484 ****
if( !str_cmp( arg, "clear"))
{
affect_strip(ch, gsn_hunt);
! ch->pcdata->hunting = str_dup( " ");
return;
}
--- 491,497 ----
if( !str_cmp( arg, "clear"))
{
affect_strip(ch, gsn_hunt);
! ch->pcdata->hunting = NULL;
return;
}
***************
*** 502,508 ****
if( !IS_NPC(victim))
{
! send_to_char("Sorry, you cannot hunt players at the moment.\n\r", ch);
affect_strip( ch, gsn_hunt);
return;
}
--- 515,521 ----
if( !IS_NPC(victim))
{
! send_to_char("Sorry, you cannot hunt players.\n\r", ch);
affect_strip( ch, gsn_hunt);
return;
}
***************
*** 518,538 ****
return;
}
! /* Joker */
ch->pcdata->hunting= str_dup(victim->name);
!
! /* if ( IS_NPC(victim) && IS_SET(victim->act,ACT_NO_TRACK) )
! act( "$N seems to have covered $S tracks very well!", ch, NULL, victim, TO_CHAR );
! */
/*
! * Deduct some movement.
! */
if( ch->move > 10 )
ch->move -= 10;
else
{
send_to_char( "You're too exhausted to hunt anyone!\n\r", ch );
return;
}
act( "$n carefully sniffs the air.", ch, NULL, NULL, TO_ROOM );
--- 531,617 ----
return;
}
! /* Joker:
! * Old code, doesn't work right
ch->pcdata->hunting= str_dup(victim->name);
! */
!
! affect_strip( ch, gsn_hunt );
!
! if ( IS_NPC(ch) || number_percent( ) < ch->pcdata->learned[gsn_hunt] )
! {
! af.type = gsn_hunt;
! af.duration = ch->level;
! af.location = APPLY_NONE;
! af.modifier = 0;
! af.bitvector = AFF_TRACKING;
! affect_to_char( ch, &af );
! }
!
! ch->pcdata->hunting = victim;
!
! plr_hunt( ch );
!
! return;
!
! }
!
! void plr_hunt ( CHAR_DATA *ch )
! {
!
! extern char * const dir_name[];
! char buf[MAX_STRING_LENGTH];
! char colour[MAX_INPUT_LENGTH];
! CHAR_DATA *victim;
! CHAR_DATA *wch;
! int direction;
! bool found = FALSE;
!
! if ( ch->pcdata->hunting == NULL )
! return;
!
! victim = ch->pcdata->hunting;
!
! for ( wch = char_list; wch != NULL ; wch = wch->next )
! {
! if ( !IS_NPC(wch) ) continue;
!
! if ( wch == victim )
! {
! found = TRUE;
! break;
! }
! }
!
! if( !found )
! {
! strcpy( colour, "You've lost your pray!" );
! ADD_COLOUR(ch,colour,D_RED,MAX_STRING_LENGTH);
! act( colour , ch, NULL, victim, TO_CHAR );
! affect_strip(ch, gsn_hunt);
! return;
! }
!
/*
! * Deduct some movement.
! */
if( ch->move > 10 )
ch->move -= 10;
else
{
send_to_char( "You're too exhausted to hunt anyone!\n\r", ch );
return;
+ }
+
+ if( ch->in_room == victim->in_room )
+ {
+ if(IS_NPC(victim)) snprintf( colour, MAX_INPUT_LENGTH, "%s is here!\n\r", capitalize(victim->short_descr));
+ else snprintf( colour, MAX_INPUT_LENGTH, "%s is here!", victim->name);
+
+ ADD_COLOUR(ch,colour,D_RED,MAX_STRING_LENGTH);
+ send_to_char(colour, ch);
+ affect_strip(ch, gsn_hunt);
+ return;
}
act( "$n carefully sniffs the air.", ch, NULL, NULL, TO_ROOM );
diff -r -c -N ../vw.old.source/interp.c ./interp.c
*** ../vw.old.source/interp.c Mon Sep 10 19:04:28 2001
--- ./interp.c Mon Sep 10 19:02:58 2001
***************
*** 257,263 ****
{ "group", do_group, POS_DEAD, 2, LOG_ALWAYS },
{ "hide", do_hide, POS_RESTING, 0, LOG_NORMAL },
{ "trap", do_trap, POS_STANDING, 3, LOG_ALWAYS },
! { "hunt", do_track, POS_STANDING, 3, LOG_ALWAYS },
{ "home", do_home, POS_STANDING, 0, LOG_ALWAYS },
{ "locate", do_locate, POS_STANDING, 0, LOG_ALWAYS },
{ "practice", do_practice, POS_SLEEPING, 0, LOG_NORMAL },
--- 257,263 ----
{ "group", do_group, POS_DEAD, 2, LOG_ALWAYS },
{ "hide", do_hide, POS_RESTING, 0, LOG_NORMAL },
{ "trap", do_trap, POS_STANDING, 3, LOG_ALWAYS },
! { "hunt", do_hunt, POS_STANDING, 3, LOG_ALWAYS },
{ "home", do_home, POS_STANDING, 0, LOG_ALWAYS },
{ "locate", do_locate, POS_STANDING, 0, LOG_ALWAYS },
{ "practice", do_practice, POS_SLEEPING, 0, LOG_NORMAL },
diff -r -c -N ../vw.old.source/merc.h ./merc.h
*** ../vw.old.source/merc.h Sun Jun 17 18:00:48 2001
--- ./merc.h Mon Sep 10 19:03:01 2001
***************
*** 1300,1306 ****
char * poweraction;
char * powertype;
char * pload;
! CHAR_DATA * hunting;
sh_int sex;
sh_int class;
sh_int race;
--- 1300,1306 ----
char * poweraction;
char * powertype;
char * pload;
! CHAR_DATA * hunting;
sh_int sex;
sh_int class;
sh_int race;
***************
*** 1370,1376 ****
OBJ_DATA * chobj;
char * pwd;
char * email;
! char * hunting;
char * bamfin;
char * bamfout;
char * title;
--- 1370,1376 ----
OBJ_DATA * chobj;
char * pwd;
char * email;
! CHAR_DATA * hunting;
char * bamfin;
char * bamfout;
char * title;
***************
*** 2407,2412 ****
--- 2407,2414 ----
#define OID OBJ_INDEX_DATA
#define RID ROOM_INDEX_DATA
#define SF SPEC_FUN
+
+ void plr_hunt args( ( CHAR_DATA *ch ) );
/* act_comm.c */
void add_follower args( ( CHAR_DATA *ch, CHAR_DATA *master ) );
diff -r -c -N ../vw.old.source/save.c ./save.c
*** ../vw.old.source/save.c Mon Sep 10 19:04:28 2001
--- ./save.c Mon Sep 10 19:02:58 2001
***************
*** 480,486 ****
ch->extra = 0;
ch->pcdata->pwd = str_dup( "" );
ch->pcdata->email = str_dup( "" );
! ch->pcdata->hunting = str_dup( "" );
ch->pcdata->bamfin = str_dup( "" );
ch->pcdata->bamfout = str_dup( "" );
ch->pcdata->title = str_dup( "" );
--- 480,486 ----
ch->extra = 0;
ch->pcdata->pwd = str_dup( "" );
ch->pcdata->email = str_dup( "" );
! ch->pcdata->hunting = char_free;
ch->pcdata->bamfin = str_dup( "" );
ch->pcdata->bamfout = str_dup( "" );
ch->pcdata->title = str_dup( "" );