void do_bladespin( CHAR_DATA *ch, char *argument ) { if ( IS_NPC(ch) ) return; if ( !IS_CLASS(ch, CLASS_SAMURAI) ) { stc("Huh?\n\r",ch); return; } if (ch->wpn[3] < 1000 || ch->wpn[0]<1000 || ch->wpn[1] <1000) { stc("You are not a true samurai yet.\n\r",ch); return; } if ( IS_SET(ch->newbits, NEW_BLADESPIN) ) { stc("You relax your combat techniques.\n\r",ch); act("$n relaxes.",ch,NULL,NULL,TO_ROOM); REMOVE_BIT(ch->newbits, NEW_BLADESPIN); return; } if (!IS_SET(ch->newbits, NEW_BLADESPIN) ) { stc("Your concentrate on your combat techniques.\n\r",ch); act("$n's muscles flexes, looking for prey that one, better beware!",ch,NULL,NULL,TO_ROOM); SET_BIT(ch->newbits, NEW_BLADESPIN); return; } return; }
/* * I wanted a function that would allow me to easily make a select statement from inside the MUD, so here it is.. * It will mostly format the output in a boxed setup. Todo - break this out so you can use select, insert, update, or create * effectively becoming a remote interface to run queries of any type.. * -Syn */ void do_sqlgenselect(CHAR_DATA *ch, char *argument) { MYSQL_RES *res; char query[4096*2]; snprintf(query, sizeof(query) -1, argument); if(!mysql_safe_query(query)) { stc("#W\n\rSomething went wrong, check the string and try again.\n\r#0",ch); return; } res = mysql_store_result(&db); unsigned int numfields = mysql_num_fields(res); if((numfields == 0) || (numfields == NULL)) { stc("#W\n\rSomething went wrong, check the string and try again.\n\r#0",ch); return; } if(argument == NULL) { send_to_char("SQL SELECT query.. general syntax: SELECT <stuff> FROM <someplace> ORDER BY <root-order>\n\r",ch); return; } if((res == NULL) || (!res)) { send_to_char("It might help if you entered a valid SQL SELECT query.. general syntax: SELECT <stuff> FROM <someplace> ORDER BY <root-order>\n\r",ch); return; } process_result_set(ch, &db, res); mysql_free_result(res); return; }
void do_swoop( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; ROOM_INDEX_DATA *location; CHAR_DATA *victim; one_argument (argument, arg); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_ANGEL)) { send_to_char("Huh?\n\r", ch ); return; } if (ch->pcdata->powers[ANGEL_JUSTICE] < 1) { send_to_char("You haven't learned to fly yet.\n\r",ch); return; } if (!IS_SET(ch->pcdata->powers[ANGEL_POWERS], ANGEL_WINGS)) { send_to_char("Where are your wings?\n\r",ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char("Swoop down on whom?\n\r", ch ); return; } if (IS_SET(victim->in_room->room_flags, ROOM_ASTRAL)) { stc( "You can't find it's room.\n\r",ch); return; } if (IS_IMMUNE(victim, IMM_TRAVEL) && !IS_NPC(victim)) { send_to_char("I don't think they want you to do that.\n\r",ch); return; } if (IS_SET(ch->in_room->room_flags, ROOM_ASTRAL)) { stc( "Your room is not connected to the astral plane.\n\r",ch); return; } location = victim->in_room; if (ch->move < 500) { send_to_char("You don't have the move to fly that far.\n\r", ch ); return; } act("You fly up into the sky.", ch, NULL, NULL, TO_CHAR); act("$n flies into the sky.", ch, NULL, NULL, TO_ROOM); ch->move -= 500; char_from_room(ch); char_to_room(ch, location); do_look(ch, "auto"); act("You swoop down upon $N.", ch, NULL, victim, TO_CHAR); act("$n swoops down from the sky.", ch, NULL, NULL, TO_ROOM); return; }
void do_pshift( CHAR_DATA *ch, char *argument ) { ROOM_INDEX_DATA *to_room; EXIT_DATA *pexit; CHAR_DATA *victim; int door; if (!IS_CLASS(ch, CLASS_WIZARD)) { stc("Huh?\n\r",ch); return; } if (ch->pcdata->stats[WL_SPELLS] < 5) { stc("#RYou do not yet have mastery of this spell.#n\n\r",ch); return; } if ( ( victim = ch->fighting ) == NULL ) { if ( ch->position == POS_FIGHTING ) ch->position = POS_STANDING; send_to_char( "You aren't fighting anyone.\n\r", ch ); return; } if(ch->mana < 750) { send_to_char("#RYou d not have the 750 required mana.\n\r",ch); return; } door = number_door( ); if ( ( pexit = ch->in_room->exit[door] ) == NULL || (to_room = pexit->to_room) == NULL) { act( "#y$n#R mutters some words and disappears!", ch, NULL, NULL, TO_ROOM ); send_to_char( "#RYou mutter some dark words and vanish from combat.\n\r", ch ); char_from_room( ch ); char_to_room( ch, get_room_index(ROOM_VNUM_ALTAR)); stop_fighting( ch, TRUE ); return; }; act( "#y$n#R mutters some words and disappears!", ch, NULL, NULL, TO_ROOM ); send_to_char( "#RYou mutter some dark words and vanish from combat.\n\r", ch ); char_from_room(ch); char_to_room( ch, to_room ); do_look(ch,"auto"); stop_fighting( ch, TRUE ); ch->mana -= 750; return; }
/* syntax : teleport <target> * ex : teleport satan */ void do_teleport (CHAR_DATA *ch, char *argument) { char arg[MAX_INPUT_LENGTH]; ROOM_INDEX_DATA *location; CHAR_DATA *victim; one_argument (argument, arg); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_MAGE)) { send_to_char("Huh?\n\r", ch ); return; } if (ch->pcdata->powers[PINVOKE] < 1) /* 1 is just a test */ { send_to_char("You don't have that invoke yet.\n\r",ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char("Teleport to whom?\n\r", ch ); return; } if (IS_SET(victim->in_room->room_flags, ROOM_ASTRAL)) { stc( "You can't find it's room.\n\r",ch); return; } if (IS_IMMUNE(victim, IMM_TRAVEL) && !IS_NPC(victim)) { send_to_char("I don't think they want you to do that.\n\r",ch); return; } if (IS_SET(ch->in_room->room_flags, ROOM_ASTRAL)) { stc( "Your room is not connected to the astral plane.\n\r",ch); return; } location = victim->in_room; if (ch->mana < 250) { send_to_char("You don't have the mana to cast teleport.\n\r", ch ); return; } act("You utter a single powerword.", ch, NULL, NULL, TO_CHAR); act("$n utters a strange sounding word and disappers.", ch, NULL, NULL, TO_ROOM); ch->mana -= 250; char_from_room(ch); char_to_room(ch, location); do_look(ch, "auto"); act("You materialize.", ch, NULL, NULL, TO_CHAR); act("$n suddenly appear from out of nowhere.", ch, NULL, NULL, TO_ROOM); return; }
int main() { STC<void> stc(fun1); stc(); { STC<void> stc(fun2); stc(); } stc(); }
void do_neededhelpfiles(CHAR_DATA *ch, char *argument) { HELP_DATA *pHelp; bool bIsHelp = TRUE; char *agg; sh_int col = 0; int star = 0; int cmd; int nLimit = 0; bool bChanged = FALSE; bool foundstar = FALSE; char buf[MAX_INPUT_LENGTH]; if ( argument[0] == '\0' ) return stcf(ch,"Syntax: neededhelpfiles <max amount of help files>\n\r"); nLimit = atoi(argument); for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ ) { foundstar = TRUE; agg = cmd_table[cmd].name; if ( (pHelp = get_help( ch, agg )) == NULL ) { bIsHelp = FALSE; star++; col++; if ( star >= nLimit ) break; bChanged = TRUE; } else bIsHelp = TRUE; sprintf( buf, "%-15s#n",cmd_table[cmd].name ); if ( bIsHelp == FALSE ) send_to_char( buf, ch ); if ( col % 5 == 0 && bChanged == TRUE) send_to_char( "\n\r", ch ); bChanged = FALSE; } if (col % 5 != 0 && foundstar) send_to_char("\n\r", ch); if (foundstar && star != 0) { sprintf(buf, "\n%d command%s found.\n\r", star, (star > 1) ? "s" : ""); stc(buf, ch); } if (!foundstar) { stc("No commands found.\n\r", ch); } return; }
void shopping_list(char *arg, struct char_data *ch, struct char_data * keeper, int shop_nr) { char buf[MAX_STRING_LENGTH], name[MAX_INPUT_LENGTH]; struct obj_data *obj, *last_obj = 0; int cnt = 0, index = 0; bool found = FALSE; if (!(is_ok(keeper, ch, shop_nr))) return; if (SHOP_SORT(shop_nr) < IS_CARRYING_N(keeper)) sort_keeper_objs(keeper, shop_nr); one_argument(arg, name); strcpy(buf, " ## Available Item Cost\n\r"); strcat(buf, "-------------------------------------------------------------------------\n\r"); if (keeper->carrying) for (obj = keeper->carrying; obj; obj = obj->next_content) if (CAN_SEE_OBJ(ch, obj) && (obj->obj_flags.cost > 0)) { if (!last_obj) { last_obj = obj; cnt = 1; } else if (same_obj(last_obj, obj)) cnt++; else { index++; if (!(*name) || isname(name, last_obj->name)) { strcat(buf, list_object(ch, last_obj, cnt, index, shop_nr)); found = TRUE; } cnt = 1; last_obj = obj; } } index++; if (!last_obj) stc("Currently, there is nothing for sale.\r\n", ch); else if (*name && !found) stc("Presently, none of those are for sale.\r\n", ch); else { if (!(*name) || isname(name, last_obj->name)) strcat(buf, list_object(ch, last_obj, cnt, index, shop_nr)); page_string(ch->desc, buf, 1); } }
int main() { // load all settings from configuration file Settings::loadConfFile(); // Map Init Map map(Settings::MAP_RESOLUTION, Settings::ROBOT_SIZE); // Load map from image file const char* filePath = Settings::MAP_IMAGE_PATH.c_str(); map.loadMapFromFile(filePath); // Map inflation map.inflateObstacles(); map.buildFineGrid(); map.buildCoarseGrid(); // STC Position startPos; startPos.first = Settings::STC_START_POS_X; startPos.second = Settings::STC_START_POS_Y; STC stc(map, startPos); stc.printPath(); map.addPathToFile(Settings::STC_IMAGE_PATH.c_str(),stc.getPath()); // Connect and initialize robot Robot robot(Settings::HOST,Settings::PORT); //add way points to robot robot.setWayPoints(map.getWayPoints()); PlnObstacleAvoid pln(&robot); Manager m(&robot, &pln); m.run(); return 0; }
void do_damtest(CHAR_DATA *ch, char *argument) { char buf[MAX_STRING_LENGTH]; int dam; int ac=0; ac-=(number_range(4,10)*500); dam = 0; dam+=number_range((ch->damcap[DAM_CAP]/2)+ac,ch->damcap[DAM_CAP]); dam +=ch->damroll; if(dam>ch->damcap[DAM_CAP])dam=ch->damcap[DAM_CAP]; dam +=ac/10; sprintf(buf,"%d damage",dam); stc(buf,ch); sprintf(buf," aginst %d AC",ac); stc(buf,ch); }
void do_magicsight( CHAR_DATA *ch, char *argument ) { if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_WIZARD)) { send_to_char("Huh?\n\r",ch); return; } if (IS_CLASS(ch, CLASS_WIZARD) && ch->pcdata->powers[WL_SKILLS] < 2) { stc("You can't do that yet.\n\r",ch); return; } if ( IS_SET(ch->act, PLR_HOLYLIGHT) ) { REMOVE_BIT(ch->act, PLR_HOLYLIGHT); send_to_char( "#CYour senses return to normal.\n\r", ch ); } else { SET_BIT(ch->act, PLR_HOLYLIGHT); send_to_char( "#CYour #sm#sa#sg#si#sc#sa#sl #Csenses increase to incredible proportions.\n\r", ch ); } return; }
void wxExGuiReportTestFixture::testSTCWithFrame() { wxExFrameWithHistory* frame = (wxExFrameWithHistory *)wxTheApp->GetTopWindow(); wxExSTCWithFrame stc(frame, frame, wxExFileName(TEST_FILE)); CPPUNIT_ASSERT(stc.GetFileName().GetFullPath().Contains("test.h")); stc.PropertiesMessage(); }
void do_spiderform( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; argument = one_argument(argument,arg); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_DROW) ||!IS_SET(ch->pcdata->powers[1], DPOWER_SPIDERFORM)) {send_to_char("Huh?\n\r", ch ); return;} if (IS_AFFECTED(ch, AFF_POLYMORPH)) { send_to_char("You can't spiderform while changed.\n\r", ch ); return; } if (IS_SET(ch->newbits,NEW_DFORM)) { sprintf(buf, "$n morphs back into %s.", GET_PROPER_NAME(ch)); act(buf, ch, NULL, NULL, TO_ROOM); stc("You return to your normal form.\n\r", ch); free_string(ch->morph); ch->morph = str_dup(""); ch->hitroll -= 400; ch->damroll -= 400; ch->armor += 1000; REMOVE_BIT(ch->newbits,NEW_DFORM); REMOVE_BIT(ch->newbits,THIRD_HAND); REMOVE_BIT(ch->newbits,FOURTH_HAND); WAIT_STATE(ch, 7); return; } else if (!IS_SET(ch->newbits,NEW_DFORM)) { act("You mutate into a giant spider.",ch,NULL,NULL,TO_CHAR); act("$n mutates into a giant spider.",ch,NULL,NULL,TO_ROOM); sprintf(buf,"%s the giant mylochar",ch->name); free_string(ch->morph); ch->morph = str_dup(buf); ch->hitroll += 400; ch->damroll += 400; ch->armor -= 1000; SET_BIT(ch->newbits,NEW_DFORM); SET_BIT(ch->newbits,THIRD_HAND); SET_BIT(ch->newbits,FOURTH_HAND); return; } return; }
void do_activequest(CHAR_DATA *ch, char *argument) { sh_int nQuestObjects = 0; char cBuffer[100]; OBJ_DATA *obj = NULL; for ( obj = object_list; obj != NULL; obj = obj->next ) { if ( obj != NULL && IS_SET(obj->extra_flags,ITEM_QUESTED) ) { if ( nQuestObjects < 20 ) { sprintf(cBuffer,"%s still needs to be found.\n\r",obj->short_descr); stc(cBuffer,ch); } nQuestObjects++; } } sprintf(cBuffer,"#GThere are %d quest objects left to find.\n\r",nQuestObjects); stc(cBuffer,ch); WAIT_STATE(ch,5); return; }
void do_averagedamtest(CHAR_DATA *ch, char *argument) { char buf[MAX_STRING_LENGTH]; int dam; int ac=0; int dam2=0; int i; ac-=(number_range(4,10)*500); for(i=0;i<100;i++) { dam=0; dam+=number_range((ch->damcap[DAM_CAP]/2)+ac,ch->damcap[DAM_CAP]); dam +=ch->damroll; if(dam>ch->damcap[DAM_CAP])dam=ch->damcap[DAM_CAP]; dam +=ac/10; dam2+=dam; } sprintf(buf,"%d damage",dam2); stc(buf,ch); sprintf(buf," aginst %d AC",ac); stc(buf,ch); sprintf(buf," for %d average damage",dam2/100); stc(buf,ch); }
void sparseSystem::sparseSystemRow::print(FILE *fp, int sz) { List stc(cips); stc.sort(&sparseSystem::sparseSystemRow::rowcompare); coeffIndexPair *f; int j=0; for (Node *n=stc.head(); n!=NULL; n=n->next()) { f = (coeffIndexPair *)n->data; while (f->index > j) {fprintf(fp,"0.000 "); j++;} fprintf(fp, "%.3f ",f->coeff); j++; } for (; j<sz; j++) fprintf(fp,"0.000 "); }
int pascal far IRQHandler(void) { gInInterrupt=TRUE; // int3(); if (pOhciDriver->IrqHandler()) { // we process interrupt cli(); DevHelp_EOI(pOhciDriver->pPCICard->ucGetIntrLine()); clc(); sti(); // int3(); gInInterrupt=FALSE; return 0; } // not our interrupt stc(); sti(); gInInterrupt=FALSE; return 0; }
void do_stuntubes( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; if ( IS_NPC(ch) ) return; if ( !IS_CLASS(ch, CLASS_DROID) ) { send_to_char("Huh?\n\r", ch); return; } if (ch->pcdata->powers[CYBORG_BODY] < 5 || ch->pcdata->powers[CYBORG_LIMBS] < 5 ) { send_to_char("You need level 5 implants on your legs and body to use this.\n\r",ch); return; } if (ch->move < 1000) { stc("You need 1000 move to do that.\n\r",ch); return; } if ( ( victim = ch->fighting ) == NULL ) { send_to_char( "You aren't fighting anyone.\n\r", ch ); return; } WAIT_STATE( ch, 12); ch->move -= 1000; one_hit(ch,victim,gsn_stuntubes,1); one_hit(ch,victim,gsn_stuntubes,1); one_hit(ch,victim,gsn_stuntubes,1); if (!IS_AFFECTED(victim, AFF_POISON)) SET_BIT(victim->affected_by, AFF_POISON); if (!IS_AFFECTED(victim, AFF_FLAMING)) SET_BIT(victim->affected_by, AFF_FLAMING); return; }
void do_wizardsight( CHAR_DATA *ch, char *argument ) { char arg [MAX_INPUT_LENGTH]; argument = one_argument( argument, arg ); if (IS_NPC(ch)) return; if ( IS_CLASS(ch, CLASS_WIZARD) && ch->pcdata->powers[WL_SKILLS] < 1 ) { stc("You need level 1 in Wizard Skills\n\r",ch); return; } if (IS_AFFECTED(ch,AFF_SHADOWSIGHT) ) { send_to_char("You can no longer see between planes.\n\r",ch); REMOVE_BIT(ch->affected_by, AFF_SHADOWSIGHT); return; } send_to_char("You can now see between planes.\n\r",ch); SET_BIT(ch->affected_by, AFF_SHADOWSIGHT); return; }
void vme_mzr8300_card_device::device_add_mconfig(machine_config &config) { upd7201_new_device& sio0(UPD7201_NEW(config, "sio0", XTAL(4'000'000))); sio0.out_txdb_callback().set("rs232p1", FUNC(rs232_port_device::write_txd)); sio0.out_dtrb_callback().set("rs232p1", FUNC(rs232_port_device::write_dtr)); sio0.out_rtsb_callback().set("rs232p1", FUNC(rs232_port_device::write_rts)); UPD7201_NEW(config, "sio1", XTAL(4'000'000)); rs232_port_device &rs232p1(RS232_PORT(config, "rs232p1", default_rs232_devices, "terminal")); rs232p1.rxd_handler().set("sio0", FUNC(upd7201_new_device::rxb_w)); rs232p1.cts_handler().set("sio0", FUNC(upd7201_new_device::ctsb_w)); am9513_device &stc(AM9513(config, "stc", 4_MHz_XTAL)); stc.out1_cb().set("sio0", FUNC(upd7201_new_device::rxca_w)); stc.out1_cb().append("sio0", FUNC(upd7201_new_device::txca_w)); stc.out2_cb().set("sio0", FUNC(upd7201_new_device::rxcb_w)); stc.out2_cb().append("sio0", FUNC(upd7201_new_device::txcb_w)); stc.out3_cb().set("sio1", FUNC(upd7201_new_device::rxca_w)); stc.out3_cb().append("sio1", FUNC(upd7201_new_device::txca_w)); stc.out4_cb().set("sio1", FUNC(upd7201_new_device::rxcb_w)); stc.out4_cb().append("sio1", FUNC(upd7201_new_device::txcb_w)); }
int setflr(flr * f, char * str) { int i; int r; i = 0; r = 0; f->flag = (char *) malloc(8*6); while(1) { if (!stc(str[i])) { f->flag[r++] = str[i]; } else { f->selector = str[i]; break; } i++; } return i; }
void Converter::start() { FileFinder ff(true, inputFolder_, "docx;doc;xlsx;xls"); auto files = ff.getFiles(); for (auto it = files.begin(); it != files.end(); ++it) { try { ScopedTimeCalculator stc(logger(), "Elapsed "); logInfo(logger(), "Processing [document]: " + *it); std::string::size_type pt = (*it).find_last_of('.'); auto ext = (*it).substr(pt + 1); if (ext.find("doc") != std::string::npos) convertSingleDocPrecise(*it); else convertSingleExcel(*it); } catch (const Poco::Exception& pe) { logError(logger(), pe.displayText()); } catch (const std::exception& e) { logError(logger(), e.what()); } } }
void process_result_set (CHAR_DATA *ch, MYSQL *db, MYSQL_RES *res) { MYSQL_FIELD *field; MYSQL_ROW row; unsigned int i, c, col_len; char sbuf[MSL]; /* determine column display widths */ mysql_field_seek (res, 0); unsigned int clen[1000]; for (i = 0; i < mysql_num_fields (res); i++) { field = mysql_fetch_field (res); clen[i] = strlen (field->name); if (clen[i] < field->max_length) clen[i]=field->max_length; if (clen[i] < 4 && !IS_NOT_NULL (field->flags)) clen[i] = 4; /* 4 = length of the word “NULL” */ if(!strcmp(field->name,"timestamp")) clen[i] -= 18; } print_dashes (ch, res); mysql_field_seek (res, 0); for (i = 0; i < mysql_num_fields (res); i++) { field = mysql_fetch_field (res); sprintf (sbuf,"#8| #C%-*s #0", clen[i], field->name); stc(sbuf, ch); } sprintf (sbuf,"\n"); stc(sbuf, ch); print_dashes (ch, res); while ((row = mysql_fetch_row (res)) != NULL) { mysql_field_seek (res, 0); for (i = 0; i < mysql_num_fields (res); i++) { field = mysql_fetch_field (res); if (row[i] == NULL) { sprintf (sbuf,"#8| %-*s #0", clen[i], "NULL"); stc(sbuf, ch); } else if (IS_NUM (field->type)) { sprintf (sbuf,"#8| #R%*s #0", clen[i], row[i]); stc(sbuf, ch); } else { c = strlen(field->name); sprintf (sbuf,"#8| #W%-*s #0", clen[i], row[i]); stc(sbuf, ch); } } sprintf (sbuf,"\n"); stc(sbuf, ch); } print_dashes (ch, res); sprintf (sbuf,"\n\r#R%lu #8Records returned#0\n\r", (unsigned long) mysql_num_rows (res)); stc(sbuf, ch); }
void do_heavenlyrain(CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; char buf[MAX_STRING_LENGTH]; char arg1[MAX_INPUT_LENGTH]; int dam; argument = one_argument(argument, arg1); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_SKYBLADE)) { stc("Huh?\n\r",ch); return; } if (ch->pcdata->powers[SKYBLADE_MAGIC] < 3) { send_to_char("You haven't mastered that magic yet.\n\r",ch); return; } if (( victim = get_char_room(ch, NULL, arg1)) == NULL) { if (( victim = ch->fighting) == NULL) { send_to_char("Call heavenlyrain upon whom?\n\r",ch); return; } else victim = ch->fighting; } if (is_safe(ch, victim)) { send_to_char("They are safe from such a hostile action.\n\r",ch); return; } if (ch->mana < 5000) { send_to_char("You do not have the 5000 mana required to call on the dragon.\n\r",ch); return; } if (ch->pcdata->powers[SKYBLADE_MAGIC] >= 4) dam = number_range(5000, 7000); else dam = number_range(3000, 5000); if (!IS_NPC(victim) && victim->alignment == 1000) dam *= .5; if (IS_NPC(victim)) dam += victim->hit/10; xprintf(buf, "#CYou call upon a heavenly rain to harm your opponent!#W[%d]\n\r",dam); stc(buf,ch); xprintf(buf, "#C%s calls upon a heavenly rain to harm you!#W[%d]\n\r",ch->name,dam); stc(buf,victim); act("#C$n calls upon a heavenly rain to harm $N!#n\n\r",ch,NULL,victim,TO_NOTVICT); ch->mana -= 5000; if (number_range(1,4) == 4){ if (ch->pcdata->powers[SKYBLADE_MAGIC] >= 4) ch->hit += dam; else ch->hit += dam/2; stc ("#LYour heavenly rain has healed you.#n\n\r",ch);} hurt_person(ch, victim, dam); if (victim->hit < -10) victim->hit = -10; WAIT_STATE(ch, 8); if (ch->fighting == NULL) ch->fighting = victim; return; }
void do_dragonx (CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; char arg1[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; int dam; argument = one_argument(argument, arg1); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_SKYBLADE)) { stc("Huh?\n\r",ch); return; } if (ch->pcdata->powers[SKYBLADE_SKILLS] < 8) { send_to_char("You haven't mastered that skill yet.\n\r",ch); return; } if (ch->pcdata->powers[SKYBLADE_DTIMER] != 10) { send_to_char("Your dragon power has not fully charged.\n\r",ch); return; } if (( victim = get_char_room(ch, NULL, arg1)) == NULL) { if (( victim = ch->fighting) == NULL) { send_to_char("Use the power of the dragon on whom?\n\r",ch); return; } else victim = ch->fighting; } if (is_safe(ch, victim)) { send_to_char("They are safe from such a hostile action.\n\r",ch); return; } if (ch->mana < 10000) { send_to_char("You do not have the 10000 mana required to call on the dragon.\n\r",ch); return; } dam = victim->hit/3; if (IS_NPC(victim)) dam = victim->hit * .9; if (ch->pcdata->powers[SKYBLADE_MAGIC] >= 5) dam *= 1.5; if (IS_NPC(victim)) { if (dam > 15000) dam = 5000 + (number_range(1,5) * number_range(1,7)); } else { if (dam > 6000) dam = 6000 + (number_range(1,5) * number_range(1,7)); } do_say(ch, "#LMighty dragon give me your POWER!!!!!!#n"); act("#C$n #Lleaps high into the air.......#n\n\r",ch,NULL,victim,TO_ROOM); stc("#LYou leap high into the air!#n\n\r",ch); act("#0The #ylightning crackles#0 as a large dragon is seen in the horizon.#n\n\r",ch,NULL,victim,TO_ROOM); WAIT_STATE(ch, 6); WAIT_STATE(victim, 6); stc("#LYou charge down upon your victim riding a huge dragon!#n\n\r",ch); act("#C$n #0charges down upon you, riding a huge dragon!#n\n\r",ch,NULL,victim,TO_VICT); act("#C$n #0charges down upon $N, riding a huge dragon!#n\n\r",ch,NULL,victim,TO_NOTVICT); ch->mana -= 10000; ch->pcdata->powers[SKYBLADE_DTIMER] = 0; WAIT_STATE(ch, 12); WAIT_STATE(victim, 12); xprintf(buf, "#LYou return to the ground and your dragon fades away.#W[%d]\n\r",dam); stc(buf,ch); xprintf(buf, "#L%s returns to the ground and the dragon fades away.#W[%d]\n\r",ch->name,dam); stc(buf, victim); hurt_person(ch, victim, dam); WAIT_STATE(ch, 8); if (ch->fighting == NULL) ch->fighting = victim; return; }
void do_abilities( CHAR_DATA *ch, char *argument ) { char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; argument = one_argument( argument, arg1 ); argument = one_argument( argument, arg2 ); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_SKYBLADE)) { send_to_char("Huh?\n\r",ch); return; } if (arg1[0] == '\0' && arg2[0] == '\0') { xprintf(buf,"Abilities: #LPower (%d), #WMagic (%d), #CSkills (%d).#n\n\r", ch->pcdata->powers[SKYBLADE_POWER], ch->pcdata->powers[SKYBLADE_MAGIC], ch->pcdata->powers[SKYBLADE_SKILLS]); send_to_char(buf,ch); return; } if (arg2[0] == '\0') { if (!str_cmp(arg1,"power")) { /* send_to_char("-=^=-=^=-=^=-=^=-=^=- Skyblade Powers -=^=-=^=-=^=-=^=-=^=-#n\n\r",ch); send_to_char("| Powers Learned Improved |#n\n\r",ch); if (ch->pcdata->powers[SKYBLADE_POWER] > 0) { if (ch->pcdata->powers[SKYBLADE_POWER] > 0) send_to_char("| OwlEyes(Leye,Reye) Yes No |#n\n\r",ch); else if (ch->pcdata->powers[SKYBLADE_POWER] > 1) send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); if (ch->pcdata->powers[SKYBLADE_POWER] > 2){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes No |#n\n\r",ch);} else if (ch->pcdata->powers[SKYBLADE_POWER] > 3){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_POWER] > 4){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); send_to_char("| HawkEyes Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_POWER] > 5){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); send_to_char("| HawkEyes Yes Yes |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_POWER] > 6){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); send_to_char("| HawkEyes Yes Yes |#n\n\r",ch); send_to_char("| Vulture's Vigor Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_POWER] > 7){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); send_to_char("| HawkEyes Yes Yes |#n\n\r",ch); send_to_char("| Vulture's Vigor Yes Yes |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_POWER] > 8){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); send_to_char("| HawkEyes Yes Yes |#n\n\r",ch); send_to_char("| Vulture's Vigor Yes Yes |#n\n\r",ch); send_to_char("| FalconBlade Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_POWER] > 9){ send_to_char("| OwlEyes(Leye,Reye) Yes Yes |#n\n\r",ch); send_to_char("| EagleStrength Yes Yes |#n\n\r",ch); send_to_char("| HawkEyes Yes Yes |#n\n\r",ch); send_to_char("| Vulture's Vigor Yes Yes |#n\n\r",ch); send_to_char("| FalconBlade Yes Yes |#n\n\r",ch);} } else{ send_to_char("| OwlEyes(Leye,Reye) No No |#n\n\r",ch); send_to_char("| EagleStrength No No |#n\n\r",ch); send_to_char("| HawkEyes No No |#n\n\r",ch); send_to_char("| Vulture's Vigor No No |#n\n\r",ch); send_to_char("| FalconBlade No No |#n\n\r",ch);} send_to_char("-=^=-=^=-=^=-=^=-=^=-=^=-=^=-=^=-^-=^=-=^=-=^=-=^=-=^=-=^=-=^=-#n\n\r",ch);*/ xprintf(buf, "You have %d power.\n\r", ch->pcdata->powers[SKYBLADE_POWER]); stc(buf, ch); return; } else if (!str_cmp(arg1,"magic")) {/* send_to_char("-=^=-=^=-=^=-=^=-=^=- Skyblade Magics -=^=-=^=-=^=-=^=-=^=-#n\n\r",ch); send_to_char("| Magics Learned Improved |#n\n\r",ch); if (ch->pcdata->powers[SKYBLADE_MAGIC] > 0) { if (ch->pcdata->powers[SKYBLADE_MAGIC] > 0) send_to_char("| Skyforge Yes No |#n\n\r",ch); else if (ch->pcdata->powers[SKYBLADE_MAGIC] > 1) send_to_char("| Skyforge Yes Yes |#n\n\r",ch); if (ch->pcdata->powers[SKYBLADE_MAGIC] > 2){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_MAGIC] > 3){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_MAGIC] > 4){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); send_to_char("| Climax Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_MAGIC] > 5){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); send_to_char("| Climax Yes Yes |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_MAGIC] > 6){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); send_to_char("| Climax Yes Yes |#n\n\r",ch); send_to_char("| DragonAura Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_MAGIC] > 7){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); send_to_char("| Climax Yes Yes |#n\n\r",ch); send_to_char("| DragonAura Yes Yes |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_MAGIC] > 8){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); send_to_char("| Climax Yes Yes |#n\n\r",ch); send_to_char("| DragonAura Yes Yes |#n\n\r",ch); send_to_char("| WyrmAura Yes No |#n\n\r",ch); } else if (ch->pcdata->powers[SKYBLADE_MAGIC] > 9){ send_to_char("| Skyforge Yes Yes |#n\n\r",ch); send_to_char("| HeavenlyRain Yes Yes |#n\n\r",ch); send_to_char("| Climax Yes Yes |#n\n\r",ch); send_to_char("| DragonAura Yes Yes |#n\n\r",ch); send_to_char("| WyrmAura Yes Yes |#n\n\r",ch);} } else{ send_to_char("| Skyforge No No |#n\n\r",ch); send_to_char("| HeavenlyRain No No |#n\n\r",ch); send_to_char("| Climax No No |#n\n\r",ch); send_to_char("| DragonAura No No |#n\n\r",ch); send_to_char("| WyrmAura No No |#n\n\r",ch);} send_to_char("-=^=-=^=-=^=-=^=-=^=-=^=-=^=-=^=-^-=^=-=^=-=^=-=^=-=^=-=^=-=^=-#n\n\r",ch); */ xprintf(buf, "You have %d magic.\n\r",ch->pcdata->powers[SKYBLADE_MAGIC]); stc(buf, ch); return; } if (!str_cmp(arg1,"skills")) { send_to_char("-=^=-=^=-=^=-=^=-=^=- Skyblade Skills -=^=-=^=-=^=-=^=-=^=-#n\n\r",ch); send_to_char("| Skills Learned |#n\n\r",ch); if (ch->pcdata->powers[SKYBLADE_SKILLS] > 0) { if (ch->pcdata->powers[SKYBLADE_SKILLS] == 1){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel No |#n\n\r",ch); send_to_char("| CloudsBlessing No |#n\n\r",ch); send_to_char("| RapierStrike No |#n\n\r",ch); send_to_char("| Retort No |#n\n\r",ch); send_to_char("| LeapOfFaith No |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 2){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing No |#n\n\r",ch); send_to_char("| RapierStrike No |#n\n\r",ch); send_to_char("| Retort No |#n\n\r",ch); send_to_char("| LeapOfFaith No |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 3){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike No |#n\n\r",ch); send_to_char("| Retort No |#n\n\r",ch); send_to_char("| LeapOfFaith No |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 4){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort No |#n\n\r",ch); send_to_char("| LeapOfFaith No |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 5){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort Yes |#n\n\r",ch); send_to_char("| LeapOfFaith No |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 6){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort Yes |#n\n\r",ch); send_to_char("| LeapOfFaith Yes |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 7){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort Yes |#n\n\r",ch); send_to_char("| LeapOfFaith Yes |#n\n\r",ch); send_to_char("| DragonCharge Yes |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 8){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort Yes |#n\n\r",ch); send_to_char("| LeapOfFaith Yes |#n\n\r",ch); send_to_char("| DragonCharge Yes |#n\n\r",ch); send_to_char("| DragonX Yes |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 9){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort Yes |#n\n\r",ch); send_to_char("| LeapOfFaith Yes |#n\n\r",ch); send_to_char("| DragonCharge Yes |#n\n\r",ch); send_to_char("| DragonX Yes |#n\n\r",ch); send_to_char("| WyrmRoar Yes |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch); } if (ch->pcdata->powers[SKYBLADE_SKILLS] == 10){ send_to_char("| BladeJump Yes |#n\n\r",ch); send_to_char("| Pummel Yes |#n\n\r",ch); send_to_char("| CloudsBlessing Yes |#n\n\r",ch); send_to_char("| RapierStrike Yes |#n\n\r",ch); send_to_char("| Retort Yes |#n\n\r",ch); send_to_char("| LeapOfFaith Yes |#n\n\r",ch); send_to_char("| DragonCharge Yes |#n\n\r",ch); send_to_char("| DragonX Yes |#n\n\r",ch); send_to_char("| WyrmRoar Yes |#n\n\r",ch); send_to_char("| DiveStrike Yes |#n\n\r",ch);} } else{ send_to_char("| BladeJump No |#n\n\r",ch); send_to_char("| Pummel No |#n\n\r",ch); send_to_char("| CloudsBlessing No |#n\n\r",ch); send_to_char("| RapierStrike No |#n\n\r",ch); send_to_char("| Retort No |#n\n\r",ch); send_to_char("| LeapOfFaith No |#n\n\r",ch); send_to_char("| DragonCharge No |#n\n\r",ch); send_to_char("| DragonX No |#n\n\r",ch); send_to_char("| WyrmRoar No |#n\n\r",ch); send_to_char("| DiveStrike No |#n\n\r",ch);} send_to_char("-=^=-=^=-=^=-=^=-=^=-=^=-=^=-=^=-^-=^=-=^=-=^=-=^=-=^=-=^=-=^=-#n\n\r",ch); return; } }/*else { xprintf(buf,"Abilities: #LPower (%d), #nMagic (%d), #CSkills (%d).#n\n\r", ch->pcdata->powers[SKYBLADE_POWER], ch->pcdata->powers[SKYBLADE_MAGIC], ch->pcdata->powers[SKYBLADE_SKILLS]); send_to_char(buf,ch); return; }*/ if (!str_cmp(arg2,"gain")) { int improve; int cost; int max; if (!str_cmp(arg1,"power" )) {improve = SKYBLADE_POWER; max=10;} else if (!str_cmp(arg1,"magic" )) {improve = SKYBLADE_MAGIC; max=10;} else if (!str_cmp(arg1,"skills" )) {improve = SKYBLADE_SKILLS; max=10;} else { send_to_char("Abilities: Power, Magic, Skills.\n\r",ch); return; } cost = (ch->pcdata->powers[improve]+1) * 15; arg1[0] = UPPER(arg1[0]); if ( ch->pcdata->powers[improve] >= max ) { xprintf(buf,"You have mastered all the abilites in the field of %s.\n\r", arg1); send_to_char(buf,ch); return; } if ( cost > ch->practice ) { xprintf(buf,"It costs you %d primal to improve that ability.\n\r", cost); send_to_char(buf,ch); return; } ch->pcdata->powers[improve] += 1; ch->practice -= cost; xprintf(buf,"You improve your mastery of %s abilities.\n\r", arg1); send_to_char(buf,ch); } else send_to_char("To improve an ability, type: abilities <ability type> gain.\n\r",ch); return; }
void do_bladejump( CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; char arg[MAX_INPUT_LENGTH]; if ( IS_NPC(ch) ) return; argument = one_argument (argument, arg); if (!IS_CLASS(ch, CLASS_SKYBLADE) ) { send_to_char("Huh?\n\r",ch); return; } if ( arg[0] == '\0' ) { send_to_char( "BladeJump to whom?\n\r", ch ); return; } if ( ( victim = get_char_world( ch, arg ) ) == NULL ) { send_to_char( "You cannot find them.\n\r", ch ); return; } if( ch->move < 1000) { stc( "You don't have enough movement points to bladejump to them.\n\r",ch); return; } if( IS_SET(victim->in_room->room_flags, ROOM_ASTRAL)) { stc( "You can't find it's room.\n\r",ch); return; } if( IS_SET(ch->in_room->room_flags, ROOM_ASTRAL)) { stc( "Your body can't go there.\n\r",ch); return; } if (IS_SET(victim->act, ACT_NOTRAVEL)) { send_to_char("No Can Do.\n\r", ch); return; } if (ch == victim) { send_to_char("But you're already at yourself!\n\r",ch); return; } if ( room_is_private(victim->in_room ) ) { send_to_char( "That room is private right now.\n\r", ch ); return; } if (!IS_NPC(victim) && ch->move < victim->max_move) { if ( !IS_NPC(victim) && !IS_IMMUNE(victim, IMM_SUMMON) ) { send_to_char( "They are hiding from you.\n\r", ch ); return; } else send_to_char("You need more move than you're opponent.\n\r",ch); } if (victim->in_room == ch->in_room) { send_to_char("But you're already there!\n\r",ch); return; } act("You jump into the clouds", ch, NULL, victim, TO_CHAR); act("$n jumps into the clouds", ch, NULL, victim, TO_ROOM); char_from_room(ch); char_to_room(ch,victim->in_room); ch->move -= 1000; act("$n jumps out of the clouds and lands infront of $N.", ch, NULL, victim, TO_NOTVICT); act("$n jumps out of the clouds and lands infront of you.", ch, NULL, victim, TO_VICT); do_look(ch,"auto"); return; }
void do_stalk( CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; char arg[MAX_INPUT_LENGTH]; if ( IS_NPC(ch) ) return; argument = one_argument (argument, arg); if (!IS_CLASS(ch, CLASS_NINJA) ) { send_to_char("Huh?\n\r",ch); return; } if ( arg[0] == '\0' ) { send_to_char( "Stalk whom?\n\r", ch ); return; } if ( ( victim = get_char_world( ch, arg ) ) == NULL ) { send_to_char( "You cannot find them.\n\r", ch ); return; } if( ch->move < 500) { stc( "You don't have enough movement points to stalk them.\n\r",ch); return; } if( IS_SET(victim->in_room->room_flags, ROOM_ASTRAL)) { stc( "You can't find it's room.\n\r",ch); return; } if( IS_SET(ch->in_room->room_flags, ROOM_ASTRAL)) { stc( "Your body can't go there.\n\r",ch); return; } if (ch == victim) { send_to_char("But you're already at yourself!\n\r",ch); return; } if ( room_is_private(victim->in_room ) ) { send_to_char( "That room is private right now.\n\r", ch ); return; } if ( !IS_NPC(victim) && !IS_IMMUNE(victim, IMM_SUMMON) ) { send_to_char( "They are hiding from you.\n\r", ch ); return; } if (victim->in_room == ch->in_room) { send_to_char("But you're already there!\n\r",ch); return; } act("You pick up the trail of $N, and quickly find them.", ch, NULL, victim, TO_CHAR); act("$n slides into the shadows, stalking someone.", ch, NULL, victim, TO_ROOM); char_from_room(ch); char_to_room(ch,victim->in_room); ch->move -= 500; act("$n walks out of nowhere behind $N.", ch, NULL, victim, TO_NOTVICT); act("$n walks out of nowhere from behind.", ch, NULL, victim, TO_VICT); do_look(ch,"scry"); return; }
/*for the SQL result formatter*/ void print_dashes (CHAR_DATA *ch, MYSQL_RES *res) { MYSQL_FIELD *field; unsigned int i, j; char sbuf[MSL]; int jic; mysql_field_seek (res, 0); sprintf (sbuf,"#G+#0"); stc(sbuf, ch); for (i = 0; i < mysql_num_fields (res); i++) { field = mysql_fetch_field (res); if(!strcmp(field->name,"message_num")) { for (j = 0; j < 8 ; j++) { sprintf (sbuf,"#8-#0"); stc(sbuf, ch); } } else if(!strcmp(field->name,"log_num")) { for (j = 0; j < strlen(field->name) +2; j++) { sprintf (sbuf,"#8-#0"); stc(sbuf, ch); } } else if(!strcmp(field->name,"timestamp")) { for (j = 0; j < 17 ; j++) { sprintf (sbuf,"#8-#0"); stc(sbuf, ch); } } else if(!strcmp(field->name,"entry_num")) { for (j = 0; j < 11 ; j++) { sprintf (sbuf,"#8-#0"); stc(sbuf, ch); } } else if(field->max_length > 55) { for (j = 0; j < 55; j++) { sprintf (sbuf,"#8-#0"); stc(sbuf, ch); } } else { for (j = 0; j < field->max_length + 2; j++) { sprintf (sbuf,"#8-#0"); stc(sbuf, ch); } } sprintf (sbuf,"#G+#0"); stc(sbuf, ch); } sprintf (sbuf,"\n"); stc(sbuf, ch); }
void do_quest( CHAR_DATA *ch, char *argument ) { extern bool quest; extern bool auto_quest; extern CHAR_DATA *quest_mob; extern CHAR_DATA *quest_target; extern OBJ_DATA *quest_object; extern int quest_timer; extern int quest_wait; char buf[MAX_STRING_LENGTH]; char new_long_desc[MAX_STRING_LENGTH]; if ( argument[0] == '\0' ) /* Display status */ { if ( !quest ) { send_to_char( "There is no quest currently running.\n\r", ch ); if ( auto_quest ) send_to_char( "Quests are currently running automatically.\n\r", ch ); if ( quest_wait > 0 ) { sprintf( buf, "The next quest may occur in %d minutes.\n\r", (quest_wait * 2) ); send_to_char( buf, ch ); } return; } else send_to_char( "There is currently a quest running ", ch ); if ( auto_quest ) send_to_char( "(Automatically)", ch ); send_to_char( "\n\rQuest Details:\n\r\n\r", ch ); if ( quest_mob ) { sprintf( buf, "The questing mobile is: {x%s{x [In Room %d]\n\r", quest_mob->short_descr, quest_mob->in_room->vnum ); send_to_char( buf, ch ); } else { send_to_char( "The questing mobile is dead!\n\r", ch ); } if ( quest_target ) { sprintf( buf, "Target Mobile is: {x%s{x [In Room %d]\n\r", quest_target->short_descr, quest_target->in_room->vnum ); send_to_char( buf, ch ); } else send_to_char( "The target mobile is dead!\n\r", ch ); sprintf( buf, "Target Object is: {x%s{x.\n\r", quest_object->short_descr ); send_to_char( buf, ch ); sprintf( buf, "Quest Object is worth: %d QP, %d XP, %d raise points and %d GP\n\r", quest_object->value[0], (ch->level < LVL_MOBXPCAP) ? quest_object->value[1] : 0, quest_object->value[4], quest_object->value[2]); send_to_char( buf, ch ); sprintf( buf, "The Quest has been running for %d/30 minutes.\n\r", (quest_timer * 2) ); send_to_char( buf, ch ); return; } if ( !strcmp( argument, "stop" ) ) { if ( quest ) { /* sprintf( buf, "@@NThe quest has been stopped by an {mImmortal@@N. Please speak up if you have already gotten the item.\n\r" ); do_gecho( ch, buf ); */ clear_quest(); } return; } if ( !strcmp( argument, "start" ) ) { DESCRIPTOR_DATA *d; int a = 80; int b = 0; sh_int player_count = 0, average_level= 0, total_levels = 0; /* generate a new quest! */ if ( quest ) { send_to_char( "There is already a quest running...\n\r", ch ); return; } if ( auto_quest ) { auto_quest = FALSE; send_to_char( "Automatic Quests now OFF.\n\r", ch ); } /* Work out levels of currently playing folks */ for ( d = descriptor_list; d; d = d->next ) { if ( ( d->connected != CON_PLAYING ) || ( IS_IMMORTAL( d->character ) ) ) continue; player_count += 1; total_levels += d->character->level; } average_level = ( ( ( total_levels == 0 ) ? 30 : total_levels ) / ( ( player_count == 0 ) ? 1 : player_count ) ); a = average_level - 20; b = average_level + 20; sprintf(buf, "Mob lLevel: %d hLevel: %d\n\r", a, b); stc(buf,ch); quest_mob = get_quest_giver(a, b); if ( quest_mob == NULL ) { send_to_char( "Failed to find a quest mob\n\r", ch ); return; } b = UMIN( b, 110 ); a = UMAX( 20, a ); quest_target = get_quest_target( a, b ); if ( ( quest_target == NULL ) || ( quest_target == quest_mob ) ) { send_to_char( "Failed to find a quest target\n\r", ch ); return; } quest_object = load_quest_object( quest_target ); if ( quest_object == NULL ) { send_to_char( "An invalid quest object was encountered. Check log files.\n\r", ch ); quest = FALSE; return; } /* Set values on quest item for Qp, Pracs, Exp, Gold */ quest_object->value[0] = UMAX( 1, ( quest_target->level / 3) ); quest_object->value[1] = number_range(1, 60); quest_object->value[2] = ( quest_target->level * 100 ); quest_object->value[4] = 2; if ( number_percent() < 10 ) { quest_object->value[0] += 2; quest_object->value[1] += 3; quest_object->value[2] *= 2; quest_object->value[4] *= 3; } quest_timer = 0; quest = TRUE; new_long_desc[0] = '\0'; if ( quest_mob->pIndexData->long_descr_orig != NULL ) free_string( quest_mob->pIndexData->long_descr_orig ); quest_mob->pIndexData->long_descr_orig = str_dup(quest_mob->long_descr ); sprintf( new_long_desc, "%s {xsays have you found %s?\n\r", quest_mob->pIndexData->short_descr, quest_object->short_descr ); if ( quest_mob->long_descr != NULL ) free_string( quest_mob->long_descr ); quest_mob->long_descr = str_dup( new_long_desc ); SET_BIT( quest_mob->act, PLR_NOSUMMON ); REMOVE_BIT(quest_mob->act, ACT_AGGRESSIVE); /* T!!! */ new_long_desc[0] = '\0'; if ( quest_target->pIndexData->long_descr_orig != NULL ) free_string( quest_target->pIndexData->long_descr_orig ); quest_target->pIndexData->long_descr_orig = str_dup( quest_target->long_descr ); sprintf( new_long_desc, "%s {xsays I stole the {x%s{x!\n\r", quest_target->pIndexData->short_descr, quest_object->short_descr ); if ( quest_target->long_descr != NULL ) free_string( quest_target->long_descr ); quest_target->long_descr = str_dup( new_long_desc ); SET_BIT( quest_target->act, PLR_NOSUMMON ); send_to_char( "QUEST STARTED!\n\r\n\r", ch ); sprintf( buf, "The questing mobile is: {x%s{x [In Room %d]\n\r", quest_mob->pIndexData->short_descr, quest_mob->in_room->vnum ); send_to_char( buf, ch ); sprintf( buf, "Target Mobile is: {x%s{x [In Room %d]\n\r", quest_target->pIndexData->short_descr, quest_target->in_room->vnum ); send_to_char( buf, ch ); sprintf( buf, "Target Object is: {x%s{x.\n\r", quest_object->short_descr ); send_to_char( buf, ch ); sprintf( buf, "Quest Object is worth: %d QP, %d XP, %d raise points and %d GP\n\r", quest_object->value[0], quest_object->value[1], quest_object->value[4], quest_object->value[2] ); send_to_char( buf, ch ); return; } if ( !str_cmp( argument, "auto" ) ) { send_to_char( "AutoQuest now initiated!\n\r", ch ); auto_quest = TRUE; quest_wait = 360; return; } return; }