Пример #1
0
void do_enmity(CHAR_DATA *ch, char *argument)
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    CHAR_DATA *victim1;
    CHAR_DATA *victim2;

    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_TANARRI))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (!IS_SET(ch->pcdata->powers[TANARRI_POWER], TANARRI_EMNITY))
    {
        send_to_char("you don't have that power yet.\n\r",ch);
        return;
    }
    if ((victim1 = get_char_room(ch, NULL, arg1)) == NULL)
    {
        send_to_char("They are not here.\n\r", ch);
        return;
    }
    if ((victim2 = get_char_room(ch, NULL, arg2)) == NULL)
    {
        send_to_char("They are not here.\n\r", ch);
        return;
    }
    if (IS_NPC(victim1) || IS_NPC(victim2))
    {
        send_to_char("Not on NPC's\n\r",ch);
        return;
    }
    do_say(ch,"Xenus, Morkain, Hau!");
    if (number_percent() > 60)
    {
        SET_BIT(victim1->pcdata->tempflag, TEMP_AGGRESSIVE);
        do_kill(victim1, victim2->pcdata->switchname);
        REMOVE_BIT(victim1->pcdata->tempflag, TEMP_AGGRESSIVE);
    }
    else send_to_char("#RSomeone is trying to control your actions!!!#n\n\r",victim1);
    if (number_percent() > 60)
    {
        SET_BIT(victim2->pcdata->tempflag, TEMP_AGGRESSIVE);
        do_kill(victim2, victim1->pcdata->switchname);
        REMOVE_BIT(victim2->pcdata->tempflag, TEMP_AGGRESSIVE);
    }
    else send_to_char("#RSomeone is trying to control your actions!!!#n\n\r",victim2);
    WAIT_STATE(ch,24);
    return;
}
Пример #2
0
void do_mppurge(CHAR_DATA * ch, char *argument)
{
	char arg[MAX_INPUT_LENGTH];
	CHAR_DATA *victim;
	OBJ_DATA *obj;

	if (!IS_NPC(ch)) {
		send_to_char(C_DEFAULT, "Huh?\n\r", ch);
		return;
	}

	if (IS_SET(ch->act, ACT_PET) || IS_AFFECTED(ch, AFF_CHARM))
		return;

	one_argument(argument, arg);

	if (arg[0] == '\0') {
		/* 'purge' */
		CHAR_DATA *vnext;
		OBJ_DATA *obj_next;

		for (victim = ch->in_room->people; victim != NULL;
		     victim = vnext) {
			vnext = victim->next_in_room;
			if (IS_NPC(victim) && victim != ch)
				extract_char(victim, TRUE);
		}

		for (obj = ch->in_room->contents; obj != NULL; obj = obj_next) {
			obj_next = obj->next_content;
			extract_obj(obj);
		}

		return;
	}

	if ((victim = get_char_room(ch, arg)) == NULL) {
		if ((obj = get_obj_here(ch, arg))) {
			extract_obj(obj);
		} else {
			sprintf(log_buf,
				"Mppurge - Bad argument: vnum %d name %s short %s.",
				ch->pIndexData->vnum, ch->name,
				ch->short_descr);
			bug(log_buf, -1);
		}
		return;
	}

	if (!IS_NPC(victim)) {
		sprintf(log_buf,
			"Mppurge - Purging a PC: vnum %d name %s short %s.",
			ch->pIndexData->vnum, ch->name, ch->short_descr);
		bug(log_buf, -1);
		return;
	}

	extract_char(victim, TRUE);
	return;
}
Пример #3
0
/*
 * Lets the mobile force a group something. Must be mortal level.
 *
 * Syntax: mob gforce [victim] [commands]
 */
