Esempio n. 1
0
void do_lavablast(CHAR_DATA *ch, char *argument)
{
    CHAR_DATA *victim;

    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_LAVA))
    {
        send_to_char("Perhaps you should learn that power first.\n\r",ch);
        return;
    }
    if (ch->mana < 1000 || ch->move < 1000)
    {
        send_to_char("Your not up to it, you ain't got the fire in ya.\n\r",ch);
        return;
    }
    if ((victim = ch->fighting) == NULL)
    {
        send_to_char( "You aren't fighting anyone.\n\r", ch );
        return;
    }
    ch->mana -= 1000;
    ch->move -= 1000;
    one_hit(ch,victim,gsn_magma,1);
    one_hit(ch,victim,gsn_magma,1);
    one_hit(ch,victim,gsn_magma,1);
    if (!IS_AFFECTED(victim, AFF_FLAMING))
        SET_BIT(victim->affected_by, AFF_FLAMING);
    WAIT_STATE(ch,18);
    return;
}
Esempio n. 2
0
void cast_detect_invisibility( byte level, struct char_data *ch, char *arg, int type,
  struct char_data *tar_ch, struct obj_data *tar_obj )
{
  switch (type) {
    case SPELL_TYPE_SPELL:
			if ( affected_by_spell(tar_ch, SPELL_DETECT_INVISIBLE) ){
				send_to_char("Nothing seems to happen.\n\r", tar_ch);
				return;
			}
			spell_detect_invisibility(level,ch,tar_ch,0);
			break;
    case SPELL_TYPE_POTION:
			if ( affected_by_spell(ch, SPELL_DETECT_INVISIBLE) )
				return;
			spell_detect_invisibility(level,ch,ch,0);
			break;
    case SPELL_TYPE_STAFF:
         for (tar_ch = world[ch->in_room].people ; 
              tar_ch ; tar_ch = tar_ch->next_in_room)
            if (tar_ch != ch) 
               if(!(IS_AFFECTED(tar_ch, SPELL_DETECT_INVISIBLE)))
                  spell_detect_invisibility(level,ch,tar_ch,0);
         break;
    default : 
         log("Serious screw-up in detect invisibility!");
         break;
	}
}
Esempio n. 3
0
void do_mpechoat( 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;

    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;
}
Esempio n. 4
0
void do_mpmload( CHAR_DATA *ch, char *argument )
{
    char            arg[ MAX_INPUT_LENGTH ];
    MOB_INDEX_DATA *pMobIndex;
    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' || !is_number(arg) )
    {
	bug( "Mpmload - Bad vnum as arg: vnum %d.", ch->pIndexData->vnum );
	return;
    }

    if ( ( pMobIndex = get_mob_index( atoi( arg ) ) ) == NULL )
    {
	bug( "Mpmload - Bad mob vnum: vnum %d.", ch->pIndexData->vnum );
	return;
    }

    victim = create_mobile( pMobIndex );
    char_to_room( victim, ch->in_room );
    return;
}
Esempio n. 5
0
/* changes area->status, for area theme quests --Manaux */
void do_mpastatus(CHAR_DATA * ch, char * args)
{
	char 	arg1 [MAX_INPUT_LENGTH];
	int value;
	if (!IS_NPC(ch) || IS_AFFECTED(ch, AFF_CHARM))
		return;
	args = one_argument(args, arg1);
	if (!strcmp("enable", arg1))
	{
	args = one_argument(args, arg1);
	value = 1 << (atoi(arg1) -1);
	if (atoi(arg1) > 31 || atoi(arg1) < 1)
		return;
	ch->pIndexData->area->status |= value;
	}
	else if (!strcmp("disable", arg1))
	{
	args = one_argument(args, arg1);
	value = 1<< (atoi(arg1) -1);
	if (atoi(arg1) > 31 || atoi(arg1) < 1)
		return;
	ch->pIndexData->area->status &= ~value;
	}
return;
}
Esempio n. 6
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;
}
Esempio n. 7
0
/*
 * Spell to remove faerie fire outline from an individual
 */
