Esempio n. 1
0
bool spell_innerflame_master(int sn, int level, CHAR_DATA *ch, void *vo, OBJ_DATA *obj)
{
    AFFECT_DATA         af;

    if (   is_affected(ch, gsn_innerflame_novice)
        || is_affected(ch, gsn_innerflame_intermediate)
        || is_affected(ch, gsn_innerflame_advanced)
        || is_affected(ch, gsn_innerflame_expert)
        || is_affected(ch, gsn_innerflame_master))
        return FALSE;

    af.type = sn;
    af.duration = 15;
    af.location = 0;
    af.modifier = 0;
    af.bitvector = 0;
    af.save = TRUE;
    affect_to_char(ch, &af);

    act("You concentrate on your inner flame.", ch, NULL, NULL, TO_CHAR);
    act("$n concentrates on $s inner flame.", ch, NULL, NULL, TO_ROOM);

    return TRUE;

}
Esempio n. 2
0
/* specjalne sprawdzanie affectow z zaklec*/
bool check_affect(CHAR_DATA *ch, CHAR_DATA *victim, int type, int spell)
{
    sh_int sn;

    if(type < 0 || type > MAX_SPELL_INFO)
        return FALSE;

    sn = si_spell_info[type][spell].sn;


    switch(type)
    {
    case DEF_ANTITANK_SELF:
    case DEF_ANTIMAGIC_SELF:
        return is_affected(ch, sn);
    case DEF_ANTITANK_OTHER:
    case DEF_ANTIMAGIC_OTHER:
    case OFF_ANTITANK:
    case OFF_ANTICASTER:
    case FRAGS://dotyczy poisona
        return is_affected(victim, sn);
    default:
        return FALSE;
    }

    return FALSE;
}
Esempio n. 3
0
void save_track_data(CHAR_DATA *ch, ROOM_INDEX_DATA *from_room,
		ROOM_INDEX_DATA *to_room, sh_int inout)
{
	//je¶li wy³±czone, to nie zapisujemy
	if(MAX_TRACK_LEN == 0)
		return;

	if (!ch)
		return;

	if (is_affected(ch, gsn_float) || is_affected(ch, gsn_fly))
		return;

	if (!from_room)
		return;

	if (!to_room)
		return;

	TRACK_DATA *td_last = (TRACK_DATA *) malloc(sizeof(*td_last));
    int vJak = 0;
    if(ch->mounting)
        vJak = 1;

    td_last->ch = ch;
    td_last->czas = current_time;
    td_last->jak = vJak;
    td_last->kierunek = get_door_index(from_room, to_room);
    td_last->previous = to_room->track_data;
    td_last->inout = inout;
    to_room->track_data = td_last;

	cleanup_track_data(to_room);
}
Esempio n. 4
0
int spell_ethereal_wolf_howl( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA  *victim = (CHAR_DATA *) vo;
    AFFECT_DATA af;
 
    if ( is_affected( victim, sn ) || is_affected( ch, sn ) )
    {
        return SKPELL_MISSED;
    }

    af.type      = sn;
    af.level     = level;
    af.duration  = level / 5;
    af.location  = APPLY_DAMROLL;
    af.modifier  = ( level / 5 ) * -1;
    af.bitvector = 0;
    affect_to_char( victim, &af );

    af.location  = APPLY_HITROLL;
    af.modifier  = ( level / 5 ) * -1;
    affect_to_char( victim, &af );

    af.location = APPLY_DAMROLL;
    af.modifier = level / 5;
    affect_to_char( ch, &af );

    af.location = APPLY_HITROLL;
    af.modifier	 = level / 5;
    affect_to_char( ch, &af );

    return SKPELL_NO_DAMAGE;
}
Esempio n. 5
0
/* specjalne sprawdzanie affectow z zaklec*/
bool check_chant_pray_affect(CHAR_DATA *ch, CHAR_DATA *victim, int type, int spell)
{
    sh_int sn;

    if( !ch->fighting )
        return TRUE;

    if(type < 0 || type > MAX_SPELL_INFO)
        return TRUE;

    sn = si_spell_info[type][spell].sn;


    switch(type)
    {
    case DEF_ANTITANK_SELF:
    case DEF_ANTIMAGIC_SELF:
        return is_affected(ch, sn);
    case DEF_ANTITANK_OTHER:
    case DEF_ANTIMAGIC_OTHER:
    case OFF_ANTITANK:
    case OFF_ANTICASTER:
        return is_affected(victim, sn);
    default:
        return FALSE;
    }

    return FALSE;
}
Esempio n. 6
0
bool check_ice_shield(CHAR_DATA *ch, CHAR_DATA *victim, int type, int spell)
{
    if( is_affected(ch, gsn_fireshield) )
        return TRUE;

    return is_affected(ch, gsn_iceshield);
}
Esempio n. 7
0
/*
 * A healer spell that will allow the healer to create a bind stone that will stay in the
 * room with some of their healing power imbued into it.  The bind stone will be an object
 * that can't be moved or sacrificed.  Only one can exist in an area.  It will have a certain
 * amount of charges that it can be used.  When a player touches it, they will be healed.
 * when the bind stone's magic is used up it will disappear into the ether.  The item won't
 * disappear with time however.. it must be used.  For now, this will not survive copyover's
 * or reboots.
 */
void spell_healers_bind(int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    OBJ_DATA *obj;
    OBJ_DATA *objSearch;
    int charges = 0;

    // First, let's see if there are any other bind stones in the area, if so, we
    // are not going to cast this.  These will not be in containers.
    for (objSearch = object_list; objSearch != NULL; objSearch = objSearch->next)
    {
        // Can't be in a null room
        if (objSearch->in_room != NULL)
        {
            // Only one per area at a time.
            if (objSearch->pIndexData->vnum == OBJ_VNUM_HEALERS_BIND
                && objSearch->in_room->area->vnum == ch->in_room->area->vnum)
            {
                send_to_char("A healer's bind stone already exists somewhere in this area...\r\n", ch);
                return;
            }
        }
    }

    // Base is level / 5
    charges = ch->level / 5;

    // +1 for bless
    if (is_affected(ch, gsn_bless))
    {
        charges += 1;
    }

    // +1 for enhanced recovery, the healer can then pass that along.
    if (is_affected(ch, gsn_enhanced_recovery))
    {
        charges += 1;
    }

    // Cut in half if these are the case..
    if (is_affected(ch, gsn_curse) || is_affected(ch, gsn_weaken))
    {
        charges = charges / 2;
    }

    obj = create_object(get_obj_index(OBJ_VNUM_HEALERS_BIND));
    obj->value[0] = charges;  // The number of charges
    obj->value[1] = 50;       // The amount it heals

    obj_to_room(obj, ch->in_room);
    act("$p slowly fades into existence.", ch, obj, NULL, TO_ROOM);
    act("$p slowly fades into existence.", ch, obj, NULL, TO_CHAR);

} // end spell_create_healers_bind
Esempio n. 8
0
/*
 * Enhanced recovery will allow the recipient to heal more on every tick.  Originally this
 * spell was written for another class (on 5/26/2000) but it fits better under a healer.
 */
void spell_enhanced_recovery(int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;
    AFFECT_DATA af;

    if (is_affected(victim, sn))
    {
        if (victim == ch)
        {
            // Remove the affect so it can be re-added to yourself
            affect_strip(victim, sn);
        }
        else
        {
            act("$N is already blessed with enhanced recovery.", ch, NULL, victim, TO_CHAR);
            return;
        }
    }

    af.where = TO_AFFECTS;
    af.type = sn;
    af.level = level;
    af.duration = (ch->level / 2);
    af.modifier = 0;
    af.location = APPLY_NONE;
    af.bitvector = 0;
    affect_to_char(victim, &af);

    act("$N has been blessed with an enhanced recovery.", victim, NULL, victim, TO_ROOM);
    send_to_char("You feel blessed with a enhanced recovery.\r\n", victim);

} // end spell_enhanced_recovery
Esempio n. 9
0
/*
 * Sense affliction will allow the healer to see an (Affliction) flag on a player when
 * they do a 'look' in the room if a player is afflicted by something the healer can
 * cure.  If the healer looks at the person specifically they will see everything they
 * are afflicted with that they can cure specifically.  The healer can cast this on
 * themselves but not others.  This has a long duration and is not dispelable.  I
 * suppose this could also have just been a skill.
 */
void spell_sense_affliction(int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;
    AFFECT_DATA af;

    if (is_affected(victim, sn))
    {
        // Remove the affect so it can be re-added to yourself
        affect_strip(victim, sn);
    }

    af.where = TO_AFFECTS;
    af.type = sn;
    af.level = level;
    af.duration = ch->level + (ch->level / 2);
    af.modifier = 0;
    af.location = APPLY_NONE;
    af.bitvector = 0;
    affect_to_char(victim, &af);

    send_to_char("Your senses for those afflicted are heightened.\r\n", victim);

    if (ch != victim)
    {
        act("$N's senses for those afflicted are heightened.", victim, NULL, victim, TO_ROOM);
    }

    return;

} // end spell_sense_affliction
Esempio n. 10
0
/*
 * Restore mental presence will allow the caster to remove any stun affect on a
 * character (from bash, etc.).  It will not be much use on themselves since they
 * have to be ablet to cast it and stun may stop that.  We will also have this spell
 * alleviate certain other affects like disorientation.
 */
void spell_restore_mental_presence(int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;

    if (IS_NPC(victim))
    {
        send_to_char("You cannot cast this spell on them.\r\n", ch);
        return;
    }

    // This is all the code needed, it will remove the stun state from the player.
    victim->daze = 0;

    // Disorientation isn't a spell, we aren't going to make a saves check but we will
    // add some fate to it.
    if (CHANCE(33))
    {
        if (is_affected(victim, gsn_disorientation))
        {
            affect_strip(victim, gsn_disorientation);
        }
    }

    send_to_char("Your mental presence has been restored.\r\n", victim);
    act("$n's mental presence has been restored.", victim, NULL, NULL, TO_ROOM);

} // end spell_restore_mental_presence
Esempio n. 11
0
/*
 * Spell to cure people affected by slow (haste does this also, but cleric and cleric
 * reclasses don't get haste (usually).  Healers get a +3 level bonus on their curative
 * spells.
 */
void spell_cure_slow(int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;

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

    if (check_dispel(level + 3, victim, gsn_slow))
    {
        send_to_char("Your no longer feel like you're moving slowly!\r\n", victim);
        act("$n is no longer moving slowly.", victim, NULL, NULL, TO_ROOM);
    }
    else
    {
        send_to_char("Spell failed.\r\n", ch);
    }

} // end spell_cure_slow
Esempio n. 12
0
/*
 * Allows a healer to remove a weaken spell specifically.  Healers get a +3 level
 * bonus on their curative spells.
 */
