void objfun_cast_fight(OBJ_DATA *obj, CHAR_DATA *keeper) { int sn; CHAR_DATA *victim; int min_lev; char *spell = ""; if (keeper == NULL || (keeper->fighting == NULL) || (obj->item_type != ITEM_WEAPON)) return; if ((get_eq_char(keeper, WEAR_WIELD) != obj) && (get_eq_char(keeper, WEAR_WIELD_2) != obj)) return; /* Must be wielded to work */ for (victim = keeper->in_room->first_person; victim != NULL; victim = victim->next_in_room) if (victim->fighting == keeper && number_bits(2) == 0) break; if ((victim == NULL) || (victim->is_free != FALSE)) return; switch (number_range(0, 5)) { case 0: min_lev = 5; spell = "magic missile"; break; case 1: min_lev = 7; spell = "colour spray"; break; case 2: min_lev = 8; spell = "chill touch"; break; case 3: min_lev = 30; spell = "fireball"; break; case 4: min_lev = 55; spell = "flamestrike"; break; case 5: min_lev = 30; spell = "lightning bolt"; break; } if ((sn = skill_lookup(spell)) < 0) return; act("$p glows brightly at $n!", victim, obj, NULL, TO_ROOM); act("$p glows brightly at you!", victim, obj, NULL, TO_CHAR); obj_cast_spell(sn, obj->level, keeper, victim, obj); return; }
/* * Set off a trap (obj) upon character (ch) - Thoric */ ch_ret spring_trap( char_data * ch, obj_data * obj ) { int dam, typ, lev; const char *txt; ch_ret retcode; typ = obj->value[1]; lev = obj->value[2]; retcode = rNONE; switch ( typ ) { default: txt = "hit by a trap"; break; case TRAP_TYPE_POISON_GAS: txt = "surrounded by a green cloud of gas"; break; case TRAP_TYPE_POISON_DART: txt = "hit by a dart"; break; case TRAP_TYPE_POISON_NEEDLE: txt = "pricked by a needle"; break; case TRAP_TYPE_POISON_DAGGER: txt = "stabbed by a dagger"; break; case TRAP_TYPE_POISON_ARROW: txt = "struck with an arrow"; break; case TRAP_TYPE_BLINDNESS_GAS: txt = "surrounded by a red cloud of gas"; break; case TRAP_TYPE_SLEEPING_GAS: txt = "surrounded by a yellow cloud of gas"; break; case TRAP_TYPE_FLAME: txt = "struck by a burst of flame"; break; case TRAP_TYPE_EXPLOSION: txt = "hit by an explosion"; break; case TRAP_TYPE_ACID_SPRAY: txt = "covered by a spray of acid"; break; case TRAP_TYPE_ELECTRIC_SHOCK: txt = "suddenly shocked"; break; case TRAP_TYPE_BLADE: txt = "sliced by a razor sharp blade"; break; case TRAP_TYPE_SEX_CHANGE: txt = "surrounded by a mysterious aura"; break; } dam = number_range( obj->value[4], obj->value[5] ); act_printf( AT_HITME, ch, NULL, NULL, TO_CHAR, "You are %s!", txt ); act_printf( AT_ACTION, ch, NULL, NULL, TO_ROOM, "$n is %s.", txt ); --obj->value[0]; if( obj->value[0] <= 0 ) obj->extract( ); switch ( typ ) { default: case TRAP_TYPE_BLADE: retcode = damage( ch, ch, dam, TYPE_UNDEFINED ); break; case TRAP_TYPE_POISON_DART: case TRAP_TYPE_POISON_NEEDLE: case TRAP_TYPE_POISON_DAGGER: case TRAP_TYPE_POISON_ARROW: retcode = obj_cast_spell( gsn_poison, lev, ch, ch, NULL ); if( retcode == rNONE ) retcode = damage( ch, ch, dam, TYPE_UNDEFINED ); break; case TRAP_TYPE_POISON_GAS: retcode = obj_cast_spell( gsn_poison, lev, ch, ch, NULL ); break; case TRAP_TYPE_BLINDNESS_GAS: retcode = obj_cast_spell( gsn_blindness, lev, ch, ch, NULL ); break; case TRAP_TYPE_SLEEPING_GAS: retcode = obj_cast_spell( skill_lookup( "sleep" ), lev, ch, ch, NULL ); break; case TRAP_TYPE_ACID_SPRAY: retcode = obj_cast_spell( skill_lookup( "acid blast" ), lev, ch, ch, NULL ); break; case TRAP_TYPE_SEX_CHANGE: retcode = obj_cast_spell( skill_lookup( "change sex" ), lev, ch, ch, NULL ); break; case TRAP_TYPE_FLAME: retcode = obj_cast_spell( skill_lookup( "flamestrike" ), lev, ch, ch, NULL ); break; case TRAP_TYPE_EXPLOSION: retcode = obj_cast_spell( gsn_fireball, lev, ch, ch, NULL ); break; case TRAP_TYPE_ELECTRIC_SHOCK: retcode = obj_cast_spell( skill_lookup( "lightning bolt" ), lev, ch, ch, NULL ); break; } return retcode; }
/* * (FF) Da rivedere: * 1) materiali vegetali bruciabili * 2) elenco erbe per slot con effetti oppure utilizzo lista di affect uhm... da pensare. */ DO_RET do_smoke( CHAR_DATA *ch, char *argument ) { OBJ_DATA *the_pipe; if ( !VALID_STR(argument) ) { send_to_char( ch, "Che cosa devo fumare?\r\n" ); return; } if ( ms_find_obj(ch) ) return; if ( (the_pipe = get_obj_carry(ch, argument, TRUE)) == NULL ) { send_to_char( ch, "Non lo sto trasportando.\r\n" ); return; } if ( the_pipe->type != OBJTYPE_PIPE ) { act( AT_ACTION, "Tento di fumare $p.. ma non si accende.", ch, the_pipe, NULL, TO_CHAR ); act( AT_ACTION, "$n tenta di fumare $p...", ch, the_pipe, NULL, TO_ROOM ); return; } if ( !HAS_BITINT(the_pipe->pipe->flags, PIPE_LIT) ) { act( AT_ACTION, "Tento di fumare $p, ma non arde.", ch, the_pipe, NULL, TO_CHAR ); act( AT_ACTION, "$n tenta di fumare $p, con scarso successo.", ch, the_pipe, NULL, TO_ROOM ); return; } if ( the_pipe->pipe->draws > 0 ) { if ( !oprog_use_trigger( ch, the_pipe, NULL, NULL, NULL ) ) { act( AT_ACTION, "Tiro profondamente da $p.", ch, the_pipe, NULL, TO_CHAR ); act( AT_ACTION, "$n tira profondamente da $p.", ch, the_pipe, NULL, TO_ROOM ); } if ( is_valid_herb(the_pipe->pipe->herb) && the_pipe->pipe->herb <= MAX_HERB ) { int sn = the_pipe->pipe->herb + TYPE_HERB; SKILL_DATA *skill = get_skilltype( sn ); WAIT_STATE( ch, skill->beats * 3 ); /* (WT) */ if ( skill->spell_fun ) obj_cast_spell( sn, UMIN(the_pipe->level/2, get_level(ch)/2), ch, ch, NULL ); if ( obj_extracted(the_pipe) ) return; } else { send_log( NULL, LOG_BUG, "do_smoke: tipo di erba errata %d", the_pipe->pipe->herb ); } SET_BITINT( the_pipe->pipe->flags, PIPE_HOT ); if ( --the_pipe->pipe->draws < 1 ) { REMOVE_BITINT( the_pipe->pipe->flags, PIPE_LIT ); SET_BITINT( the_pipe->pipe->flags, PIPE_DIRTY ); SET_BITINT( the_pipe->pipe->flags, PIPE_FULLOFASH ); } } /* chiude l'if */ send_log( NULL, LOG_BUG, "do_smoke: in attesa di nuova implementazione." ); }
void objfun_dispeller(OBJ_DATA *obj, CHAR_DATA *keeper) { int sn; CHAR_DATA *victim; int min_lev; char *spell = ""; if (keeper == NULL || keeper->in_room == NULL) return; if ((keeper == NULL) || (obj->item_type != ITEM_WEAPON)) return; for (victim = keeper->in_room->first_person; victim != NULL; victim = victim->next_in_room) if (victim->fighting == keeper && number_bits(2) == 0) break; if (victim == NULL) { if (!IS_NPC(keeper) && (keeper->stance == STANCE_AMBUSH || keeper->stance == STANCE_AC_BEST) ) return; if (number_percent() < 2) { act("$O@@N$p@@N carried by @@a$n@@a vibrates @@Nsuddenly@@N!", keeper, obj, NULL, TO_ROOM); act("$O@@N$p @@Ncarried by you@@a vibrates @@Nsuddenly@@N!", keeper, obj, NULL, TO_CHAR); return; } if (number_percent() < 2) { act("$O@@N$p@@N carried by @@a$n@@a peers@@N at your inventory@@N.", keeper, obj, NULL, TO_ROOM); act("$O@@N$p @@Ncarried by you@@a peers@@N around the room@@N.", keeper, obj, NULL, TO_CHAR); return; } return; } if ((victim == NULL) || (victim->is_free != FALSE)) return; if ((get_eq_char(keeper, WEAR_WIELD) != obj) && (get_eq_char(keeper, WEAR_WIELD_2) != obj)) return; /* Must be wielded to work */ switch (number_range(0, 11)) { case 0: case 1: case 2: case 3: min_lev = 5; spell = "ego whip"; break; case 4: case 5: case 6: min_lev = 7; spell = "bloody tears"; break; case 7: case 8: case 9: case 10: case 11: min_lev = 30; spell = "dispel magic"; break; } if ((sn = skill_lookup(spell)) < 0) return; act("$p @@apeers@@N deeply into the mind of $n!", victim, obj, NULL, TO_ROOM); act("$p @@apeers @@Ninto your thoughts!", victim, obj, NULL, TO_CHAR); obj_cast_spell(sn, obj->level, keeper, victim, obj); return; }
void objfun_healing(OBJ_DATA *obj, CHAR_DATA *keeper) { int sn; CHAR_DATA *victim; int min_lev; char *spell = ""; if (keeper == NULL || keeper->in_room == NULL) return; if ((keeper == NULL) || (obj->item_type != ITEM_WEAPON)) return; for (victim = keeper->in_room->first_person; victim != NULL; victim = victim->next_in_room) if (victim->fighting == keeper && number_bits(1) == 0) break; if (victim == NULL) { if (!IS_NPC(keeper) && (keeper->stance == STANCE_AMBUSH || keeper->stance == STANCE_AC_BEST) ) return; if (number_percent() < 2) { act("$O@@N$p@@N carried by @@a$n@@y glows@@N with a @@mHoly @@Wlight@@N!", keeper, obj, NULL, TO_ROOM); act("$O@@N$p @@Ncarried by you@@y glows@@N with a @@mHoly @@Wlight@@N!", keeper, obj, NULL, TO_CHAR); return; } if (number_percent() < 2) { act("$O@@N$p@@N carried by @@a$n@@N sings a @@mhymn@@N.", keeper, obj, NULL, TO_ROOM); act("$O@@N$p @@Ncarried by you@@N sings a hymn@@N.", keeper, obj, NULL, TO_CHAR); return; } return; } if ((get_eq_char(keeper, WEAR_WIELD) != obj) && (get_eq_char(keeper, WEAR_WIELD_2) != obj)) return; /* Must be wielded to work */ switch (number_range(0, 11)) { case 0: case 1: min_lev = 5; spell = "cure light"; break; case 2: case 3: case 4: min_lev = 7; spell = "cure serious"; break; case 5: case 6: case 7: min_lev = 8; spell = "cure critical"; break; case 8: case 9: case 10: case 11: min_lev = 30; spell = "heal"; break; } if ((sn = skill_lookup(spell)) < 0) return; act("$p blankets $n @@Win a @@mhealing @@Waura@@N!", keeper, obj, NULL, TO_ROOM); act("$p blankets you in a @@mhealing @@Waura@@N!", keeper, obj, NULL, TO_CHAR); obj_cast_spell(sn, obj->level, keeper, keeper, obj); return; }
void objfun_flaming(OBJ_DATA *obj, CHAR_DATA *keeper) { int sn; CHAR_DATA *victim; int min_lev; char *spell = ""; if (keeper == NULL || keeper->in_room == NULL) return; if ((keeper == NULL) || (obj->item_type != ITEM_WEAPON)) return; for (victim = keeper->in_room->first_person; victim != NULL; victim = victim->next_in_room) if (victim->fighting == keeper && number_bits(2) == 0) break; if (victim == NULL) { if (!IS_NPC(keeper) && (keeper->stance == STANCE_AMBUSH || keeper->stance == STANCE_AC_BEST) ) return; if (number_percent() < 2) { act("$O@@N$p@@N carried by @@a$n@@e flames @@ybrightly@@N!", keeper, obj, NULL, TO_ROOM); act("$O@@N$p @@Ncarried by you@@e flames @@ybrightly@@N!", keeper, obj, NULL, TO_CHAR); return; } if (number_percent() < 2) { act("$O@@N$p@@N carried by @@a$n@@N goes @@ddim@@N.", keeper, obj, NULL, TO_ROOM); act("$O@@N$p @@Ncarried by you@@N goes @@ddim@@N.", keeper, obj, NULL, TO_CHAR); return; } return; } if ((victim == NULL) || (victim->is_free != FALSE)) return; if ((get_eq_char(keeper, WEAR_WIELD) != obj) && (get_eq_char(keeper, WEAR_WIELD_2) != obj)) return; /* Must be wielded to work */ switch (number_range(0, 10)) { case 0: case 1: case 2: case 3: min_lev = 5; spell = "fireball"; break; case 4: case 5: case 6: case 7: min_lev = 7; spell = "flamestrike"; break; case 8: case 9: min_lev = 8; spell = "heat armor"; break; case 10: min_lev = 25; spell = "heat armor"; break; } if ((sn = skill_lookup(spell)) < 0) return; act("$p flames at $n!", victim, obj, NULL, TO_ROOM); act("$p flames brightly at you!", victim, obj, NULL, TO_CHAR); obj_cast_spell(sn, obj->level, keeper, victim, obj); return; }
void objfun_infused_soul(OBJ_DATA *obj, CHAR_DATA *keeper) { int sn; CHAR_DATA *victim; int min_lev; char *spell = ""; if (keeper == NULL || keeper->in_room == NULL) return; if ((keeper == NULL) || (obj->item_type != ITEM_WEAPON)) return; if ((get_eq_char(keeper, WEAR_WIELD) != obj) && (get_eq_char(keeper, WEAR_WIELD_2) != obj)) return; /* Must be wielded to work */ if (keeper->fighting != NULL) { for (victim = keeper->in_room->first_person; victim != NULL; victim = victim->next_in_room) if (victim->fighting == keeper && number_bits(1) == 0) break; if ((victim == NULL) || (victim->is_free != FALSE)) return; switch (number_range(0, 3)) { case 0: min_lev = 43; spell = "throwing star"; break; case 1: min_lev = 55; spell = "acid blast"; break; case 2: min_lev = 68; spell = "dispel magic"; break; case 3: min_lev = 55; spell = "flamestrike"; break; } if ((sn = skill_lookup(spell)) < 0) return; act("$p glows brightly at $n!", victim, obj, NULL, TO_ROOM); act("$p glows brightly at you!", victim, obj, NULL, TO_CHAR); if ((!IS_NPC(keeper)) && (!IS_NPC(victim)) && (keeper->fighting == victim) ) obj_cast_spell(sn, obj->level, keeper, victim, obj); return; } else { if (!IS_NPC(keeper) && (keeper->stance == STANCE_AMBUSH || keeper->stance == STANCE_AC_BEST) ) return; /* Come on... it was SO annoying! */ if (number_percent() < 2) { act("$O@@NThe @@eSoul@@N in $p@@N carried by @@a$n@@N moans in agony.", keeper, obj, NULL, TO_ROOM); act("$O@@NThe @@eSoul@@N in $p @@Ncarried by you moans to be set free!", keeper, obj, NULL, TO_CHAR); return; } if (number_percent() < 2) { act("$O@@NThe @@eSoul@@N in $p@@N carried by @@a$n@@N tries to break free of its inprisonment!", keeper, obj, NULL, TO_ROOM); act("$O@@NThe @@eSoul@@N in $p @@Ncarried by you starts writhing--look out!!", keeper, obj, NULL, TO_CHAR); return; } } return; }