void do_mpgforce(CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim, *vch, *vch_next;

    argument = one_argument(argument, arg);

    if (arg[0] == '\0' || argument[0] == '\0') {
	bug("MpGforce - Bad syntax from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    if ((victim = get_char_room(ch, arg)) == NULL)
	return;

    if (victim == ch)
	return;

    for (vch = victim->in_room->people; vch != NULL; vch = vch_next) {
	vch_next = vch->next_in_room;

	if (is_same_group(victim, vch)) {
	    interpret(vch, argument);
	}
    }
    return;
}
Пример #4
0
void do_wake (CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;

    one_argument (argument, arg);
    if (arg[0] == '\0')
    {
        do_function (ch, &do_stand, "");
        return;
    }

    if (!IS_AWAKE (ch))
    {
        send_to_char ("You are asleep yourself!\n\r", ch);
        return;
    }

    if ((victim = get_char_room (ch, arg)) == NULL)
    {
        send_to_char ("They aren't here.\n\r", ch);
        return;
    }

    if (IS_AWAKE (victim))
    {
        act ("$N is already awake.", ch, NULL, victim, TO_CHAR);
        return;
    }


    act_new ("$n wakes you.", ch, NULL, victim, TO_VICT, POS_SLEEPING);
    do_function (ch, &do_stand, "");
    return;
}
Пример #5
0
void do_enrage(CHAR_DATA *ch, char *argument) 
{
  char arg[MAX_INPUT_LENGTH];
  CHAR_DATA *victim;

  argument = one_argument( argument, arg );

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_TANARRI))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[TANARRI_POWER], TANARRI_ENRAGE))
  {
    send_to_char("you don't have that power yet.\n\r",ch);
    return;
  }
  if ((victim = get_char_room(ch, arg)) == NULL)
  {
    send_to_char("They are not here.\n\r", ch);
    return;
  }
  if (IS_NPC(victim) || victim->level < 3)
  {
    send_to_char("Not on them\n\r",ch);
    return;
  }
  do_say(ch, "Kara, Kara, Xenos!");
  if (number_percent() > 40) do_berserk2(victim,"");
  else send_to_char("#RSomeone is trying to control your actions!!!#n\n\r",victim);
  WAIT_STATE(ch,18);
  return;
}
Пример #6
0
/*
 * Lets the mobile to strip an object or all objects from the victim.
 * Useful for removing e.g. quest objects from a character.
 *
 * Syntax: mob remove [victim] [object vnum|'all']
 */