void spell_cure_weaken(int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;

    if (!is_affected(victim, gsn_weaken))
    {
        if (victim == ch)
        {
            send_to_char("You aren't afflicted by a magical weakeness.\r\n", ch);
        }
        else
        {
            act("$N doesn't appear to be afflicted by a magical weakness.", ch, NULL, victim, TO_CHAR);
        }
        return;
    }

    // Healer's get a casting bonus when removing certain spells.
    if (check_dispel(level + 3, victim, gsn_weaken))
    {
        send_to_char("Your no longer feel weak!\r\n", victim);
        act("$n is no longer weakened.", victim, NULL, NULL, TO_ROOM);
    }
    else
    {
        send_to_char("Spell failed.\r\n", ch);
    }

} // end spell_cure_weaken
Esempio n. 13
0
/*
 * A spell to help the healer resist some offensive magics against it.  Healer's don't
 * have many offensive weapons and thus are vulnerable characters, this should help
 * at least protect them a little more from spells.  This should be set to target
 * char_self so it can only be cast on the healer themselves.  We don't want to create
 * super chars with saves who make casters worthless.
 */
void spell_magic_resistance(int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;
    AFFECT_DATA af;

    if (is_affected(victim, sn))
    {
        affect_strip(victim, sn);
    }

    af.where = TO_AFFECTS;
    af.type = sn;
    af.level = level;
    af.duration = level;
    af.modifier = (ch->level / 10) * -1;
    af.location = APPLY_SAVES;
    af.bitvector = 0;
    affect_to_char(victim, &af);

    act("$N has an enhanced resistance to magic.", victim, NULL, victim, TO_ROOM);
    send_to_char("You feel an enhanced resistance to magic.\r\n", victim);

    return;

} // end magic resistance
Esempio n. 14
0
/*
 * Allows a healer to remove a deafen affect.  Healers get a +3 level
 * bonus on their curative spells.  This should remove ALL skills/spells
 * that add a deafen affect.
 */
void spell_cure_deafness(int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;

    if (!is_affected(victim, gsn_song_of_dissonance))
    {
        if (victim == ch)
        {
            send_to_char("You aren't currently deaf.\r\n", ch);
        }
        else
        {
            act("$N doesn't appear to be currently deaf.", ch, NULL, victim, TO_CHAR);
        }

        return;
    }

    // Healer's get a casting bonus when removing certain spells.
    if (check_dispel(level + 3, victim, gsn_song_of_dissonance))
    {
        act("$n is no longer deaf.", victim, NULL, NULL, TO_ROOM);
    }
    else
    {
        send_to_char("Spell failed.\r\n", ch);
    }

} // end spell_cure_deafness
Esempio n. 15
0
void Character::spell_charm_person (int sn, int lvl, void *vo)
{
  Character *victim = (Character *) vo;
  Affect af;

  if (victim == this) {
    send_to_char ("You like yourself even better!\r\n");
    return;
  }

  if (victim->is_affected (AFF_CHARM)
    || is_affected (AFF_CHARM)
    || lvl < victim->level || victim->saves_spell (lvl))
    return;

  if (victim->master)
    victim->stop_follower();
  victim->add_follower(this);
  af.type = sn;
  af.duration = number_fuzzy (lvl / 4);
  af.location = 0;
  af.modifier = 0;
  af.bitvector = AFF_CHARM;
  victim->affect_to_char(&af);
  act ("Isn't $n just so nice?", NULL, victim, TO_VICT);
  if (this != victim)
    send_to_char ("Ok.\r\n");
  return;
}
Esempio n. 16
0
/*
 * Allows a healer to boost the life force of a recipient (e.g. increase their
 * max health points and movement for a level's worth of ticks).  The modifier
 * (how much hp and move they receive) will be calculated by the healer's casting
 * level.  This cannot be cast on NPC's as a way to make them stronger.
 */
void spell_life_boost(int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;
    AFFECT_DATA af;
    int modifier = 0;

    // Not on NPC's
    if (IS_NPC(victim))
    {
        send_to_char("You failed.\r\n", ch);
        return;
    }

    if (is_affected(victim, sn))
    {
        if (victim == ch)
        {
            // Remove the affect so it can be re-added to yourself
            affect_strip(victim, sn);
        }
        else
        {
            act("$N is already affected by the increased vitality.", ch, NULL, victim, TO_CHAR);
            return;
        }
    }

    // Base is the players level
    modifier = ch->level;

    // If the player is casting it on themselves we'll give them a 12hp-13hp bonus at 51.  Healer's
    // aren't going to be huge player killers so why not.
    if (ch == victim)
    {
        modifier += ch->level / 4;
    }

    af.where = TO_AFFECTS;
    af.type = sn;
    af.level = level;
    af.duration = level;
    af.modifier = modifier;
    af.location = APPLY_HIT;
    af.bitvector = 0;
    affect_to_char(victim, &af);

    af.location = APPLY_MOVE;
    affect_to_char(victim, &af);

    act("$N has been vitalized.", victim, NULL, victim, TO_ROOM);
    send_to_char("You feel an increased vitality.\r\n", victim);

    return;

} // end spell_life_boost
Esempio n. 17
0
//unholy fury
bool check_unholy(CHAR_DATA *ch, CHAR_DATA *victim, int type, int spell)
{
    //TRUE to znaczy ze spela nie rzuci
    if ( is_affected(victim, gsn_unholy_fury) )
        return TRUE;

    if ( !is_undead(victim) || ch == victim )
        return TRUE;

    return FALSE;
}
Esempio n. 18
0
bool Drakes::HasStonesong(const CHAR_DATA & drake)
{
    // Verify that this is a drake
    if (!IS_NPC(&drake) || drake.pIndexData->vnum != MOB_VNUM_DRAKE)
        return false;

    // Check for a drake master present
    if (drake.master == NULL || drake.master->in_room != drake.in_room)
        return false;

    // Check for stonesong
    return is_affected(drake.master, gsn_conduitofstonesong);
}
Esempio n. 19
0
bool spell_ordainsanctum(int sn, int level, CHAR_DATA * ch, void * vo, int target)
{
    // Sanity check
    if (ch->in_room == NULL)
    {
        bug("Ordain sanctum called from null room", 0);
        return false;
    }

    // Check for cooldown
    if (is_affected(ch, sn))
    {
        send_to_char("You are not yet ready to ordain this ground.\n", ch);
        return false;
    }

    // Check for effect already present
    if (room_is_affected(ch->in_room, sn))
    {
        send_to_char("This place has already been ordained as a sanctum.\n", ch);
        return false;
    }

    // Check for annointing oil
    OBJ_DATA * obj(lookup_obj_extra_flag(ch, ITEM_ANNOINTINGOIL));
    if (obj == NULL)
    {
        send_to_char("You cannot ordain this place without holy oil.\n", ch);
        return false;
    }

    // Ordain the room
    act("You murmur a soft chant, pouring out $p as you do so.", ch, obj, NULL, TO_CHAR);
    act("$n murmurs a soft chant, pouring out $p as $e does so.", ch, obj, NULL, TO_ROOM);
    act("As the last of the oil is poured out, you sense a certain protective aura fill this place.", ch, NULL, NULL, TO_ALL);

    AFFECT_DATA af = {0};
    af.where    = TO_ROOM;
    af.type     = sn;
    af.level    = level;
    af.duration = (level / 12);
    affect_to_room(ch->in_room, &af);

    // Apply a cooldown
    af.duration = 14;
    affect_to_char(ch, &af);

    return true;
}
void look_room(struct char_data *ch, struct room_index_data *in_room) {
    if (!validate_look(ch)) {
	return;
    }

    if (in_room == NULL) {
	send_to_char("NOWHERE.", ch);
	return;
    }

    if (room_is_dark(ch, in_room) && !IS_SET(ch->act, PLR_HOLYLIGHT)) {
	send_to_char("It is pitch ```8black...`` \n\r", ch);
	show_char_to_char(in_room->people, ch);
	return;
    }


    send_to_char(in_room->name, ch);
    if ((IS_IMMORTAL(ch) && (IS_NPC(ch) || IS_SET(ch->act, PLR_HOLYLIGHT))) || IS_BUILDER(ch, in_room->area)) {
	printf_to_char(ch, " [`1Room `!%d``]", in_room->vnum);
    }

    send_to_char("\n\r", ch);
    if ((!IS_NPC(ch) && !IS_SET(ch->comm, COMM_BRIEF))) {
	send_to_char("  ", ch);
	send_to_char(in_room->description, ch);
    }

    send_to_char("\n\r", ch);

    if ((is_affected(ch, gsp_detect_magic) || IS_SET(ch->act, PLR_HOLYLIGHT))) {
	struct affect_data *paf;
	for (paf = in_room->affected; paf != NULL; paf = paf->next) {
	    send_to_char(room_affect(paf), ch);
	}
	send_to_char("\n\r", ch);
    }

    if (!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT))
	do_exits(ch, "auto");

    if (is_affected_room(in_room, gsp_faerie_fog))
	send_to_char("There is a `Ppurple haze`` floating throughout the room.\n\r", ch);

    show_list_to_char(in_room->contents, ch, false, false);
    show_char_to_char(in_room->people, ch);
    return;
}
Esempio n. 21
0
void do_drowfire(CHAR_DATA * ch, char *argument)
{
	AFFECT_DATA af;
	CHAR_DATA *victim;

	if (ch->race != RACE_DROW) {
		send_to_char(AT_GREY, "Drowfire by a non-drow?\n\r", ch);
		return;
	}

	if (argument[0] != '\0') {
		if (!(victim = get_char_room(ch, argument))) {
			send_to_char(C_DEFAULT, "They aren't here.\n\r", ch);
			return;
		}
	} else {
		if (!(victim = ch->fighting)) {
			send_to_char(C_DEFAULT,
				     "You aren't fighting anyone.\n\r", ch);
			return;
		}
	}
	if (is_affected(victim, gsn_drowfire))
		return;

	WAIT_STATE(ch, skill_table[gsn_drowfire].beats);
	af.type = gsn_drowfire;
	af.level = ch->level;
	af.duration = ch->level / 10;
	af.location = APPLY_AC;
	af.modifier = 5 * ch->level;
	af.bitvector = 0;
	affect_to_char(victim, &af);
	af.location = APPLY_HITROLL;
	af.modifier = 0 - ch->level / 5;
	af.bitvector = 0;
	affect_to_char(victim, &af);

	send_to_char(AT_PINK, "You are surrounded by a purple outline.\n\r",
		     victim);
	act(AT_PINK, "$n is surrounded by a purple outline.", victim, NULL,
	    NULL, TO_ROOM);
	if (!victim->fighting)
		set_fighting(victim, ch);

	return;
}
Esempio n. 22
0
/*
 * A healing spell that will return small bits of health over the period of a few ticks
 * outside of the normal tick cycle.  This will cost half as much as a heal (because it
 * can only be cast once and is spread out.  Players will get 10hp every half tick if
 * they are below their max health.
 */
