cotn_jail.c
src/cotn_jail.c · 3.8 KB
From the archive cotn-2.5.tar.gz
Download the archive « Back to the archive contents
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
#include <unistd.h>
void do_jail( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char arg2[MSL];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
int jtime;
argument = one_argument( argument, arg );
argument = one_argument( argument, arg2 );
if ( arg[0] == '\0' )
{
send_to_char( "Jail whom?\n\r", ch );
return;
}
if ( ( victim = get_char_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
/*if ( get_trust( victim ) > get_trust( ch ) )
{
send_to_char( "You failed.\n\r", ch );
return;
}*/
//How long do you want them jailed?
if(is_number(arg2)){
jtime = atoi( arg2 );
}
else{
jtime = 120;
}
victim->jailtime = jtime;
// if((IS_SET(ch->newbits2, PLR_UINVIS) || IS_SET(ch->act, PLR_WIZINVIS)) && ch->level > 6)
// {
// sprintf(buf,"#C%s #Lgets beaten half to death by an Immortal, then is led to #0prison#l.", victim->name);
// do_info(ch,buf);
// }
// {
sprintf(buf,"#C%s #Lgets beaten half to death by %s, then is led to #0prison#l.", victim->name,ch->name);
do_info(ch, buf);
// }
send_to_char( "OK.\n\r", ch );
stop_fighting(victim,TRUE);
do_transfer(victim, "self 5");
SET_BIT(victim->newbits2, IS_JAILED);
return;
}
void do_freechar( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Unjail whom?\n\r", ch );
return;
}
if ( ( victim = get_char_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
sprintf(buf,"#y%s #Lhas been released from #0jail#l.#n", victim->name);
REMOVE_BIT(victim->newbits2, IS_JAILED);
do_info(ch, buf);
send_to_char( "OK.\n\r", ch );
stop_fighting(victim,TRUE);
victim->jailtime = -1;
do_transfer(victim, "self 3054");
return;
}
void do_warden( CHAR_DATA *ch, char *argument )
{
char buf[MSL];
CHAR_DATA *gch;
if( IS_NPC(ch)) return;
stc("#R[#r--#r------------#r---#RWarden's List#r---------#r----------#R]#n\n\r",ch);
stc("#R[#r #yName #r| #RTime #r| #RType #R]#n\n\r",ch);
stc("#R[#r--#r------------#r------#r------------#r-------#r----------#R]#n\n\r",ch);
for(gch=char_list;gch != NULL;gch=gch->next){
if(IS_NPC(gch)) continue;
if(
(gch->jailtime <= 0 && gch->in_room->vnum != 10162)
&& gch->siletime <= 0 && gch->freetime <= 0 && gch->hallutime <= 0
) continue;
if(gch->jailtime > 0){
sprintf(buf,"#R[ #y%-12s #r| #R%-15d #r| #R%-14s #R]#n\n\r",gch->pcdata->switchname,gch->jailtime,"Jail");
stc(buf,ch);
}
else if(gch->in_room->vnum == 10162){
sprintf(buf,"#R[ #y%-12s #r| #R%-15s #r| #R%-14s #R]#n\n\r",gch->pcdata->switchname,"No Time Set","Jail");
stc(buf,ch);
}
if(gch->hallutime > 0){
sprintf(buf,"#R[ #y%-12s #r| #R%-15d #r| #R%-14s #R]#n\n\r",gch->pcdata->switchname,gch->hallutime,"Hallucination");
stc(buf,ch);
}
if(gch->siletime > 0){
sprintf(buf,"#R[ #y%-12s #r| #R%-15d #r| #R%-14s #R]#n\n\r",gch->pcdata->switchname,gch->siletime,"Silence");
stc(buf,ch);
}
if(gch->freetime > 0){
sprintf(buf,"#R[ #y%-12s #r| #R%-15d #r| #R%-14s #R]#n\n\r",gch->pcdata->switchname,gch->freetime,"Freeze");
stc(buf,ch);
}
}
stc("#R[#r-------------------------------------------------#R]#n\n\r",ch);
return;
}