void do_mpremove(CHAR_DATA * ch, char *argument)
{
    CHAR_DATA *victim;
    OBJ_DATA *obj, *obj_next;
    sh_int vnum = 0;
    bool fAll = FALSE;
    char arg[MAX_INPUT_LENGTH];

    argument = one_argument(argument, arg);
    if ((victim = get_char_room(ch, arg)) == NULL)
	return;

    one_argument(argument, arg);
    if (!str_cmp(arg, "all"))
	fAll = TRUE;
    else if (!is_number(arg)) {
	bug("MpRemove: Invalid object from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    } else
	vnum = atoi(arg);

    for (obj = victim->carrying; obj; obj = obj_next) {
	obj_next = obj->next_content;
	if (fAll || obj->pIndexData->vnum == vnum) {
	    unequip_char(ch, obj);
	    obj_from_char(obj);
	    extract_obj(obj);
	}
    }
}
Пример #7
0
/*
 * Lets mob cause unconditional damage to someone. Nasty, use with caution.
 * Also, this is silent, you must show your own damage message...
 *
 * Syntax: mob damage [victim] [min] [max] {kill}
 */
void do_mpdamage(CHAR_DATA * ch, char *argument)
{
    CHAR_DATA *victim = NULL, *victim_next;
    char target[MAX_INPUT_LENGTH], min[MAX_INPUT_LENGTH], max[MAX_INPUT_LENGTH];
    int low, high;
    bool fAll = FALSE, fKill = FALSE;

    argument = one_argument(argument, target);
    argument = one_argument(argument, min);
    argument = one_argument(argument, max);

    if (target[0] == '\0') {
	bug("MpDamage - Bad syntax from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    if (!str_cmp(target, "all"))
	fAll = TRUE;
    else if ((victim = get_char_room(ch, target)) == NULL)
	return;

    if (is_number(min))
	low = atoi(min);
    else {
	bug("MpDamage - Bad damage min vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    if (is_number(max))
	high = atoi(max);
    else {
	bug("MpDamage - Bad damage max vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    one_argument(argument, target);

    /*
     * If kill parameter is omitted, this command is "safe" and will not
     * kill the victim.
     */

    if (target[0] != '\0')
	fKill = TRUE;
    if (fAll) {
	for (victim = ch->in_room->people; victim; victim = victim_next) {
	    victim_next = victim->next_in_room;
	    if (victim != ch)
		damage(victim, victim,
		       fKill ?
		       number_range(low, high) : UMIN(victim->hit, number_range(low, high)),
		       TYPE_UNDEFINED, DAM_NONE, FALSE);
	}
    } else
	damage(victim, victim,
	       fKill ?
	       number_range(low, high) : UMIN(victim->hit, number_range(low, high)),
	       TYPE_UNDEFINED, DAM_NONE, FALSE);
    return;
}
Пример #8
0
/*
 * Lets the mobile to call another MOBprogram withing a MOBprogram.
 * This is a crude way to implement subroutines/functions. Beware of
 * nested loops and unwanted triggerings... Stack usage might be a problem.
 * Characters and objects referred to must be in the same room with the
 * mobile.
 *
 * Syntax: mob call [vnum] [victim|'null'] [object1|'null'] [object2|'null']
 *
 */
void do_mpcall(CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *vch;
    OBJ_DATA *obj1, *obj2;
    MPROG_CODE *prg;
    extern void program_flow(sh_int, char *, CHAR_DATA *, CHAR_DATA *, const void *, const void *);

    argument = one_argument(argument, arg);
    if (arg[0] == '\0') {
	bug("MpCall: missing arguments from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    if ((prg = get_mprog_index(atoi(arg))) == NULL) {
	bug("MpCall: invalid prog from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    vch = NULL;
    obj1 = obj2 = NULL;
    argument = one_argument(argument, arg);
    if (arg[0] != '\0')
	vch = get_char_room(ch, arg);
    argument = one_argument(argument, arg);
    if (arg[0] != '\0')
	obj1 = get_obj_here(ch, arg);
    argument = one_argument(argument, arg);
    if (arg[0] != '\0')
	obj2 = get_obj_here(ch, arg);
    program_flow(prg->vnum, prg->code, ch, vch, (void *) obj1, (void *) obj2);
}
Пример #9
0
void do_chaosblast(CHAR_DATA *ch, char *argument) {

    CHAR_DATA *victim;
    char arg [MAX_INPUT_LENGTH];
    int sn;
    int level;
    int spelltype;

    argument = one_argument( argument, arg );
    if (IS_NPC(ch)) return;

	if (!IS_CLASS(ch, CLASS_DROW) || (!IS_SET(ch->special,
	SPC_DROW_MAG) && ch->generation > 2)) {
		return;}

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
        if ((victim = ch->fighting) == NULL)
    {
        send_to_char( "They aren't here.\n\r", ch );
        return;
    }
        if (ch->mana < 750) {
                send_to_char("You don't have enough mana.\n\r", ch);
                return;}

    if ( ( sn = skill_lookup( "chaos blast" ) ) < 0 ) return;
    spelltype = skill_table[sn].target;
    level = ch->spl[spelltype]/3;
        act("You concentrate your power on $N.",ch,NULL,victim,TO_CHAR);
        act("$n concentrates $s power on you.",ch,NULL,victim,TO_VICT);
    (*skill_table[sn].spell_fun) ( sn, level, ch, victim );
    WAIT_STATE( ch, 12 );
        ch->mana = ch->mana - 750;
    return;
}
Пример #10
0
void do_mpechoaround( CHAR_DATA *ch, char *argument )
{
  char       arg[ MAX_INPUT_LENGTH ];
  CHAR_DATA *victim;

    if ( !IS_NPC( ch ) )
    {
       send_to_char(C_DEFAULT, "Huh?\n\r", ch );
       return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) )
    {
        return;
    }

    argument = one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
       bug( "Mpechoaround - No argument:  vnum %d.", ch->pIndexData->vnum );
       return;
    }

    if ( !( victim=get_char_room( ch, arg ) ) )
    {
        bug( "Mpechoaround - victim does not exist: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    act(C_DEFAULT,  argument, ch, NULL, victim, TO_NOTVICT );
    return;
}
Пример #11
0
Character *get_char_world(Character *ch, const char *argument)
{
    char arg[BUF_SIZ];
    long number;
    Character *wch;
    int count;

    if ((wch = get_char_room(ch, argument)) != NULL) {
        return wch;
    }
    number = number_argument(argument, arg);
    count = 0;

    for (wch = first_character; wch != NULL; wch = wch->next)
    {

        if (wch->inRoom == NULL || !can_see(ch, wch)
                || !is_name(arg, wch->name)) {
            continue;
        }

        if (++count == number) {
            return wch;
        }
    }
    return NULL;
}
Пример #12
0
/*
 * Lets the mobile transfer all chars in same group as the victim.
 *
 * Syntax: mob gtransfer [victim] [location]
 */
void do_mpgtransfer(CHAR_DATA * ch, char *argument)
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    CHAR_DATA *who, *victim, *victim_next;

    argument = one_argument(argument, arg1);
    argument = one_argument(argument, arg2);

    if (arg1[0] == '\0') {
	bug("Mpgtransfer - Bad syntax from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0);
	return;
    }
    if ((who = get_char_room(ch, arg1)) == NULL)
	return;

    for (victim = ch->in_room->people; victim; victim = victim_next) {
	victim_next = victim->next_in_room;
	if (is_same_group(who, victim)) {
	    sprintf(buf, "%s %s", victim->name, arg2);
	    do_mptransfer(ch, buf);
	}
    }
    return;
}
Пример #13
0
void do_harmony( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    char arg[MAX_INPUT_LENGTH];
    int sn, level;

    argument = one_argument( argument, arg );

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_HARMONY] < 5)
    {
        send_to_char("Your not in contact with your inner harmonies.\n\r",ch);
        return;
    }
    if ((victim = get_char_room(ch, arg)) == NULL)
    {
        send_to_char("They are not here.\n\r", ch);
        return;
    }
    level = number_range(100,200);
    sn = skill_lookup("spirit kiss");
    if (sn  > 0) (*skill_table[sn].spell_fun) (sn,level,ch,victim);
    WAIT_STATE(ch,12);
    return;
}
Пример #14
0
void do_mpechoat(CHAR_DATA * ch, char *argument)
{
	char arg[MAX_INPUT_LENGTH];
	CHAR_DATA *victim;

	if (!IS_NPC(ch)) {
		send_to_char(C_DEFAULT, "Huh?\n\r", ch);
		return;
	}

	if (IS_SET(ch->act, ACT_PET) || IS_AFFECTED(ch, AFF_CHARM))
		return;

	argument = one_argument(argument, arg);

	if (arg[0] == '\0' || argument[0] == '\0') {
		sprintf(log_buf,
			"Mpechoat - No argument: vnum %d name %s short %s.",
			ch->pIndexData->vnum, ch->name, ch->short_descr);
		bug(log_buf, -1);
		return;
	}

	if (!(victim = get_char_room(ch, arg))) {
		sprintf(log_buf,
			"Mpechoat - victim does not exist: vnum %d name %s short %s.",
			ch->pIndexData->vnum, ch->name, ch->short_descr);
		bug(log_buf, -1);
		return;
	}

	act(C_DEFAULT, argument, ch, NULL, victim, TO_VICT);
	return;
}
Пример #15
0
/*
 * Lets the mobile kill any player or mobile without murder
 *
 * Syntax: mob kill [victim]
 */
void do_mpkill( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
	return;

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
	return;

    if ( victim == ch || IS_NPC(victim) || ch->position == POS_FIGHTING )
	return;

    if ( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
    {
	bug( "MpKill - Charmed mob attacking master from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	return;
    }

    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Пример #16
0
/* 格式: mpaddmark <victim> <mark> */
void do_mpadd_qmark( CHAR_DATA *ch, char *argument )
{
    char arg1[MAX_STRING_LENGTH];
    char arg2[MAX_STRING_LENGTH];    
    char *pTmp;
    CHAR_DATA *victim;
    
    if ( !IS_NPC( ch ) )
    {
        send_to_char( "你想幹嘛?\n\r", ch );
	return;
    }
    pTmp = one_argument( argument, arg1);
    one_argument( pTmp, arg2 );
    if ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
    {
	char buf[100];
	if( !str_cmp(arg1,"不明人物") )
           return; /* 這是因為看不見才會這樣 不是出錯*/
	
	sprintf( buf," BUG : MPADDMARK : no VICTIM %s !! mob %d", 
	      arg1 , ch->pIndexData->vnum );
	bug( buf,0);
	return;
    }    
    if ( arg2[0] == '\0' )
    {
	bug( " BUG : MPADDMARK : no MARK string !! mob %d ", ch->pIndexData->vnum );
	return;
    }        
    if ( IS_NPC(victim) )
	return;    
    if( check_qmark( victim, arg2 ) == FALSE ) 
        set_qmark( victim, arg2 );
}
Пример #17
0
void do_group( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
	CHAR_DATA *gch;
	CHAR_DATA *leader;

	leader = (ch->leader != NULL) ? ch->leader : ch;
	sprintf( buf, "%s's group:\n\r", person( ch, leader ) );
	send_to_char( buf, ch );

	for ( gch = char_list; gch != NULL; gch = gch->next )
	{
	    if ( is_same_group( gch, ch ) )
	    {
		sprintf( buf, "%-16s\n\r", person( ch, gch) );
		send_to_char( buf, ch );
	    }
	}
	return;
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
	send_to_char( "They aren't here.\n\r", ch );
	return;
    }

    if ( ch->master != NULL || ( ch->leader != NULL && ch->leader != ch ) )
    {
	send_to_char( "But you are following someone else!\n\r", ch );
	return;
    }

    if ( victim->master != ch && ch != victim )
    {
	act( "$N isn't following you.", ch, victim, NULL, NULL, NULL, TO_CHAR, SENSE_SIXTH );
	return;
    }

    if ( is_same_group( victim, ch ) && ch != victim )
    {
	victim->leader = NULL;
	act( "$n removes you from $s group.",  ch, victim, NULL, NULL, NULL, TO_VICT, SENSE_SIXTH );
	act( "You remove $N from your group.", ch, victim, NULL, NULL, NULL, TO_CHAR, SENSE_SIXTH );
	return;
    }

    victim->leader = ch;
    act( "You join $n's group.", ch, victim, NULL, NULL, NULL, TO_VICT, SENSE_SIXTH );
    act( "$N joins your group.", ch, victim, NULL, NULL, NULL, TO_CHAR, SENSE_SIXTH );
    return;
}
Пример #18
0
void do_chaosmagic (CHAR_DATA *ch, char *argument)
{
  char arg[MAX_STRING_LENGTH];
  CHAR_DATA *victim;
  int sn, random, level;

  argument=one_argument(argument,arg);
  level = ch->spl[RED_MAGIC]/4;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_MAGE) && !IS_CLASS(ch, CLASS_LICH))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (IS_CLASS(ch, CLASS_LICH) && ch->pcdata->powers[CHAOS_MAGIC] < 1)
  {
    send_to_char("Not yet, not yet.\n\r",ch);
    return;
  }
  if (ch->mana < 1500)
  {
    send_to_char("You need more mana.\n\r",ch);
    return;
  }
  if (ch->in_room != NULL)
  {
    if ( IS_SET(ch->in_room->room_flags,ROOM_SAFE) )
    {
      send_to_char( "You cannot invoke the forces of chaos in a safe room.\n\r", ch );
      return;
    }
  }
  if (arg[0] == '\0' && ch->fighting != NULL) victim = ch->fighting;
  else if ((victim = get_char_room(ch, arg)) == NULL)
  {
    send_to_char("They are not here.\n\r", ch );
    return;
  }
  random = number_range(1,12);
  if (random == 1) sn = skill_lookup("spirit kiss");
  else if (random == 2) sn = skill_lookup("desanct");
  else if (random == 3) sn = skill_lookup("imp heal");
  else if (random == 4) sn = skill_lookup("imp fireball");
  else if (random == 5) sn = skill_lookup("imp faerie fire");
  else if (random == 6) sn = skill_lookup("imp teleport");
  else if (random == 7) sn = skill_lookup("change sex");
  else if (random == 8) sn = skill_lookup("shield");
  else if (random == 9) sn = skill_lookup("readaura");
  else if (random == 10) sn = skill_lookup("earthquake");
  else if (random == 11) sn = skill_lookup("gate");
  else if (random == 12) sn = skill_lookup("dispel magic");
  else sn = 0;
  if (sn  > 0) (*skill_table[sn].spell_fun) (sn,level,ch,victim);
  ch->mana -= 1500;
  WAIT_STATE(ch,6);
  return;
}
Пример #19
0
/* lets the mobile kill any player or mobile without murder*/
void do_mpkill( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;

    if ( !IS_NPC( ch ) )
    {
	typo_message( ch );
	return;
    }

    if ( IS_SET( ch->act , ACT_PET ) || IS_AFFECTED( ch, AFF_CHARM ) )
      return;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        sprintf( log_buf, "MpKill - no argument: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
        sprintf( log_buf, "MpKill - Victim not in room: vnum %d name %s short %s .",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( victim == ch )
    {
        sprintf( log_buf, "MpKill - Bad victim to attack: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
    {
        sprintf( log_buf, "MpKill - Charmed mob attacking master: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( ch->position == POS_FIGHTING )
    {	
        sprintf( log_buf, "MpKill - Already fighting: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Пример #20
0
Файл: org.c Проект: verias/SRMud
void do_denounce(CHAR_DATA *ch, char * argument )
{	char arg[MSL], arg2[MSL];
	CHAR_DATA *victim;
	if(IS_NPC(ch ) )
		return;

	if(!str_cmp(argument, "organization" ) )
	{	denounce_org(ch, FALSE);
		return;
	}
	argument = one_argument(argument, arg );
	argument = one_argument(argument, arg2 );
	
	if(!str_cmp(arg, "follower" ) )
	{	if(ch->pcdata->rank <= RANK_PRIEST )
		{	do_function(ch, &do_denounce, NULL );
			return;
		}

		if(!IS_IMMORTAL(ch) )
		{	if( ( victim = get_char_room(ch, NULL, arg2 ) ) == NULL )
			{	send_to_char("They aren't here.\n\r",ch);
				return;
			}
		}
		else
		{	if( ( victim = get_char_world(ch, arg2 ) ) == 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(!IS_SAME_ORGANIZATION(ch, victim) && ch->pcdata->rank != RANK_GOD  )
		{	send_to_char("They aren't in your organization!\n\r",ch); 
			return; 
		}


		if(ch->pcdata->rank <= victim->pcdata->rank )
		{	send_to_char("You cannot denounce their organization.\n\r",ch);
			return;
		}

		send_to_char("You denounce thier organization!\n\r",ch);
		denounce_org(victim, TRUE);
		return;
	}

	if(ch->pcdata->rank <= RANK_PRIEST )
		send_to_char("To denounce a followers organization, use the syntax: 'denounce follower <name>'\n\r",ch);
	send_to_char("To denounce your faith, please type use the syntax: 'denounce organization'\n\r", ch);
	return;
}
Пример #21
0
void do_mpkill( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;

    if ( !IS_NPC( ch ) )
    {
        send_to_char(C_DEFAULT, "Huh?\n\r", ch );
	return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) )
    {
        return;
    }

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
	bug( "MpKill - no argument: vnum %d.",
		ch->pIndexData->vnum );
	return;
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
	bug( "MpKill - Victim not in room: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    if ( victim == ch )
    {
	bug( "MpKill - Bad victim to attack: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
    {
	bug( "MpKill - Charmed mob attacking master: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    if ( ch->position == POS_FIGHTING )
    {	
	bug( "MpKill - Already fighting: vnum %d",
	    ch->pIndexData->vnum );
	return;
    }

    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Пример #22
0
// Added by SinaC 2001 so, people can teach skills/spells to other
void do_teach( CHAR_DATA *ch, const char *argument ) {
  CHAR_DATA *victim;
  char arg[MAX_INPUT_LENGTH];
  char arg2[MAX_INPUT_LENGTH];
  int sn;

  argument = one_argument( argument, arg );
  argument = one_argument( argument, arg2 );

  if ( IS_NPC(ch)
       && ( IS_AFFECTED( ch, AFF_CHARM ) 
	    || ch->master != NULL
	    || ch->leader != NULL ) ) {
    send_to_char("You can't teach anything.\n\r", ch );
    return;
  }

  if ( ( victim = get_char_room( ch, arg2 ) ) == NULL ) {
    send_to_char( "They aren't here.\n\r", ch );
    return;
  }

  if ( IS_NPC( victim ) ) {
    send_to_char("NPC's are dumb, they can't learn anything.\n\r", ch );
    return;
  }

  if ( ( sn = ability_lookup( arg ) ) <= 0 ) {
    send_to_char("That skill/spell doesn't exist!\n\r", ch );
    return;
  }

  if ( get_ability( ch, sn ) < 95 ) {
    send_to_charf( ch,
		   "You haven't practiced '%s' enough to teach it.\n\r", 
		   ability_table[sn].name );
    return;
  }

  // get_ability_simple cos' we don't want to take care of victim's level
  if ( get_ability_simple( victim, sn ) > 0 ) {
    act("$N already knows '$t'.", ch, ability_table[sn].name, victim, TO_CHAR );
    return;
  }

  victim->pcdata->ability_info[sn].learned = 1;
  victim->pcdata->ability_info[sn].casting_level = ability_table[sn].nb_casting_level > 0 ? 1 : 0;
  victim->pcdata->ability_info[sn].level = URANGE( 1, victim->level, 100 );

  act( "$n teachs '$t' to $N.",
       ch, ability_table[sn].name, victim, TO_NOTVICT );
  act( "You teach '$t' to $N.",
       ch, ability_table[sn].name, victim, TO_CHAR );
  act( "$N teachs you '$t'.",
       victim, ability_table[sn].name, ch, TO_CHAR );
}
Пример #23
0
Файл: org.c Проект: verias/SRMud
void do_initiate(CHAR_DATA *ch, char *argument )
{	char arg[MSL], arg2[MSL], arg3[MSL];
	CHAR_DATA *victim;

	if(IS_NPC(ch ) )
		return;

	argument = one_argument(argument, arg  );
	argument = one_argument(argument, arg2 );
	argument = one_argument(argument, arg3 );
	if(!HAS_ORGANIZATION(ch) )
	{	send_to_char("But you aren't organized!\n\r",ch);
		return;
	}
	if(ch->pcdata->rank < RANK_PRIEST )
	{	send_to_char("You can't initiate people!\n\r",ch);
		return;
	}

	if(arg[0] == '\0' )
	{	send_to_char("Syntax: Initiate <person>\n\r",ch);
		return;
	}

	if(ch->pcdata->rank < RANK_PRIEST )
	{	send_to_char("You can't initiate people!\n\r",ch);
		return;
	}

	if(!IS_IMMORTAL(ch) )
	{	if( ( victim = get_char_room(ch, NULL, arg ) ) == NULL )
		{	send_to_char("They aren't here.\n\r",ch);
			return;
		}
	}
	else
	{	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(arg2[0] == '\0' )
	{	if( HAS_ORGANIZATION(victim) )
		{	send_to_char("They are already in an organization!\n\r",ch);
			return;
		}
		printf_to_char(ch, "They have been initiated.\n\r" );
		join_org(victim, ch->pcdata->organization );
	}
	return;
}
Пример #24
0
/*
 * Lets the mobile purge all objects and other npcs in the room,
 * or purge a specified object or mob in the room. The mobile cannot
 * purge itself for safety reasons.
 *
 * syntax mob purge {target}
 */
void do_mppurge( CHAR_DATA *ch, char *argument )
{
    char       arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;
    OBJ_DATA  *obj;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        /* 'purge' */
        CHAR_DATA *vnext;
        OBJ_DATA  *obj_next;

	for ( victim = ch->in_room->people; victim != NULL; victim = vnext )
	{
	    vnext = victim->next_in_room;
	    if ( IS_NPC( victim ) && victim != ch 
	    &&   !IS_SET(victim->act, ACT_NOPURGE) )
		extract_char( victim, TRUE );
	}

	for ( obj = ch->in_room->contents; obj != NULL; obj = obj_next )
	{
	    obj_next = obj->next_content;
	    if ( !IS_SET(obj->extra_flags, ITEM_NOPURGE) )
		extract_obj( obj );
	}

	return;
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
	if ( ( obj = get_obj_here( ch, arg ) ) )
	{
	    extract_obj( obj );
	}
	else
	{
	    bug( "Mppurge - Bad argument from vnum %d.",
		IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	}
	return;
    }

    if ( !IS_NPC( victim ) )
    {
	bug( "Mppurge - Purging a PC from vnum %d.", 
		IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	return;
    }
    extract_char( victim, TRUE );
    return;
}
Пример #25
0
void do_gag( CHAR_DATA * ch, char *argument )
{
   CHAR_DATA *victim;
   int schance;

   if( argument[0] == '\0' )
   {
      send_to_char( "Syntax: Gag <victim>\n\r", ch );
      return;
   }

   if( ( victim = get_char_room( ch, argument ) ) == NULL )
   {
      send_to_char( "They are not here.\n\r", ch );
      return;
   }

   if( victim == ch )
   {
      send_to_char( "You can not gag yourself!\n\r", ch );
      return;
   }

   if( IS_NPC( victim ) )
   {
      send_to_char( "You can only gag players.\n\r", ch );
      return;
   }

   if( ( victim->position != POS_STUNNED ) && ( victim->position != POS_SLEEPING )
       && !IS_SET( victim->pcdata->act2, ACT_BOUND ) )
   {
      send_to_char( "They need to be stunned, asleep, or bound.\n\r", ch );
      return;
   }

   schance = ( int )( ch->pcdata->learned[gsn_gag] );

   if( number_percent(  ) < schance )
   {
      act( AT_WHITE, "You quickly place a gag over $N's mouth.", ch, NULL, victim, TO_CHAR );
      act( AT_WHITE, "$n roughly puts a gag over your mouth.", ch, NULL, victim, TO_VICT );
      act( AT_WHITE, "$n roughly places a gag on $N's mouth.", ch, NULL, victim, TO_NOTVICT );
      SET_BIT( victim->pcdata->act2, ACT_GAGGED );
      learn_from_success( ch, gsn_gag );
   }
   else
   {
      send_to_char( "You look puzzled as you wonder how to put on such a contraption.\n\r", ch );
      learn_from_failure( ch, gsn_gag );
   }

   return;
}
Пример #26
0
void do_chaossurge(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;
  char buf[MAX_STRING_LENGTH];
  char arg[MAX_INPUT_LENGTH];
  int dam;

  argument = one_argument( argument, arg );

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_TANARRI) && !IS_CLASS(ch, CLASS_LICH))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (IS_CLASS(ch, CLASS_LICH) && ch->pcdata->powers[CHAOS_MAGIC] < 3)
  {
    send_to_char("Yes Master.\n\r",ch);
    return;
  }
  if ((victim = get_char_room(ch, arg)) == NULL)
  {
    send_to_char("They are not here.\n\r", ch);
    return;
  }
  if (IS_NPC(victim))
  {
    send_to_char("Not on mobiles.\n\r",ch);
    return;
  }
  if (is_safe(ch,victim)) return;
  if (victim == ch)
  {
    send_to_char("That doesn't seem like a good idea.\n\r",ch);
    return;
  }
  if (victim->alignment < -500)
  {
    send_to_char("They are too evil, you cannot affect them.\n\r",ch);
    return;
  }
  if (victim->alignment > 500) dam = 1500;
  else if (victim->alignment > 0) dam = 1000;
  else dam = 500;
  sprintf(buf,"Your let chaos envelope $N and $S is hurt [%d]",dam);
  act(buf,ch,NULL,victim,TO_CHAR);
  sprintf(buf,"$n points a wicked finger at you and chaos strikes your mind! [%d]",dam);
  act(buf,ch,NULL,victim,TO_VICT);
  sprintf(buf,"$n strikes $N down with a burst of pure #RCHAOS!#n.");
  act(buf,ch,NULL,victim,TO_NOTVICT);
  hurt_person(ch,victim,dam);
  WAIT_STATE(ch,12);
  return;
}
Пример #27
0
void do_forgivness( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    char arg[MAX_INPUT_LENGTH];

    argument = one_argument( argument, arg );

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_LOVE] < 3)
    {
        send_to_char("Your are not loving enough.\n\r",ch);
        return;
    }
    if ((victim = get_char_room(ch, arg)) == NULL)
    {
        send_to_char("They are not here.\n\r", ch);
        return;
    }
    if (IS_NPC(victim))
    {
        send_to_char("Not on mobiles.\n\r",ch);
        return;
    }
    if (is_safe(ch,victim)) return;
    if (victim == ch)
    {
        send_to_char("You haven't sinned, why seek forgivness ??\n\r",ch);
        return;
    }
    if (IS_CLASS(ch, CLASS_TANARRI))
    {
        send_to_char("You cannot forgive a creature of utter evil.\n\r",ch);
        return;
    }
    if (victim->alignment < 0)
    {
        send_to_char("They are not ready to seek forgivness, first they must repent.\n\r",ch);
        return;
    }
    victim->hit += number_range(1000,1500);
    if (victim->hit > victim->max_hit) victim->hit = victim->max_hit;
    act("You feel the cleansing love of God run through your veins, filling you with an inner peace.", victim, NULL, NULL, TO_CHAR);
    act("$n is struck by a ray of pure light, and a blissful smile crosses $s lips.", victim, NULL, NULL, TO_ROOM);
    send_to_char("You forgive them, and thus God forgives them for their sins.\n\r",ch);
    WAIT_STATE(ch, 16);
    return;
}
Пример #28
0
void do_mpcast( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *vch;
    OBJ_DATA *obj;
    void *victim = NULL;
    char spell[ MAX_INPUT_LENGTH ],
	 target[ MAX_INPUT_LENGTH ];
    int sn;

    argument = one_argument( argument, spell );
               one_argument( argument, target );

    if ( spell[0] == '\0' )
    {
	bug( "MpCast - Bad syntax from vnum %d.", 
		IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	return;
    }

    if ( ( sn = skill_lookup( spell ) ) < 0 )
    {
	bug( "MpCast - No such spell from vnum %d.", 
		IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	return;
    }
    vch = get_char_room( ch, target );
    obj = get_obj_here( ch, target );
    switch ( skill_table[sn].target )
    {
	default: return;
	case TAR_IGNORE: 
	    break;
	case TAR_CHAR_OFFENSIVE: 
	    if ( vch == NULL || vch == ch )
		return;
	    victim = ( void * ) vch;
	    break;
	case TAR_CHAR_DEFENSIVE:
	    victim = vch == NULL ? ( void *) ch : (void *) vch; break;
	case TAR_CHAR_SELF:
	    victim = ( void *) ch; break;
	case TAR_OBJ_CHAR_DEF:
	case TAR_OBJ_CHAR_OFF:
	case TAR_OBJ_INV:
	    if ( obj == NULL )
		return;
	    victim = ( void * ) obj;
    }
    (*skill_table[sn].spell_fun)( sn, ch->level, ch, victim,
	skill_table[sn].target );
    return;
}
Пример #29
0
void do_touchofgod(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    char arg[MAX_INPUT_LENGTH];
    int dam;

    argument = one_argument( argument, arg );
    dam = number_range(100,200);

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_JUSTICE] < 4)
    {
        send_to_char("You cannot channel the will of God yet.\n\r",ch);
        return;
    }
    if ((victim = get_char_room(ch, arg)) == NULL)
    {
        send_to_char("They are not here.\n\r", ch);
        return;
    }
    if (IS_NPC(victim))
    {
        send_to_char("Not on mobiles.\n\r",ch);
        return;
    }
    if (is_safe(ch,victim)) return;
    if (victim == ch)
    {
        send_to_char("That doesn't seem like a good idea.\n\r",ch);
        return;
    }
    WAIT_STATE(ch, 18);
    hurt_person(ch, victim, dam);
    act("You grab $N by the forehead and channel God's justice into $S body.",ch,NULL,victim,TO_CHAR);
    act("$n grabs you by your forehead and sends a prayer to God, DAMN THAT HURT.",ch,NULL,victim,TO_VICT);
    act("$n grabs $N by the forehead and sends a prayer to God.",ch,NULL,victim,TO_NOTVICT);
    if (number_range(1,3) == 1)
    {
        if (victim->position == POS_FIGHTING) stop_fighting(victim,TRUE);
        act("$N screams in pain and drops to the ground as God's justice wrecks $S body.",ch,NULL,victim,TO_CHAR);
        act("AARGH!!! The pain is to much, you drop to the ground.",ch,NULL,victim,TO_VICT);
        act("$N screams in agony and falls to the ground.",ch,NULL,victim,TO_NOTVICT);
        victim->position = POS_STUNNED;
    }
    return;
}
Пример #30
0
/*
 * Prints the message to only the victim
 *
 * Syntax: mob echoat [victim] [string]
 */
void do_mpechoat(CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;

    argument = one_argument(argument, arg);

    if (arg[0] == '\0' || argument[0] == '\0')
	return;

    if ((victim = get_char_room(ch, arg)) == NULL)
	return;

    act(argument, ch, NULL, victim, TO_VICT);
}