void spell_vitalizing_presence(int sn, int level, CHAR_DATA *ch, void *vo, int target)
{
    CHAR_DATA *victim = (CHAR_DATA *)vo;
    AFFECT_DATA af;

    if (is_affected(victim, sn))
    {
        if (victim == ch)
        {
            // Remove the affect so it can be re-added to yourself
            affect_strip(victim, sn);
        }
        else
        {
            act("$N is already affected by the vitalizing presence.", ch, NULL, victim, TO_CHAR);
            return;
        }
    }

    af.where = TO_AFFECTS;
    af.type = sn;
    af.level = level;

    // Lasts longer on yourself
    if (ch == victim)
    {
        af.duration = 10;
    }
    else
    {
        af.duration = 5;
    }

    af.modifier = 0;
    af.location = APPLY_NONE;
    af.bitvector = 0;
    affect_to_char(victim, &af);

    act("$N is vitalized with a healing presence.", victim, NULL, victim, TO_ROOM);
    send_to_char("You are vitalized with a healing presence.\r\n", victim);

    return;

} // end spell_vitalizing_presence
Esempio n. 23
0
void do_pray( CHAR_DATA * ch, char * argument ) {
  if ( !IS_GOOD( ch ) ) {
    send_to_char( AT_BLUE, "Thalador forgives some of your sins.\n\r", ch );
    ch->alignment += 10;
  } else if ( !IS_NPC( ch ) && ch->pcdata->learned[ gsn_prayer ] < number_percent() ) {
    send_to_char( AT_BLUE, "Thalador smiles upon you, and sends you a gold coin.\n\r", ch );
    ch->money.gold += 1;
  } else if ( !is_affected( ch, gsn_prayer ) ) {
    AFFECT_DATA af;

    af.duration  = ch->level / 3;
    af.level     = ch->level;
    af.type      = gsn_prayer;
    af.bitvector = 0;

    af.location = APPLY_HIT;
    af.modifier = number_range( ch->level, ch->level * 2 );
    affect_to_char( ch, &af );

    af.location = APPLY_MANA;
    af.modifier = number_range( ch->level / 2, ch->level );
    affect_to_char( ch, &af );

    af.location = APPLY_INT;
    af.modifier = ( ( ch->level - 1 ) / 50 ) + 1;
    affect_to_char( ch, &af );

    af.location = APPLY_DEX;
    affect_to_char( ch, &af );

    send_to_char( AT_BLUE, "Thalador places his blessing upon you.\n\r", ch );
    update_skpell( ch, gsn_prayer );
  } else {
    send_to_char( AT_BLUE, "Thalador frowns at your greed.\n\r", ch );
    ch->alignment -= 10;
  }

  send_to_char( AT_GREY, "You fall to the ground, unconscious.\n\r", ch );
  act( AT_GREY, "$n falls to the ground, unconscious.", ch, NULL, NULL, TO_ROOM );
  STUN_CHAR( ch, 4, STUN_COMMAND );
  return;
}
Esempio n. 24
0
bool spell_hoarfrost(int sn, int level, CHAR_DATA * ch, void * vo, int target)
{
    // Sanity check
    if (ch->in_room == NULL || !ON_GROUND(ch))
    {
        send_to_char("There is no solid ground here to rime over.\n", ch);
        return false;
    }

    // Check for cooldown
    if (is_affected(ch, sn))
    {
        send_to_char("You are not prepared to conjure more hoarfrost yet.\n", ch);
        return false;
    }

    // Check for the room already having some
    if (room_is_affected(ch->in_room, sn))
    {
        send_to_char("This place is already coated in hoarfrost.\n", ch);
        return false;
    }

    act("You spin in a slow circle, chanting softly as a thin layer of ice coats the ground.", ch, NULL, NULL, TO_CHAR);
    act("$n spins in a slow circle, chanting softly as a thin layer of ice coats the ground.", ch, NULL, NULL, TO_ROOM);

    // Add the effect
    AFFECT_DATA af = {0};
    af.where    = TO_ROOM;
    af.type     = sn;
    af.level    = level;
    af.duration = (level / 10);
    affect_to_room(ch->in_room, &af);

    // Add a cooldown
    af.duration = 8;
    affect_to_char(ch, &af);

    return true;
}
Esempio n. 25
0
void do_pipe ( CHAR_DATA *ch, char *argument )
{
	OBJ_DATA * pObj;
	OBJ_DATA * qObj;
	char *pipe_name;
	char pipe_name_2[MAX_INPUT_LENGTH];
	int amount, range, weed_amount, weed_type, dex, wis, con;
	AFFECT_DATA *old_smoke, *old_poison;
	AFFECT_DATA new_smoke, poison;
	int dur = 1, old_dur = 0, old_level = 0, level = 1;

	char buf[ MAX_INPUT_LENGTH ];

	char arg1[ MAX_INPUT_LENGTH ];
	char arg2[ MAX_INPUT_LENGTH ];
	char arg3[ MAX_INPUT_LENGTH ];
	char arg4[ MAX_INPUT_LENGTH ];

	// mobom dziêkujemy bez komunikatu
	if ( IS_NPC( ch ) )
	{
		return ;
	}

    // w czasie walki dziêkujemy z komunikatem
    if ( ch->position == POS_FIGHTING || ch->fighting != NULL )
	{
		send_to_char( "Lepiej skup siê na walce.\n\r", ch );
		return;
    }

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

	pObj = get_obj_carry( ch, arg2, ch );

	if ( arg1[ 0 ] == '\0' )
	{
		send_to_char( "Co takiego chcesz zrobiæ z fajk±?\n\r", ch );
		send_to_char( "{R[PORADA]:{y 'Je¿eli nie wiesz, co mo¿esz, wpisz {Rhelp pipe{x / {Cpomoc fajka{x.{Y'{x\n\r", ch );
		return;
	}

	if ( !str_prefix( arg1, "smoke" ) || !str_prefix( arg1, "pal" ))
	{
		if ( arg2[ 0 ] == '\0' )
		{
			send_to_char( "Paliæ co?\n\r", ch );
			return ;
		}

		// je¿eli obiekt nieistnieje w inventory, to mo¿e kto¶ co¶ takiego trzyma

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			send_to_char( "Potrzebujesz fajki ¿eby paliæ ziele fajkowe.\n\r", ch );
			return ;
		}

		/*if ( ( pObj = get_obj_carry( ch, arg2, ch ) ) == NULL )
		{
			send_to_char( "Potrzebujesz fajki ¿eby paliæ ziele fajkowe.\n\r", ch );
			return ;
		}*/

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Potrzebujesz fajki ¿eby paliæ ziele fajkowe.\n\r", ch );
			return ;
		}

		/* Gdy fajka jest pusta... */
		if ( pObj->value[ 1 ] <= 0 )
		{
			act( "W $j nie ma niczego, co móg³by¶ paliæ! Jest pusta.", ch, pObj, NULL, TO_CHAR );
			act( "$n spogl±da z dziwnym smutkiem na $h.", ch, pObj, NULL, TO_ROOM );
			return ;
		}

		/* Gdy fajka jest zgaszona*/
		if ( pObj->value[ 0 ] == 0 )
		{
			act( "Przecie¿ $p jest zgaszona!", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		/* Flaga informujaca o tym, ze gracz sobie pociagnal dymka... */
		if ( !EXT_IS_SET( ch->act, PLR_SMOKED ) )
			EXT_SET_BIT( ch->act, PLR_SMOKED );

		if ( is_affected( ch, gsn_on_smoke ) )
		{
			old_smoke = affect_find( ch->affected, gsn_on_smoke );
			old_dur = old_smoke->duration;
			old_level = old_smoke->level;
			affect_strip( ch, gsn_on_smoke );
		}

		level = weed_table[ pObj->value[2] ].weed_affect[0];

		dur += old_dur;
		level += old_level;

		new_smoke.where = TO_AFFECTS;
		new_smoke.type = gsn_on_smoke;
		new_smoke.level = level;
		new_smoke.duration = UMIN( dur, number_range( 5, 7 ) );
		new_smoke.rt_duration = 0;
		new_smoke.location = APPLY_NONE;
		new_smoke.modifier = 0;
		new_smoke.bitvector = &AFF_NONE;

		if ( level > number_range( 5, 7 ) && weed_table[ pObj->value[2] ].weed_affect[0] && number_percent() < weed_table[ pObj->value[2] ].weed_affect[1] )
		{
			send_to_char( "\n\rZaczynasz czuæ siê jako¶ dziwnie. Przed oczyma zaczynaj± lataæ ci kolorowe plamki.\n\r", ch );
			act( "\n\r$n zaczyna wygl±dajaæ jako¶ dziwnie blado.", ch, pObj, NULL, TO_ROOM );
			if ( dice( 1, 2 ) == 1 )
				new_smoke.bitvector = &AFF_HALLUCINATIONS_NEGATIVE;
			else
				new_smoke.bitvector = &AFF_HALLUCINATIONS_POSITIVE;
		}
		new_smoke.visible = FALSE;
		affect_to_char( ch, &new_smoke, NULL, FALSE );

		if ( number_percent() < weed_table[ pObj->value[2] ].weed_affect[2] )
		{
			if( is_affected(ch,gsn_poison ))
			{
				old_poison = affect_find( ch->affected, gsn_poison );
				old_poison->duration += stat_throw(ch,STAT_CON) ? number_range(2,4) : number_range(4,8);
				if( old_poison->level < UMIN( weed_table[ pObj->value[2] ].weed_affect[0], 3) )
					old_poison->level = UMIN( weed_table[ pObj->value[2] ].weed_affect[0], 3);
				act( "$n jeszcze bardziej zielenieje na twarzy.", ch, pObj, NULL, TO_ROOM );
				send_to_char( "Czujesz siê jeszcze gorzej.\n\r", ch );
			}
			else
			{
				poison.where = TO_AFFECTS;
				poison.type = gsn_poison;
				poison.level = UMIN( weed_table[ pObj->value[2] ].weed_affect[0], 3);
				poison.duration = stat_throw(ch,STAT_CON) ? number_range(2,4) : number_range(4,8);
				poison.rt_duration = 0;
				poison.location = APPLY_NONE;
				poison.modifier = 0;
				poison.bitvector = &AFF_NONE;
				poison.visible = FALSE;
				affect_to_char( ch, &poison, NULL, FALSE );
				send_to_char( "Momentalnie zaczynasz czuæ siê jako¶ niedobrze. Bardzo niedobrze.\n\r", ch );
				act( "$n widocznie zielenieje na twarzy.", ch, pObj, NULL, TO_ROOM );
			}
		}

		/* Troche losowosci */
		range = number_range( 1, 9 );
		switch ( range )
		{
			case 1:
				act( "$n zaci±ga siê g³êboko $j.", ch, pObj, NULL, TO_ROOM );
				act( "Zaci±gasz siê g³êboko $j.", ch, pObj, NULL, TO_CHAR );
				break;
			case 2:
				act( "$n pyka sobie $h przez chwilê.", ch, pObj, NULL, TO_ROOM );
				act( "Pykasz sobie $h przez chwilê.", ch, pObj, NULL, TO_CHAR );
				break;
			case 3:
				act( "$n wci±ga gwa³townie dym z $f.", ch, pObj, NULL, TO_ROOM );
				act( "Wci±gasz gwa³townie dym z $f.", ch, pObj, NULL, TO_CHAR );
				break;
			case 4:
				act( "$n zaci±ga siê delikatnie $j.", ch, pObj, NULL, TO_ROOM );
				act( "Zaci±gasz siê delikatnie $j.", ch, pObj, NULL, TO_CHAR );
				break;
			case 5:
				act( "Widzisz jak $n zaci±ga siê lekko $j.", ch, pObj, NULL, TO_ROOM );
				act( "Zaci±gasz siê lekko $j.", ch, pObj, NULL, TO_CHAR );
				break;
			case 6:
				act( "Dostrzegasz, jak $n z wpraw± zaci±ga siê dymkiem z $f.", ch, pObj, NULL, TO_ROOM );
				act( "Z wielk± wpraw± zaci±gasz siê dymkiem z $f.", ch, pObj, NULL, TO_CHAR );
				break;
			case 7:
				act( "$n jakby od niechcenia pali przez chwilê swoj± $h.", ch, pObj, NULL, TO_ROOM );
				act( "Przez chwilkê machinalnie palisz sobie swoj± $h.", ch, pObj, NULL, TO_CHAR );
				break;
			case 8:
				act( "$n z u¶miechem kurzy sobie $h.", ch, pObj, NULL, TO_ROOM );
				act( "Kurzysz sobiê $h, u¶miechaj±c siê przy tym b³ogo.", ch, pObj, NULL, TO_CHAR );
				break;
			default:
				act( "$n pali sobie przez chwilkê $h.", ch, pObj, NULL, TO_ROOM );
				act( "Palisz sobie przez chwilkê $h.", ch, pObj, NULL, TO_CHAR );
				break;
		}

		amount = number_range( 1, 3 ); // moze sie palic szybciej, lub wolniej (o 1, 2 lub o 3)
		if ( pObj->value[ 0 ] == 1 )     // sprawdzamy czy fajeczka jest zapalona
		{
			pObj->value[ 1 ] -= amount; // wypalamy zawartosc fajeczki
			//pObj->short_descr = capitalize(pObj->short_descr );
			amount = number_range( 1, 7 );
			switch ( amount )
			{
				case 1:
					act( "Nad $j trzyman± przez $z unosi siê w±ska stru¿ka dymu.", ch, pObj, NULL, TO_ROOM );
					act( "Nad $j unosi siê w±ska stru¿ka dymu.", ch, pObj, NULL, TO_CHAR );
					break;
				case 2:
					act( "Nad $j $z unosz± siê ma³e, ciemne chmurki dymu.", ch, pObj, NULL, TO_ROOM );
					act( "Nad $j unosz± siê ma³e, ciemne chmurki dymu.", ch, pObj, NULL, TO_CHAR );
					break;
				case 3:
					act( "Widzisz jak w $f $z tl± siê ma³e, jasne iskierki.", ch, pObj, NULL, TO_ROOM );
					act( "Widzisz kilka ma³ych, jasnych iskierek tl±cych siê w $k.", ch, pObj, NULL, TO_CHAR );
					break;
				case 4:
					act( "Dostrzegasz, ¿e nad $f trzyman± przez $z unosi siê gêsta smuga dymu.", ch, pObj, NULL, TO_ROOM );
					act( "Dosrzegasz unosz±c± siê nad $f gêst± smugê dymu.", ch, pObj, NULL, TO_CHAR );
					break;
				case 5:
					act( "S³yszysz jak zawarto¶æ $f $z lekko syczy tl±c siê.", ch, pObj, NULL, TO_ROOM );
					act( "S³yszysz jak zawarto¶æ $f lekko syczy tl±c siê.", ch, pObj, NULL, TO_CHAR );
					break;
				case 6:
					act( "Czujesz delikatny aromat jakoby zio³owego dymu, bij±cy od $z i jego $f.", ch, pObj, NULL, TO_ROOM );
					act( "Czujesz bij±cy od $f lekki, jakby zio³owy aromat.", ch, pObj, NULL, TO_CHAR );
					break;
				default:
					act( "Zawarto¶æ $f nale¿±cej do $z tli siê lekko.", ch, pObj, NULL, TO_ROOM );
					act( "Zawarto¶æ $f tli siê lekko.", ch, pObj, NULL, TO_CHAR );
					break;
			}

			if ( pObj->value[ 1 ] <= 0 )
			{
				act( "Ostatnie, tl±ce siê iskierki gasn±, kiedy wypali³a siê ca³a zawarto¶æ $f.", ch, pObj, NULL, TO_CHAR );
				act( "Widzisz jak $p $z ga¶nie z lekkim sykiem.", ch, pObj, NULL, TO_ROOM );
				pObj->value[ 0 ] = 0;
				pObj->value[ 1 ] = 0;
				pObj->value [ 2 ] = 0;
			}
		}
		return ;
	}


	if ( !str_prefix( arg1, "exhale" ) || !str_prefix( arg1, "wydech" ))
	{
		// Potrzebne staty do testow na 'triki'...
		dex = get_curr_stat_deprecated(ch,STAT_DEX);
		con = get_curr_stat_deprecated(ch,STAT_CON);
		wis = get_curr_stat_deprecated(ch,STAT_WIS);

		/* Zeby "wydychac" flaga palenia musi byc nalozona na gracza - sprawdzanie */
		if ( !EXT_IS_SET( ch->act, PLR_SMOKED ) )
		{
			send_to_char( "Jak chcesz to zrobiæ? Najpierw musisz zaci±gn±æ siê dymem!\n\r", ch );
			return ;
		}

		/* Pomocy!
		if ( !str_prefix( arg2, "help" ) || !str_prefix( arg2, "pomoc" ))
		{
			act( "{R[PORADA]:{x\n\r", ch, NULL, NULL, TO_CHAR );
			act( "{YZanim bêdziesz <&móg³/mog³a/mog³o> wydychaæ dym musisz paliæ fajkê.{x", ch, NULL, NULL, TO_CHAR );
			act( "{YPo tym jak skoñczysz rozkoszowaæ siê bogatym smakiem ziela fajkowego...{x", ch, NULL, NULL, TO_CHAR );
			act( "{YMo¿esz wydychaæ tytoniowy dym na ró¿ne sposoby, ¿eby uatrakcyjniæ palenie.{x", ch, NULL, NULL, TO_CHAR );
			act( "{YSpróbuj tych oto typów wydechu, aby zadziwiæ znajomych:{x \n\r", ch, NULL, NULL, TO_CHAR );
			act( "Angielskie komendy: RINGS, LINES, SPHERE, WEB, PHOENIX, HORNS, NAME", ch, NULL, NULL, TO_CHAR );
			act( "Polskie komendy: KO£A, LINIE, KULA, SIEÆ, FENIKS, ROGI, IMIÊ\n\r", ch, NULL, NULL, TO_CHAR );
			act( "\n\r{YSk³adnia angielska: {Gpipe exhale <nazwa figury>{x.", ch, NULL, NULL, TO_CHAR );
			act( "{YSk³adnia polska: {Gfajka wydech <nazwa figury>{x.\n\r", ch, NULL, NULL, TO_CHAR );
			return ;
		}*/

		if ( arg2[ 0 ] == '\0' )
		{
			switch ( number_range ( 1, 5 ) )
			{
				case 1:
					act( "$n wydycha ustami ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Wydychasz ustami ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				case 2:
					act( "$n wydycha nosem ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Wydychasz nosem ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				case 3:
					act( "$n spokojnie wydycha ustami ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Spokojnie wydychasz ustami ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				case 4:
					act( "$n spokojnie wydycha nosem ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Spokojnie wydychasz nosem ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				default:
					act( "$n wydycha ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Wydychasz ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
			}
		}
		else if ( !str_prefix( arg2, "ko³a" ) || !str_prefix( arg2, "rings" ) )
		{
			if ( dice( 2, dex - 10 ) >= 4 && dice( 2, con - 6 ) > 6 )
			{
				act( "$n niespodziewanie wypuszcza z ust kilka du¿ych, zadziwiaj±co okr±g³ych kó³ z dymu, które uk³adaj± siê w ¶mieszny tunel zawieszony w powietrzu!", ch, NULL, NULL, TO_ROOM );
				act( "Wypuszczasz z ust kilka du¿ych, zadziwiaj±co okr±g³ych kó³ z dymu, które uk³adaj± siê w ¶mieszny tunel zawieszony w powietrzu!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 4 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie ko³a, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kilka kszta³tnych kó³, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "linie" ) || !str_prefix( arg2, "lines" ))
		{
			if ( dice( 2, dex - 10 ) > 5 && dice( 2, con - 8 ) >= 5 )
			{
				act( "$n wydycha d³ug± smugê dymu w kszta³cie piêknej, prostej linii, zdaj±c± siê pi±æ w kierunku nieba!", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz d³ug± smugê dymu w kszta³cie piêknej, prostej linii, zdaj±c± siê pi±æ w kierunku nieba!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 5 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n z gracj± zaczyna wypuszczaæ z ust kilka chmurek dymu, które niespodziewanie szybko rozp³ywaj± siê w powietrzu.", ch, pObj, NULL, TO_ROOM );
						act( "W skupieniu wypuszczasz z ust kilka chmurek dymu, te jednak rozp³ywaj± siê szybko w powietrzu zanim zd±zy³y siê uformowaæ w jaki¶ kszta³t.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust prost± liniê dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "kula" ) || !str_prefix( arg2, "sphere" ))
		{
			if ( dice( 2, dex - 5 ) >= 7 && dice( 3, con - 2 ) > 15 )
			{
				act( "$n wypuszcza z ust jedn±, niesamowicie okr±g³a, chmurê dymu w kszta³cie idealnej kuli!", ch, NULL, NULL, TO_ROOM );
				act( "Wypuszczasz z ust du¿±, niesamowicie okr±g³±, chmurê dymu w kszta³cie idealnej kuli!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 5 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie kuli, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n nagle zaczyna kaszlaæ dymem, a dym który ulatuje z jego ust tworzy dziwn± chmurkê.", ch, pObj, NULL, TO_ROOM );
						act( "Niespodziewanie co¶ ci nie wychodzi, krztusisz siê i kaszlaj±c panicznie wypuszczasz z ust resztki dymu.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kulê dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "sieæ" ) || !str_prefix( arg2, "web" ))
		{
			if ( dice( 2, dex - 5 ) >= 15 && dice( 2, con - 8 ) > 6 )
			{
				act( "$n wydycha kilkana¶cie cieniutkich, zwiewnych pasemek dymu, które niespodziewanie ³±cz± siê tworz±c delikatn±, prawie pajêcz±, sieæ w powietrzu!", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz kilkana¶cie cieniutkich, zwiewnych pasemek dymu, które niespodziewanie ³±cz± siê tworz±c delikatn±, prawie pajêcz±, sieæ w powietrzu!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 5 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie kuli, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n wydycha szybk± seriê w±skich dymków, które wydaj± siê pe³zaæ w powietrzu jak niepos³usze robaczki, szybko rozp³ywaj±ce siê w powietrzu.", ch, pObj, NULL, TO_ROOM );
						act( "Szybko wydychasz seriê w±skich dymków chc±c z nich uformowaæ pajêczynê, te jednak szybko rozp³ywaj± siê w powietrzu.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust seriê dymków, jednak nie udaje ci siê, a sam dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "feniks" ) || !str_prefix( arg2, "phoenix" ) || !str_prefix( arg2, "fenix" ) )
		{
			if ( dice( 2, dex - 10 ) >= 8 && dice( 2, con - 10 ) >= 8 && dice( 2, wis - 10 ) >= 5 )
			{
				act( "$n wydycha serie ma³ych chmurek dymu, które na chwilê uk³adaj± siê w wizerunek feniksa, tylko po to, aby chwilê pó¼niej rozp³ynê³y siê, niczym proch.", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz serie ma³ych chmurek dymu, które na chwilê uk³adaj± siê w wizerunek feniksa, tylko po to, aby chwilê pó¼niej rozp³ynê³y siê, niczym proch.", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 7 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n w wielkim skupieniu wydycha kilkana¶cie dymków, które zaczynaj± uk³adaæ siê w powietrzu w co¶ przypominaj±cego hybrydê szczura z ludzkimi nogami... Czy to by³o zamierzone?", ch, pObj, NULL, TO_ROOM );
						act( "W wielkim skupieniu wydychasz kilkana¶cie dymków, które niespodziewanie zamiast feniksa uk³adaj± siê w co¶ przypominaj±cego po³±czenie szczura z ludzkimi nogami! Okropne.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 5:
						act( "$n, z grymasem na twarzy, wypuszcza z ust kilkana¶cie dymków, które uk³adaj± siê w powietrzu w jaki¶ dziwny ptakopodobny twór, wygl±daj±cy dosyæ ohydnie.", ch, pObj, NULL, TO_ROOM );
						act( "Czuj±c, ¿e co¶ pójdzie ¼le wypuszczasz z ust kilkana¶cie dymków, które uk³adaj± siê w powietrzu w jaki¶ bezkszta³tny, ptakopodobny twór.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 6:
						act( "$n, z wyrazem pewno¶ci siebie na twarzy, wydycha seriê ma³ych dymków, które nagle ³±cz± siê w powietrzu tworz±c pewien du¿y, oble¶ny kszta³t... Hmm, to ciekawe. K±tem oka widzisz, ¿e $n siê rumieni na widok swojego dzie³a.", ch, pObj, NULL, TO_ROOM );
						act( "Wypuszczasz z ust kilkana¶cie ma³ych dymków, które nagle ³±cz± siê w powietrzu, tworz±c naprawdê du¿y, oble¶ny kszta³t. Chyba siê zaraz spalisz ze wstydu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kilkana¶cie dymków, jednak nie udaje ci siê, a sam dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "rogi" ) || !str_prefix( arg2, "horns" ))
		{
			if ( dice( 2, dex - 10 ) >= 9 && dice( 2, con - 6 ) >= 10 )
			{
				act( "$n wydycha dwie grube smugi dymu, które uk³adaj± siê nad $m niczym para wielkich rogów!", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz dwie grube smugi dymu, które uk³adaj± sie nad tob± niczym para wielkich rogów!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 4 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust prost± liniê dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "imiê" ) || !str_prefix( arg2, "name" ))
		{
			if ( dice( 2, dex - 10 ) >= 8 && dice( 2, con - 8 ) >= 9 && dice( 2, wis - 10 ) > 6 )
			{
				act( "$n wypuszcza z ust kilkana¶cie ma³ych dymków, które niespodziewanie tworz± w powietrzu napis '$n'! Niesamowite!", ch, NULL, NULL, TO_ROOM );
				act( "Wypuszczasz z ust kilkana¶cie ma³ych dymków, które niespodziewanie tworz± w powietrzu napis '$n'! ¦wietnie!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 6 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n, z wyrazem pewno¶ci siebie na twarzy, wydycha seriê ma³ych dymków, które nagle ³±cz± siê w powietrzu tworz±c pewien du¿y, oble¶ny kszta³t... Hmm, to ciekawe. K±tem oka widzisz, ¿e $n siê rumieni na widok swojego dzie³a.", ch, pObj, NULL, TO_ROOM );
						act( "Wypuszczasz z ust kilkana¶cie ma³ych dymków, które nagle ³±cz± siê w powietrzu, tworz±c naprawdê du¿y, oble¶ny kszta³t. Chyba siê zaraz spalisz ze wstydu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 5:
						print_char( ch, "Wydychasz w wielkim skupieniu kilkana¶cie szarych dymków, które niespodziewanie tworz± w powietrzu bezsensowny napis '%s'!", gen_random_str( 4, 8 ) );
						sprintf( buf, "$n wydycha w wielkim skupieniu kilkana¶cie szarych dymków, które niespodziewanie tworz± w powietrzu bezsensowny napis '%s'!\n\r", gen_random_str( 4, 8 ) );
						act( buf, ch, NULL, NULL, TO_ROOM );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kilka dziwnych chmurek dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else
		{
			send_to_char( "Huh?! Nie znasz takiej sztuczki!\n\r", ch );
			return;
		}
	}


	// Nabijanie fajki
	if ( !str_prefix( arg1, "tamp" ) || !str_prefix( arg1, "nabij" ))
	{
		// Seria zabezpieczen...
		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz nabiæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz nabijaæ jedynie fajki!\n\r", ch );
			return ;
		}

		if ( ( qObj = get_obj_carry( ch, arg3, ch ) ) == NULL )
		{
			act( "Czym chcesz nabiæ $h?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( qObj->item_type != ITEM_WEED )
		{
			pipe_name = capitalize( pObj->name4 );
			sprintf( pipe_name_2, "%s mo¿esz nabiæ jedynie jakim¶ rodzajem ziela.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
		}
		else if ( pObj->value[ 0 ] == 1 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest zapalona, nie mo¿esz jej teraz nabijaæ!", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else if ( pObj->value[ 1 ] > 0 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest ju¿ czym¶ nabita. Przed ponownym nabiciem opró¿nij j±.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else
		{
			// Nabijanie fajki, przepisywanie wartosci ziela do fajeczki.
			weed_amount = qObj->value [ 0 ];
			weed_type = qObj->value [ 1 ];
			pObj->value [ 1 ] = weed_amount;
			pObj->value [ 2 ] = weed_type;
			print_char( ch, "Nabijasz %s %s.\n\r", pObj->name4, qObj->name5 );
			sprintf( buf, "$n nabija %s %s.\n\r", pObj->name4, qObj->name5 );
			act( buf, ch, NULL, NULL, TO_ROOM );
			extract_obj( qObj );
			return ;
		}


	}

	// zapalanie
	if ( !str_prefix( arg1, "light" ) || !str_prefix( arg1, "zapal" ))
	{
		pObj = get_obj_carry( ch, arg2, ch );

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz zapaliæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz zapalaæ jedynie fajki!\n\r", ch );
			return ;
		}
		else if ( pObj->value[ 0 ] == 1 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest ju¿ zapalona.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else if ( pObj->value[ 2 ] == 4 )
		{
			act( "Zawarto¶æ $f jest mokra! Nie dasz rady tego zapaliæ.", ch, pObj, NULL, TO_CHAR );
			act( "Lepiej wyczy¶æ $h i nape³nij j± czym¶ suchym, najlepiej zielem fajkowym.", ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else
		{
			pObj->value [ 0 ] = 1;
			act( "Zapalaj±c $h zaczynasz czuæ przyjemny, delikatny zapach palonego ziela.", ch, pObj, NULL, TO_CHAR );
			act( "$n zapala $h. Czujesz jak w powietrzu zaczyna unosiæ siê lekki zapach palonego ziela.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
	}

	// gaszenie
	if ( !str_prefix( arg1, "extinguish" ) || !str_prefix( arg1, "zga¶" ))
	{

		/*if ( ( pObj = get_obj_carry( ch, arg2, ch ) ) == NULL )
		{
			act( "Co chcesz zgasiæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}*/

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz zgasiæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz gasiæ jedynie fajki!\n\r", ch );
			return ;
		}
		else if ( pObj->value[ 0 ] == 0 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest ju¿ zgaszona.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else
		{
			pObj->value [ 0 ] = 0;
			act( "Gasz±c $h widzisz jak ostatnie iskierki ognia bledn± i znikaj±.", ch, pObj, NULL, TO_CHAR );
			act( "$n gasi $h.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
	}

	// czyszczenie / opró¿nianie
	if ( !str_prefix( arg1, "clean" ) || !str_prefix( arg1, "wyczy¶æ" ))
	{

		/*if ( ( pObj = get_obj_carry( ch, arg2, ch ) ) == NULL )
		{
			act( "Co chcesz wyczy¶ciæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}*/

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz wyczy¶ciæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz czy¶ciæ jedynie fajki!\n\r", ch );
			return ;
		}
		else if ( pObj->value[ 0 ] == 1 )
		{
			act( "Mo¿e lepiej najpierw zga¶ $h?", ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else if ( pObj->value[ 1 ] == 0 )
		{
			act( "Ogl±dasz z dum± $h, po czym pucujesz j± dok³adnie rêkawem. Teraz jest naprawdê czysta!", ch, pObj, NULL, TO_CHAR );
			act( "$n z dum± pucuje $h, u¶miechaj±c siê przy tym tajemniczo.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
		else
		{
			pObj->value [ 1 ] = 0;
			pObj->value [ 2 ] = 0;
			act( "Wysypujesz zawarto¶æ $f. Teraz jest pusta.", ch, pObj, NULL, TO_CHAR );
			act( "$n wysypuje zawarto¶æ $f.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
	}

	send_to_char( "Huh?\n\r", ch );
	return;
}
Esempio n. 26
0
void do_quit( CHAR_DATA *ch, char *argument )
{
    DESCRIPTOR_DATA *d;
    char buf[MAX_INPUT_LENGTH];

    if ( IS_NPC(ch) )
	return;

    if ( check_fighting( ch ) )
    {
	send_to_char( "No way! You are fighting.\n\r", ch );
	return;
    }

    if ( ch->position  < POS_STUNNED  )
    {
	send_to_char( "You're not DEAD yet.\n\r", ch );
	return;
    }

    if ( is_affected( ch, gsn_noquit ) && !IS_IMMORTAL( ch ) )
    {
	send_to_char("You are a bit too restless to quit just yet.\n\r", ch );
	return;
    }

    if ( ch->in_room && !IS_SET( ch->in_room->room_flags, ROOM_RENT )
    && !IS_IMMORTAL( ch ) )
    {
        /* Urik Tavern special tell. */

        if ( ch->in_room == get_room_index( ROOM_VNUM_TEMPLE ) )
        {
            send_to_char("You can't quit here.\n\rTry going west, then quit.\n\r", ch );
            return;
        }

	send_to_char("You can't quit here.\n\r", ch );
	return;
    }
    sprintf(buf, "%s",(char *) ctime( &current_time ) );
    ch->time = buf;
    send_to_char( 
	"Farewell.\n\r",
	ch );
    if (!IS_SET(ch->act, PLR_WIZINVIS) ){
    act( "$n departs from the area.", ch, NULL, NULL, NULL, NULL, TO_ROOM, SENSE_SIXTH );
    
    }
    sprintf( log_buf, "%s has quit.", ch->name );
    log_string( log_buf );

    /*
     * After extract_char the ch is no longer valid!
     */
  //  save_char_obj( ch );
  //  d = ch->desc;
  //  extract_char( ch, TRUE );
    save_char_obj( ch );
    d = ch->desc;
    extract_char( ch, TRUE );
    if ( d != NULL )
        close_socket( d );

    
/* New quit code, needs a lot of working, causing wierd bugs. */

   /* if ( d != NULL )
    {
        extern char *help_greeting;
        write_to_buffer(d, help_greeting, 0 );
        d->connected = CON_MAIN_MENU;
        return;
    }
*/
    return;
}
Esempio n. 27
0
void Character::update() {
    AFFECT_DATA *paf;
    AFFECT_DATA *paf_next;

    if ( this->desc && this->desc->connected == CON_PLAYING )
        send_to_char("\n\r",this);

    if ( this->position >= POS_STUNNED )
    {
        if ( this->hit  < this->max_hit )
            this->hit  += this->hit_gain();
        else
            this->hit = this->max_hit;

        if ( this->mana < this->max_mana )
            this->mana += this->mana_gain();
        else
            this->mana = this->max_mana;

        if ( this->move < this->max_move )
            this->move += this->move_gain();
        else
            this->move = this->max_move;
    }

    if ( this->position == POS_STUNNED )
        update_pos( this );

    for ( paf = this->affected; paf != NULL; paf = paf_next )
    {
        paf_next	= paf->next;
        if ( paf->duration > 0 )
        {
            paf->duration--;
            if (number_range(0,4) == 0 && paf->level > 0)
                paf->level--;  /* spell strength fades with time */
        }
        else if ( paf->duration < 0 )
            ;
        else
        {
            if ( paf_next == NULL
                    ||   paf_next->type != paf->type
                    ||   paf_next->duration > 0 )
            {
                if ( paf->type > 0 && skill_table[paf->type].msg_off )
                {
                    send_to_char( skill_table[paf->type].msg_off, this );
                    send_to_char( "\n\r", this );
                }
            }

            affect_remove( this, paf );
        }
    }

    /*
     * Careful with the damages here,
     *   MUST NOT refer to ch after damage taken,
     *   as it may be lethal damage (on NPC).
     */

    if (is_affected(this, gsn_plague) && this != NULL)
    {
        if (this->in_room == NULL)
            return;

        ::act("$n writhes in agony as plague sores erupt from $s skin.",
                this,NULL,NULL,TO_ROOM);
        send_to_char("You writhe in agony from the plague.\n\r",this);

        AFFECT_DATA *af;
        for ( af = this->affected; af != NULL; af = af->next )
        {
            if (af->type == gsn_plague)
                break;
        }

        if (af == NULL)
        {
            REMOVE_BIT(this->affected_by,AFF_PLAGUE);
            return;
        }

        if (af->level == 1)
            return;

        AFFECT_DATA plague;
        plague.where		= TO_AFFECTS;
        plague.type 		= gsn_plague;
        plague.level 		= af->level - 1;
        plague.duration 	= number_range(1,2 * plague.level);
        plague.location		= APPLY_STR;
        plague.modifier 	= -5;
        plague.bitvector 	= AFF_PLAGUE;

        for ( Character* vch = this->in_room->people; vch != NULL; vch = vch->next_in_room)
        {
            if (!saves_spell(plague.level - 2,vch,DAM_DISEASE)
                    &&  !IS_IMMORTAL(vch)
                    &&  !IS_AFFECTED(vch,AFF_PLAGUE) && number_bits(4) == 0)
            {
                send_to_char("You feel hot and feverish.\n\r",vch);
                ::act("$n shivers and looks very ill.",vch,NULL,NULL,TO_ROOM);
                affect_join(vch,&plague);
            }
        }

        int dam = UMIN(this->level,af->level/5+1);
        this->mana -= dam;
        this->move -= dam;
        damage_old( this, this, dam, gsn_plague,DAM_DISEASE,FALSE);
    }
    else if ( IS_AFFECTED(this, AFF_POISON) && this != NULL
            &&   !IS_AFFECTED(this,AFF_SLOW))

    {
        AFFECT_DATA *poison;

        poison = affect_find(this->affected,gsn_poison);

        if (poison != NULL)
        {
            ::act( "$n shivers and suffers.", this, NULL, NULL, TO_ROOM );
            send_to_char( "You shiver and suffer.\n\r", this );
            damage_old(this,this,poison->level/10 + 1,gsn_poison,
                    DAM_POISON,FALSE);
        }
    }

    else if ( this->position == POS_INCAP && number_range(0,1) == 0)
    {
        ::damage( this, this, 1, TYPE_UNDEFINED, DAM_NONE,FALSE);
    }
    else if ( this->position == POS_MORTAL )
    {
        ::damage( this, this, 1, TYPE_UNDEFINED, DAM_NONE,FALSE);
    }
}
void show_char_to_char_0(struct char_data *victim, struct char_data *ch)
{
    char buf[MAX_STRING_LENGTH], message[MAX_STRING_LENGTH];

    buf[0] = '\0';

    if (IS_SET(victim->comm, COMM_AFK)) strcat(buf, "```!A```@F```OK ``");
    if (IS_SET(victim->comm, COMM_BUSY))
	strcat(buf, "[`1Busy``] ");

    if (IS_SET(victim->comm, COMM_CODING)) strcat(buf, "[`@CODING``] ");
    if (IS_SET(victim->comm, COMM_BUILD)) strcat(buf, "[`3BUILDING``] ");
    if (IS_AFFECTED(victim, AFF_INVISIBLE)) strcat(buf, "``(`iInvis``) ");
    if (victim->invis_level >= LEVEL_HERO) strcat(buf, "`8(`wWiZi`8) ``");
    if (!IS_NPC(victim))
	if (IS_AFFECTED(victim, AFF_HIDE)) strcat(buf, "```4(`hHide```4) ``");
    if (IS_AFFECTED(victim, AFF_CHARM)) strcat(buf, "```#(`cCharmed```#) ``");
    if (IS_AFFECTED(victim, AFF_PASS_DOOR)) strcat(buf, "```6(```^Translucent```6) ``");
    if (IS_AFFECTED(victim, AFF_FAERIE_FIRE)) strcat(buf, "```!(```PPink Aura```!) ``");
    if (IS_AFFECTED(victim, AFF_SANCTUARY)) strcat(buf, "(```&White Aura``) ");
    if (IS_AFFECTED(victim, AFF_DRUID_CALL)) strcat(buf, "(`8Grey Aura``) ");
    if (IS_AFFECTED(victim, AFF_CALLOUSED)) strcat(buf, "`&(`6C`^a`6ll`^ou`6s`^e`6d`&)`` ");
    if (is_affected(victim, gsp_web)) strcat(buf, "`8(`2St`@i`2c`@k`2y`8)`` ");

    if (!IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER)) strcat(buf, "-```1K```!i```1LLER``- ");
    if (!IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF)) strcat(buf, "-```8TH``i```8EF``- ");
    if (!IS_NPC(victim) && IS_SET(victim->act, PLR_LINKDEAD)) strcat(buf, "`7[`8LINKDEAD`7] ");
    if (victim->position == victim->start_pos && victim->long_descr[0] != '\0') {
	strcat(buf, victim->long_descr);
	send_to_char(buf, ch);
	return;
    }

    strcat(buf, PERS(victim, ch));

    if (!IS_NPC(victim) && !IS_SET(ch->comm, COMM_BRIEF)
	    && victim->position == POS_STANDING && ch->on == NULL)
	strcat(buf, victim->pcdata->title);

    switch (victim->position) {
	case POS_DEAD:
	    strcat(buf, " is ```1D```8E```1A```8D``!!");
	    break;
	case POS_MORTAL:
	    strcat(buf, " is mortally wounded.");
	    break;
	case POS_INCAP:
	    strcat(buf, " is incapacitated.");
	    break;
	case POS_STUNNED:
	    strcat(buf, " is lying here stunned.");
	    break;
	case POS_SLEEPING:
	    if (victim->on != NULL) {
		if (IS_SET(victim->on->value[2], SLEEP_AT)) {
		    sprintf(message, " is sleeping at %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else if (IS_SET(victim->on->value[2], SLEEP_ON)) {
		    sprintf(message, " is sleeping on %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else {
		    sprintf(message, " is sleeping in %s.", victim->on->short_descr);
		    strcat(buf, message);
		}
	    } else {
		strcat(buf, " is sleeping here.");
	    }

	    break;
	case POS_RESTING:
	    if (victim->on != NULL) {
		if (IS_SET(victim->on->value[2], REST_AT)) {
		    sprintf(message, " is resting at %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else if (IS_SET(victim->on->value[2], REST_ON)) {
		    sprintf(message, " is resting on %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else {
		    sprintf(message, " is resting in %s.", victim->on->short_descr);
		    strcat(buf, message);
		}
	    } else {
		strcat(buf, " is resting here.");
	    }

	    break;
	case POS_SITTING:
	    if (victim->on != NULL) {
		if (IS_SET(victim->on->value[2], SIT_AT)) {
		    sprintf(message, " is sitting at %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else if (IS_SET(victim->on->value[2], SIT_ON)) {
		    sprintf(message, " is sitting on %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else {
		    sprintf(message, " is sitting in %s.", victim->on->short_descr);
		    strcat(buf, message);
		}
	    } else {
		strcat(buf, " is sitting here.");
	    }

	    break;
	case POS_STANDING:
	    if (victim->on != NULL) {
		if (IS_SET(victim->on->value[2], STAND_AT)) {
		    sprintf(message, " is standing at %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else if (IS_SET(victim->on->value[2], STAND_ON)) {
		    sprintf(message, " is standing on %s.", victim->on->short_descr);
		    strcat(buf, message);
		} else {
		    sprintf(message, " is standing in %s.", victim->on->short_descr);
		    strcat(buf, message);
		}
	    } else {
		strcat(buf, " is here.");
	    }

	    break;
	case POS_FIGHTING:
	    strcat(buf, " is here, `!fighting`` ");
	    if (victim->fighting == NULL) {
		strcat(buf, "thin air??");
	    } else if (victim->fighting == ch) {
		strcat(buf, "```!YOU``!");
	    } else if (victim->in_room == victim->fighting->in_room) {
		strcat(buf, PERS(victim->fighting, ch));
		strcat(buf, ".");
	    } else {
		strcat(buf, "someone who left??");
	    }

	    break;
    }

    strcat(buf, "\n\r");
    buf[0] = UPPER(buf[0]);
    send_to_char(buf, ch);
    return;
}
Esempio n. 29
0
bool sp_damage( OBJ_DATA * obj, CHAR_DATA * ch, CHAR_DATA * victim, int dam, int type, int sn, bool show_msg )
{
    int ch_strong, ch_weak, ch_race, ch_suscept, ch_resist, vi_strong, vi_weak, vi_race, vi_suscept, vi_resist;
    float dam_modifier = 1.0;
    float tmp = 0;
    bool can_reflect = TRUE;
    bool can_absorb = TRUE;

    if ( victim == NULL )
        return FALSE;

    /*
     *  First, check caster's strengths and weaknesses.
     *
     */

    if ( IS_SET( type, NO_REFLECT ) )
    {
        REMOVE_BIT( type, NO_REFLECT );
        can_reflect = FALSE;
    }
    if ( IS_SET( type, NO_ABSORB ) )
    {
        REMOVE_BIT( type, NO_ABSORB );
        can_absorb = FALSE;
    }
    if ( obj == NULL )
    {
        if ( ( can_reflect )
                && ( skill_table[sn].target == TAR_CHAR_OFFENSIVE )
                && ( IS_AFFECTED( victim, AFF_CLOAK_REFLECTION ) )
                && ( ch != victim ) && ( number_percent(  ) < ( victim->get_level("psuedo") - 70 ) ) )
        {

            act( "@@N$n's @@lc@@el@@ro@@ya@@ak@@N glows brightly as $Nn's spell hits it, and the spell is reflected@@N!!", ch,
                 victim, NULL, TO_ROOM );
            act( "@@N$N's @@lc@@el@@ro@@ya@@ak@@N glows brightly, and reflects your spell back on you@@N!!", ch, NULL, victim,
                 TO_CHAR );
            act( "@@NYour @@lc@@el@@ro@@ya@@ak@@N glows brightly, and reflects the spell back on $N@@N!!!", victim, NULL, ch,
                 TO_CHAR );
            ( *skill_table[sn].spell_fun ) ( sn, 60, ch, ( void * )ch, NULL );
            return FALSE;

        }


        else if ( ( can_reflect )
                  && ( skill_table[sn].target == TAR_CHAR_OFFENSIVE )
                  && ( IS_AFFECTED( victim, AFF_CLOAK_ABSORPTION ) )
                  && ( ch != victim ) && ( number_percent(  ) < ( victim->get_level("psuedo") - 55 ) ) )
        {
            int mana;
            mana = mana_cost( ch, sn );
            victim->mana = UMIN( victim->max_mana, victim->mana + mana );

            act( "@@N$n's @@lcloak@@N glows brightly as $N's spell hits it, then fades@@N!!", victim, NULL, ch, TO_ROOM );
            act( "@@N$N's @@lcloak@@N glows brightly, and absorbs your spell@@N!!", ch, NULL, victim, TO_CHAR );
            act( "@@NYour @@lcloak@@N glows brightly, and absorbs $N's spell@@N!!!", victim, NULL, ch, TO_CHAR );
            return FALSE;
        }




        ch_strong = ( IS_NPC( ch ) ?
                      ( ( ( ch->race > 0 )
                          && ( ch->race < MAX_RACE ) ) ?
                        race_table[ch->race].strong_realms : ch->npcdata->strong_magic ) : race_table[ch->race].strong_realms );
        ch_resist = ( IS_NPC( ch ) ?
                      ( ( ( ch->race > 0 )
                          && ( ch->race < MAX_RACE ) ) ?
                        race_table[ch->race].resist_realms : ch->npcdata->resist ) : race_table[ch->race].resist_realms );
        ch_weak = ( IS_NPC( ch ) ?
                    ( ( ( ch->race > 0 )
                        && ( ch->race < MAX_RACE ) ) ?
                      race_table[ch->race].weak_realms : ch->npcdata->weak_magic ) : race_table[ch->race].weak_realms );
        ch_suscept = ( IS_NPC( ch ) ?
                       ( ( ( ch->race > 0 )
                           && ( ch->race < MAX_RACE ) ) ?
                         race_table[ch->race].suscept_realms : ch->npcdata->suscept ) : race_table[ch->race].suscept_realms );
        ch_race = ( IS_NPC( ch ) ?
                    ( ( ( ch->race > 0 )
                        && ( ch->race < MAX_RACE ) ) ?
                      race_table[ch->race].race_flags : ch->race_mods ) : race_table[ch->race].race_flags );

        if ( IS_SET( ch_strong, type ) )
        {
            dam_modifier += .35;
        }
        else if ( IS_SET( ch_weak, type ) )
        {
            dam_modifier -= .35;
        }

        if ( IS_SET( ch_race, RACE_MOD_STRONG_MAGIC ) )
        {
            dam_modifier += .25;
        }
        else if ( IS_SET( ch_race, RACE_MOD_WEAK_MAGIC ) )
        {
            dam_modifier -= .25;
        }
        else if ( IS_SET( ch_race, RACE_MOD_NO_MAGIC ) )
        {
            dam_modifier -= .50;
        }

        if ( ch->stance == STANCE_CASTER )
            dam_modifier += .10;
        else if ( ch->stance == STANCE_WIZARD )
            dam_modifier += .25;
        else if ( ch->stance == STANCE_MAGI )
            dam_modifier += .30;

        if ( ( !IS_NPC( ch ) ) && ( !IS_SET( type, REALM_MIND ) ) )
        {
            if ( ch->pcdata->learned[gsn_potency] > 0 )
            {
                dam_modifier += ( get_curr_int( ch ) * ch->pcdata->learned[gsn_potency] / 5000 );
            }

            if ( ch->pcdata->learned[gsn_thaumatergy] > 0 )
            {
                dam_modifier += ( get_curr_int( ch ) * ch->pcdata->learned[gsn_thaumatergy] / 2500 );
            }
        }
        if ( is_affected( ch, skill_lookup( "mystical focus" ) ) )
        {
            dam_modifier += .5;
        }
    }  /* obj == NULL */
    else if ( obj->carried_by != NULL )
    {
        ch = obj->carried_by;
    }
    else
    {
        snprintf( log_buf, (2 * MIL), "Error, object %s casting spell, but not carried by anyone.", obj->short_descr );
        monitor_chan( log_buf, MONITOR_DEBUG );
        return FALSE;
    }

    /*
     *  Next, the victim
     *
     */
    vi_strong = ( IS_NPC( victim ) ?
                  ( ( ( victim->race > 0 )
                      && ( victim->race < MAX_RACE ) ) ?
                    race_table[victim->race].strong_realms :
                    victim->npcdata->strong_magic ) : race_table[victim->race].strong_realms );
    vi_resist = ( IS_NPC( victim ) ?
                  ( ( ( victim->race > 0 )
                      && ( victim->race < MAX_RACE ) ) ?
                    race_table[victim->race].resist_realms : victim->npcdata->resist ) : race_table[victim->race].resist_realms );
    vi_weak = ( IS_NPC( victim ) ?
                ( ( ( victim->race > 0 )
                    && ( victim->race < MAX_RACE ) ) ?
                  race_table[victim->race].weak_realms : victim->npcdata->weak_magic ) : race_table[victim->race].weak_realms );
    vi_suscept = ( IS_NPC( victim ) ?
                   ( ( ( victim->race > 0 )
                       && ( victim->race < MAX_RACE ) ) ?
                     race_table[victim->race].suscept_realms : victim->npcdata->suscept ) : race_table[victim->race].suscept_realms );
    vi_race = ( IS_NPC( victim ) ?
                ( ( ( victim->race > 0 )
                    && ( victim->race < MAX_RACE ) ) ?
                  race_table[victim->race].race_flags : victim->race_mods ) : race_table[victim->race].race_flags );

    if ( IS_SET( vi_suscept, type ) )
    {
        dam_modifier += .45;
    }
    else if ( IS_SET( vi_resist, type ) )
    {
        dam_modifier -= .45;
    }

    else if ( IS_SET( vi_race, RACE_MOD_NO_MAGIC ) )
    {
        dam_modifier -= .25;
    }

    if ( MAGIC_STANCE( ch ) )
        dam_modifier += .15;

    if ( ( IS_SET( type, REALM_MIND ) ) && ( !HAS_MIND( victim ) ) )
        dam_modifier = 0.0;
    else if ( ( ( IS_SET( type, REALM_IMPACT ) )
                || ( IS_SET( type, REALM_ACID ) ) || ( IS_SET( type, REALM_GAS ) ) ) && ( !HAS_BODY( victim ) ) )
        dam_modifier = 0.0;

    if ( ( IS_SET( type, REALM_POISON ) ) && ( IS_SET( vi_race, RACE_MOD_IMMUNE_POISON ) ) )
        dam_modifier = 0.0;

    if ( ( IS_SET( type, REALM_DRAIN ) ) && ( IS_UNDEAD( victim ) ) )
        dam_modifier = 0.0;

    tmp = dam;
    tmp *= dam_modifier;

    if ( check_charm_aff(ch, CHARM_AFF_MAGE) )
        tmp *= ((100 + get_charm_bonus(ch, CHARM_AFF_MAGE)) / 100);

    dam = static_cast<int>(tmp);
    dam += number_range(static_cast<int>((dam * -0.10)), static_cast<int>((dam * 0.10))); /* Lets add a little randomness to things. --Kline */

    if ( victim != ch )
    {
        /*
         * Certain attacks are forbidden.
         * Most other attacks are returned.
         */
        if ( is_safe( ch, victim ) )
            return FALSE;
        if ( victim != ch->fighting )
            check_killer( ch, victim );

        if ( victim->position > POS_STUNNED )
        {
            if ( victim->fighting == NULL )
                set_fighting( victim, ch, FALSE );
            victim->position = POS_FIGHTING;
        }

        if ( victim->position > POS_STUNNED )
        {
            if ( ch->fighting == NULL )
            {
                set_fighting( ch, victim, TRUE );
            }


            /*
             * If victim is charmed, ch might attack victim's master.
             */
            if ( IS_NPC( ch )
                    && IS_NPC( victim )
                    && IS_AFFECTED( victim, AFF_CHARM )
                    && victim->master != NULL && victim->master->in_room == ch->in_room && number_bits( 3 ) == 0 )
            {
                stop_fighting( ch );
                one_hit( ch, victim->master, TYPE_UNDEFINED );
            }
        }

        /*
         * More charm stuff.
         */
        if ( victim->master == ch )
            stop_follower( victim );

        /*
         * Inviso attacks ... not.
         */
        if ( IS_AFFECTED( ch, AFF_INVISIBLE ) )
        {
            affect_strip( ch, gsn_invis );
            affect_strip( ch, gsn_mass_invis );
            REMOVE_BIT( ch->affected_by, AFF_INVISIBLE );
            act( "$n shimmers into existence.", ch, NULL, NULL, TO_ROOM );
        }

        /*
         * Damage modifiers.
         */

        if ( dam < 0 )
            dam = 0;

        /*
         * Stop up any residual loopholes.
         */
        if ( dam > sysdata.damcap )
        {
            char buf[MAX_STRING_LENGTH];
            snprintf( buf, MSL, "Spell: %d damage by %s, spell %s", dam, ( obj == NULL ) ? ch->get_name() : obj->short_descr, skill_table[sn].name );
            if ( ch->level < 82 )
                monitor_chan( buf, MONITOR_MAGIC );
            log_f( "%s", buf );
            dam = sysdata.damcap;
        }


        if ( ( show_msg ) && ( dam >= 0 ) )
            sp_dam_message( obj, ch, victim, dam, type, sn );

    }

    /*
     * Hurt the victim.
     * Inform the victim of his new state.
     */
    victim->hit -= dam;

    if ( !IS_NPC(ch) )
    {
        if ( dam > ch->pcdata->records->mdam_amt )
        {
            send_to_char("@@yYou've broken your magical damage record!@@N\r\n", ch);
            ch->pcdata->records->mdam_amt = dam;
            ch->pcdata->records->mdam_gsn = sn;
        }
    }

    if ( !IS_NPC( victim ) )
        check_adrenaline( victim, dam );

    if ( !IS_NPC( victim ) && IS_WOLF( victim ) && ( dam > 350 ) )
        do_rage( victim, "FORCE" );

    update_pos( victim );

    if ( ( IS_NPC( victim ) || !IS_VAMP( victim ) ) && !( deathmatch ) )
    {
        switch ( victim->position )
        {
            case POS_MORTAL:
                act( "$n is mortally wounded, and will die soon, if not aided.", victim, NULL, NULL, TO_ROOM );
                send_to_char( "You are mortally wounded, and will die soon, if not aided.\r\n", victim );
                break;

            case POS_INCAP:
                act( "$n is incapacitated and will slowly die, if not aided.", victim, NULL, NULL, TO_ROOM );
                send_to_char( "You are incapacitated and will slowly die, if not aided.\r\n", victim );
                break;

            case POS_STUNNED:
                act( "$n is too stunned to do anything!", victim, NULL, NULL, TO_ROOM );
                send_to_char( "You are too stunned to do anything!\r\n", victim );
                break;

            case POS_DEAD:
                act( "$n is DEAD!!", victim, 0, 0, TO_ROOM );
                send_to_char( "You have been KILLED!!\r\n\r\n", victim );
                break;

            default:
                if ( dam > victim->max_hit / 4 )
                    send_to_char( "That really did HURT!\r\n", victim );
                if ( victim->hit < victim->max_hit / 4 )
                    send_to_char( "You sure are BLEEDING!\r\n", victim );
                break;
        }
    }  /* end of if statement */
    /*
     * Sleep spells and extremely wounded folks.
     */
    if ( !IS_AWAKE( victim ) )
        stop_fighting( victim );

    /*
     * Payoff for killing things.
     */



    if ( victim->position == POS_DEAD && ( IS_NPC( victim ) || !IS_VAMP( victim ) || ( deathmatch ) ) )
    {
        group_gain( ch, victim );

        /*
         * Sort out kill counts.....
         */
        if ( !IS_NPC( ch ) )
        {
            if ( !IS_NPC( victim ) )
                ch->pcdata->records->pk++;
            else
                ch->pcdata->records->mk++;
        }

        if ( !IS_NPC( victim ) )
        {
            if ( !IS_NPC( ch ) )
                victim->pcdata->records->pd++;
            else
                victim->pcdata->records->md++;
        }

        if ( !IS_NPC( victim ) || victim->act.test(ACT_INTELLIGENT) )
        {


            snprintf( log_buf, (2 * MIL), "%s killed by %s at %d", victim->get_name(), ch->get_name(), victim->in_room->vnum );
            log_string( log_buf );

            notify( log_buf, 82 );

            /*
             * As level gain is no longer automatic, a dead char loses
             * * 1/2 their gained exp.  -S-
             * * Fixed my bug here too, hehe!
             */

            if ( victim->exp > 0 )
            {
                int lose = (victim->exp / 2);
                lose *= -1;
                victim->gain_exp(lose);
            }

        }

        if ( IS_NPC( ch ) )
            raw_kill( victim, "" );
        else
        {
            char name_buf[MAX_STRING_LENGTH];
            snprintf( name_buf, MSL, "%s", ch->name.c_str() );
            raw_kill( victim, name_buf );
        }

        if ( deathmatch && !IS_NPC( victim ) )
            do_quit( victim, "" );

        if ( IS_NPC( ch ) && IS_NPC( victim ) && ch->act.test(ACT_INTELLIGENT) )
        {
            do_get( ch, "all corpse" );
            do_sacrifice( ch, "corpse" );
        }

        if ( !IS_NPC( ch ) && IS_NPC( victim ) )
        {
            if ( ch->act.test(ACT_AUTOLOOT) )
                do_get( ch, "all corpse" );
            else
                do_look( ch, "in corpse" );

            if ( ch->act.test(ACT_AUTOSAC) )
                do_sacrifice( ch, "corpse" );
        }

        return FALSE;
    }

    if ( victim == ch )
        return TRUE;

    /*
     * Take care of link dead people.
     */
    if ( !IS_NPC( victim ) && victim->desc == NULL )
    {
        if ( number_range( 0, victim->wait ) == 0 )
        {
            do_recall( victim, "" );
            return TRUE;
        }
    }

    /*
     * Wimp out?
     */
    if ( IS_NPC( victim ) && dam > 0 )
    {
        if ( ( victim->act.test(ACT_WIMPY) && number_bits( 1 ) == 0
                && victim->hit < victim->max_hit / 2 )
                || ( IS_AFFECTED( victim, AFF_CHARM ) && victim->master != NULL && victim->master->in_room != victim->in_room ) )
            do_flee( victim, "" );
    }

    if ( !IS_NPC( victim ) && victim->hit > 0 && victim->hit <= victim->wimpy && victim->wait == 0 )
        do_flee( victim, "" );

    return TRUE;

}
Esempio n. 30
0
void do_swordtech(CHAR_DATA * ch, char *argument)
{
	char buf[MAX_STRING_LENGTH];
	CHAR_DATA *victim = 0;
	OBJ_DATA *obj;
	AFFECT_DATA af;
	long chance;

	if(!ch || IS_NPC(ch))
		return;

	if(!IS_CLASS(ch, CLASS_HIGHLANDER))
	{
		send_to_char("You are not one of the chosen.\n\r", ch);
		return;
	}

	if(!argument || argument[0] == '\0')
	{
		send_to_char("What type of swordtech manuever do you want to attempt?\n\r", ch);
		send_to_char("Types are: fury, disarm, berserk, stun, decapitate, concentrate\n\r", ch);
		return;
	}

	if((obj = get_eq_char(ch, WEAR_WIELD)) == 0 || obj->pIndexData->vnum != 29695)
	{
		send_to_char("You must be wielding your Katana to do a swordtech manuever.\n\r", ch);
		return;
	}

	if(is_affected(ch, gsn_swordtech))
	{
		send_to_char("You are not ready for another swordtech manuever yet!\n\r", ch);
		return;
	}

	if(ch->move < 850)
	{
		send_to_char("You need 850 movement points to do a swordtech manuever!\n\r", ch);
		return;
	}

	ch->move -= 600;

	if(ch->pcdata->stats[UNI_GEN] == 1)
		chance = 55;
	else if(ch->pcdata->stats[UNI_GEN] == 2)
		chance = 35;
	else
		chance = 0;

	chance += 35;

	act("{G$n holds $p in front of $m and a spiral of silver energy swirls around $s body.{x", ch, obj, 0, TO_ROOM);
	act("{GYou holds $p in front of you and a spiral of silver energy swirls around your body.{x",
	    ch, obj, 0, TO_CHAR);

	if(chance < number_percent())
	{
		af.type = gsn_swordtech;
		af.duration = 3 + ch->pcdata->stats[UNI_GEN];
		af.modifier = 0;
		af.location = 0;
		af.bitvector = 0;
		affect_to_char(ch, &af);

		act("{gYou fail the manuever and the energy leaves you.{x", ch, 0, 0, TO_CHAR);
		act("{g$n fails the manuever and the energy leaves $m.{x", ch, 0, 0, TO_ROOM);
		return;
	}

	if(!str_prefix(argument, "berserk")
	   || !str_prefix(argument, "bezerk") || !str_prefix(argument, "beserk") || !str_prefix(argument, "berzerk"))
	{
		af.type = gsn_swordtech;
		af.duration = 5 + ((3 - ch->pcdata->stats[UNI_GEN]) * 2);
		af.modifier = 0;
		af.location = 0;
		af.bitvector = STECH_BERSERK;
		affect_to_char(ch, &af);
		act("You go berserk!", ch, 0, 0, TO_CHAR);
		act("$n goes berserk!", ch, 0, 0, TO_ROOM);
		return;
	}

	if(!str_prefix(argument, "concentrate"))
	{
		af.type = gsn_swordtech;
		af.duration = 5 + ((3 - ch->pcdata->stats[UNI_GEN]) * 2);
		af.modifier = 0;
		af.location = 0;
		af.bitvector = STECH_CONCENTRATE;
		affect_to_char(ch, &af);
		act("A deep calm overcomes you and you begin examining your opponent very carefully.", ch, 0, 0,
		    TO_CHAR);
		act("$n appears to get very calm and more alertive.", ch, 0, 0, TO_ROOM);
		return;
	}

	if(!str_prefix(argument, "decapitate"))
	{
		if((victim = ch->fighting) == 0)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		if(IS_NPC(victim) || number_percent() < 50)
		{
			act("You bring your sword up for a masterful swing and......miss horribly.", ch, 0, victim,
			    TO_CHAR);
			act("$n brings $s sword up for a masterful swing and......misses $N's head by a mile.", ch, 0,
			    victim, TO_NOTVICT);
			act("$n brings $s sword up for a masterful swing and......misses your head by a mile.", ch, 0,
			    victim, TO_VICT);
			act("You drop your weapons!", ch, 0, 0, TO_CHAR);
			act("$n drops $s weapons!", ch, 0, 0, TO_ROOM);
			obj_from_char(obj);
			obj_to_room(obj, ch->in_room);
			if((obj = get_eq_char(ch, WEAR_HOLD)) != 0)
			{
				obj_from_char(obj);
				obj_to_room(obj, ch->in_room);
			}
			return;
		}
		act("You bring your sword up for a masterful swing and whack $N's head clean off!", ch, 0, victim,
		    TO_CHAR);
		act("$n brings $s sword up for a masterful swing and whacks $N's head clean off!", ch, 0, victim,
		    TO_NOTVICT);
		act("$n brings $s sword up for a masterful swing and......you are now missing a head?!", ch, 0, victim,
		    TO_VICT);
		sprintf(buf, "{B%s swordtech decapitates %s!  Ooooh that's gotta hurt!{X", ch->name, victim->name);
		do_info(ch, buf);
		behead(victim);
		return;
	}

	if(!str_prefix(argument, "stun"))
	{
		if((victim = ch->fighting) == 0)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		act("You knock the hell out of $N's head with the side of your sword!", ch, 0, victim, TO_CHAR);
		act("$n knocks the hell out of $N's head with the side of $s sword!", ch, 0, victim, TO_NOTVICT);
		act("$n knocks the hell out of your head with the side of $s sword!", ch, 0, victim, TO_VICT);
		WAIT_STATE(victim, number_range(24, 60));
		return;
	}

	if(!str_prefix(argument, "fury"))
	{
		if((victim = ch->fighting) == 0)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		af.type = gsn_swordtech;
		af.duration = 3 + (ch->pcdata->stats[UNI_GEN] * 2);
		af.modifier = APPLY_STR;
		af.location = 0;
		af.bitvector = STECH_FURY;
		affect_to_char(ch, &af);
		act("You attack in a wild fury!", ch, 0, 0, TO_CHAR);
		act("$n attacks in a wild fury!", ch, 0, 0, TO_ROOM);
		multi_hit(ch, ch->fighting, TYPE_UNDEFINED);
		multi_hit(ch, ch->fighting, TYPE_UNDEFINED);
		multi_hit(ch, ch->fighting, TYPE_UNDEFINED);
		return;
	}

	if(!str_prefix(argument, "disarm"))
	{
		if((victim = ch->fighting) == 0 && !ch->in_room)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		if(IS_NPC(victim))
		{
			send_to_char("Not on NPC's.\n\r", ch);
			return;
		}
		if((obj = get_eq_char(victim, WEAR_WIELD)) == 0)
		{
			send_to_char("They aren't wielding a weapon!\n\r", ch);
			return;
		}
		obj_from_char(obj);
		obj_to_room(obj, ch->in_room);
		af.type = gsn_swordtech;
		af.duration = 5 + (ch->pcdata->stats[UNI_GEN] * 2);
		af.modifier = 0;
		af.location = 0;
		af.bitvector = STECH_DISARM;
		affect_to_char(ch, &af);
		act("$n disarms YOU!", ch, 0, victim, TO_VICT);
		act("$n disarms $N!", ch, 0, victim, TO_NOTVICT);
		act("You disarm $N!", ch, 0, victim, TO_CHAR);
		return;
	}

	send_to_char("Nothing happens.\n\r", ch);
}