Beispiel #1
0
void spell_portal( int sn, int level, CHAR_DATA *ch, void *vo,int target)
{
    CHAR_DATA *victim;
    OBJ_DATA *portal, *stone;

        if ( ( victim = get_char_world( ch, target_name ) ) == NULL
    ||   victim == ch
    ||   victim->in_room == NULL
    ||   !can_see_room(ch,victim->in_room)
    ||   IS_SET(victim->in_room->room_flags, ROOM_SAFE)
    ||   IS_SET(victim->in_room->room_flags, ROOM_PRIVATE)
    ||   IS_SET(victim->in_room->room_flags, ROOM_SOLITARY)
    ||   IS_SET(victim->in_room->room_flags, ROOM_DRAGONPIT)
    ||   IS_SET(ch->in_room->room_flags, ROOM_DRAGONPIT)
    ||   IS_SET(victim->in_room->room_flags, ROOM_NO_RECALL)
    ||   IS_SET(victim->in_room->area->area_flags, AREA_PROTO )
    ||   IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL)
    ||   victim->level >= level + 3
    ||   (!IS_NPC(victim) && victim->level >= LEVEL_HERO) 
    ||   (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON))
    ||   (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) )
    ||   (is_clan(victim) && !is_same_clan(ch,victim)))
    {
        send_to_char( "You failed.\n\r", ch );
        return;
    }   

 if (!IS_IMP(ch))
    {
    if (IS_IMMORTAL(ch))
      {
       send_to_char("\n\r{rIMMs can use {RGOTO{r so there is no reason to be opening {RPORTAL{r.{x\n\r",ch);
       return;
      }
    }

    stone = get_eq_char(ch,WEAR_HOLD);
    if (!IS_IMMORTAL(ch) 
    &&  (stone == NULL || stone->item_type != ITEM_WARP_STONE))
    {
	send_to_char("You lack the proper component for this spell.\n\r",ch);
	return;
    }

    if (stone != NULL && stone->item_type == ITEM_WARP_STONE)
    {
     	act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR);
     	//act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR);
     	//extract_obj(stone);
    }

    portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0);
    portal->timer = 2 + level / 25; 
    portal->value[3] = victim->in_room->vnum;

    obj_to_room(portal,ch->in_room);

    act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM);
    act("$p rises up before you.",ch,portal,NULL,TO_CHAR);
}
Beispiel #2
0
/* random room generation procedure */
ROOM_INDEX_DATA  *get_random_room(CHAR_DATA *ch)
{
    ROOM_INDEX_DATA *room;
    long i;

    for ( i = 0; i < 60000 ; i++)
    {
        room = get_room_index( number_range( 0, 65535 ) );
        if ( room != NULL )
        if ( can_see_room(ch,room)
        &&   !ENTRE_INC(20000,room->vnum,20999)
	&&   !IS_SET(room->area->area_flags, AREA_NOPLAYERS)
	&&   !IS_SET(room->area->area_flags, AREA_NOTELEPORT)
	&&   !room_is_private(ch,room)
        &&   !IS_SET(room->room_flags, ROOM_PRIVATE)
        &&   !IS_SET(room->room_flags, ROOM_SOLITARY) 
	&&   !IS_SET(room->room_flags, ROOM_LOCKED)
	&&   !IS_SET(room->room_flags, ROOM_SAFE) 
	&&   !IS_SET(room->room_flags, ROOM_NO_RECALL) 
	&&   (IS_NPC(ch) || IS_SET(ch->act,ACT_AGGRESSIVE) 
	||   !IS_SET(room->room_flags,ROOM_LAW)))
            break;
    }

    return room;
}
Beispiel #3
0
void MapArea 
(ROOM_INDEX_DATA *room, CHAR_DATA *ch, int x, int y, int min, int max)
{
ROOM_INDEX_DATA *prospect_room;
EXIT_DATA *pexit;
int door;

/* marks the room as visited */
switch (room->sector_type) 
{
case SECT_INSIDE:	map[x][y]="{WI";		break;
case SECT_CITY:		map[x][y]="{cC";		break;
case SECT_FIELD:	map[x][y]="{G\"";		break;
case SECT_FOREST:	map[x][y]="{g@";		break;
case SECT_HILLS:	map[x][y]="{G^";		break;
case SECT_MOUNTAIN:	map[x][y]="{y^";		break;
case SECT_WATER_SWIM:	map[x][y]="{B-";		break;
case SECT_WATER_NOSWIM:	map[x][y]="{b~";		break;
case SECT_UNUSED:	map[x][y]="{DX";		break;
case SECT_AIR:		map[x][y]="{C#";		break;
case SECT_DESERT:	map[x][y]="{Y+";		break;
case SECT_UNDERGROUND:	map[x][y]="{wU";		break;
case SECT_ROAD:		map[x][y]="{RR";		break;
default: 		map[x][y]="{m|";
}

    for ( door = 0; door < MAX_MAP_DIR; door++ ) 
    {
	if (
             (pexit = room->exit[door]) != NULL
	     &&   pexit->u1.to_room != NULL 
	     &&   can_see_room(ch,pexit->u1.to_room)  /* optional */
	     &&   !IS_SET(pexit->exit_info, EX_CLOSED)
           )
        { /* if exit there */

	prospect_room = pexit->u1.to_room;

        if ( prospect_room->exit[rev_dir[door]] &&
	 prospect_room->exit[rev_dir[door]]->u1.to_room!=room)
		{ /* if not two way */
		if ((prospect_room->sector_type==SECT_CITY)
		||  (prospect_room->sector_type==SECT_INSIDE))
			map[x][y]="{W@";			
		else
			map[x][y]="{D?";
		return;
		} /* end two way */

        if ((x<=min)||(y<=min)||(x>=max)||(y>=max)) return;
        if (map[x+offsets[door][0]][y+offsets[door][1]]==NULL) {
                MapArea (pexit->u1.to_room,ch,
                    x+offsets[door][0], y+offsets[door][1],min,max);
        }

	} /* end if exit there */
    }
return;
}
Beispiel #4
0
/* random room generation procedure */
ROOM_INDEX_DATA *get_random_room (CHAR_DATA * ch)
{
    ROOM_INDEX_DATA *room;

    for (;;)
    {
        room = get_room_index (number_range (0, 65535));
        if (room != NULL)
            if (can_see_room (ch, room)
                && !room_is_private (room)
                && !IS_SET (room->room_flags, ROOM_PRIVATE)
                && !IS_SET (room->room_flags, ROOM_SOLITARY)
                && !IS_SET (room->room_flags, ROOM_SAFE)
                && (IS_NPC (ch) || IS_SET (ch->act, ACT_AGGRESSIVE)
                    || !IS_SET (room->room_flags, ROOM_LAW)))
                break;
    }

    return room;
}
Beispiel #5
0
void spell_nexus( int sn, int level, Character *ch, void *vo, int target)
{
    Character *victim;
    OBJ_DATA *portal, *stone;
    ROOM_INDEX_DATA *to_room, *from_room;

    from_room = ch->in_room;
 
        if ( ( victim = get_char_world( ch, target_name ) ) == NULL
    ||   victim == ch
    ||   (to_room = victim->in_room) == NULL
    ||   !can_see_room(ch,to_room) || !can_see_room(ch,from_room)
    ||   IS_SET(to_room->room_flags, ROOM_SAFE)
    ||	 IS_SET(from_room->room_flags,ROOM_SAFE)
    ||   IS_SET(to_room->room_flags, ROOM_PRIVATE)
    ||   IS_SET(to_room->room_flags, ROOM_SOLITARY)
    ||   IS_SET(to_room->room_flags, ROOM_NO_RECALL)
    ||   IS_SET(from_room->room_flags,ROOM_NO_RECALL)
    ||   victim->level >= level + 3
    ||   (!IS_NPC(victim) && victim->level >= LEVEL_HERO)  /* NOT trust */
    ||   (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON))
    ||   (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) ) 
    ||	 (IS_CLANNED(victim) && !is_same_clan(ch,victim)))
    {
        send_to_char( "You failed.\n\r", ch );
        return;
    }   
 
    stone = get_eq_char(ch,WEAR_HOLD);
    if (!IS_IMMORTAL(ch)
    &&  (stone == NULL || stone->item_type != ITEM_WARP_STONE))
    {
        send_to_char("You lack the proper component for this spell.\n\r",ch);
        return;
    }
 
    if (stone != NULL && stone->item_type == ITEM_WARP_STONE)
    {
        act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR);
        act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR);
        extract_obj(stone);
    }

    /* portal one */ 
    portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0);
    portal->timer = 1 + level / 10;
    portal->value[3] = to_room->vnum;
 
    obj_to_room(portal,from_room);
 
    act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM);
    act("$p rises up before you.",ch,portal,NULL,TO_CHAR);

    /* no second portal if rooms are the same */
    if (to_room == from_room)
	return;

    /* portal two */
    portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0);
    portal->timer = 1 + level/10;
    portal->value[3] = from_room->vnum;

    obj_to_room(portal,to_room);

    if (to_room->people != NULL)
    {
	act("$p rises up from the ground.",to_room->people,portal,NULL,TO_ROOM);
	act("$p rises up from the ground.",to_room->people,portal,NULL,TO_CHAR);
    }
}
Beispiel #6
0
/* RT Enter portals */
void do_enter( CHAR_DATA *ch, char *argument)
{    
    ROOM_INDEX_DATA *location; 

    if ( ch->fighting != NULL ) 
	return;

    /* nifty portal stuff */
    if (argument[0] != '\0')
    {
        ROOM_INDEX_DATA *old_room;
	OBJ_DATA *portal;
	CHAR_DATA *fch, *fch_next;

        old_room = ch->in_room;

	portal = get_obj_list( ch, argument,  ch->in_room->contents );
	
	if (portal == NULL)
	{
	    send_to_char("You don't see that here.\n\r",ch);
	    return;
	}

	if (portal->item_type != ITEM_PORTAL 
        ||  (IS_SET(portal->value[1],EX_CLOSED) && !IS_TRUSTED(ch,KNIGHT)))
	{
	    send_to_char("You can't seem to find a way in.\n\r",ch);
	    return;
	}

	if (!IS_TRUSTED(ch,KNIGHT) && !IS_SET(portal->value[2],GATE_NOCURSE)
	&&  IS_AFFECTED(ch,AFF_CURSE) )
	{
	    send_to_char("Something prevents you from leaving...\n\r",ch);
	    return;
	}

	if (IS_SET(portal->value[2],GATE_RANDOM) || portal->value[3] == -1)
	{
	    location = get_random_room(ch);
	    portal->value[3] = location->vnum; /* for record keeping :) */
	}
	else if (IS_SET(portal->value[2],GATE_BUGGY) && (number_percent() < 5))
	    location = get_random_room(ch);
	else
	    location = get_room_index(portal->value[3]);

	if (location == NULL
	||  location == old_room
	||  !can_see_room(ch,location) 
	||  (room_is_private(ch,location) && !IS_TRUSTED(ch,IMPLEMENTOR)))
	{
	   act("$p doesn't seem to go anywhere.",ch,portal,NULL,TO_CHAR);
	   return;
	}

        if (IS_NPC(ch) && IS_SET(ch->act,ACT_AGGRESSIVE)
        &&  IS_SET(location->room_flags,ROOM_LAW))
        {
            send_to_char("Something prevents you from leaving...\n\r",ch);
            return;
        }

	act("$n steps into $p.",ch,portal,NULL,TO_ROOM);
	
	if (IS_SET(portal->value[2],GATE_NORMAL_EXIT))
	    act("You enter $p.",ch,portal,NULL,TO_CHAR);
	else
	    act("You walk through $p and find yourself somewhere else...",
	        ch,portal,NULL,TO_CHAR); 

	char_from_room(ch);
	char_to_room(ch, location);

	if (IS_SET(portal->value[2],GATE_GOWITH)) /* take the gate along */
	{
	    obj_from_room(portal);
	    obj_to_room(portal,location);
	}

	if (IS_SET(portal->value[2],GATE_NORMAL_EXIT))
	    act("$n has arrived.",ch,portal,NULL,TO_ROOM);
	else
	    act("$n has arrived through $p.",ch,portal,NULL,TO_ROOM);

	do_look(ch,"auto");

	/* charges */
	if (portal->value[0] > 0)
	{
	    portal->value[0]--;
	    if (portal->value[0] == 0)
		portal->value[0] = -1;
	}

	/* protect against circular follows */
	if (old_room == location)
	    return;

    	for ( fch = old_room->people; fch != NULL; fch = fch_next )
    	{
            fch_next = fch->next_in_room;

            if (portal == NULL || portal->value[0] == -1) 
	    /* no following through dead portals */
                continue;
 
            if ( fch->master == ch && IS_AFFECTED(fch,AFF_CHARM)
            &&   fch->position < POS_STANDING)
            	do_stand(fch,"");

            if ( fch->master == ch && fch->position == POS_STANDING)
            {
 
                if (IS_SET(ch->in_room->room_flags,ROOM_LAW)
                &&  (IS_NPC(fch) && IS_SET(fch->act,ACT_AGGRESSIVE)))
                {
                    act("You can't bring $N into the city.",
                    	ch,NULL,fch,TO_CHAR);
                    act("You aren't allowed in the city.",
                    	fch,NULL,NULL,TO_CHAR);
                    continue;
            	}
 
            	act( "You follow $N.", fch, NULL, ch, TO_CHAR );
		do_enter(fch,argument);
            }
    	}

 	if (portal != NULL && portal->value[0] == -1)
	{
	    act("$p fades out of existence.",ch,portal,NULL,TO_CHAR);
	    if (ch->in_room == old_room)
		act("$p fades out of existence.",ch,portal,NULL,TO_ROOM);
	    else if (old_room->people != NULL)
	    {
		act("$p fades out of existence.", 
		    old_room->people,portal,NULL,TO_CHAR);
		act("$p fades out of existence.",
		    old_room->people,portal,NULL,TO_ROOM);
	    }
	    extract_obj(portal);
	}

	/* 
	 * If someone is following the char, these triggers get activated
	 * for the followers before the char, but it's safer this way...
	 */
	if ( IS_NPC( ch ) && HAS_TRIGGER( ch, TRIG_ENTRY ) )
	    mp_percent_trigger( ch, NULL, NULL, NULL, TRIG_ENTRY );
	if ( !IS_NPC( ch ) )
	    mp_greet_trigger( ch );

	return;
    }

    send_to_char("Nope, can't do it.\n\r",ch);
    return;
}
Beispiel #7
0
/**
 * owhere <var> <value>
 */