void spell_remove_faerie_fire(int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;

    if (!IS_AFFECTED(victim, AFF_FAERIE_FIRE))
    {
        if (victim == ch)
        {
            send_to_char("You aren't afflicted by faerie fire.\r\n", ch);
        }
        else
        {
            act("$N doesn't appear to be afflicted by faerie fire.", ch, NULL, victim, TO_CHAR);
        }
        return;
    }

    if (check_dispel(level + 3, victim, gsn_faerie_fire))
    {
        act("The pink aura around $n fades away.", victim, NULL, NULL, TO_ROOM);
    }
    else
    {
        send_to_char("Spell failed.\r\n", ch);
    }

} // end spell_remove_faerie_fire
Esempio n. 8
0
/*
 * subtracts amount of hitpoints from ch's current and starts points event
 */
void alter_hit(struct char_data *ch, int amount)
{
  struct regen_event_obj *regen;
  long time;
  int gain;

  GET_HIT(ch) = MIN(GET_HIT(ch) - amount, GET_MAX_HIT(ch));

  if (GET_HIT(ch) <= HIT_INCAP||IS_AFFECTED(ch,AFF_TRAMORTITO))
    return;
  if (PLR_FLAGGED(ch, PLR_FANTASMA) && amount > 0)
    return;

  if (GET_HIT(ch) < GET_MAX_HIT(ch) && !GET_POINTS_EVENT(ch, REGEN_HIT)) {
    CREATE(regen, struct regen_event_obj, 1);	
    regen->ch = ch;
    regen->type = REGEN_HIT;
    gain = hit_gain(ch);
    time = PULSES_PER_MUD_HOUR / (gain ? gain : 1);
    GET_POINTS_EVENT(ch, REGEN_HIT) = event_create(points_event, regen, time);

    if (amount >= 0) {
	
      /*
       * if the character gained hp, update position and
       * restart mana and move regeneration if needed.
       */
      update_pos(ch);
      alter_mana(ch, 0);
      alter_move(ch, 0);
    }
  }
Esempio n. 9
0
void do_shadowshift( CHAR_DATA *ch, char *argument )
{
    OBJ_DATA *obj;
    char      arg [MAX_INPUT_LENGTH];
    argument = one_argument( argument, arg );

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_WIZARD))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (IS_CLASS(ch, CLASS_WIZARD) && ch->pcdata->powers[WL_SKILLS] < 3)
    {
        send_to_char("You need Level 3 in Wizard Skills.\n\r",ch);
        return;
    }
    if ( arg[0] == '\0' )
    {
        if (!IS_AFFECTED(ch, AFF_SHADOWPLANE))
        {
            if (has_timer(ch)) return;
            send_to_char("You fade into the plane of shadows.\n\r",ch);
            act("The shadows flicker and swallow up $n.",ch,NULL,NULL,TO_ROOM);
            SET_BIT(ch->affected_by, AFF_SHADOWPLANE);
            do_look(ch,"auto");
            return;
        }
        REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
        send_to_char("You fade back into the real world.\n\r",ch);
        act("The shadows flicker and $n fades into existance.",ch,NULL,NULL,TO_ROOM);
        do_look(ch,"auto");
        return;
    }

    if ( ( obj = get_obj_here( ch, arg ) ) == NULL )
    {
        send_to_char( "What do you wish to toss into the shadow plane?\n\r", ch );
        return;
    }

    if (IS_AFFECTED(ch, AFF_SHADOWPLANE))
        send_to_char( "You toss it to the ground and it vanishes.\n\r", ch );
    else
        send_to_char( "You toss it into a shadow and it vanishes.\n\r", ch );
    return;
}
Esempio n. 10
0
void do_sinsofthepast( 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_JUSTICE] < 3)
    {
        send_to_char("Your not ready to punish the sinners.\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;
    }
    send_to_char("#RYou burn them with the fires of hell!#n\n\r",ch);
    if (!IS_AFFECTED(victim, AFF_FLAMING)) SET_BIT(victim->affected_by, AFF_FLAMING);
    send_to_char("#LTheir body is wrecked by poison!#n\n\r",ch);
    if (!IS_AFFECTED(victim, AFF_POISON)) SET_BIT(victim->affected_by, AFF_POISON);
    send_to_char("#CGod's fury upon them for they have truly sinned!!!#n\n\r",ch);
    one_hit(ch,victim, gsn_wrathofgod,1);
    one_hit(ch,victim, gsn_wrathofgod,1);
    one_hit(ch,victim, gsn_wrathofgod,1);
    one_hit(ch,victim, gsn_wrathofgod,1);
    WAIT_STATE(ch,12);
    return;
}
Esempio n. 11
0
int calcManaMulti(CharData *ch) {
    int multi = 100;

    if(ROOM_FLAGGED(ch->in_room, ROOM_MANA_REGEN))
        multi += 50;
    
    if(IS_AFFECTED(ch, AFF_WRAITHFORM))
        multi += 25;

    if((GET_CLASS(ch) == CLASS_SHADOW_DANCER) && (IS_DARK(ch->in_room) || IS_AFFECTED(ch, AFF_SHADOW_SPHERE)))
        multi += 50;

    if(IS_AFFECTED(ch, AFF_POISON))
        multi -= 100;

    if(!IS_NPC(ch)) {
        if( !IS_NPC(ch) && ROOM_FLAGGED(ch->in_room, ROOM_SUFFER) && ( GET_LEVEL(ch) < LVL_IMMORT ))
            multi -= 90;
        else if (!GET_COND(ch, THIRST) && IS_AMARA(ch))
            multi -= 90;
        else if (IS_IZARTI(ch) && IS_EVIL(ch))
            multi -= 90;
        else if (IS_DEMON(ch) && IS_GOOD(ch))
            multi -= 90;
    }

    if(GET_RACE(ch) == RACE_STROLL)
        multi += 100;

    /* Position calculations    */
    switch (GET_POS(ch)) {
        case POS_MEDITATING:
        case POS_SLEEPING:
            multi += 120;
            break;
        case POS_RESTING:
            multi += 60;
            break;
    }

    multi += (int)GET_SKILL(ch, SKILL_DEVOTION);

    // Don't let a player's regeneration completely stagnate...
    multi = MAX(multi, 25);
    return multi;
}
Esempio n. 12
0
void do_taste(struct char_data *ch, char *argument, int cmd)
{
	struct affected_type af;
	char arg[MAX_STRING_LENGTH];
	char buf[MAX_STRING_LENGTH];
	struct obj_data *temp;

	one_argument(argument,arg);

	if(!(temp = get_obj_in_list_vis(ch,arg,ch->carrying)))
	{
		act("You can't find it!",FALSE,ch,0,0,TO_CHAR);
		return;
	}

	if(temp->obj_flags.type_flag==ITEM_DRINKCON)
	{
		do_sip(ch,argument,0);
		return;
	}

	if(!(temp->obj_flags.type_flag==ITEM_FOOD))
	{
		act("Taste that?!? Your stomach refuses!",FALSE,ch,0,0,TO_CHAR);
		return;
	}

	act("$n tastes the $o", FALSE, ch, temp, 0, TO_ROOM);
	act("You taste the $o", FALSE, ch, temp, 0, TO_CHAR);

	gain_condition(ch,FULL,1);

	if(GET_COND(ch,FULL)>20)
		act("You are full.",FALSE,ch,0,0,TO_CHAR);

	if(temp->obj_flags.value[3]&&!IS_AFFECTED(ch,AFF_POISON)) /* The shit was poisoned ! */
	{
		act("Ooups, it did not taste good at all!",FALSE,ch,0,0,TO_CHAR);

		af.type = SPELL_POISON;
		af.duration = 2;
		af.modifier = 0;
		af.location = APPLY_NONE;
		af.bitvector = AFF_POISON;
		affect_to_char(ch,&af);
	}

	temp->obj_flags.value[0]--;

	if(!temp->obj_flags.value[0])	/* Nothing left */
	{
		act("There is nothing left now.",FALSE,ch,0,0,TO_CHAR);
		extract_obj(temp);
	}

	return;

}
Esempio n. 13
0
void do_krecall(CHAR_DATA * ch, char *argument)
{
	char buf[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	CHAR_DATA *mount;
	ROOM_INDEX_DATA *location;
	KINGDOM_DATA *kingdom;

	if(IS_NPC(ch) || (kingdom = get_kingdom(ch->pcdata->kingdom)) == &kingdom_default)
	{
		send_to_char("You have no kingdom!\n\r", ch);
		return;
	}

	act("$n's body flickers with green energy.", ch, 0, 0, TO_ROOM);
	act("Your body flickers with green energy.", ch, 0, 0, TO_CHAR);

	if((location = get_room_index(kingdom->recall)) == 0)
	{
		send_to_char("Your kingdom has no recall set.\n\r", ch);
		return;
	}

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

	if(IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL) || IS_AFFECTED(ch, AFF_CURSE))
	{
		send_to_char("You are unable to recall.\n\r", ch);
		return;
	}

	if((victim = ch->fighting) != 0)
	{
		if(number_bits(1) == 0)
		{
			WAIT_STATE(ch, 4);
			sprintf(buf, "You failed!\n\r");
			send_to_char(buf, ch);
			return;
		}
		sprintf(buf, "You recall from combat!\n\r");
		send_to_char(buf, ch);
		stop_fighting(ch, TRUE);
	}

	act("$n disappears.", ch, 0, 0, TO_ROOM);
	char_from_room(ch);
	char_to_room(ch, location);
	act("$n appears in the room.", ch, 0, 0, TO_ROOM);
	do_look(ch, "auto");

	if((mount = ch->mount) == 0)
		return;
	char_from_room(mount);
	char_to_room(mount, ch->in_room);
	return;
}
Esempio n. 14
0
void do_reveal(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *ich;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_MAGE))
  {
    send_to_char("Huh?!?.\n\r",ch);
    return;
  }
  if (ch->mana < 5000)
  {
    send_to_char("You don't have the mystical energies to do this.\n\r",ch);
    return;
  } 
  act( "$n mumles a few words, and you are suddenly blinded by a flash.", ch, NULL, NULL, TO_ROOM );   
  send_to_char( "You reveal everything hidden in the room.\n\r", ch );
  for ( ich = ch->in_room->people; ich != NULL; ich = ich->next_in_room )
  {
    if (ich==ch || ich->trust > 6) continue;
    affect_strip ( ich, gsn_invis );
    affect_strip ( ich, gsn_mass_invis );
    affect_strip ( ich, gsn_sneak );
    if (IS_SET(ich->affected_by, AFF_HIDE))      REMOVE_BIT(ich->affected_by, AFF_HIDE);
    if (IS_SET(ich->affected_by, AFF_INVISIBLE)) REMOVE_BIT(ich->affected_by, AFF_INVISIBLE);
    if (IS_SET(ich->affected_by, AFF_SNEAK))     REMOVE_BIT(ich->affected_by, AFF_SNEAK);
    if (IS_SET(ich->act, PLR_WIZINVIS))          REMOVE_BIT(ich->act, PLR_WIZINVIS);
    if (IS_SET(ich->act, AFF_HIDE))              REMOVE_BIT(ich->act, AFF_HIDE);
    if (IS_SET(ich->affected_by, AFF_SHIFT))     REMOVE_BIT(ich->affected_by, AFF_SHIFT);
    if (IS_SET(ich->extra, EXTRA_EARTHMELD))     REMOVE_BIT(ich->extra, EXTRA_EARTHMELD);
    if (IS_AFFECTED(ch,AFF_SHADOWPLANE)) REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
    if (IS_AFFECTED(ch, AFF_PEACE)) REMOVE_BIT(ch->affected_by, AFF_PEACE);
    if (IS_AFFECTED(ch,AFF_ETHEREAL)) REMOVE_BIT(ch->affected_by, AFF_ETHEREAL);

    if (IS_CLASS(ich, CLASS_DROW) && IS_SET(ich->newbits, NEW_DARKNESS))
    {
      REMOVE_BIT(ich->newbits, NEW_DARKNESS);
      REMOVE_BIT(ich->in_room->room_flags, ROOM_TOTAL_DARKNESS);
    }
    send_to_char("You are suddenly very visible.\n\r",ich);
  }
  ch->mana -= 5000;
  return;
}
Esempio n. 15
0
int move_gain( CHAR_DATA *ch )
{
    int gain;

    if (ch->in_room == NULL)
	return 0;

    if ( IS_NPC(ch) )
    {
	gain = ch->level;
    }
    else
    {
	gain = UMAX( 15, ch->level );

	switch ( ch->position )
	{
	case POS_SLEEPING: gain += get_curr_stat(ch,STAT_DEX);		break;
	case POS_RESTING:  gain += get_curr_stat(ch,STAT_DEX) / 2;	break;
	}

	if ( ch->pcdata->condition[COND_HUNGER]   == 0 )
	    gain /= 2;

	if ( ch->pcdata->condition[COND_THIRST] == 0 )
	    gain /= 2;
    }

    gain = gain * ch->in_room->heal_rate/100;

    if (ch->on != NULL && ch->on->item_type == ITEM_FURNITURE)
	gain = gain * ch->on->value[3] / 100;

    if ( IS_AFFECTED(ch, AFF_POISON) )
	gain /= 4;

    if (IS_AFFECTED(ch, AFF_PLAGUE))
        gain /= 8;

    if (IS_AFFECTED(ch,AFF_HASTE) || IS_AFFECTED(ch,AFF_SLOW))
        gain /=2 ;

    return UMIN(gain, ch->max_move - ch->move);
}
Esempio n. 16
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 );
}
Esempio n. 17
0
void spell_farsight( int sn, int level, Character *ch, void *vo,int target)
{
    if (IS_AFFECTED(ch,AFF_BLIND))
    {
        send_to_char("Maybe it would help if you could see?\n\r",ch);
        return;
    }
 
    do_scan(ch,target_name);
}
Esempio n. 18
0
/*
 * Attempt to remove bad spells (e.g. blind, poison etc.) from 'affected'. Returns TRUE if a
 * spell was cast (even if it failed), other wise FALSE.
 * @param mob the mobile
 */
