コード例 #1
0
ファイル: magic2.c プロジェクト: Sembiance/kotrd
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);
}
コード例 #2
0
ファイル: clan.c プロジェクト: verias/SRMud
/* clan channels */
void do_clantalk( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    DESCRIPTOR_DATA *d;

    if (!is_clan(ch))
    {
	send_to_char("You aren't in a clan.\n\r",ch);
	return;
    }
    if ( argument[0] == '\0' )
    {
      if (IS_SET(ch->comm,COMM_NOCLAN))
      {
        send_to_char("Clan channel is now ON\n\r",ch);
        REMOVE_BIT(ch->comm,COMM_NOCLAN);
      }
      else
      {
        send_to_char("Clan channel is now OFF\n\r",ch);
        SET_BIT(ch->comm,COMM_NOCLAN);
      }
      return;
    }

        if (IS_SET(ch->comm,COMM_NOCHANNELS))
        {
         send_to_char("The gods have revoked your channel priviliges.\n\r",ch);
          return;
        }

        REMOVE_BIT(ch->comm,COMM_NOCLAN);
	  if(!IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10)
		  argument = makedrunk(argument,ch);

      sprintf( buf, "You clan '%s'{x\n\r", argument );
      send_to_char( buf, ch );
      sprintf( buf, "$n clans '%s'{x", argument );
    for ( d = descriptor_list; d != NULL; d = d->next )
    {
        if ( d->connected == CON_PLAYING &&
			is_same_clan(ch,d->character) &&
	     is_same_clan(ch,d->character) &&
         !IS_SET(d->character->comm,COMM_NOCLAN) &&
	     !IS_SET(d->character->comm,COMM_QUIET) )
        {
            act_new("$n clans '$t'{x",ch,argument,d->character,TO_VICT,POS_DEAD);
        }
		if(IS_SET(d->character->comm,COMM_ALLCLAN) &&
			d->connected == CON_PLAYING &&
             d->character != ch
			 && !is_same_clan(d->character, ch))
		{
			send_to_one(d->character,"[ %s ] %s clans '%s'{x",clan_table[ch->clan].name,ch->name,
				argument);
		}
    }

    return;
}
コード例 #3
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void remove_from_clan( CHAR_DATA *ch )
{
    CLAN_DATA *clan;

    if ( !is_clan( ch ) )
	return;

    clan = ch->pcdata->clan;

    switch ( ch->pcdata->rank )
    {
    default:								  break;
    case RANK_CLANSMAN:							  break;
    case RANK_CLANHERO:  clan->clanheros--;				  break;
    case RANK_SUBCHIEF:  clan->subchiefs--;				  break;
    case RANK_CHIEFTAIN: free_string( clan->chieftain );		  break;
    case RANK_OVERLORD:  free_string( clan->overlord );			  break;
    }

    clan->members--;
    ch->pcdata->clan = NULL;

    return;    
}
コード例 #4
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_leaveclan( CHAR_DATA *ch, char *argument )
{
    CLAN_DATA *clan;
    char       buf [ MAX_STRING_LENGTH ];

    if ( !is_clan( ch )  )
    {
        send_to_char( "You aren't a clansman.\n\r", ch );
        return;
    }

    clan = ch->pcdata->clan;

    if ( ch->pcdata->rank == RANK_OVERLORD )
    {
        send_to_char( "Huh? An Overlord shouldn't leave his clan!\n\r", ch );
        return;
    }

    remove_from_clan( ch );
    ch->pcdata->rank = RANK_EXILED;

    sprintf( buf,
	    "You leave %s off into exile.\n\r"
	    "You hear a thundering sound...\n\r\n\r"
	    "A booming voice says: 'You have been exiled. Only the gods can allow you\n\r"
	    "to join another clan, order or guild!'\n\r",
	    clan->name );

    send_to_char( buf, ch );

    act( "You have left clan $t.", ch, clan->name, NULL, TO_CHAR );
    save_char_obj( ch );
    
    return;
}
コード例 #5
0
ファイル: magic2.c プロジェクト: Geadin/balrog
void spell_nexus( int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    CHAR_DATA *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_clan(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);
    }
}
コード例 #6
0
ファイル: guild.c プロジェクト: michaelmwu/bota
void do_guild(CHAR_DATA * ch, char *argument)
{
    char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    int clan;

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

    if (!can_guild(ch))
    {
	send_to_char("Huh?\n\r", ch);
	return;
    }
    if (arg1[0] == '\0' || arg2[0] == '\0')
    {
	send_to_char("Syntax: guild <char> <clan name>\n\r", ch);
	return;
    }
    if ((victim = get_char_world(ch, arg1)) == NULL)
    {
	send_to_char("They aren't playing.\n\r", ch);
	return;
    }

	if(IS_NPC(victim))
    {
	send_to_char("Not on NPCs.\n\r", ch);
	return;
    }	

    /** thanks to Zanthras for the bug fix here...*/
    if (is_clan(victim) && !is_same_clan(ch, victim) &&
	((ch->level < SUPREME) & (ch->trust < SUPREME)))
    {
	send_to_char("They are a member of a guild other than your own.\n\r", ch);
	return;
    }

    if (!str_prefix(arg2, "none"))
    {
	send_to_char("They are no longer a member of any guild.\n\r", ch);
	send_to_char("You are no longer a member of any guild!\n\r", victim);
	victim->clan = 0;
	victim->rank = 0;

	/* add by: Zak Jonhson ([email protected]) */
	if (IS_SET(victim->act, PLR_MORTAL_LEADER))
	    REMOVE_BIT(victim->act, PLR_MORTAL_LEADER);

	return;
    }
    if ((clan = clan_lookup(arg2)) == 0)
    {
	send_to_char("No such guild exists.\n\r", ch);
	return;
    }
    
    if( (IS_SET(victim->act, PLR_NOCLAN) && is_clan_pkill(clan)) && !IS_IMMORTAL(ch) )
    {
	send_to_char("They aren't allowed to be in a pkill clan",ch);
		return;
    }

    sprintf(buf, "They are now a %s of the %s.\n\r",
	    clan_table[clan].rank[0].rankname, clan_table[clan].name);
    send_to_char(buf, ch);

    sprintf(buf, "You are now a %s of the %s.\n\r",
	    clan_table[clan].rank[0].rankname, clan_table[clan].name);
    send_to_char(buf, victim);

    if (IS_SET(victim->act, PLR_MORTAL_LEADER))
	REMOVE_BIT(victim->act, PLR_MORTAL_LEADER);

    victim->clan = clan;
    victim->rank = 0;		/* lowest, default */
} /* end: do_guild */
コード例 #7
0
ファイル: guild.c プロジェクト: michaelmwu/bota
void do_promote(CHAR_DATA * ch, char *argument)
{
    char arg1[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    int cnt;
    int sn = 0;

    argument = one_argument(argument, arg1);

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

    if (arg1[0] == '\0' || argument[0] == '\0')
    {
	/*
	 * --------------------------------------------------------------
	 * Keep in mind that we are displaying the ranks as 1 - MAX_RANK,
	 * so, since the structure is actually 0 - MAX_RANK-1, we need to
	 * set "cnt" to cnt-1.
	 * -------------------------------------------------------------- 
	 */

	send_to_char("Syntax: promote <who> <rank #>\n\r", ch);
	send_to_char("where rank is one of the following:\n\r", ch);

	for (cnt = 0; cnt < MAX_RANK; cnt++)
	{
	  sprintf(buf, "%2d] %s\n\r", cnt + 1,
 	    is_clan(ch) ? clan_table[ch->clan].rank[cnt].rankname : "(None)");
	  send_to_char(buf, ch);
	}
	send_to_char("\n\r", ch);
	return;
    }				/* end syntax */

    if ((victim = get_char_world(ch, arg1)) == NULL)
    {
	send_to_char("They aren't playing.\n\r", ch);
	return;
    }

	if(IS_NPC(victim))
    {
	send_to_char("Not on NPCs.\n\r", ch);
	return;
    }

    if (!is_clan(victim))
    {
        send_to_char("They are not a member of any guilds!\n\r", ch);
        return;
    }

    if (!is_same_clan(ch, victim) &&
	(ch->level < SUPREME))
    {
	send_to_char("They are a member of a guild different than yours!\n\r", ch);
	return;
    }

    if (!str_cmp(argument, "leader"))
    {
	SET_BIT(victim->act, PLR_MORTAL_LEADER);
	send_to_char("They are now a mortal leader.\n\r", ch);
	send_to_char("You have just been promoted to a leader of your guild!\n\r", victim);
	return;
    }

    cnt = atoi(argument) - 1;
    if (cnt < 0 ||
	cnt > MAX_RANK -1 ||
	clan_table[victim->clan].rank[cnt].rankname == NULL)
    {
	send_to_char("That rank does not exist!", ch);
	return;
    }
    if (cnt > victim->rank && ((ch == victim) & (!IS_IMMORTAL(ch))))
    {
	send_to_char("Heh. I dont think so...", ch);
	return;
    }

  /** bug report by: Zak Jonhnson ([email protected])
    * we were checking ch->rank here..*sigh* Thanks Zak!
    */
    if (cnt > victim->rank)
    {
	int i;

	sprintf(buf, "You have been promoted to %s!\n\r",
		clan_table[victim->clan].rank[cnt].rankname);
	send_to_char(buf, victim);

	sprintf(buf, "%s has been promoted to %s!\n\r",
	      victim->name, clan_table[victim->clan].rank[cnt].rankname);
	send_to_char(buf, ch);

	for (i = victim->rank; i < cnt; i++)
	    if (clan_table[victim->clan].rank[i].skillname != NULL)
	    {
		sn = skill_lookup(clan_table[victim->clan].rank[i].skillname);
		if (sn < 0)
		{
		    sprintf(buf, "Bug: Add skill [%s] is not a valid skill",
			    clan_table[victim->clan].rank[cnt].skillname);
		    log_string(LOG_ERR,buf);
		} else if (!victim->pcdata->learned[sn])
		    victim->pcdata->learned[sn] = 20 + (victim->level / 4);
	    }
    } 
    
    else if (cnt < victim->rank)
    {
	if (IS_SET(victim->act, PLR_MORTAL_LEADER))
	    REMOVE_BIT(victim->act, PLR_MORTAL_LEADER);

	sprintf(buf, "You have been demoted to %s!\n\r",
		clan_table[victim->clan].rank[cnt].rankname);

	send_to_char(buf, victim);
	sprintf(buf, "%s has been demoted to %s!\n\r",
	      victim->name, clan_table[victim->clan].rank[cnt].rankname);

	send_to_char(buf, ch);
	/*
	 * ---------------------------------------------------------------
	 * Note: I dont think it would be fair here to take away any skills
	 * the victim may have earned at a higher rank. It makes no RP sense
	 * to do so and only hurts the player (loss of practices etc). Imms
	 * may want to keep an eye on this, as we dont want players jumping
	 * guilds just to gain new skills.
	 * -------------------------------------------------------------- 
	 */
    }				/* else no change */
    victim->rank = cnt;
    return;
} /* end: do_promote */
コード例 #8
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_claninfo( CHAR_DATA *ch, char *argument )
{
    CLAN_DATA *clan;
    char       buf  [ MAX_STRING_LENGTH ];
    char       buf1 [ MAX_STRING_LENGTH ];

    if ( !is_clan( ch )  )
    {
        send_to_char( "You aren't a clansman.\n\r", ch );
        return;
    }

    clan = ch->pcdata->clan;

    buf1[0] = '\0';

    strcat( buf1, "{o{r __________________________________________________________________________{x\n\r" );
    strcat( buf1, "{o{r/                                                                          \\{x\n\r" );

    sprintf( buf, "                         {o{r[{y={r]{x  %s  {o{r[{y={r]{x\n\r",
	    clan->name );
    strcat( buf1, buf );

    sprintf( buf, "\n\r {o{w\"{x%s{o{w\"{x\n\r",
	    clan->motto );
    strcat( buf1, buf );

    sprintf( buf, "\n\r {o{r[>{x Overlord {o{w'%s'{x\n\r",
	    clan->overlord );
    strcat( buf1, buf );

    if ( clan->members > 9 )
    {
	sprintf( buf, " {o{r[>{x Chieftain {o{w'%s'{x\n\r",
	    clan->chieftain );
	strcat( buf1, buf );
    }

    sprintf( buf, "\n\r {o{r[>{x {o{w%d{x subchiefs, maximum {o{w%d{x.\n\r",
	    clan->subchiefs, clan->members / 6 );
    strcat( buf1, buf );

    sprintf( buf, " {o{r[>{x {o{w%d{x clanheros, maximum {o{w%d{x.\n\r",
	    clan->clanheros, clan->members / 3 );
    strcat( buf1, buf );

    sprintf( buf, " {o{r[>{x {o{w%d{x members.\n\r",
	    clan->members );
    strcat( buf1, buf );

    sprintf( buf, "\n\r {o{r[>{x {o{w%d{x score.\n\r\n\r",
	    clan->score );
    strcat( buf1, buf );

    strcat( buf1, "{o{r\\__________________________________________________________________________/{x\n\r" );
    strcat( buf1, "{o{r/                                                                          \\{x\n\r" );

    sprintf( buf, " ... %s ...{x\n\r",
	    clan->description );
    strcat( buf1, buf );

    strcat( buf1, "{o{r\\__________________________________________________________________________/{x\n\r" );
    send_to_char( buf1, ch );

    return;
}
コード例 #9
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_initiate( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    CLAN_DATA *clan;
    OBJ_DATA  *card;
    OBJ_DATA  *ring;
    char       arg [ MAX_INPUT_LENGTH ];
    char       buf [ MAX_STRING_LENGTH ];

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        send_to_char( "Initiate whom?\n\r", ch );
        return;
    }

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

    if ( !is_clan( ch )
        || ch->pcdata->rank < RANK_CHIEFTAIN
        || victim->level > ch->level )
    {
        send_to_char( "You don't have the power to do this.\n\r", ch );
        return;
    }

    clan = ch->pcdata->clan;

    if ( victim == ch )
        return;

    card = get_eq_char( victim, WEAR_HOLD );
    if ( is_clan( victim )
	 || IS_NPC( victim )
         || !card
         || card->pIndexData->vnum != OBJ_VNUM_CLAN_CARD
	 || victim->pcdata->rank == RANK_EXILED
         || victim->level < 20 )
    {
        act( "$N hasn't what's required to be initiated.",
	    ch, NULL, victim, TO_CHAR );
        act( "You can't be initiated to $t!",
	    ch, clan->name, victim, TO_VICT );
        return;
    }

    if ( clan->clan_type == CLAN_GUILD && clan->cclass != victim->cclass[0] )
	send_to_char( "You may only initiate those of your class.\n\r", ch );

    victim->pcdata->clan      = clan;
    victim->pcdata->rank      = RANK_CLANSMAN;
    clan->members++;

    ring = create_object( get_obj_index( clan->clanobj1 ), victim->level );

    if ( ring )
	obj_to_char( ring, victim );

    sprintf( buf, "Log %s: initiated %s to %s",
	    ch->name,
	    victim->name,
	    clan->name  );
    log_clan( buf );

    sprintf( buf, "'I %s %s, hereby declare you %s a member of %s!'\n\r"
		  "Take %s as a symbol of this union for all time.\n\r"
		  "Forever remember our motto: \"%s\"\n\r",
		  flag_string( rank_flags, ch->pcdata->rank ),
		  ch->name,
		  victim->name,
		  clan->name,
		  ring ? ring->short_descr : "my handshake",
		  clan->motto );

    send_to_char( buf, victim );

    act( "$N has been initiated to $t!", ch, clan->name, victim, TO_ROOM );
    act( "You have initiated $N to $t!", ch, clan->name, victim, TO_CHAR );
    save_char_obj( victim );

    clan->score += 5;
    
    return;
}
コード例 #10
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_cdonate( CHAR_DATA *ch, char *arg )
{
    OBJ_DATA *container;
    OBJ_DATA *obj;
    OBJ_DATA *obj_next;
    char      arg1 [ MAX_INPUT_LENGTH ];

    if ( !is_clan( ch ) )
    {
	send_to_char( "You aren't a clansman!\n\r", ch );
	return;
    }

    arg = one_argument( arg, arg1 );

    if ( arg1[0] == '\0' )
    {
	send_to_char( "Donate to your clan what?\n\r", ch );
	return;
    }

    for ( container = object_list; container; container = container->next )
    {
        if ( can_see_obj( ch, container )
	    && container->pIndexData->vnum == ch->pcdata->clan->donation )
	    break;
    }

    if ( !container )
    {
	send_to_char( "The donation pit is missing from the world.\n\r", ch );
	return;
    }

    if ( str_cmp( arg1, "all" ) && str_prefix( "all.", arg1 ) )
    {
	if ( !( obj = get_obj_carry( ch, arg1 ) ) )
	{
	    send_to_char( "You do not have that item.\n\r", ch );
	    return;
	}

	if ( !can_drop_obj( ch, obj ) )
	{
	    send_to_char( "You can't let go of it.\n\r", ch );
	    return;
	}
	
	if ( get_obj_weight( obj ) + get_obj_weight( container ) 
	  > container->value[0] )
	{
	    send_to_char( "It won't fit.\n\r", ch );
	    return;
	}

	if ( obj->item_type == ITEM_TRASH
	    || obj->item_type == ITEM_FOOD
	    || obj->item_type == ITEM_KEY
	    || obj->item_type == ITEM_PILL )
	{
	    act( "You send $p flying to the $P.", ch, obj, container,
		TO_CHAR );
	    extract_obj( obj );
	    return;
	}

	obj_from_char( obj );
	obj_to_obj( obj, container );
	act( "$n sends $p flying to the $P.", ch, obj, container, TO_ROOM );
	act( "You send $p flying to the $P.", ch, obj, container, TO_CHAR );
	send_to_room( "A loud clank is heard from the pit!",
		     container->in_room );
    }
    else
    {
	for ( obj = ch->carrying; obj; obj = obj_next )
	{
	    obj_next = obj->next_content;

	    if ( obj->deleted )
		continue;

	    if ( ( arg1[3] == '\0' || is_name( &arg1[4], obj->name ) )
		&& can_see_obj( ch, obj )
		&& obj->wear_loc == WEAR_NONE
		&& obj != container
		&& can_drop_obj( ch, obj )
		&& get_obj_weight( obj ) + get_obj_weight( container )
		<= container->value[0] )
	    {

	        if ( obj->item_type == ITEM_TRASH
		    || obj->item_type == ITEM_FOOD
		    || obj->item_type == ITEM_KEY
		    || obj->item_type == ITEM_PILL )
		{
		    act( "You send $p flying to the $P.", ch, obj, container,
			TO_CHAR );
		    extract_obj( obj );
		    continue;
		}

		obj_from_char( obj );
		obj_to_obj( obj, container );
		act( "$n sends $p flying to the $P.", ch, obj, container,
		    TO_ROOM );
		act( "You send $p flying to the $P.", ch, obj, container,
		    TO_CHAR );
		send_to_room( "A loud clank is heard from the pit!\n\r",
		     container->in_room );

		ch->pcdata->clan->score += 1;
	    }
	}
    }

    return;

}
コード例 #11
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_crecall( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA       *victim;
    ROOM_INDEX_DATA *location;
    char             buf [ MAX_STRING_LENGTH ];
    int              place;

    if ( !is_clan( ch ) )
    {
	send_to_char( "You aren't a clansman!\n\r", ch );
	return;
    }

    act( "$n prays for transportation!", ch, NULL, NULL, TO_ROOM );

    if ( IS_SET( ch->in_room->room_flags, ROOM_NO_RECALL )
	|| IS_AFFECTED( ch, AFF_CURSE ) )
    {
	send_to_char( "God has forsaken you.\n\r", ch );
	return;
    }

    place = ch->pcdata->clan->recall;
    if ( !( location = get_room_index( place ) ) )
    {
	send_to_char( "You are completely lost.\n\r", ch );
	return;
    }

    if ( ch->in_room == location )
	return;

    if ( ( victim = ch->fighting ) )
    {
	int lose;

	if ( number_bits( 1 ) == 0 )
	{
	    WAIT_STATE( ch, 4 );
	    lose = ( ch->desc ) ? 25 : 50;
	    gain_exp( ch, 0 - lose );
	    sprintf( buf, "You failed!  You lose %d exps.\n\r", lose );
	    send_to_char( buf, ch );
	    return;
	}

	lose = ( ch->desc ) ? 50 : 100;
	gain_exp( ch, 0 - lose );
	sprintf( buf, "You recall from combat!  You lose %d exps.\n\r", lose );
	send_to_char( buf, ch );
	stop_fighting( ch, TRUE );
    }

    ch->move /= 2;
    act( "$n disappears.", ch, NULL, NULL, TO_ROOM );
    char_from_room( ch );
    char_to_room( ch, location );
    act( "$n appears in the room.", ch, NULL, NULL, TO_ROOM );
    do_look( ch, "auto" );

    return;
}
コード例 #12
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_demote( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    CLAN_DATA *clan;
    char       arg [ MAX_INPUT_LENGTH ];
    char       buf [ MAX_STRING_LENGTH ];
    int        newrank;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        send_to_char( "Demote whom?\n\r", ch );
        return;
    }

    if ( !is_clan( ch )
        || ch->pcdata->rank != RANK_OVERLORD )
    {
        send_to_char( "You don't have the power to do this.\n\r", ch );
        return;
    }

    clan = ch->pcdata->clan;

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

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

    if ( !is_same_clan( ch, victim ) )
    {
        act( "$N isn't even from $t.", ch, clan->name, victim, TO_CHAR );
        return;
    }

    switch ( victim->pcdata->rank )
    {
    default:
	return;
	break;
    case RANK_CLANSMAN:
	send_to_char( "He's as low as they can get.\n\r", ch );
	return;
	break;
    case RANK_CLANHERO:
	clan->clanheros--;
	break;
    case RANK_SUBCHIEF:
	clan->clanheros++;
	clan->subchiefs--;
	break;
    case RANK_CHIEFTAIN:
	clan->subchiefs++;
	free_string( clan->chieftain );
	break;
    case RANK_OVERLORD:
	send_to_char( "You may not demote an Overlord!?\n\r", ch );
	return;
	break;
    }

    victim->pcdata->rank--;
    newrank = victim->pcdata->rank;

    sprintf( buf, "Log %s: demoting %s to %s",
	    ch->name,
	    victim->name,
	    ch->pcdata->clan->name  );
    log_clan( buf );

    sprintf( buf,
	    "The grand Overlord %s says:\n\r\n\r"
	    "'I hereby demote you %s to %s!!!'\n\r"
	    "You should make more efforts to improve!",
	    ch->name,
	    victim->name,
	    flag_string( rank_flags, newrank ) );
    send_to_char( buf, victim );

    act( "You have demoted $N to $t.",
	ch, flag_string( rank_flags, newrank ), victim, TO_CHAR );
    save_char_obj( victim );
    
    return;
}
コード例 #13
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_promote( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    CLAN_DATA *clan;
    OBJ_DATA  *obj;
    char       arg [ MAX_INPUT_LENGTH ];
    char       buf [ MAX_STRING_LENGTH ];
    int        newrank;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        send_to_char( "Promote whom?\n\r", ch );
        return;
    }

    if ( !is_clan( ch )
        || ch->pcdata->rank != RANK_OVERLORD )
    {
        send_to_char( "You don't have the power to do this.\n\r", ch );
        return;
    }

    clan = ch->pcdata->clan;

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

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

    if ( !is_same_clan( ch, victim ) )
    {
        act( "$N isn't even from $t.", ch, clan->name, victim, TO_CHAR );
        return;
    }

    obj = NULL;

    switch ( victim->pcdata->rank )
    {
    default:
	return;
	break;
    case RANK_CLANSMAN:
	if ( clan->clanheros >= clan->members / 3 )
	{
	    send_to_char( "You may have only 1 clanhero per 3 clansmen.\n\r", ch );
	    return;
	}
	obj = create_object( get_obj_index( clan->clanobj2 ), victim->level );
	clan->clanheros++;
	clan->score		+= 5;
    	break;
    case RANK_CLANHERO:
	if ( clan->subchiefs >= clan->members / 6 )
	{
	    send_to_char( "You may have only 1 subchief per 6 clansmen.\n\r", ch );
	    return;
	}
	obj = create_object( get_obj_index( clan->clanobj3 ), victim->level );
	clan->clanheros--;
	clan->subchiefs++;
	clan->score		+= 15;
	break;
    case RANK_SUBCHIEF:
	if ( clan->chieftain[0] != '\0' )
	{
	    send_to_char( "You may have only 1 chieftain.\n\r", ch );
	    return;
	}
	else if ( clan->members < 9 )
	{
	    send_to_char( "You need to have 9 clansmen before you can have a chieftain.\n\r", ch );
	    return;
	}

	clan->subchiefs--;
	clan->chieftain = str_dup( victim->name );
	clan->score		+= 45;
	break;
    case RANK_CHIEFTAIN:
    case RANK_OVERLORD:
	send_to_char( "You may not promote any further that person.\n\r", ch );
	return;
	break;
    }

    victim->pcdata->rank++;
    newrank = victim->pcdata->rank;

    if ( obj )
	obj_to_char( obj, victim );

    sprintf( buf, "Log %s: promoting %s to %s",
	    ch->name,
	    victim->name,
	    ch->pcdata->clan->name  );
    log_clan( buf );

    sprintf( buf,
	    "The grand Overlord %s says:\n\r\n\r"
	    "'I hereby promote you %s to %s!'\n\r"
	    "Take %s as a prize for your superb performance.\n\r"
	    "%s\n\r",
	    ch->name,
	    victim->name,
	    flag_string( rank_flags, newrank ),
	    obj ? obj->short_descr : "this promotion",
	    clan->motto );

    send_to_char( buf, victim );

    act( "You have promoted $N to $t.",
	ch, flag_string( rank_flags, newrank ), victim, TO_CHAR );
    save_char_obj( victim );
    
    return;
}
コード例 #14
0
ファイル: act_clan.c プロジェクト: vcosta/greedmud
void do_exile( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    CLAN_DATA *clan;
    char       arg [ MAX_INPUT_LENGTH ];
    char       buf [ MAX_STRING_LENGTH ];

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        send_to_char( "Exile whom?\n\r", ch );
        return;
    }

    if ( !is_clan( ch )
        || ch->pcdata->rank != RANK_OVERLORD )
    {
        send_to_char( "You don't have the power to do this.\n\r", ch );
        return;
    }

    clan = ch->pcdata->clan;

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

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

    if ( !is_same_clan( ch, victim ) )
    {
        act( "$N isn't even from $t.", ch, clan->name, victim, TO_CHAR );
        return;
    }

    sprintf( buf, "Log %s: exiling %s from %s",
	    ch->name,
	    victim->name,
	    ch->pcdata->clan->name  );
    log_clan( buf );

    remove_from_clan( victim );
    victim->pcdata->rank = RANK_EXILED;

    sprintf( buf,
	    "The grand Overlord of %s %s says:\n\r\n\r"
	    "'Then so be done, you %s shall be exiled from %s!'\n\r"
	    "You hear a thundering sound...\n\r\n\r"
	    "A booming voice says: 'You have been exiled. Only the gods can allow you\n\r"
	    "to join another clan, order or guild!'\n\r",
	    clan->name,
	    clan->overlord,
	    victim->name,
	    clan->name );

    send_to_char( buf, victim );

    act( "You have exiled $N from $t!", ch, clan->name, victim, TO_CHAR );
    save_char_obj( victim );
    
    return;
}