void do_owhere(struct char_data *ch, const char *argument)
{
    struct buf_type *buffer;
    OBJ_CMP_FN *cmp_fn;
    char buf[MAX_INPUT_LENGTH];
    char arg[MAX_INPUT_LENGTH];
    int iter;

    if (ch == NULL || IS_NPC(ch))
        return;

    if (argument[0] == '\0') {
        send_to_char("\n\rFind what?\n\r", ch);
        return;
    }

    cmp_fn = NULL;
    one_argument(argument, arg);

    if (argument[0] == '?' || !str_prefix(argument, "help")) {
        show_help(ch->desc, "owhere", NULL);
        return;
    }

    buffer = new_buf();
    if (!str_prefix(argument, "list")) {
        add_buf(buffer, "owhere: searchable property list\n\r");
        for (iter = 0; obj_flags[iter].var[0] != '\0'; iter++) {
            sprintf(buf, "%-18.17s", obj_flags[iter].var);
            add_buf(buffer, buf);
            if ((iter % 2) == 1)
                add_buf(buffer, "\n\r");
        }
        add_buf(buffer, "\n\r");
        page_to_char(buf_string(buffer), ch);
        return;
    }

    sprintf(buf, "`#QUERY``: owhere %s\n\r\n\r", argument);
    add_buf(buffer, buf);

    for (iter = 0; obj_flags[iter].var[0] != '\0'; iter++) {
        if (!str_prefix(arg, obj_flags[iter].var)) {
            cmp_fn = (OBJ_CMP_FN *)obj_flags[iter].fn;
            argument = one_argument(argument, arg);
            break;
        }
    }

    if (cmp_fn == NULL)
        cmp_fn = obj_cmp_name;


    if (argument[0] == '?' || argument[0] == '\0') {
        clear_buf(buffer);
        sprintf(buf, "`#SYNTAX``:\n\r    owhere %s <value>:\n\r\n\r", arg);
        add_buf(buffer, buf);

        (*cmp_fn)(object_iterator_start(&object_empty_filter), argument, buffer);
        page_to_char(buf_string(buffer), ch);
    } else {
        struct gameobject *obj, *opending;
        struct gameobject *in_obj;
        char *clr1;
        char *clr2;
        int number;

        number = 0;

        opending = object_iterator_start(&object_empty_filter);
        while ((obj = opending) != NULL) {
            opending = object_iterator(obj, &object_empty_filter);

            if (can_see_obj(ch, obj)
                && (*cmp_fn)(obj, argument, NULL)) {
                number++;
                if (number == 1) {
                    sprintf(buf, "#   vnum   name                        where                      room\n\r");
                    add_buf(buffer, buf);
                    sprintf(buf, "=== ====== =========================== ========================== =====\n\r");

                    add_buf(buffer, buf);
                }

                for (in_obj = obj; in_obj->in_obj != NULL; in_obj = in_obj->in_obj)
                    continue;

                if (in_obj->carried_by != NULL
                    && can_see(ch, in_obj->carried_by)
                    && in_obj->carried_by->in_room != NULL) {
                    clr1 = uncolor_str(obj->short_descr);
                    clr2 = uncolor_str(PERS(in_obj->carried_by, ch));
                    sprintf(buf, "%-3d %-7ld  %-26.26s  %-25.25s  %-7ld\n\r",
                            number,
                            obj->objprototype->vnum,
                            clr1,
                            clr2,
                            in_obj->carried_by->in_room->vnum);
                    free_string(clr1);
                    free_string(clr2);
                } else if (in_obj->in_room != NULL && can_see_room(ch, in_obj->in_room)) {
                    clr1 = uncolor_str(obj->short_descr);
                    clr2 = uncolor_str(in_obj->in_room->name);

                    sprintf(buf, "%-3d %-7ld  %-26.26s  %-25.25s  %-7ld\n\r",
                            number,
                            obj->objprototype->vnum,
                            clr1,
                            clr2,
                            in_obj->in_room->vnum);
                    free_string(clr1);
                    free_string(clr2);
                } else {
                    clr1 = uncolor_str(obj->short_descr);

                    sprintf(buf, "%-3d %-7ld  %-26.26s\n\r",
                            number,
                            obj->objprototype->vnum,
                            clr1);
                    free_string(clr1);
                }

                buf[0] = UPPER(buf[0]);
                add_buf(buffer, buf);

                if (number >= MAX_RETURN)
                    break;
            }
        }


        if (number == 0)
            send_to_char("Nothing like that in heaven or earth.\n\r", ch);
        else
            page_to_char(buf_string(buffer), ch);
    }

    free_buf(buffer);
}
Beispiel #8
0
void move_char (CHAR_DATA * ch, int door, bool follow)
{
    CHAR_DATA *fch;
    CHAR_DATA *fch_next;
    ROOM_INDEX_DATA *in_room;
    ROOM_INDEX_DATA *to_room;
    EXIT_DATA *pexit;

  
    if(ch->infight)
    {
    if(!TURN(ch))
    {
    printf_to_char(ch,"It's not your turn.\n");
    return;
    }

    refresh(ch->in_room);


    if(ch->MoveLeft == 0)
    {
    printf_to_char(ch,"You have no moves left.\n");
    return;
    }
    
    switch(door)
    {
    case DIR_EAST:
    if(find_char_xy(ch,ch->mposx+1,ch->mposy) == NULL)
    {
    if(hdif(ch,DIR_EAST) > ch->jump || hdif(ch,DIR_EAST) < -(ch->jump) || ch->mposx > 24) 
    {
    printf_to_char(ch,"You can't jump that high.\n");
    return;
    }
    ch->mposx++;
    ch->in_room->map.index[ch->mposy][ch->mposx].occupied = FALSE;
    ch->in_room->map.index[ch->mposy][ch->mposx+1].occupied = TRUE;
    announce_move(ch,"east");
    }
    else
    printf_to_char(ch,"Somebody's in the way.\n");
    break;
    case DIR_WEST:
    if(find_char_xy(ch,ch->mposx-1,ch->mposy) == NULL)
    {
    if(hdif(ch,DIR_WEST) > (ch->jump) || hdif(ch,DIR_WEST) < -(ch->jump) || ch->mposx < 1) 
    {
    printf_to_char(ch,"You can't jump that high.\n");
    return;
    }
    ch->in_room->map.index[ch->mposy][ch->mposx].occupied = FALSE;
    ch->in_room->map.index[ch->mposy][ch->mposx-1].occupied = TRUE;
    ch->mposx--;
    announce_move(ch,"west");
    }
    else
    printf_to_char(ch,"Somebody's in the way.\n");
    break;
    case DIR_NORTH:
    if(hdif(ch,DIR_NORTH) > (ch->jump) || hdif(ch,DIR_NORTH) < -(ch->jump) || ch->mposy < 1) 
    {
    printf_to_char(ch,"You can't jump that high.\n");
    return;
    }
    if(find_char_xy(ch,ch->mposx,ch->mposy-1) == NULL)
    {
    ch->in_room->map.index[ch->mposy][ch->mposx].occupied = FALSE;
    ch->in_room->map.index[ch->mposy-1][ch->mposx].occupied = TRUE;
    ch->mposy--;
    announce_move(ch,"north");
    }
    else
    printf_to_char(ch,"Somebody's in the way.\n");
    break;
    case DIR_SOUTH:
    if(hdif(ch,DIR_SOUTH) > (ch->jump) || hdif(ch,DIR_SOUTH) < -(ch->jump) || ch->mposy > 14) 
    {
    printf_to_char(ch,"You can't jump that high.\n");
    return;
    }
    if(find_char_xy(ch,ch->mposx,ch->mposy+1) == NULL)
    {
    ch->in_room->map.index[ch->mposy][ch->mposx].occupied = FALSE;
    ch->in_room->map.index[ch->mposy+1][ch->mposx].occupied = TRUE;
    ch->mposy++;
    announce_move(ch,"south");
    }
    else
    printf_to_char(ch,"Somebody's in the way.\n");
    break;
    }

return;
}


    if (door < 0 || door > 5)
    {
        bug ("Do_move: bad door %d.", door);
        return;
    }

    /*
     * Exit trigger, if activated, bail out. Only PCs are triggered.
     */

    in_room = ch->in_room;
    if ((pexit = in_room->exit[door]) == NULL
        || (to_room = pexit->u1.to_room) == NULL
        || !can_see_room (ch, pexit->u1.to_room))
    {
        send_to_char ("Alas, you cannot go that way.\n\r", ch);
        return;
    }

    if (IS_SET (pexit->exit_info, EX_CLOSED)
            || IS_SET (pexit->exit_info, EX_NOPASS))
    {
        act ("The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR);
        return;
    }

    if (!is_room_owner (ch, to_room) && room_is_private (to_room))
    {
        send_to_char ("That room is private right now.\n\r", ch);
        return;
    }

    if ( ch->invis_level < LEVEL_HERO)
        act ("$n leaves $T.", ch, NULL, dir_name[door], TO_ROOM);


    char_from_room (ch);
    char_to_room (ch, to_room);


    if ( ch->invis_level < LEVEL_HERO)
        act ("$n has arrived.", ch, NULL, NULL, TO_ROOM);

    do_function (ch, &do_look, "auto");

    if (in_room == to_room)        /* no circular follows */
        return;

    for (fch = in_room->people; fch != NULL; fch = fch_next)
    {
        fch_next = fch->next_in_room;

        if (fch->master == ch && fch->position == POS_STANDING
            && can_see_room (fch, to_room))
        {

            if (IS_SET (ch->in_room->room_flags, ROOM_LAW)
                && (IS_NPC (fch) && IS_SET (fch->act, ACT_AGGRESSIVE)))
            {
                act ("You can't bring $N into the city.",
                     ch, NULL, fch, TO_CHAR);
                act ("You aren't allowed in the city.",
                     fch, NULL, NULL, TO_CHAR);
                continue;
            }

            act ("You follow $N.", fch, NULL, ch, TO_CHAR);
            move_char (fch, door, TRUE);
        }
    }

    /* 
     * If someone is following the char, these triggers get activated
     * for the followers before the char, but it's safer this way...
     */
   // if(number_range(1,10) > 2)
 //   gen_random_battle(ch);

    return;
}
Beispiel #9
0
//********************KONIEC PRZYTRZYMUJACYCH*******************//
//to jest do_owhere() tylko zmodyfikowany na potrzeby do_astat()
void awhere( CHAR_DATA *ch, char *argument )
{
	char buf[ MAX_INPUT_LENGTH ];
	BUFFER *buffer = NULL;
	OBJ_DATA *obj;
	OBJ_DATA *in_obj;
	bool found;
	int vnum = -1;

	found = FALSE;

	buffer = new_buf();

	if ( argument[ 0 ] == '\0' )
	{
		send_to_char( "Find what?\n\r", ch );
		return ;
	}

	if ( is_number( argument ) )
		vnum = atoi( argument );

	for ( obj = object_list; obj != NULL; obj = obj->next )
	{
		if ( vnum > 0 )
		{
			if ( !can_see_obj( ch, obj ) || obj->pIndexData->vnum != vnum )
				continue;
		}
		else
		{
			if ( !can_see_obj( ch, obj ) || !is_name( argument, obj->name ) )
				continue;
		}

		found = TRUE;

		for ( in_obj = obj; in_obj->in_obj != NULL; in_obj = in_obj->in_obj );

		if ( in_obj->carried_by != NULL && can_see( ch, in_obj->carried_by )
		     && in_obj->carried_by->in_room != NULL )
			sprintf( buf, " %s jest noszone przez %s [Room %d]\n\r",
			         obj->short_descr, PERS( in_obj->carried_by, ch ),
			         in_obj->carried_by->in_room->vnum );
		else if ( in_obj->in_room != NULL && can_see_room( ch, in_obj->in_room ) )
			sprintf( buf, " %s jest w %s [Room %d]\n\r",
			         obj->short_descr, in_obj->in_room->name,
			         in_obj->in_room->vnum );
		else
			sprintf( buf, " %s jest gdzies\n\r", obj->short_descr );

		sprintf( buf, "%s", capitalize( buf ) );
		add_buf( buffer, buf );

	}

	if ( !found )
		send_to_char( "	Niczego takiego nie ma aktualnie w grze.\n\r", ch );
	else
		page_to_char( buf_string( buffer ), ch );

	free_buf( buffer );
}