static bool removeBadSpells(struct char_data *mob, struct char_data *affected) {
  bool doneCasting = FALSE;
  int i;

  for(i = 0; i < NUM_CURATIVE_SPELLS; i++)
    if(!doneCasting && IS_AFFECTED(affected, curative_spell_list[i].affect) && mob_cast(mob, affected, curative_spell_list[i].spell))
      doneCasting = TRUE;

  return doneCasting;
}
Esempio n. 19
0
void group_gain(struct char_data *ch, struct char_data *victim)
{
	char buf[256];
	int no_members, share;
	struct char_data *k;
	struct follow_type *f;

	if (!(k=ch->master))
		k = ch;


	if (IS_AFFECTED(k, AFF_GROUP) &&
	   (k->in_room == ch->in_room))
		no_members = 1;
	else
		no_members = 0;

	for (f=k->followers; f; f=f->next)
		if (IS_AFFECTED(f->follower, AFF_GROUP) &&
		   (f->follower->in_room == ch->in_room))
			no_members++;

	if (no_members >= 1)
		share = MIN(450000/no_members, (GET_EXP(victim)/3)/no_members);
	else
		share = 0;

	if (IS_AFFECTED(k, AFF_GROUP) &&
	   (k->in_room == ch->in_room)) {
		act("You receive your share of experience.", FALSE, k, 0, 0, TO_CHAR);
		gain_exp(k, share);
		change_alignment(k, victim);
	}

	for (f=k->followers; f; f=f->next) {
		if (IS_AFFECTED(f->follower, AFF_GROUP) &&
		   (f->follower->in_room == ch->in_room)) {
			act("You receive your share of experience.", FALSE, f->follower,0,0,TO_CHAR);
			gain_exp(f->follower, share);
			change_alignment(f->follower, victim);
		}
	}
}
Esempio n. 20
0
void cast_blindness( byte level, struct char_data *ch, char *arg, int type,
  struct char_data *tar_ch, struct obj_data *tar_obj )
{
	struct affected_type af;

