void muckle_over(int awardQP) { CharData *i; int reward = 0; for(i = character_list; i; i = i->next) { sendChar(i, "The quest is over.\r\n"); REMOVE_BIT_AR(PRF_FLAGS(i), PRF_QUEST); if(!awardQP) break; reward = i->muckleTime/60 + (i->muckleTime % 60 > 0 ? 1:0); if(i->muckleTime == muckle_duration * 60) reward += 2; if(!IS_NPC(i) && reward) { sendChar(i, "You have been awarded %d quest points for your effort.\r\n", reward); GET_QP(i) += reward; mudlog(BRF, LVL_IMMORT, TRUE, "%s has received %d quest points for %s efforts in muckle.", GET_NAME(i), reward, HSHR(i)); } i->muckleTime = 0; } CONFIG_QUEST_ACTIVE = 0; }
static void event_rats_invade_zone(struct char_data *ch, char *arg) { struct event_mob_set mobset[11] = { /* vnum, hp: xdy+z, exp: xdy+z, gold: xdy+z, object %, obj vnum */ {4618, 6, 8, 8, 1, 6, 4, 2, 6, 0, 2, 4602}, /* special large rat */ {4618, 4, 6, 5, 1, 6, 4, 1, 6, 0, 0, -1}, /* large rat */ {4618, 4, 6, 3, 1, 6, 4, 1, 4, 0, 0, -1}, /* large rat */ {3432, 3, 6, 1, 1, 6, 4, 1, 2, -1, 0, -1}, /* disgusting rat */ {3432, 2, 6, 1, 1, 6, 4, 0, 0, 0, 0, -1}, /* disgusting rat */ {3432, 2, 6, 1, 1, 6, 4, 0, 0, 0, 0, -1}, /* disgusting rat */ {3432, 2, 6, 1, 1, 6, 4, 0, 0, 0, 0, -1}, /* disgusting rat */ {3433, 4, 6, 1, 1, 6, 4, 1, 4, -1, 0, -1}, /* giant rat */ {3433, 4, 6, 1, 1, 6, 4, 1, 4, -1, 0, -1}, /* giant rat */ {3433, 4, 6, 5, 1, 6, 4, 1, 4, -1, 0, -1}, /* giant rat */ {5056, 3, 8, 5, 2, 6, 10, 1, 2, -1, 0, -1} /* black cat */ }; struct event_mob_in_zone mobs = { 0, 0, 60, 1, 8, 11, mobset }; int zone = 0; struct room_data *rp = NULL; if (DEBUG > 1) log_info("called %s with %s, %s", __PRETTY_FUNCTION__, SAFE_NAME(ch), VNULL(arg)); if ((rp = real_roomp(ch->in_room))) zone = rp->zone; else return; mobs.bottom = zone ? (zone_table[zone - 1].top + 1) : 0; mobs.top = zone_table[zone].top; if (IS_SET(ch->specials.act, PLR_STEALTH)) zprintf(zone, "\r\nYou feel a great surge of power!\r\nYou hear odd scurrying sounds all around you...\r\n\r\n"); else zprintf(zone, "\r\nIn a puff of acrid smoke, you see %s snap %s fingers!\r\nYou hear odd scurrying sounds all around you...\r\n\r\n", GET_NAME(ch), HSHR(ch)); mob_count = 0; hash_iterate(&room_db, (funcp)event_fill_zone_with_mobs, &mobs); cprintf(ch, "You just added %d rats to %s [#%d].\r\n", mob_count, zone_table[zone].name, zone); log_info("%s added %d rats to %s [#%d].", GET_NAME(ch), mob_count, zone_table[zone].name, zone); }
static void event_scatter_goodies(struct char_data *ch, char *arg) { int the_objects[] = { 5023, 6131, 5932, 15011, 7010, 5937, 1901, 9015 }; int the_mobs[] = { 1200, 9618, 1400, 5441, 5054, 5055, 15047, 9620, 1202, 9601 }; struct event_goodies junk = { 0, 0, 50, 4, 6, -3, 7, 8, the_objects, 11, 10, the_mobs }; int zone = 0; struct room_data *rp = NULL; if (DEBUG > 1) log_info("called %s with %s, %s", __PRETTY_FUNCTION__, SAFE_NAME(ch), VNULL(arg)); if ((rp = real_roomp(ch->in_room))) zone = rp->zone; else return; junk.bottom = zone ? (zone_table[zone - 1].top + 1) : 0; junk.top = zone_table[zone].top; if (IS_SET(ch->specials.act, PLR_STEALTH)) zprintf(zone, "\r\nSuddenly, you fell the winds HOWL into being!\r\nYou can hear the sounds of things FALLING all around you!\r\n\r\n"); else zprintf(zone, "\r\nYou hear %s chanting, and suddenly a wind HOWLS in from %s direction!\r\nYou can hear the sounds of things FALLING all around you!\r\n\r\n", GET_NAME(ch), HSHR(ch)); mob_count = obj_count = gold_count = 0; hash_iterate(&room_db, (funcp)event_scatter_goodies_zone, &junk); cprintf(ch, "You just added %d critters, %d things, and %d gold to %s [#%d].\r\n", mob_count, obj_count, gold_count, zone_table[zone].name, zone); log_info("%s added %d critters, %d things, and %d gold to %s [#%d].\r\n", GET_NAME(ch), mob_count, obj_count, gold_count, zone_table[zone].name, zone); }
static void event_zombie_master(struct char_data *ch, char *arg) { struct room_data *rp = NULL; struct char_data *master = NULL; struct char_data *mob = NULL; int i = 0; int j = 0; if (DEBUG > 1) log_info("called %s with %s, %s", __PRETTY_FUNCTION__, SAFE_NAME(ch), VNULL(arg)); if ((rp = real_roomp(ch->in_room))) { master = read_mobile(666, VIRTUAL); /* xenthia, lady of the dead */ j = dice(1, 4) + 3; if (IS_SET(ch->specials.act, PLR_STEALTH)) allprintf ("\r\nYou feel a darkening of the land.\r\nYou hear a low moaning wind arise nearby...\r\n\r\n"); else allprintf ("\r\n%s begins a low incantation, and a bolt of ebon lightning strikes %s upraised hands!\r\nYou hear a low moaning wind arise nearby...\r\n\r\n", GET_NAME(ch), HSHR(ch)); for (i = 0; i < j; i++) { mob = read_mobile(100, VIRTUAL); /* zombie */ char_to_room(mob, ch->in_room); SET_BIT(mob->specials.affected_by, AFF_CHARM); GET_EXP(mob) = number(300, 500); add_follower(mob, master); mob->points.max_hit = dice(4, 10) + 10; mob->points.hit = mob->points.max_hit; AddHatred(master->followers->follower, OP_VNUM, ZM_NEMESIS); SET_BIT(master->followers->follower->specials.act, ACT_GUARDIAN); SET_BIT(master->followers->follower->specials.act, ACT_USE_ITEM); SET_BIT(master->followers->follower->specials.affected_by, AFF_FLYING); } char_to_room(master, ch->in_room); } }
void sub_write_to_char(char_data *ch, char *tokens[], void *otokens[], char type[]) { char sb[MAX_STRING_LENGTH]; int i; strcpy(sb,""); for (i = 0; tokens[i + 1]; i++) { strcat(sb,tokens[i]); switch (type[i]) { case '~': if (!otokens[i]) strcat(sb,"someone"); else if ((char_data *)otokens[i] == ch) strcat(sb,"you"); else { GET_PERS((char_data*) otokens[i], ch, chname); strcat(sb, chname); FREE_NAME(chname); } break; case '@': if (!otokens[i]) strcat(sb,"someone's"); else if ((char_data *)otokens[i] == ch) strcat(sb,"your"); else { GET_PERS((char_data*) otokens[i], ch, chname); strcat(sb, chname); FREE_NAME(chname); strcat(sb,"'s"); } break; case '^': if (!otokens[i] || !CAN_SEE(ch, (char_data *) otokens[i])) strcat(sb,"its"); else if (otokens[i] == ch) strcat(sb,"your"); else strcat(sb,HSHR((char_data *) otokens[i])); break; case '&': if (!otokens[i] || !CAN_SEE(ch, (char_data *) otokens[i])) strcat(sb,"it"); else if (otokens[i] == ch) strcat(sb,"you"); else strcat(sb,HSSH((char_data *) otokens[i])); break; case '*': if (!otokens[i] || !CAN_SEE(ch, (char_data *) otokens[i])) strcat(sb,"it"); else if (otokens[i] == ch) strcat(sb,"you"); else strcat(sb,HMHR((char_data *) otokens[i])); break; case '`': if (!otokens[i]) strcat(sb,"something"); else strcat(sb,OBJS(((obj_data *) otokens[i]), ch)); break; } } strcat(sb,tokens[i]); strcat(sb,"\n\r"); sb[0] = toupper(sb[0]); send_to_char(sb,ch); }