int spell_ethereal_snake_devour(int sn, int level, CHAR_DATA *ch, void *vo ) { CHAR_DATA *victim = (CHAR_DATA *) vo; OBJ_DATA *obj_lose; OBJ_DATA *obj_next; if ( !IS_NPC(victim) ) { send_to_char(AT_BLUE, "You failed.\n\r", ch); return SKPELL_MISSED; } if ( number_percent( ) < level && !saves_spell( level, victim ) ) for ( obj_lose = victim->carrying; obj_lose; obj_lose = obj_next ) { obj_next = obj_lose->next_content; if ( obj_lose->deleted ) continue; if ( number_bits( 2 ) != 0 ) continue; act(AT_WHITE, "$p has been devoured by an ethereal snake!", victim, obj_lose, NULL, TO_CHAR ); act(AT_WHITE, "$n's $p has been devoured by an ethereal snake!", victim, obj_lose, NULL, TO_ROOM ); extract_obj( obj_lose ) ; } if ( !saves_spell( level, victim ) ) /* * Devour char, do not generate a corpse, do not * give experience for kill. Extract_char will take care * of items carried/wielded by victim. */ { act(AT_WHITE, "Your ethereal snake has DEVOURED $N!", ch, NULL, victim, TO_CHAR ); act(AT_WHITE, "You have been DEVOURED by $n's ethereal snake!", ch, NULL, victim, TO_VICT ); act(AT_WHITE, "$n's ethereal snake DEDVOURS $N!", ch, NULL, victim, TO_ROOM ); if ( IS_NPC( victim ) ) { extract_char( victim, TRUE ); } else { extract_char( victim, FALSE ); } } return SKPELL_NO_DAMAGE; }
void trap_teleport(struct char_data *v) { int to_room; extern int top_of_world; /* ref to the top element of world */ if (saves_spell(v, SAVING_SPELL)) { send_to_char("You feel strange, but the effect fades.\n\r", v); return; } do { to_room = number(0, top_of_world); } while (IS_SET(real_roomp(to_room)->room_flags, PRIVATE)); act("$n slowly fade out of existence.", FALSE, v, 0, 0, TO_ROOM); char_from_room(v); char_to_room(v, to_room); act("$n slowly fade in to existence.", FALSE, v, 0, 0, TO_ROOM); look_room(v); if (IS_SET(real_roomp(to_room)->room_flags, DEATH) && get_max_level(v) < LOW_IMMORTAL) { nail_this_sucker(v); } }
void spell_portal( int sn, int level, CHAR_DATA *ch, void *vo,int target) { CHAR_DATA *victim; OBJ_DATA *portal, *stone; if ( ( victim = get_char_world( ch, target_name ) ) == NULL || victim == ch || victim->in_room == NULL || !can_see_room(ch,victim->in_room) || IS_SET(victim->in_room->room_flags, ROOM_SAFE) || IS_SET(victim->in_room->room_flags, ROOM_PRIVATE) || IS_SET(victim->in_room->room_flags, ROOM_SOLITARY) || IS_SET(victim->in_room->room_flags, ROOM_DRAGONPIT) || IS_SET(ch->in_room->room_flags, ROOM_DRAGONPIT) || IS_SET(victim->in_room->room_flags, ROOM_NO_RECALL) || IS_SET(victim->in_room->area->area_flags, AREA_PROTO ) || IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL) || victim->level >= level + 3 || (!IS_NPC(victim) && victim->level >= LEVEL_HERO) || (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON)) || (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) ) || (is_clan(victim) && !is_same_clan(ch,victim))) { send_to_char( "You failed.\n\r", ch ); return; } if (!IS_IMP(ch)) { if (IS_IMMORTAL(ch)) { send_to_char("\n\r{rIMMs can use {RGOTO{r so there is no reason to be opening {RPORTAL{r.{x\n\r",ch); return; } } stone = get_eq_char(ch,WEAR_HOLD); if (!IS_IMMORTAL(ch) && (stone == NULL || stone->item_type != ITEM_WARP_STONE)) { send_to_char("You lack the proper component for this spell.\n\r",ch); return; } if (stone != NULL && stone->item_type == ITEM_WARP_STONE) { act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR); //act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR); //extract_obj(stone); } portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 2 + level / 25; portal->value[3] = victim->in_room->vnum; obj_to_room(portal,ch->in_room); act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM); act("$p rises up before you.",ch,portal,NULL,TO_CHAR); }
int spell_sonic_blast( int sn, int level, CHAR_DATA *ch, void *vo ) { CHAR_DATA *victim = (CHAR_DATA *) vo; static const int dam_each [ ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260 }; int dam; level = UMIN( level, sizeof( dam_each ) / sizeof( dam_each[0] ) - 1 ); level = UMAX( 0, level ); dam = number_range( dam_each[level], dam_each[level] * 6 ); if ( saves_spell( level, victim ) ) dam /= 2; //damage( ch, victim, dam, sn ); return dam; }
void spell_feeblemind(byte level, struct char_data *ch, struct char_data *victim, struct obj_data *obj) { struct affected_type af; int t,i; if (!saves_spell(victim, SAVING_SPELL)) { /* eld - I took the liberty of adding this little dandy.. In my opinion, */ /* this spell should not be accumulative. */ if(affected_by_spell(victim, SPELL_FEEBLEMIND)) { send_to_char("They are already dumb enough as it is!\n\r", ch); return; } send_to_char("You feel really really dumb\n\r", victim); af.type = SPELL_FEEBLEMIND; af.duration = 24; af.modifier = -5; af.location = APPLY_INT; af.bitvector = 0; affect_to_char(victim, &af); af.type = SPELL_FEEBLEMIND; af.duration = 24; af.modifier = 70; af.location = APPLY_SPELLFAIL; af.bitvector = 0; affect_to_char(victim, &af); /* last, but certainly not least */ if (!victim->skills) return; t = number(1,100); while (1) { for (i=0;i<MAX_SKILLS;i++) { if (victim->skills[i].learned) t--; if (t==0) { victim->skills[i].learned = 0; victim->skills[i].flags = 0; break; } /* eld - what happens if you get outside the for loop? Yer screwed... */ /* this fixes it by giving the function something to do (return) */ } return; } } }
/***************************************************************************** Chiunque veda il Verme della Morte, viene addormentato dal suo sguardo ipnotico, a meno con non azzecchi un tiro salvezza contro paralisi. *****************************************************************************/ int VermeDellaMorte( struct char_data *pChar, int nCmd, const char *szArg, struct char_data *pMob, int nType ) { if( nType == EVENT_TICK && AWAKE( pMob ) ) { struct room_data *pRoom; if( ( pRoom = real_roomp( pMob->in_room ) ) != NULL ) { struct char_data *pNext, *pTar; for( pTar = pRoom->people; pTar; pTar = pNext ) { pNext = pTar->next_in_room; if( CAN_SEE( pTar, pMob ) && ( ( IS_PC( pTar ) && !IS_SET( pTar->specials.act, PLR_NOHASSLE ) ) || ( IS_NPC( pTar ) && ( ( pTar->specials.zone != pMob->specials.zone && !strchr( zone_table[ pTar->specials.zone ].races, GET_RACE( pTar ) ) ) || IS_SET( pTar->specials.act, ACT_ANNOYING ) ) ) ) && GET_POS( pTar ) > POSITION_SLEEPING && !IsImmune( pTar, IMM_SLEEP ) ) { if( IsSusc( pTar, IMM_SLEEP ) || ( !saves_spell( pTar, SAVING_PARA ) && ( !IsResist( pTar, IMM_SLEEP ) || !saves_spell( pTar, SAVING_PARA ) ) ) ) { act( "$N ti guarda fisso. La tua vista si sdoppia.", FALSE, pTar, 0, pMob, TO_CHAR ); act( "$n cade a terra addormentat$b.", TRUE, pTar, 0, 0, TO_ROOM ); if( pTar->specials.fighting ) stop_fighting( pTar ); GET_POS( pTar ) = POSITION_SLEEPING; } } } } else mudlog( LOG_SYSERR, "pMob in invalid room in VermeDellaMorte( carceri.c )" ); } return FALSE; }
int KyussSon( struct char_data *pChar, int nCmd, const char *szArg, struct char_data *pMob, int nType ) { struct char_data *pTar; struct room_data *pRoom; if( pMob == NULL ) { mudlog( LOG_SYSERR, "pMob == NULL in KyussSon( carceri.c )" ); return FALSE; } if( nType == EVENT_TICK ) { UpdateList( (CharElem **)&pMob->act_ptr ); if( ( pRoom = real_roomp( pMob->in_room ) ) != NULL ) { struct char_data *pNext; for( pTar = pRoom->people; pTar; pTar = pNext ) { pNext = pTar->next_in_room; if( CAN_SEE( pTar, pMob ) && !IsInList( (CharElem *)pMob->act_ptr, pTar ) && ( ( IS_PC( pTar ) && !IS_SET( pTar->specials.act, PLR_NOHASSLE ) ) || ( IS_NPC( pTar ) && ( ( pTar->specials.zone != pMob->specials.zone && !strchr( zone_table[ pTar->specials.zone ].races, GET_RACE( pTar ) ) ) || IS_SET( pTar->specials.act, ACT_ANNOYING ) ) ) ) ) { if( !saves_spell( pTar, SAVING_PARA ) ) { act( "Quando vedi $N, sei preso da un incontrollabile panico!", TRUE, pTar, 0, pMob, TO_CHAR ); do_flee( pTar, "", 0 ); } else { InsertInList( (CharElem **)&pMob->act_ptr, pTar, ( SECS_PER_MUD_HOUR * 48 ) / PULSE_MOBILE ); } } } } else mudlog( LOG_SYSERR, "pMob in invalid room in KyussSon( carceri.c )" ); } else if( nType == EVENT_DEATH ) FreeList( (CharElem **)&pMob->act_ptr ); return FALSE; }
int spell_ethereal_snake_strike( int sn, int level, CHAR_DATA *ch, void *vo ) { CHAR_DATA *victim = (CHAR_DATA *) vo; int dam; dam = number_range( ch->level * 5, ch->level * 7 ); if ( saves_spell( level, victim ) ) { dam = number_range( ch->level * 5 / 2, ch->level * 7 / 2 ); } damage( ch, victim, dam, sn ); return SKPELL_NO_DAMAGE; }
bool spell_causticblast(int sn, int level, CHAR_DATA * ch, void * vo, int target) { CHAR_DATA *victim = (CHAR_DATA *) vo; int dam(dice(level, 4)); // Blast them act("$n unleashes a blast of hissing acid upon $N!", ch, NULL, victim, TO_NOTVICT); act("You unleash a blast of hissing acid upon $N!", ch, NULL, victim, TO_CHAR); act("$n unleashes a blast of hissing acid upon you!", ch, NULL, victim, TO_VICT); if (saves_spell(level, ch, victim, DAM_ACID)) { damage_old(ch, victim, dam / 2, sn, DAM_ACID, true); return true; } damage_old(ch, victim, dam, sn, DAM_ACID, true); if (!IS_VALID(victim) || victim->in_room != ch->in_room) return true; act("The acid eats away at you, leaving painful, ugly scars!", victim, NULL, NULL, TO_CHAR); act("The acid eats away at $m, leaving painful, ugly scars!", victim, NULL, NULL, TO_ROOM); // Apply -charisma AFFECT_DATA af = {0}; af.where = TO_AFFECTS; af.type = sn; af.level = level; af.duration = level / 2; af.location = APPLY_CHR; af.modifier = -1; affect_to_char(victim, &af); // Apply burning for (AFFECT_DATA * paf(get_affect(victim, sn)); paf != NULL; paf = get_affect(victim, sn, paf)) { if (paf->location == APPLY_NONE) { paf->duration = UMAX(2, paf->duration); paf->modifier = UMIN(100, paf->modifier + 1); return true; } } af.duration = 2; af.location = APPLY_NONE; af.modifier = 1; affect_to_char(victim, &af); return true; }
int spell_ethereal_wolf_claw( int sn, int level, CHAR_DATA *ch, void *vo ) { CHAR_DATA *victim = (CHAR_DATA *) vo; int dam; dam = number_range( ch->level * 4, ch->level * 6 ); if ( saves_spell( level, victim ) ) { dam = number_range( ch->level * 4 / 2, ch->level * 7 / 6 ); } damage( ch, victim, dam, sn ); return SKPELL_NO_DAMAGE; }
void TrapDamage(struct char_data *v, int damtype, int amnt, struct obj_data *t) { struct char_data *tmp_ch; char buf[132]; if(DEBUG) dlog("TrapDamage"); amnt = SkipImmortals(v, amnt); if (amnt == -1) return; if (IS_AFFECTED(v, AFF_SANCTUARY)) amnt = MAX((int)(amnt/2), 0); /* Max 1/2 damage when sanct'd */ amnt = PreProcDam(v, damtype, amnt); if (saves_spell(v, SAVING_PETRI)) amnt = MAX((int)(amnt/2),0); DamageStuff(v, damtype, amnt); amnt=MAX(amnt,0); GET_HIT(v)-=amnt; update_pos(v); TrapDam(v, damtype, amnt, t); InformMess(v); if (GET_POS(v) == POSITION_DEAD) { if (!IS_NPC(v)) { if (real_roomp(v->in_room)->name) sprintf(buf, "%s killed by a trap at %s", GET_NAME(v),real_roomp(v->in_room)->name); log(buf); /* remove the hatreds of this character */ } for (tmp_ch=character_list; tmp_ch; tmp_ch=tmp_ch->next) { if (Hates(tmp_ch, v)) { RemHated(tmp_ch, v); } } die(v); } }
int spell_ethereal_snake_bite(int sn, int level, CHAR_DATA *ch, void *vo ) { CHAR_DATA *victim = (CHAR_DATA *) vo; int dam; if ( !saves_spell( level, victim ) ) { dam = number_range( ch->level * 5, ch->level * 6 ); } else { dam = number_range( ch->level * 7, ch->level * 9 ); spell_poison( skill_lookup("poison"), ch->level, ch, victim ); } damage( ch, victim, dam, sn ); return SKPELL_NO_DAMAGE; }
void cast_ventriloquate( byte level, struct char_data *ch, char *arg, int type, struct char_data *tar_ch, struct obj_data *tar_obj ) { struct char_data *tmp_ch; char buf1[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; char buf3[MAX_STRING_LENGTH]; if (type != SPELL_TYPE_SPELL) { log("Attempt to ventriloquate by non-cast-spell."); return; } for(; *arg && (*arg == ' '); arg++); if (tar_obj) { sprintf(buf1, "The %s says '%s'\r\n", fname(tar_obj->name), arg); sprintf(buf2, "Someone makes it sound like the %s says '%s'.\r\n", fname(tar_obj->name), arg); } else { sprintf(buf1, "%s says '%s'\r\n", GET_NAME(tar_ch), arg); sprintf(buf2, "Someone makes it sound like %s says '%s'\r\n", GET_NAME(tar_ch), arg); } sprintf(buf3, "Someone says, '%s'\r\n", arg); for (tmp_ch = world[ch->in_room].people; tmp_ch; tmp_ch = tmp_ch->next_in_room) { if ((tmp_ch != ch) && (tmp_ch != tar_ch)) { if ( saves_spell(tmp_ch, SAVING_SPELL) ) send_to_char(buf2, tmp_ch); else send_to_char(buf1, tmp_ch); } else { if (tmp_ch == tar_ch) send_to_char(buf3, tar_ch); } } }
void do_earthshatter( CHAR_DATA *ch, char *argument) { CHAR_DATA *vch; CHAR_DATA *vch_next; int dam; int level; if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_DROW) || !IS_SET(ch->pcdata->powers[1], DPOWER_EARTHSHATTER)) { send_to_char("Huh?\n\r", ch ); return;} if (ch->mana < 150) { send_to_char("You need more mana.\n\r", ch ); return;} level = ch->spl[PURPLE_MAGIC]; ch->mana -= 150; send_to_char("You summon the power of the underworld, shattering the earth.\n\r", ch ); act("$n causes the earth to shatter",ch,NULL,NULL,TO_ROOM); for ( vch = ch->in_room->people; vch != NULL; vch = vch_next ) { vch_next = vch->next_in_room; if (vch == ch) continue; if (vch->trust>6) continue; dam = dice(level, 7 ); if ( saves_spell( level, vch ) ) dam /= 2; damage( ch, vch, dam, skill_lookup("earthquake")); } WAIT_STATE(ch, 12); return; }
void trap_sleep(struct char_data *v) { struct affected_type af; if (!saves_spell(v, SAVING_SPELL)) { af.type = SPELL_SLEEP; af.duration = 12; af.modifier = 0; af.location = APPLY_NONE; af.bitvector = AFF_SLEEP; affect_join(v, &af, FALSE, FALSE); if (GET_POS(v) > POSITION_SLEEPING) { act("You feel very sleepy ..... zzzzzz", FALSE, v, 0, 0, TO_CHAR); act("$n goes to sleep.", TRUE, v, 0, 0, TO_ROOM); GET_POS(v) = POSITION_SLEEPING; } } else { send_to_char("You feel sleepy,but you recover\n\r", v); } }
void TrapTeleport(struct char_data *v) { int to_room; extern int top_of_world; /* ref to the top element of world */ struct room_data *room; if(DEBUG) dlog("TrapTeleport"); if (saves_spell(v,SAVING_SPELL)) { send_to_char("You feel strange, but the effect fades.\n\r",v); return; } do { to_room = number(0, top_of_world); room = real_roomp(to_room); if(room) { if(IS_SET(room->room_flags,PRIVATE)) room = 0; } } while(!room); act("$n slowly fade out of existence.", FALSE, v,0,0,TO_ROOM); char_from_room(v); char_to_room(v, to_room); act("$n slowly fade in to existence.", FALSE, v,0,0,TO_ROOM); do_look(v, "", 0); if (IS_SET(real_roomp(to_room)->room_flags,DEATH) && GetMaxLevel(v) < LOW_IMMORTAL) { death_cry(v); zero_rent(v); extract_char(v); } }
void trap_damage(struct char_data *v, int damtype, int amnt, struct obj_data *t) { amnt = skip_immortals(v, amnt); if (amnt == -1) { return; } if (IS_AFFECTED(v, AFF_SANCTUARY)) amnt = MAX((int)(amnt / 2), 0); /* Max 1/2 damage when sanct'd */ amnt = pre_proc_dam(v, damtype, amnt); if (saves_spell(v, SAVING_PETRI)) amnt = MAX((int)(amnt / 2), 0); damage_stuff(v, damtype, amnt); amnt = MAX(amnt, 0); GET_HIT(v) -= amnt; update_pos(v); trap_dam(v, damtype, amnt, t); inform_mess(v); if (GET_POS(v) == POSITION_DEAD) { if (!IS_NPC(v)) { if (real_roomp(v->in_room)->name) log_msgf("%s killed by a trap at %s", GET_NAME(v), real_roomp(v->in_room)->name); } die(v); } }
void fire_effect(void *vo, int level, int dam, int target) { if (target == TARGET_ROOM) /* nail objects on the floor */ { ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo; OBJ_DATA *obj, *obj_next; for (obj = room->contents; obj != NULL; obj = obj_next) { obj_next = obj->next_content; fire_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_CHAR) /* do the effect on a victim */ { CHAR_DATA *victim = (CHAR_DATA *) vo; OBJ_DATA *obj, *obj_next; /* chance of blindness */ if (!IS_AFFECTED(victim,AFF_BLIND) && !saves_spell(level / 4 + dam / 20, victim,DAM_FIRE)) { AFFECT_DATA af; act("$n is blinded by smoke!",victim,NULL,NULL,TO_ROOM); act("Your eyes tear up from smoke...you can't see a thing!", victim,NULL,NULL,TO_CHAR); af.where = TO_AFFECTS; af.type = skill_lookup("fire breath"); af.level = level; af.duration = number_range(0,level/10); af.location = APPLY_HITROLL; af.modifier = -4; af.bitvector = AFF_BLIND; affect_to_char(victim,&af); } /* getting thirsty */ if (!IS_NPC(victim)) gain_condition(victim,COND_THIRST,dam/20); /* let's toast some gear! */ for (obj = victim->carrying; obj != NULL; obj = obj_next) { obj_next = obj->next_content; fire_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_OBJ) /* toast an object */ { OBJ_DATA *obj = (OBJ_DATA *) vo; OBJ_DATA *t_obj,*n_obj; int chance = level / 4 + dam / 10; char *msg; if (IS_OBJ_STAT(obj,ITEM_BURN_PROOF) || IS_OBJ_STAT(obj,ITEM_NOPURGE) || number_range(0,4) == 0) return; if (chance > 25) chance = (chance - 25) / 2 + 25; if (chance > 50) chance = (chance - 50) / 2 + 50; if (IS_OBJ_STAT(obj,ITEM_BLESS)) chance -= 5; chance -= obj->level * 2; switch ( obj->item_type ) { default: return; case ITEM_CONTAINER: msg = "$p ignites and burns!"; break; case ITEM_POTION: chance += 25; msg = "$p bubbles and boils!"; break; case ITEM_SCROLL: chance += 50; msg = "$p crackles and burns!"; break; case ITEM_STAFF: chance += 10; msg = "$p smokes and chars!"; break; case ITEM_WAND: msg = "$p sparks and sputters!"; break; case ITEM_FOOD: msg = "$p blackens and crisps!"; break; case ITEM_PILL: msg = "$p melts and drips!"; break; } chance = URANGE(5,chance,95); if (number_percent() > chance) return; if (obj->carried_by != NULL) act( msg, obj->carried_by, obj, NULL, TO_ALL ); else if (obj->in_room != NULL && obj->in_room->people != NULL) act(msg,obj->in_room->people,obj,NULL,TO_ALL); if (obj->contains) { /* dump the contents */ for (t_obj = obj->contains; t_obj != NULL; t_obj = n_obj) { n_obj = t_obj->next_content; obj_from_obj(t_obj); if (obj->in_room != NULL) obj_to_room(t_obj,obj->in_room); else if (obj->carried_by != NULL) obj_to_room(t_obj,obj->carried_by->in_room); else { extract_obj(t_obj); continue; } fire_effect(t_obj,level/2,dam/2,TARGET_OBJ); } } extract_obj( obj ); return; } }
void cold_effect(void *vo, int level, int dam, int target) { if (target == TARGET_ROOM) /* nail objects on the floor */ { ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo; OBJ_DATA *obj, *obj_next; for (obj = room->contents; obj != NULL; obj = obj_next) { obj_next = obj->next_content; cold_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_CHAR) /* whack a character */ { CHAR_DATA *victim = (CHAR_DATA *) vo; OBJ_DATA *obj, *obj_next; /* chill touch effect */ if (!saves_spell(level/4 + dam / 20, victim, DAM_COLD)) { AFFECT_DATA af; act("$n turns blue and shivers.",victim,NULL,NULL,TO_ROOM); act("A chill sinks deep into your bones.",victim,NULL,NULL,TO_CHAR); af.where = TO_AFFECTS; af.type = skill_lookup("chill touch"); af.level = level; af.duration = 6; af.location = APPLY_STR; af.modifier = -1; af.bitvector = 0; affect_join( victim, &af ); } /* hunger! (warmth sucked out */ if (!IS_NPC(victim)) gain_condition(victim,COND_HUNGER,dam/20); /* let's toast some gear */ for (obj = victim->carrying; obj != NULL; obj = obj_next) { obj_next = obj->next_content; cold_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_OBJ) /* toast an object */ { OBJ_DATA *obj = (OBJ_DATA *) vo; int chance = level / 4 + dam / 10; char *msg; if (IS_OBJ_STAT(obj,ITEM_BURN_PROOF) || IS_OBJ_STAT(obj,ITEM_NOPURGE) || number_range(0,4) == 0) return; if (chance > 25) chance = (chance - 25) / 2 + 25; if (chance > 50) chance = (chance - 50) / 2 + 50; if (IS_OBJ_STAT(obj,ITEM_BLESS)) chance -= 5; chance -= obj->level * 2; switch(obj->item_type) { default: return; case ITEM_POTION: msg = "$p freezes and shatters!"; chance += 25; break; case ITEM_DRINK_CON: msg = "$p freezes and shatters!"; chance += 5; break; } chance = URANGE(5,chance,95); if (number_percent() > chance) return; if (obj->carried_by != NULL) act(msg,obj->carried_by,obj,NULL,TO_ALL); else if (obj->in_room != NULL && obj->in_room->people != NULL) act(msg,obj->in_room->people,obj,NULL,TO_ALL); extract_obj(obj); return; } }
void spell_nexus( int sn, int level, Character *ch, void *vo, int target) { Character *victim; OBJ_DATA *portal, *stone; ROOM_INDEX_DATA *to_room, *from_room; from_room = ch->in_room; if ( ( victim = get_char_world( ch, target_name ) ) == NULL || victim == ch || (to_room = victim->in_room) == NULL || !can_see_room(ch,to_room) || !can_see_room(ch,from_room) || IS_SET(to_room->room_flags, ROOM_SAFE) || IS_SET(from_room->room_flags,ROOM_SAFE) || IS_SET(to_room->room_flags, ROOM_PRIVATE) || IS_SET(to_room->room_flags, ROOM_SOLITARY) || IS_SET(to_room->room_flags, ROOM_NO_RECALL) || IS_SET(from_room->room_flags,ROOM_NO_RECALL) || victim->level >= level + 3 || (!IS_NPC(victim) && victim->level >= LEVEL_HERO) /* NOT trust */ || (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON)) || (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) ) || (IS_CLANNED(victim) && !is_same_clan(ch,victim))) { send_to_char( "You failed.\n\r", ch ); return; } stone = get_eq_char(ch,WEAR_HOLD); if (!IS_IMMORTAL(ch) && (stone == NULL || stone->item_type != ITEM_WARP_STONE)) { send_to_char("You lack the proper component for this spell.\n\r",ch); return; } if (stone != NULL && stone->item_type == ITEM_WARP_STONE) { act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR); act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR); extract_obj(stone); } /* portal one */ portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 1 + level / 10; portal->value[3] = to_room->vnum; obj_to_room(portal,from_room); act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM); act("$p rises up before you.",ch,portal,NULL,TO_CHAR); /* no second portal if rooms are the same */ if (to_room == from_room) return; /* portal two */ portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 1 + level/10; portal->value[3] = from_room->vnum; obj_to_room(portal,to_room); if (to_room->people != NULL) { act("$p rises up from the ground.",to_room->people,portal,NULL,TO_ROOM); act("$p rises up from the ground.",to_room->people,portal,NULL,TO_CHAR); } }
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); } }
int skill_ethereal_wolf( int sn, int level, CHAR_DATA *ch, void *vo ) { AFFECT_DATA af; char arg [ MAX_INPUT_LENGTH ]; CHAR_DATA *victim; /* if ( !IS_NPC( ch ) && ( ( ch->level < skill_table[sn].skill_level[ch->class] ) && (ch->level < skill_table[sn].skill_level[ch->multied]))) { send_to_char(C_DEFAULT, "You can not perform that skill.\n\r", ch ); return SKPELL_MISSED; } */ // modified check so if NPCs have spell on already // they can use bite/howl/etc - Ahsile if ( IS_NPC(ch) || number_percent( ) > ( ch->pcdata->learned[sn] / 10 ) ) { if (IS_NPC(ch)) { if (!IS_AFFECTED4(ch, AFF_ETHEREAL_WOLF)) { send_to_char( C_DEFAULT, "You failed.\n\r", ch ); return SKPELL_MISSED; } } else { send_to_char( C_DEFAULT, "You failed.\n\r", ch ); return SKPELL_MISSED; } } if ( !ch->fighting ) { if ( IS_AFFECTED4( ch, AFF_ETHEREAL_WOLF ) ) { send_to_char( AT_DGREY, "You replace your ethereal wolf with a new one.\n\r", ch ); return SKPELL_NO_DAMAGE; } /* TO DO: Mana costs */ af.type = sn; af.level = ch->level; af.duration = ch->level; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = AFF_ETHEREAL_WOLF; affect_to_char4(ch, &af); act( AT_DGREY, "$n summons an ethereal wolf!", ch, NULL, NULL, TO_ROOM ); send_to_char( AT_DGREY, "You have summoned an ethereal wolf to assist you.\n\r", ch ); WAIT_STATE( ch, skill_table[sn].beats ); return SKPELL_NO_DAMAGE; } /* Wolf commands will go here */ victim = ch->fighting; if (target_name[0] == '\0') { send_to_char( AT_DGREY, "You get the attention of your wolf.\n\r", ch ); act( AT_DGREY, "$n gets the attention of $m wolf.", ch, NULL, NULL, TO_ROOM ); return SKPELL_NO_DAMAGE; } if ( !str_cmp( target_name, "bite" ) ) { send_to_char( AT_DGREY, "You order your wolf to bite!\n\r", ch ); act( AT_DGREY, "$n orders $m ethereal wolf to bite!", ch, NULL, NULL, TO_ROOM ); WAIT_STATE( ch, skill_table[skill_lookup("ethereal wolf bite")].beats ); return spell_ethereal_wolf_bite ( skill_lookup("ethereal wolf bite"), ch->level, ch, victim ); } if ( !str_cmp( arg, "claw" ) ) { send_to_char( AT_DGREY, "You order your wolf to claw!\n\r", ch ); act( AT_DGREY, "$n orders $m ethereal wolf to claw!", ch, NULL, NULL, TO_ROOM ); WAIT_STATE( ch, skill_table[skill_lookup("ethereal wolf claw")].beats ); return spell_ethereal_wolf_claw ( skill_lookup("ethereal wolf claw"), ch->level, ch, victim ); } if ( !str_cmp( arg, "howl" ) ) { send_to_char( AT_DGREY, "You order your wolf to howl!\n\r", ch ); act( AT_DGREY, "$n orders $m ethereal wolf to howl!", ch, NULL, NULL, TO_ROOM ); spell_ethereal_wolf_howl ( skill_lookup("ethereal wolf howl"), ch->level, ch, victim ); WAIT_STATE( ch, skill_table[skill_lookup("ethereal wolf howl")].beats / 2); send_to_char( AT_DGREY, "You are terrified!\n\r", victim ); if( !saves_spell( ch->level, victim ) ) { WAIT_STATE( victim, skill_table[skill_lookup("ethereal wolf howl")].beats ); } return SKPELL_NO_DAMAGE; } send_to_char ( AT_DGREY, "You may only order your wolf to BITE, CLAW or HOWL.\n\r", ch ); return SKPELL_BOTCHED; }
void poison_effect(void *vo,int level, int dam, int target) { if (target == TARGET_ROOM) /* nail objects on the floor */ { ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo; OBJ_DATA *obj, *obj_next; for (obj = room->contents; obj != NULL; obj = obj_next) { obj_next = obj->next_content; poison_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_CHAR) /* do the effect on a victim */ { CHAR_DATA *victim = (CHAR_DATA *) vo; OBJ_DATA *obj, *obj_next; /* chance of poisoning */ if (!saves_spell(level / 4 + dam / 20,victim,DAM_POISON)) { AFFECT_DATA af; send_to_char("You feel poison coursing through your veins.\n\r", victim); act("$n looks very ill.",victim,NULL,NULL,TO_ROOM); af.where = TO_AFFECTS; af.type = gsn_poison; af.level = level; af.duration = level / 2; af.location = APPLY_STR; af.modifier = -1; af.bitvector = AFF_POISON; affect_join( victim, &af ); } /* equipment */ for (obj = victim->carrying; obj != NULL; obj = obj_next) { obj_next = obj->next_content; poison_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_OBJ) /* do some poisoning */ { OBJ_DATA *obj = (OBJ_DATA *) vo; int chance = level / 4 + dam / 10; if (IS_OBJ_STAT(obj,ITEM_BURN_PROOF) || IS_OBJ_STAT(obj,ITEM_BLESS) || number_range(0,4) == 0) return; if (chance > 25) chance = (chance - 25) / 2 + 25; if (chance > 50) chance = (chance - 50) / 2 + 50; chance -= obj->level * 2; switch (obj->item_type) { default: return; case ITEM_FOOD: break; case ITEM_DRINK_CON: if (obj->value[0] == obj->value[1]) return; break; } chance = URANGE(5,chance,95); if (number_percent() > chance) return; obj->value[3] = 1; return; } }
/* * Update all chars, including mobs. */ void char_update( void ) { CHAR_DATA *ch; CHAR_DATA *ch_next; CHAR_DATA *ch_quit; ch_quit = NULL; /* update save counter */ save_number++; if (save_number > 29) save_number = 0; for ( ch = char_list; ch != NULL; ch = ch_next ) { AFFECT_DATA *paf; AFFECT_DATA *paf_next; ch_next = ch->next; if ( ch->timer > 30 ) ch_quit = ch; if ( ch->position >= POS_STUNNED ) { /* check to see if we need to go home */ if (IS_NPC(ch) && ch->zone != NULL && ch->zone != ch->in_room->area && ch->desc == NULL && ch->fighting == NULL && !IS_AFFECTED(ch,AFF_CHARM) && number_percent() < 5) { act("$n wanders on home.",ch,NULL,NULL,TO_ROOM); extract_char(ch,TRUE); continue; } if ( ch->hit < ch->max_hit ) ch->hit += hit_gain(ch); else ch->hit = ch->max_hit; if ( ch->mana < ch->max_mana ) ch->mana += mana_gain(ch); else ch->mana = ch->max_mana; if ( ch->move < ch->max_move ) ch->move += move_gain(ch); else ch->move = ch->max_move; } if ( ch->position == POS_STUNNED ) update_pos( ch ); if ( !IS_NPC(ch) && ch->level < LEVEL_IMMORTAL ) { OBJ_DATA *obj; if ( ( obj = get_eq_char( ch, WEAR_LIGHT ) ) != NULL && obj->item_type == ITEM_LIGHT && obj->value[2] > 0 ) { if ( --obj->value[2] == 0 && ch->in_room != NULL ) { --ch->in_room->light; act( "$p goes out.", ch, obj, NULL, TO_ROOM ); act( "$p flickers and goes out.", ch, obj, NULL, TO_CHAR ); extract_obj( obj ); } else if ( obj->value[2] <= 5 && ch->in_room != NULL) act("$p flickers.",ch,obj,NULL,TO_CHAR); } if (IS_IMMORTAL(ch)) ch->timer = 0; if ( ++ch->timer >= 12 ) { if ( ch->was_in_room == NULL && ch->in_room != NULL ) { ch->was_in_room = ch->in_room; if ( ch->fighting != NULL ) stop_fighting( ch, TRUE ); act( "$n disappears into the void.", ch, NULL, NULL, TO_ROOM ); send_to_char( "You disappear into the void.\n\r", ch ); if (ch->level > 1) save_char_obj( ch ); char_from_room( ch ); char_to_room( ch, get_room_index( ROOM_VNUM_LIMBO ) ); } } gain_condition( ch, COND_DRUNK, -1 ); gain_condition( ch, COND_FULL, ch->size > SIZE_MEDIUM ? -4 : -2 ); gain_condition( ch, COND_THIRST, -1 ); gain_condition( ch, COND_HUNGER, ch->size > SIZE_MEDIUM ? -2 : -1); } for ( paf = ch->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, ch ); send_to_char( "\n\r", ch ); } } affect_remove( ch, 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(ch, gsn_plague) && ch != NULL) { AFFECT_DATA *af, plague; CHAR_DATA *vch; int dam; if (ch->in_room == NULL) continue; act("$n writhes in agony as plague sores erupt from $s skin.", ch,NULL,NULL,TO_ROOM); send_to_char("You writhe in agony from the plague.\n\r",ch); for ( af = ch->affected; af != NULL; af = af->next ) { if (af->type == gsn_plague) break; } if (af == NULL) { REMOVE_BIT(ch->affected_by,AFF_PLAGUE); continue; } if (af->level == 1) continue; 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 ( vch = ch->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); } } dam = UMIN(ch->level,af->level/5+1); ch->mana -= dam; ch->move -= dam; damage( ch, ch, dam, gsn_plague,DAM_DISEASE,FALSE); } else if ( IS_AFFECTED(ch, AFF_POISON) && ch != NULL && !IS_AFFECTED(ch,AFF_SLOW)) { AFFECT_DATA *poison; poison = affect_find(ch->affected,gsn_poison); if (poison != NULL) { act( "$n shivers and suffers.", ch, NULL, NULL, TO_ROOM ); send_to_char( "You shiver and suffer.\n\r", ch ); damage(ch,ch,poison->level/10 + 1,gsn_poison, DAM_POISON,FALSE); } } else if ( ch->position == POS_INCAP && number_range(0,1) == 0) { damage( ch, ch, 1, TYPE_UNDEFINED, DAM_NONE,FALSE); } else if ( ch->position == POS_MORTAL ) { damage( ch, ch, 1, TYPE_UNDEFINED, DAM_NONE,FALSE); } } /* * Autosave and autoquit. * Check that these chars still exist. */ for ( ch = char_list; ch != NULL; ch = ch_next ) { ch_next = ch->next; if (ch->desc != NULL && ch->desc->descriptor % 30 == save_number) { save_char_obj(ch); } if (ch == ch_quit) { do_function(ch, &do_quit, "" ); } } return; }
void shock_effect(void *vo,int level, int dam, int target) { if (target == TARGET_ROOM) { ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo; OBJ_DATA *obj, *obj_next; for (obj = room->contents; obj != NULL; obj = obj_next) { obj_next = obj->next_content; shock_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_CHAR) { CHAR_DATA *victim = (CHAR_DATA *) vo; OBJ_DATA *obj, *obj_next; /* daze and confused? */ if (!saves_spell(level/4 + dam/20,victim,DAM_LIGHTNING)) { send_to_char("Your muscles stop responding.\n\r",victim); DAZE_STATE(victim,UMAX(12,level/4 + dam/20)); } /* toast some gear */ for (obj = victim->carrying; obj != NULL; obj = obj_next) { obj_next = obj->next_content; shock_effect(obj,level,dam,TARGET_OBJ); } return; } if (target == TARGET_OBJ) { OBJ_DATA *obj = (OBJ_DATA *) vo; int chance = level / 4 + dam / 10; char *msg; if (IS_OBJ_STAT(obj,ITEM_BURN_PROOF) || IS_OBJ_STAT(obj,ITEM_NOPURGE) || number_range(0,4) == 0) return; if (chance > 25) chance = (chance - 25) / 2 + 25; if (chance > 50) chance = (chance - 50) /2 + 50; if (IS_OBJ_STAT(obj,ITEM_BLESS)) chance -= 5; chance -= obj->level * 2; switch(obj->item_type) { default: return; case ITEM_WAND: case ITEM_STAFF: chance += 10; msg = "$p overloads and explodes!"; break; case ITEM_JEWELRY: chance -= 10; msg = "$p is fused into a worthless lump."; } chance = URANGE(5,chance,95); if (number_percent() > chance) return; if (obj->carried_by != NULL) act(msg,obj->carried_by,obj,NULL,TO_ALL); else if (obj->in_room != NULL && obj->in_room->people != NULL) act(msg,obj->in_room->people,obj,NULL,TO_ALL); extract_obj(obj); return; } }
void do_forge(CHAR_DATA * ch, char *argument) { char arg[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char buf[MAX_INPUT_LENGTH]; OBJ_DATA *obj, *hammer; int wear, lvl; long group1 = ITEM_ANTI_HUMAN + ITEM_ANTI_DROW + ITEM_ANTI_ELF + ITEM_ANTI_ELDER; long group2 = ITEM_ANTI_OGRE + ITEM_ANTI_TROLL + ITEM_ANTI_DEMON + ITEM_ANTI_MINOTAUR; long group3 = ITEM_ANTI_DWARF + ITEM_ANTI_HALFLING + ITEM_ANTI_SHADOW; long group4 = ITEM_ANTI_ILLITHID + ITEM_ANTI_GHOUL; long group5 = ITEM_ANTI_PIXIE; long group6 = ITEM_ANTI_LIZARDMAN; long antirace = 0; wear = 0; if (ch->race != RACE_DWARF) { send_to_char(AT_GREY, "You aren't a dwarf!\n\r", ch); return; } if (argument[0] == '\0') { send_to_char(AT_WHITE, "Syntax: Forge <obj> <race> <lvl>\n\r", ch); send_to_char(AT_WHITE, " obj = ring necklace armor helm\n\r", ch); send_to_char(AT_WHITE, " mask leggings boots gauntlets\n\r", ch); send_to_char(AT_WHITE, " gauntlets armplates shield\n\r", ch); send_to_char(AT_WHITE, " belt bracer anklet weapon\n\r", ch); send_to_char(AT_WHITE, " race= any valid race. HELP FORGE RACES\n\r", ch); send_to_char(AT_WHITE, " to see race groupings.\n\r", ch); sprintf(buf, " lvl = minimum 30, maximum %d.\n\r", ch->level); send_to_char(AT_WHITE, buf, ch); send_to_char(AT_WHITE, " BASE cost to make item is: 100 gold * lvl\n\r", ch); return; } if (ch->in_room->vnum != ROOM_VNUM_SMITHY) { send_to_char(AT_GREY, "You cannot forge equipment here.\n\r", ch); return; } for (hammer = ch->carrying; hammer; hammer = hammer->next) { if (hammer->pIndexData->vnum == OBJ_VNUM_SMITHY_HAMMER && hammer->wear_loc == WEAR_HOLD) break; } if (!hammer) { send_to_char(AT_GREY, "You must hold a smithy hammer to forge something.\n\r", ch); return; } argument = one_argument(argument, arg); argument = one_argument(argument, arg2); if (!str_prefix(arg, "ring")) wear = ITEM_WEAR_FINGER; if (!str_prefix(arg, "necklace")) wear = ITEM_WEAR_NECK; if (!str_prefix(arg, "armor")) wear = ITEM_WEAR_BODY; if (!str_prefix(arg, "helm")) wear = ITEM_WEAR_HEAD; if (!str_prefix(arg, "mask")) wear = ITEM_WEAR_FACE; if (!str_prefix(arg, "leggings")) wear = ITEM_WEAR_LEGS; if (!str_prefix(arg, "boots")) wear = ITEM_WEAR_FEET; if (!str_prefix(arg, "gauntlets")) wear = ITEM_WEAR_HANDS; if (!str_prefix(arg, "armplates")) wear = ITEM_WEAR_ARMS; if (!str_prefix(arg, "shield")) wear = ITEM_WEAR_SHIELD; if (!str_prefix(arg, "belt")) wear = ITEM_WEAR_WAIST; if (!str_prefix(arg, "bracer")) wear = ITEM_WEAR_WRIST; if (!str_prefix(arg, "anklet")) wear = ITEM_WEAR_ANKLE; if (!str_prefix(arg, "weapon")) wear = ITEM_WIELD; if (!str_prefix(arg2, "elf") || !str_prefix(arg2, "drow") || !str_prefix(arg2, "elder") || !str_prefix(arg2, "human")) antirace = group2 + group3 + group4 + group5 + group6; if (!str_prefix(arg2, "ogre") || !str_prefix(arg2, "demon") || !str_prefix(arg2, "troll") || !str_prefix(arg2, "minotaur")) antirace = group1 + group3 + group4 + group5 + group6; if (!str_prefix(arg2, "dwarf") || !str_prefix(arg2, "halfling") || !str_prefix(arg2, "shadow")) antirace = group1 + group2 + group4 + group5 + group6; if (!str_prefix(arg2, "illithid") || !str_prefix(arg2, "ghoul")) antirace = group1 + group2 + group3 + group5 + group6; if (!str_prefix(arg2, "pixie")) antirace = group1 + group2 + group3 + group4 + group6; if (!str_prefix(arg2, "lizardman")) antirace = group1 + group2 + group3 + group4 + group5; if (is_number(argument)) lvl = atoi(argument); else lvl = 0; if (wear && antirace && (lvl < 30 || lvl > ch->level)) { sprintf(buf, "Illegal level. Valid levels are 30 to %d.\n\r", ch->level); send_to_char(AT_GREY, buf, ch); return; } if (wear && antirace == 0) { send_to_char(AT_GREY, "Illegal race. Help RACE for valid race list.\n\r", ch); return; } if (wear) { #ifdef NEW_MONEY if ((ch->money.gold + (ch->money.silver / SILVER_PER_GOLD) + (ch->money.copper / COPPER_PER_GOLD)) < (lvl * 100)) { #else if (ch->gold < lvl * 10000) { #endif send_to_char(AT_GREY, "You do not have enough money to create the base item of this level.\n\r", ch); return; } else if (wear == ITEM_WIELD) obj = create_object(get_obj_index(OBJ_VNUM_TO_FORGE_W), lvl); else obj = create_object(get_obj_index(OBJ_VNUM_TO_FORGE_A), lvl); #ifdef NEW_MONEY obj->cost.silver = obj->cost.copper = 0; obj->cost.gold = lvl * 100; #else obj->cost = lvl * 10000; #endif obj->weight = lvl * 0.15; obj->level = lvl; obj->anti_race_flags = antirace; if (obj->level >= 101) obj->extra_flags += ITEM_NO_DAMAGE; obj->wear_flags += wear; forge_obj(ch, obj); } else do_forge(ch, ""); return; } void do_spit(CHAR_DATA * ch, char *argument) { AFFECT_DATA af; CHAR_DATA *victim; char arg[MAX_INPUT_LENGTH]; int dam; if (ch->race != RACE_LIZARDMAN) { send_to_char(AT_GREY, "Huh?\n\r", ch); return; } if (ch->race_wait > 0) return; if (!ch->fighting) { send_to_char(C_DEFAULT, "You aren't fighting anyone.\n\r", ch); return; } one_argument(argument, arg); victim = ch->fighting; if (arg[0] != '\0') if (!(victim = get_char_room(ch, arg))) { send_to_char(C_DEFAULT, "They aren't here.\n\r", ch); return; } dam = ch->level + number_range(ch->level, ch->level * 4); damage(ch, victim, dam, gsn_spit); ch->race_wait = 36; if (!victim || victim->position == POS_DEAD || !victim->in_room || victim->in_room != ch->in_room) return; if (number_percent() < 25) { int location = number_range(0, 1); switch (location) { case 0: if (victim->race != RACE_ILLITHID) { act(AT_DGREEN, "You spit right in $S eyes!", ch, NULL, victim, TO_CHAR); act(AT_DGREEN, "$n spit into $N's eyes!", ch, NULL, victim, TO_NOTVICT); act(AT_DGREEN, "$n spit into your eyes!", ch, NULL, victim, TO_VICT); if (!IS_AFFECTED(victim, AFF_BLIND)) { send_to_char(AT_WHITE, "You are blinded!", victim); act(AT_WHITE, "$n is blinded!", victim, NULL, NULL, TO_ROOM); af.type = gsn_spit; af.level = ch->level; af.duration = 0; af.location = APPLY_HITROLL; af.modifier = -10; af.bitvector = AFF_BLIND; affect_to_char(victim, &af); af.location = APPLY_AC; af.modifier = 50; affect_to_char(victim, &af); } } break; case 1: act(AT_DGREEN, "You spit right in $S mouth!", ch, NULL, victim, TO_CHAR); act(AT_DGREEN, "$n spit into $N's mouth! Gross!", ch, NULL, victim, TO_NOTVICT); act(AT_DGREEN, "$n spit into your mouth!", ch, NULL, victim, TO_VICT); send_to_char(AT_WHITE, "The acidic spit burns your mouth and throat.\n\r", victim); STUN_CHAR(victim, 2, STUN_MAGIC); break; } } if (!saves_spell(ch->level, victim) && victim->race != RACE_GHOUL) { af.type = gsn_poison; af.level = ch->level; af.duration = 2; af.location = APPLY_STR; af.modifier = -3; af.bitvector = 0; affect_join(victim, &af); } return; }