  switch (type) {
    case SPELL_TYPE_SPELL:
			if ( IS_AFFECTED(tar_ch, AFF_BLIND) ){
				send_to_char("Nothing seems to happen.\r\n", ch);
				return;
			}
			spell_blindness(level,ch,tar_ch,0);
			break;
    case SPELL_TYPE_POTION:
			if ( IS_AFFECTED(ch, AFF_BLIND) )
				return;
			spell_blindness(level,ch,ch,0);
			break;
    case SPELL_TYPE_SCROLL:
         if (tar_obj) return;
         if (!tar_ch) tar_ch = ch;
			if ( IS_AFFECTED(ch, AFF_BLIND) )
				return;
			spell_blindness(level,ch,ch,0);
			break;
    case SPELL_TYPE_WAND:
         if (tar_obj) return;
			if ( IS_AFFECTED(ch, AFF_BLIND) )
				return;
			spell_blindness(level,ch,ch,0);
			break;
    case SPELL_TYPE_STAFF:
         for (tar_ch = world[ch->in_room].people ; 
              tar_ch ; tar_ch = tar_ch->next_in_room)
            if (tar_ch != ch) 
               if (!(IS_AFFECTED(tar_ch, AFF_BLIND)))
                  spell_blindness(level,ch,tar_ch,0);
         break;
    default : 
         log("Serious screw-up in blindness!");
         break;
	}
}
Esempio n. 21
0
void do_mpat( CHAR_DATA *ch, char *argument )
{
    char             arg[ MAX_INPUT_LENGTH ];
    ROOM_INDEX_DATA *location;
    ROOM_INDEX_DATA *original;
    CHAR_DATA       *wch;

    if ( !IS_NPC( ch ) )
    {
	typo_message( 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, "Mpat - Bad argument: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( ( location = find_location( ch, arg ) ) == NULL )
    {
        sprintf( log_buf, "Mpat - No such location: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    original = ch->in_room;
    char_from_room( ch );
    char_to_room( ch, location );
    interpret( ch, argument );

    /*
     * See if 'ch' still exists before continuing!
     * Handles 'at XXXX quit' case.
     */
    for ( wch = char_list; wch != NULL; wch = wch->next )
    {
	if ( wch == ch )
	{
	    char_from_room( ch );
	    char_to_room( ch, original );
	    break;
	}
    }

    return;
}
Esempio n. 22
0
void do_spiderform( CHAR_DATA *ch, char *argument ) 
{
	char arg[MAX_INPUT_LENGTH];
	char buf[MAX_STRING_LENGTH];
 
	argument = one_argument(argument,arg);

	if (IS_NPC(ch)) return;

	if (!IS_CLASS(ch, CLASS_DROW) ||!IS_SET(ch->pcdata->powers[1], DPOWER_SPIDERFORM))
	{send_to_char("Huh?\n\r", ch );
	return;}

	if (IS_AFFECTED(ch, AFF_POLYMORPH)) 
      {
	send_to_char("You can't spiderform while changed.\n\r", ch );
	return;
      }

      if (IS_SET(ch->newbits,NEW_DFORM))
      {
	sprintf(buf, "$n morphs back into %s.", GET_PROPER_NAME(ch));
        act(buf, ch, NULL, NULL, TO_ROOM);
        stc("You return to your normal form.\n\r", ch);
        free_string(ch->morph);
        ch->morph = str_dup("");
        ch->hitroll -= 400;
        ch->damroll -= 400;
        ch->armor   += 1000;
        REMOVE_BIT(ch->newbits,NEW_DFORM);
	REMOVE_BIT(ch->newbits,THIRD_HAND);
	REMOVE_BIT(ch->newbits,FOURTH_HAND);
        WAIT_STATE(ch, 7);
        return;   
      }

      else if (!IS_SET(ch->newbits,NEW_DFORM))
      {
	
	act("You mutate into a giant spider.",ch,NULL,NULL,TO_CHAR);
        act("$n mutates into a giant spider.",ch,NULL,NULL,TO_ROOM);
        sprintf(buf,"%s the giant mylochar",ch->name);
        free_string(ch->morph);
        ch->morph = str_dup(buf);
        ch->hitroll += 400;
        ch->damroll += 400;
        ch->armor   -= 1000;
        SET_BIT(ch->newbits,NEW_DFORM);
	SET_BIT(ch->newbits,THIRD_HAND);
	SET_BIT(ch->newbits,FOURTH_HAND);
	return;
    }

	return;
}
Esempio n. 23
0
struct char_data *find_hunted_char(int idnum)
{
  struct char_data *tmp;
  struct char_data *tmp_next;
  for (tmp = character_list; tmp; tmp = tmp_next) {
    tmp_next = tmp->next;
    if (GET_IDNUM(tmp) == idnum && !IS_AFFECTED(tmp, AFF_NOTRACK))
      return tmp;
  }
  return NULL;
}
Esempio n. 24
0
/* needless to ssay the code needs work to function normally */
bool dimd_can_see(int slev, struct char_data *o)
{
  if (!slev && IS_AFFECTED(o, AFF_INVISIBLE))
    return FALSE;
  
  if (o->invis_level && (o->invis_level - (LOW_IMMORTAL-1)) > slev)
    return FALSE;
  
  return TRUE;
  
}
Esempio n. 25
0
/* syntax : discharge
 * (drops all elementalshields in one BIG blast)
 */
void do_discharge (CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *vch;
  CHAR_DATA *vch_next;
  CHAR_DATA *mount;
  char buf1[MAX_STRING_LENGTH];
  char buf2[MAX_STRING_LENGTH];
  char buf3[MAX_STRING_LENGTH];
  int magic_power = ch->spl[RED_MAGIC] + ch->spl[BLUE_MAGIC] + ch->spl[GREEN_MAGIC] + ch->spl[PURPLE_MAGIC] + ch->spl[YELLOW_MAGIC];
  int dam;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_MAGE))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (ch->pcdata->powers[PINVOKE] < 4) /* 4 is just a test */
  {
    send_to_char("You don't have that invoke yet.\n\r",ch);
    return;
  }
  if (IS_ITEMAFF(ch, ITEMA_AFFENTROPY)) 
    magic_power +=100;
  if (IS_ITEMAFF(ch, ITEMA_MAGESHIELD))
  {
    REMOVE_BIT(ch->itemaffect, ITEMA_MAGESHIELD);
    for (vch = ch->in_room->people; vch != NULL; vch = vch_next)
    {
      vch_next = vch->next_in_room;
      if (vch != ch)
      {
        if (is_safe(ch,vch)) continue;
        if ((mount = ch->mount) != NULL)
          if (mount == vch) continue;
        dam = number_range(magic_power*7/2, magic_power*9/2) + ch->damroll;
        if (IS_AFFECTED(vch, AFF_SANCTUARY)) dam *= 0.5;
        sprintf(buf1,"$n's mystical shields explodes in a shower of flames striking $N [#C%d#n]",dam);
        sprintf(buf2,"Your mystical shields explodes in a shower of flames striking $N [#C%d#n]",dam);
        sprintf(buf3,"$n's mystical shields explodes in a shower of flames striking you [#C%d#n]",dam);
        act(buf1,ch,NULL,vch, TO_NOTVICT);
        act(buf2,ch,NULL,vch, TO_CHAR);
        act(buf3,ch,NULL,vch, TO_VICT);
        hurt_person(ch,vch,dam);
        if (vch->position > POS_STUNNED)
        {
          if (vch->fighting == NULL) set_fighting(vch, ch);
          if (ch->fighting == NULL) set_fighting(ch, vch);
        }
      }
    }
  }
  return;
}
Esempio n. 26
0
int calcMoveMulti(CharData *ch) {
    int multi = 100;
    
    if(IS_AFFECTED(ch, AFF_PLAGUE) > 0)
        multi -= 50;

    /* vampires barely regen vigor in sunlight, unless they're shadow sphered */
    if (!IS_NPC(ch) && IS_VAMPIRE(ch) && IS_SUNLIGHT(IN_ROOM(ch)) && !IS_AFFECTED(ch, AFF_SHADOW_SPHERE))
        multi -= 90;
    else if (IS_AFFECTED(ch, AFF_POISON))
        multi -= 90;
    else if ((GET_COND(ch, HUNGER) == 0 && !IS_VAMPIRE(ch)) || (GET_COND(ch, THIRST) == 0))
        multi -= 90;

    if( ROOM_FLAGGED(ch->in_room, ROOM_SUFFER) && ( GET_LEVEL(ch) < LVL_IMMORT ))
        multi -= 90;
    else if (!GET_COND(ch, THIRST) && IS_AMARA(ch))
        multi -= 90;
    else if (IS_IZARTI(ch) && IS_EVIL(ch))
        multi -= 90;
    else if (IS_DEMON(ch) && IS_GOOD(ch))
        multi -= 90;

    /* Position calculations    */
    switch (GET_POS(ch)) {
        case POS_MEDITATING:
        case POS_SLEEPING:
            multi += 120;
            break;
        case POS_RESTING:
            multi += 80;
            break;
        case POS_SITTING:
            multi += 40;	/* Divide by 8 */
            break;
    }

    // Don't let a player's regeneration completely stagnate...
    multi = MAX(multi, 25);
    return multi;
}
Esempio n. 27
0
char *check_cmd_flags( CHAR_DATA * ch, CMDTYPE * cmd )
{

   if( IS_AFFECTED( ch, AFF_POSSESS ) && IS_SET( cmd->flags, CMD_FLAG_POSSESS ) )
      snprintf( cmd_flag_buf, MAX_STRING_LENGTH, "You can't %s while you are possessing someone!\r\n", cmd->name );
   else if( ch->morph != NULL && IS_SET( cmd->flags, CMD_FLAG_POLYMORPHED ) )
      snprintf( cmd_flag_buf, MAX_STRING_LENGTH, "You can't %s while you are polymorphed!\r\n", cmd->name );
   else
      cmd_flag_buf[0] = '\0';

   return cmd_flag_buf;
}
Esempio n. 28
0
void do_mpat( CHAR_DATA *ch, char *argument )
{
    char             arg[ MAX_INPUT_LENGTH ];
    ROOM_INDEX_DATA *location;
    ROOM_INDEX_DATA *original;
    CHAR_DATA       *wch;

    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' || argument[0] == '\0' )
    {
	bug( "Mpat - Bad argument: vnum %d.", ch->pIndexData->vnum );
	return;
    }

    if ( ( location = find_location( ch, arg ) ) == NULL )
    {
	bug( "Mpat - No such location: vnum %d.", ch->pIndexData->vnum );
	return;
    }

    original = ch->in_room;
    char_from_room( ch );
    char_to_room( ch, location );
    interpret( ch, argument );

    /*
     * See if 'ch' still exists before continuing!
     * Handles 'at XXXX quit' case.
     */
    for ( wch = char_list; wch != NULL; wch = wch->next )
    {
	if ( wch == ch )
	{
	    char_from_room( ch );
	    char_to_room( ch, original );
	    break;
	}
    }

    return;
}
Esempio n. 29
0
bool MP_Commands(CHAR_DATA * ch)  /* Can MOBProged mobs
                                     * use mpcommands? TRUE if yes.
                                     * - Kahn */
{
    if(IS_SWITCHED(ch)) {
        return FALSE;
    }
    if(IS_NPC(ch) && ch->pIndexData->progtypes && !IS_AFFECTED(ch, AFF_CHARM)) {
        return TRUE;
    }
    return FALSE;
}
Esempio n. 30
0
void do_stuntubes( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;

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

    if (ch->pcdata->powers[CYBORG_BODY] < 5 || ch->pcdata->powers[CYBORG_LIMBS] < 5 )
    {
        send_to_char("You need level 5 implants on your legs and body to use this.\n\r",ch);
        return;
    }

    if (ch->move < 1000)
    {
        stc("You need 1000 move to do that.\n\r",ch);
        return;
    }

    if ( ( victim = ch->fighting ) == NULL )
    {
        send_to_char( "You aren't fighting anyone.\n\r", ch );
        return;
    }
    WAIT_STATE( ch,     12);
    ch->move -= 1000;

    one_hit(ch,victim,gsn_stuntubes,1);
    one_hit(ch,victim,gsn_stuntubes,1);
    one_hit(ch,victim,gsn_stuntubes,1);
    if (!IS_AFFECTED(victim, AFF_POISON))
        SET_BIT(victim->affected_by, AFF_POISON);
    if (!IS_AFFECTED(victim, AFF_FLAMING))
        SET_BIT(victim->affected_by, AFF_FLAMING);
    return;
}