QGen "Quest Item Generator" Conceptually, qgen is a tool used by immortals to dynamically create items for quest prizes. Qgen relies on two systems to accomplish this; 1) "quest points". QGen created items cost their creators a certain amount of points, these 'quest points' are granted to the immortals by the mud implementors/council. Not meant so much as a prize or reward, quest points are meant more as a means to control how many QGen items are created in any given time frame. An items 'cost' is determined by it's equipment value, or 2) 'eq_cost'. The method we use to determine an items cost in WoTMud is included in this snippet in the function "eq_cost". ** Requirements: OLC What is not included: Quest points. You'll need to add support for quest_points. (used in this snippet as ch->pcdata->quest_points). You should also add an option to the 'set' command to allow your mud council (58+ on WoTMud) to 'set' someone's quest points. Be sure you save/restore these points from the pfile. Utility functions ** Note: MSL == MAX_STRING_LENGTH MIL == MAX_INPUT_LENGTH ** Note: The following functions you may, or may not have. I've included them for those of you who need them. chprintf logf set_obj_data show_obj_data !!! Creating your "Generic QGen Item" Included (as an EXAMPLE ONLY) is the generic qgen item from WoTMud. The WoTMud area file format is NOT compatible with stock ROM. You'll need to write your own object. QGen requires this object to work properly. The standard QGen looks for object vnum# 6. Retool as necessary. #6 generic qgen item~ generic qgen item~ Generic qgen item- DO NOT DELETE~ unknown~ trash 0 0 0 0 0 0 0 0 0 0 P void chprintf(CHAR_DATA * ch, char *fmt, ...) { char buf[MSL]; va_list args; va_start (args, fmt); #if !defined(_WIN32) vsnprintf (buf, MSL, fmt, args); #else _vsnprintf(buf, MSL, fmt, args); #endif va_end (args); send_to_char (buf, ch); } void logf (char *fmt, ...) { char buf[2 * MSL]; va_list args; va_start (args, fmt); #if !defined(_WIN32) vsnprintf (buf, 2*MSL, fmt, args); #else _vsnprintf(buf, 2*MSL, fmt, args); #endif va_end (args); log_string (buf); } void show_obj_data(CHAR_DATA * ch, OBJ_DATA * obj) { switch (obj->item_type) { default: break; case ITEM_LIGHT: if (obj->value[2] == -1 || obj->value[2] == 999) chprintf(ch, "[v2] Light: Infinite[-1]\n\r"); else chprintf(ch, "[v2] Light: [%d]\n\r", obj->value[2]); break; case ITEM_PORTAL: chprintf(ch, "[v0] Charges: [%d]\n\r" "[v1] Exit Flags: %s\n\r" "[v2] Portal Flags: %s\n\r" "[v3] Goes to (vnum): [%d]\n\r", obj->value[0], flag_string (exit_flags, obj->value[1]), flag_string (portal_flags, obj->value[2]), obj->value[3]); break; case ITEM_FURNITURE: chprintf(ch, "[v0] Max people : [%d]\n\r" "[v1] Max weight : [%d]\n\r" "[v2] Furniture Flags : %s\n\r" "[v3] Heal bonus : [%d]\n\r" "[v4] OPU bonus : [%d]\n\r", obj->value[0], obj->value[1], flag_string (furniture_flags, obj->value[2]), obj->value[3], obj->value[4]); break; case ITEM_POTION: case ITEM_HERB: chprintf(ch, "[v0] Level: [%d]\n\r" "[v1] Weave: %s\n\r" "[v2] Weave: %s\n\r" "[v3] Weave: %s\n\r" "[v4] Weave: %s\n\r", obj->value[0], obj->value[1] != -1 ? skill_table[obj->value[1]].name : "none", obj->value[2] != -1 ? skill_table[obj->value[2]].name : "none", obj->value[3] != -1 ? skill_table[obj->value[3]].name : "none", obj->value[4] != -1 ? skill_table[obj->value[4]].name : "none"); break; case ITEM_ARMOR: chprintf(ch, "[v0] Ac pierce [%d]\n\r" "[v1] Ac bash [%d]\n\r" "[v2] Ac slash [%d]\n\r" "[v3] Ac exotic [%d]\n\r", obj->value[0], obj->value[1], obj->value[2], obj->value[3]); break; case ITEM_WEAPON: chprintf(ch, "Average Damage : %d\n\r" "[v0] Weapon class : %s\n\r" "[v1] Number of dice: [%d]\n\r" "[v2] Type of dice : [%d]\n\r" "[v3] Attack Type : %s\n\r" "[v4] Special type : %s\n\r", ((1 + obj->value[2]) * obj->value[1] / 2), flag_string (weapon_class, obj->value[0]), obj->value[1], obj->value[2], attack_table[obj->value[3]].name, flag_string (weapon_type2, obj->value[4])); break; case ITEM_CONTAINER: chprintf(ch, "[v0] Weight: [%d kg]\n\r" "[v1] Flags: [%s]\n\r" "[v2] Key: %s [%d]\n\r" "[v3] Capacity [%d]\n\r" "[v4] Weight Mult [%d]\n\r", obj->value[0], flag_string (container_flags, obj->value[1]), get_obj_index (obj->value[2]) ? get_obj_index (obj->value[2])->short_descr : "none", obj->value[2], obj->value[3], obj->value[4]); break; case ITEM_DRINK_CON: case ITEM_FOUNTAIN: chprintf(ch, "[v0] Liquid Total: [%d]\n\r" "[v1] Liquid Left: [%d]\n\r" "[v2] Liquid: %s\n\r" "[v3] Poisoned: %s\n\r", obj->value[0], obj->value[1], liq_table[obj->value[2]].liq_name, obj->value[3] != 0 ? "Yes" : "No"); break; case ITEM_FOOD: chprintf(ch, "[v0] Food hours: [%d]\n\r" "[v1] Full hours: [%d]\n\r" "[v3] Poisoned: %s\n\r", obj->value[0], obj->value[1], obj->value[3] != 0 ? "Yes" : "No"); break; case ITEM_MONEY: chprintf(ch, "[v0] Gold: [%d]\n\r", obj->value[0]); break; } return; } bool set_obj_data (CHAR_DATA * ch, OBJ_DATA * pObj, int value_num, char *argument) { switch (pObj->item_type) { default: break; case ITEM_LIGHT: switch (value_num) { default: do_help (ch, "ITEM_LIGHT"); return FALSE; case 2: send_to_char ("HOURS OF LIGHT SET.\n\r\n\r", ch); pObj->value[2] = atoi (argument); break; } break; case ITEM_POTION: case ITEM_HERB: switch (value_num) { default: do_help (ch, "ITEM_HERB_POTION"); return FALSE; case 0: send_to_char ("WEAVE LEVEL SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("WEAVE TYPE 1 SET.\n\r\n\r", ch); pObj->value[1] = skill_lookup (argument); break; case 2: send_to_char ("WEAVE TYPE 2 SET.\n\r\n\r", ch); pObj->value[2] = skill_lookup (argument); break; case 3: send_to_char ("WEAVE TYPE 3 SET.\n\r\n\r", ch); pObj->value[3] = skill_lookup (argument); break; case 4: send_to_char ("WEAVE TYPE 4 SET.\n\r\n\r", ch); pObj->value[4] = skill_lookup (argument); break; } break; case ITEM_ARMOR: switch (value_num) { default: do_help (ch, "ITEM_ARMOR"); return FALSE; case 0: send_to_char ("AC PIERCE SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("AC BASH SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; case 2: send_to_char ("AC SLASH SET.\n\r\n\r", ch); pObj->value[2] = atoi (argument); break; case 3: send_to_char ("AC EXOTIC SET.\n\r\n\r", ch); pObj->value[3] = atoi (argument); break; } break; case ITEM_WEAPON: switch (value_num) { default: do_help (ch, "ITEM_WEAPON"); return FALSE; case 0: if (!argument || argument[0] == '\0') { show_help (ch, "wclass"); return FALSE; } send_to_char ("WEAPON CLASS SET.\n\r\n\r", ch); pObj->value[0] = flag_value (weapon_class, argument); break; case 1: send_to_char ("NUMBER OF DICE SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; case 2: send_to_char ("TYPE OF DICE SET.\n\r\n\r", ch); pObj->value[2] = atoi (argument); break; case 3: if (!argument || argument[0] == '\0') { show_damlist (ch); return FALSE; } send_to_char ("WEAPON TYPE SET.\n\r\n\r", ch); pObj->value[3] = attack_lookup (argument); break; case 4: if (!argument || argument[0] == '\0') { show_help (ch, "wtype"); return FALSE; } send_to_char ("SPECIAL WEAPON TYPE TOGGLED.\n\r\n\r", ch); pObj->value[4] ^= (flag_value (weapon_type2, argument) != NO_FLAG ? flag_value (weapon_type2, argument) : 0); break; } break; case ITEM_PORTAL: switch (value_num) { default: do_help (ch, "ITEM_PORTAL"); return FALSE; case 0: send_to_char ("CHARGES SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: { int value = flag_value (exit_flags, argument); if (value != NO_FLAG) { send_to_char ("EXIT FLAGS SET.\n\r\n\r", ch); TOGGLE_BIT (pObj->value[1], value); break; } else send_to_char ("Invalid exit flag(s).\n\r", ch); } break; case 2: { int value = flag_value (portal_flags, argument); if (value != NO_FLAG) { send_to_char ("PORTAL FLAGS SET.\n\r\n\r", ch); TOGGLE_BIT (pObj->value[2], value); break; } else send_to_char ("Invalid portal flag(s).\n\r", ch); } break; case 3: send_to_char ("EXIT VNUM SET.\n\r\n\r", ch); pObj->value[3] = atoi (argument); break; } break; case ITEM_FURNITURE: switch (value_num) { default: do_help (ch, "ITEM_FURNITURE"); return FALSE; case 0: send_to_char ("NUMBER OF PEOPLE SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("MAX WEIGHT SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; case 2: send_to_char ("FURNITURE FLAGS TOGGLED.\n\r\n\r", ch); pObj->value[2] ^= (flag_value (furniture_flags, argument) != NO_FLAG ? flag_value (furniture_flags, argument) : 0); break; case 3: send_to_char ("HEAL BONUS SET.\n\r\n\r", ch); pObj->value[3] = atoi (argument); break; case 4: send_to_char ("OPU BONUS SET.\n\r\n\r", ch); pObj->value[4] = atoi (argument); break; } break; case ITEM_CONTAINER: switch (value_num) { int value; default: do_help (ch, "ITEM_CONTAINER"); return FALSE; case 0: send_to_char ("WEIGHT CAPACITY SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: if ((value = flag_value (container_flags, argument)) != NO_FLAG) TOGGLE_BIT (pObj->value[1], value); else { do_help (ch, "ITEM_CONTAINER"); return FALSE; } send_to_char ("CONTAINER TYPE SET.\n\r\n\r", ch); break; case 2: if (atoi (argument) != 0) { if (!get_obj_index (atoi (argument))) { send_to_char ("THERE IS NO SUCH ITEM.\n\r\n\r", ch); return FALSE; } if (get_obj_index (atoi (argument))->item_type != ITEM_KEY) { send_to_char ("THAT ITEM IS NOT A KEY.\n\r\n\r", ch); return FALSE; } } send_to_char ("CONTAINER KEY SET.\n\r\n\r", ch); pObj->value[2] = atoi (argument); break; case 3: send_to_char ("CONTAINER MAX WEIGHT SET.\n\r", ch); pObj->value[3] = atoi (argument); break; case 4: send_to_char ("WEIGHT MULTIPLIER SET.\n\r\n\r", ch); pObj->value[4] = atoi (argument); break; } break; case ITEM_DRINK_CON: switch (value_num) { default: do_help (ch, "ITEM_DRINK"); return FALSE; case 0: send_to_char ("MAXIMUM AMOUT OF LIQUID HOURS SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("CURRENT AMOUNT OF LIQUID HOURS SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; case 2: send_to_char ("LIQUID TYPE SET.\n\r\n\r", ch); pObj->value[2] = (liq_lookup (argument) != -1 ? liq_lookup (argument) : 0); break; case 3: send_to_char ("POISON VALUE TOGGLED.\n\r\n\r", ch); pObj->value[3] = (pObj->value[3] == 0) ? 1 : 0; break; } break; case ITEM_FOUNTAIN: switch (value_num) { default: do_help (ch, "ITEM_FOUNTAIN"); return FALSE; case 0: send_to_char ("MAXIMUM AMOUT OF LIQUID HOURS SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("CURRENT AMOUNT OF LIQUID HOURS SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; case 2: send_to_char ("LIQUID TYPE SET.\n\r\n\r", ch); pObj->value[2] = (liq_lookup (argument) != -1 ? liq_lookup (argument) : 0); break; case 3: send_to_char ("POISON VALUE TOGGLED.\n\r\n\r", ch); pObj->value[3] = (pObj->value[3] == 0) ? 1 : 0; break; } break; case ITEM_FOOD: switch (value_num) { default: do_help (ch, "ITEM_FOOD"); return FALSE; case 0: send_to_char ("HOURS OF FOOD SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("HOURS OF FULL SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; case 3: send_to_char ("POISON VALUE TOGGLED.\n\r\n\r", ch); pObj->value[3] = (pObj->value[3] == 0) ? 1 : 0; break; } break; case ITEM_MONEY: switch (value_num) { default: do_help (ch, "ITEM_MONEY"); return FALSE; case 0: send_to_char ("GOLD AMOUNT SET.\n\r\n\r", ch); pObj->value[0] = atoi (argument); break; case 1: send_to_char ("SILVER AMOUNT SET.\n\r\n\r", ch); pObj->value[1] = atoi (argument); break; } break; } show_obj_data(ch, pObj); return TRUE; } /** Function: eq_cost * Descr : Determines the number of 'points' that an object is valued at * Returns : object points * Syntax : eq_cost( object ) * Written : v1.0 9/98 * Author : Gary McNickle <gary@tarmongaidon.org> */ int eq_cost (OBJ_DATA * pObj) { AFFECT_DATA *pAf; int cost = 1; if (pObj == NULL) return 0; /* Points are irrelevant of object type * Costs: * ITEM_LIGHT: * 1ep / 200hours (max 4ep) * 5ep / -1 (infinite) * ITEM_ARMOR * ep = v0+v1+v2+v3/8 + (v1*v2) * ITEM_WEAPON * ep = v1 * v2 / 2 (commented out below) * 5ep / type2_flag * flags * burnproof = 2ep * Neverbreak = 3ep * Visdeath/Bless = 2ep * Glow/Hum = 1ep * Dark/AntiAlign = 0ep * Evil = -2ep * applies * str/dex/etc = 1ep/per pt. * -2ac = 1ep * 10endurance = 1ep * 5hp = 1ep * -1save = 2ep * +1ab = 3ep */ if (!pObj->enchanted) for (pAf = pObj->pIndexData->affected; pAf; pAf = pAf->next) { switch (pAf->location) { case APPLY_LEVEL: cost += pAf->modifier * 5; break; case APPLY_ABILITY: cost += pAf->modifier * 3; break; case APPLY_HITROLL: case APPLY_DAMROLL: cost += pAf->modifier * 2; break; case APPLY_HIT: if (pAf->modifier != 0) cost += (int) pAf->modifier / 5; break; case APPLY_ENDURANCE: if (pAf->modifier != 0) cost += (int) pAf->modifier / 10; break; case APPLY_STR: case APPLY_DEX: case APPLY_WIS: case APPLY_CON: case APPLY_INT: (pAf->modifier > 0) ? cost += pAf->modifier : 0; break; case APPLY_AC: if (pAf->modifier < 0) cost += pAf->modifier / -2; else if (pAf->modifier > 0) cost -= pAf->modifier / 2; break; default: break; } } for (pAf = pObj->affected; pAf; pAf = pAf->next) { switch (pAf->location) { case APPLY_LEVEL: cost += pAf->modifier * 5; break; case APPLY_ABILITY: cost += pAf->modifier * 3; break; case APPLY_HITROLL: case APPLY_DAMROLL: cost += pAf->modifier * 2; break; case APPLY_HIT: if (pAf->modifier != 0) cost += (int) pAf->modifier / 5; break; case APPLY_ENDURANCE: if (pAf->modifier != 0) cost += (int) pAf->modifier / 10; break; case APPLY_STR: case APPLY_DEX: case APPLY_WIS: case APPLY_CON: case APPLY_INT: (pAf->modifier > 0) ? cost += pAf->modifier : 0; break; case APPLY_AC: if (pAf->modifier < 0) cost += pAf->modifier / -2; else if (pAf->modifier > 0) cost -= pAf->modifier / 2; break; default: break; } } switch (pObj->item_type) { case ITEM_POTION: case ITEM_HERB: if (pObj->value[0] > 0) cost += pObj->value[0] / 5; if (pObj->value[1] >= 0) cost += 3; if (pObj->value[2] >= 0) cost += 3; if (pObj->value[3] >= 0) cost += 3; break; case ITEM_FURNITURE: if (pObj->value[3] > 100) cost += UMAX (2, pObj->value[3] / 100); if (pObj->value[4] > 100) cost += UMAX (2, pObj->value[4] / 100); break; case ITEM_LIGHT: if (pObj->value[0] == -1 || pObj->value[0] >= 800) cost += 5; else if (pObj->value[0] > 0) cost += (int) pObj->value[0] / 200; break; case ITEM_WEAPON: if (pObj->value[4] != 0) { int i; for (i = 0; weapon_type2[i].name != NULL; i++) if (IS_SET (pObj->value[4], weapon_type2[i].bit)) cost += 5; } /* adjust for average damage if ( pObj->value[1] != 0 && pObj->value[2] != 0 ) cost += pObj->value[1] * pObj->value[2] / 2; break; */ case ITEM_ARMOR: cost += (pObj->value[0] + pObj->value[1] + pObj->value[2] + pObj->value[3]) / 8; break; default: break; } if (IS_SET (pObj->extra_flags, ITEM_GLOW)) cost += 1; if (IS_SET (pObj->extra_flags, ITEM_INVIS)) cost += 2; if (IS_SET (pObj->extra_flags, ITEM_NODROP)) cost += 1; if (IS_SET (pObj->extra_flags, ITEM_BLESS)) cost += 2; if (IS_SET (pObj->extra_flags, ITEM_NOREMOVE)) cost += 1; if (IS_SET (pObj->extra_flags, ITEM_VIS_DEATH)) cost += 2; if (IS_SET (pObj->extra_flags, ITEM_BURN_PROOF)) cost += 2; if (IS_SET (pObj->extra_flags, ITEM_NOBREAK)) cost += 3; return cost; } /** Function: do_qgen * Descr : Quest Item Creation code. * Returns : Item created, once it's finished. * Syntax : see below * Written : v1.0 9/98 * Author : Gary McNickle <gary@tarmongaidon.org> */ _DOFUN (do_qgen) { char cmd[MIL], arg1[MIL]; if (IS_NPC (ch)) { chprintf(ch, "Not available to NPCs.\n\r"); return; } if (ch->desc->editor && ch->desc->editor != ED_QGEN) { chprintf(ch, "You are currently using an OLC Editor. Please exit first.\n\r"); return; } argument = one_argument (argument, cmd); argument = one_argument (argument, arg1); if (cmd[0] == '\0' || !str_prefix (cmd, "syntax") || !str_prefix (cmd, "help")) { chprintf(ch, "\n\rSyntax: qGen command [arguments]\n\r" "Where 'command' is one of: start, finish, type, cost, level,\n\r" "v0, v1, v2, v3, v4, show, wear, points, delete, condition, weight\n\r" "material, wear_flags, extra_flags, affects, name, short, long\n\r"); return; } // if the command is anything but 'start', then... if (str_prefix (cmd, "start")) { OBJ_DATA *qObj = (OBJ_DATA *) ch->desc->pEdit; if (!qObj) { chprintf(ch, "You have to create a qGen item before you can modify one.\n\r"); return; } if (!str_prefix (cmd, "finish")) { char buf[MSL]; long eqCost = eq_cost (qObj); if (qObj->item_type < 1 || IS_NULLSTR(qObj->name) || IS_NULLSTR(qObj->short_descr) || IS_NULLSTR(qObj->description)) { chprintf(ch, "Please finish your item first.\n\r"); return; } if (eqCost > ch->pcdata->quest_points) { chprintf (ch,"You have %d quest points, this object\n\r" "costs %d points. You can't afford it.\n\r", ch->pcdata->quest_points, eqCost); return; } if ((qObj->level < 11 && eqCost > 6) || (qObj->level < 26 && eqCost > 10) || (qObj->level < 41 && eqCost > 14) || eqCost > 16) { chprintf(ch, "\n\rYour object costs too much. Valid costs are:\n\r\n\r" "Levels 1 - 10 6 Points\n\r" " 11 - 25 10 Points\n\r" " 26 - 40 14 Points\n\r" " 41 and up 16 Points\n\r\n\r" "Please adjust your item accordingly.\n\r"); return; } if (!IS_SET (qObj->extra_flags, ITEM_QUEST)) SET_BIT (qObj->extra_flags, ITEM_QUEST); ch->pcdata->quest_points -= eq_cost (qObj); sprintf(buf, "%s [%s's qGen]", qObj->name, ch->name); free_string (qObj->name); qObj->name = str_dup (buf); obj_to_char(qObj, ch); ch->desc->pEdit = NULL; ch->desc->editor = ED_NONE; chprintf (ch, "%s has been transferred to your inventory and\n\r" "your quest points have been adjusted.\n\r", qObj->short_descr); return; } else if (!str_prefix (cmd, "?")) { show_help (ch, arg1); return; } else if (!str_prefix (cmd, "delete")) { chprintf (ch, "Item deleted!\n\r"); extract_obj(qObj); ch->desc->pEdit = NULL; ch->desc->editor = ED_NONE; return; } else if (!str_prefix (cmd, "type")) { int value = flag_value (type_flags, arg1); if (value == NO_FLAG || arg1[0] == '\0') { chprintf(ch,"Syntax: type [flag]\n\r" "Type '? type' for a list of valid flags.\n\r"); return; } memset (qObj->value, 0, 5); qObj->item_type = value; if (qObj->item_type == ITEM_WAYGATE) qObj->value[1] = EX_ISDOOR | EX_CLOSED | EX_NOLOCK; chprintf (ch, "Type set [%s].\n\r", flag_string (type_flags, qObj->item_type)); return; } else if (!str_prefix (cmd, "level")) { int value = atoi (arg1); if (value < 0 || value > ML) { chprintf(ch, "Invalid value. Valid range is 0 - %d\n\r", ML); return; } qObj->level = value; chprintf (ch, "Level set to: %d.\n\r", qObj->level); return; } else if ( cmd[0] == 'v' && cmd[1] != '\0') { int which = -1; if (IS_NULLSTR(arg1)) { chprintf(ch, "Invalid argument.\n\r"); return; } // for some god awful reason, VC++ is choking on using atoi on cmd[1], even // when the watch shows it to be '1'. In fact, casting it in the watch window // to a (char*)cmd[1] completely trashes it... *boggle* Thank you MS... which = ( cmd[1] - 48 ); // char(48) = '0' if ( which < 0 || which > 4 ) { chprintf(ch, "Invalid v#"); return; } if ( set_obj_data(ch, qObj, which, arg1)) chprintf(ch, "Value %d set.\n\r", which); return; } else if (!str_prefix (cmd, "wear_flags")) { int value; strcat (arg1, " "); strcat (arg1, argument); value = flag_value (wear_flags, arg1); if (value == NO_FLAG || arg1[0] == '\0') { chprintf (ch, "Syntax: wear [flag]\n\r" "Type '? wear' for a list of valid flags.\n\r"); return; } TOGGLE_BIT (qObj->wear_flags, value); chprintf (ch, "Wear Flag(s) set to: [%s].\n\r", flag_string (wear_flags, qObj->wear_flags)); return; } else if (!str_prefix (cmd, "extra_flags")) { int value; strcat (arg1, " "); strcat (arg1, argument); value = flag_value (extra_flags, arg1); if (value == NO_FLAG || arg1[0] == '\0') { chprintf (ch, "Syntax: extra [flag]\n\r" "Type '? extra-flags' for a list of valid flags.\n\r"); return; } TOGGLE_BIT (qObj->extra_flags, value); chprintf (ch, "Extra Flag(s) set to: [%s].\n\r", flag_string (extra_flags, qObj->extra_flags)); return; } else if (!str_prefix (cmd, "points")) { chprintf (ch, "The current point value of this item is: %d", eq_cost (qObj)); return; } else if (!str_prefix (cmd, "condition")) { int value = atoi (arg1); if (value < 0) { chprintf(ch, "Invalid value.\n\r"); return; } qObj->condition = value; chprintf (ch, "Condition set to: %d.\n\r", value); return; } else if (!str_prefix (cmd, "cost")) { long value = atol (arg1); if (value < 0) { chprintf(ch, "Invalid value.\n\r"); return; } qObj->cost = value; chprintf (ch, "Cost set to: %d.\n\r", value); return; } else if (!str_prefix (cmd, "weight")) { int value = atoi (arg1); if (value < 0) { chprintf(ch, "Invalid value.\n\r"); return; } qObj->weight = value; chprintf (ch, "Weight set to: %d.\n\r", value); return; } else if (!str_prefix (cmd, "affects")) { int value = -1; AFFECT_DATA *pAf; char mod[MSL]; bool bDelete = FALSE; one_argument (argument, mod); if (arg1[0] == '\0' || mod[0] == '\0' ) { chprintf (ch,"Syntax: qgen affect [location] [delete|#xmod]\n\r" "Valid affects are:\n\r"); show_help (ch, "apply"); return; } if ( !str_prefix(mod, "delete") ) bDelete = TRUE; else if ((value = flag_value (apply_flags, arg1)) == NO_FLAG) { chprintf(ch, "Valid affects are:\n\r"); show_help (ch, "apply"); return; } if ( bDelete ) { value = atoi(arg1); if (!(pAf = qObj->affected) || value == -1) { chprintf(ch, "Non-existant affect.\n\r"); return; } if ( value == 0 ) { pAf = qObj->affected; qObj->affected = pAf->next; free_affect(pAf); } else { int cnt = 0; AFFECT_DATA *pAf_next; while ((pAf_next = pAf->next) && (++cnt < value)) pAf = pAf_next; if (pAf_next) { pAf->next = pAf_next->next; free_affect (pAf_next); } else { chprintf(ch, "No such affect.\n\r"); return; } } chprintf(ch, "Affect deleted.\n\r"); return; } pAf = new_affect (); pAf->location = value; pAf->modifier = atoi (mod); pAf->where = TO_OBJECT; pAf->type = -1; pAf->duration = -1; pAf->bitvector = 0; pAf->level = qObj->level; pAf->next = qObj->affected; qObj->affected = pAf; chprintf(ch, "Affect added.\n\r"); return; } else if (!str_prefix (cmd, "name")) { char buf[MSL / 2]; strcat (arg1, " "); strcat (arg1, argument); if (qObj->name && qObj->name[0] != '\0') free_string (qObj->name); memset (buf, 0, MSL); strcat (buf, arg1); qObj->name = str_dup (buf); chprintf (ch, "Name set to: %s", qObj->name); return; } else if (!str_prefix (cmd, "short")) { strcat (arg1, " "); strcat (arg1, argument); if (qObj->short_descr && qObj->short_descr[0] != '\0') free_string (qObj->short_descr); qObj->short_descr = str_dup (arg1); chprintf (ch, "Short Description set to: \n\r%s", qObj->short_descr); return; } else if (!str_prefix (cmd, "long")) { strcat (arg1, " "); strcat (arg1, argument); if (qObj->description && qObj->description[0] != '\0') free_string (qObj->description); qObj->description = str_dup (arg1); chprintf (ch, "Long Description set to: %s", qObj->description); return; } else if (!str_prefix (cmd, "material")) { strcat (arg1, " "); strcat (arg1, argument); if (qObj->material && qObj->material[0] != '\0') free_string (qObj->material); qObj->material = str_dup (arg1); chprintf (ch, "Material set to: %s", qObj->material); return; } else if (!str_prefix (cmd, "show")) { int cnt = -1; AFFECT_DATA *paf; chprintf (ch, "\n\r\n\rLevel [%2d] Name : %s\n\r", qObj->level, qObj->name); chprintf (ch, "Short description : %s\n\r" "Long description : %s\n\r\n\r", qObj->short_descr, qObj->description); if (qObj->extra_descr) { EXTRA_DESCR_DATA *ed; chprintf(ch, "Ex desc kwd : "); for (ed = qObj->extra_descr; ed; ed = ed->next) { chprintf(ch, "["); chprintf(ch, ed->keyword); chprintf(ch, "]"); } chprintf(ch, "\n\r"); } if (qObj->pIndexData->extra_descr) { EXTRA_DESCR_DATA *ed; chprintf(ch, "Ex desc kwd2 : "); for (ed = qObj->pIndexData->extra_descr; ed; ed = ed->next) { chprintf(ch, "["); chprintf(ch, ed->keyword); chprintf(ch, "]"); } chprintf(ch, "\n\r"); } chprintf (ch, "Vnum : [%ld] Type: %s Resets: %d Points: %d\n\r", qObj->pIndexData->vnum, item_name (qObj->item_type), qObj->pIndexData->reset_num, eq_cost (qObj)); chprintf (ch, "Wear flags : [%s]\n\rExtra flags : [%s]\n\r", flag_string(wear_flags, qObj->wear_flags), flag_string(extra_flags, qObj->extra_flags)); chprintf (ch, "Number : [1/%d] Weight: [%d/%d/%d]\n\r", get_obj_number (qObj), qObj->weight, get_obj_weight (qObj), get_true_weight (qObj)); chprintf (ch, "Cost : [%d] Condition: [%d] Timer: [%d]\n\r", qObj->cost, qObj->condition, qObj->timer); chprintf (ch, "In room : [%ld] In Object : %s Carried by : (%s)\n\r\n\r", qObj->in_room == NULL ? 0 : qObj->in_room->vnum, qObj->in_obj == NULL ? "(none)" : qObj->in_obj->short_descr, qObj->carried_by == NULL ? "(none)" : can_see (ch, qObj-> carried_by) ? qObj->carried_by->name : "someone"); show_obj_data (ch, qObj); for (cnt = 0, paf = qObj->affected; paf; paf = paf->next) { if (cnt == 0) { chprintf (ch,"\n\rNumber Modifier Affects\n\r" "------ -------- -------\n\r"); } chprintf (ch, "[%4d] %-8d %s\n\r", cnt, paf->modifier, flag_string (apply_flags, paf->location)); cnt++; } if (!qObj->enchanted) { for (paf = qObj->pIndexData->affected; paf; paf = paf->next) { if (cnt == 0) { chprintf(ch, "\n\rNumber Modifier Affects\n\r" "------ -------- -------\n\r"); } chprintf (ch, "[%4d] %-8d %s\n\r", cnt, paf->modifier, flag_string (apply_flags, paf->location)); cnt++; } } return; } } // Ok, they want to start a new item... else { OBJ_DATA *qObj = NULL; if (ch->desc->pEdit != NULL) { chprintf(ch, "Finish your current item first!\n\r"); return; } qObj = create_object (get_obj_index (OBJ_VNUM_GENERIC), 0); if (!qObj) { chprintf(ch, "qGen Error: Unable to create object!\n\r"); logf ("qGen Error: Unable to create object #%d", OBJ_VNUM_GENERIC); return; } // qGen has officially begun! ch->desc->editor = ED_QGEN; ch->desc->pEdit = qObj; chprintf(ch, "Your qGen process has begun.\n\r"); return; } } <<<<<<<<< HELP FILES FOLLOW >>>>>>>>>> 52 QGEN~ QGEN QGen is a means to create unqiue, personalized Quest eq. This file will explain the rules for it as well as detail all the commands it uses. QGen Rules- -You may create only 1 piece of Qgen generated quest eq per Quest. The only exception to this is if you are another Imm(s) are running a multi-level Quest. IE a lowbie group and a high level group. Even then each group will only receive 1 piece of eq made for their group. -EQPoints: The max number of eqpoints (read the HELP EQUIPMENT_POINTS file) you can pump into your QuestEQ is based on the following values. Levels 1-10=6pts. Levels 11-25=10pts. Levels 26-40=14pts. Levels 41+=16pts. (Note 1 EQPoint is equal to 1 QPoint). -Stats: QuestEQ is powerful, however there are some guidelines you must follow. Balance your EQ out. There should never be a piece of EQ with +4/+4 hit/dam and nothing else. Use your imagination and make it unique. NEVER put negative stats into the EQ to free up additional points. (The only exceptions are for AC (armor class) and saves, which neagtive stats are good) Anyone caught doing this will be demoted and lose their right to run Quests. -Never reuse your QuestEQ for other Quests. QuestEQ can not be restrung and each Quest should have brand new, original prizes. -Your alts may NEVER possess QuestEQ made by you. -The name of your EQ must match the description(s). IE no hidden keywords. -QuestEQ is for Quests only. It may not be given out as a reward to your Guildies or morts. Period. -Qpoints are given out by Council on a weekly basis, if you use all your Qpoints in 2 days.... Too bad. Qpoints do not carry over week-to-week you will be reset each week. -Do not put the QuestEQ on the Quest mobs. It is to nbe given out only at the conclusion of the Quest. -Weapons are not allowed as QuestEQ. Period. -QuestEQ names/descriptions MUST be IC. No Nikes or Levis, etc. -DO not make QuestEQ for other Imms, if they burned up their Quest points... They have to wait until next week. QGen is a tool to help makes Quests more unique and rewarding for morts. Do not abuse it or it will be taken away from you. Read the Help QUEST_RULES for more guidelines for running Quests. `RAll instances of Qgen are logged automatically and your name is hard-coded into it. If you cheat you WILL be caught. `w QGen Commands- Start- Starts the Qgen process. Finish- Ends the Qgen process and loads the EQ into your inventory. DOUBLE CHECK YOUR WORK! Type- This set the item type. Weapon, armor, clothing, etc. Type 'qgen ? Type' for a full list. Cost- This is the items worth in silver. Leave at 0. Level- This sets the eq's level. The level determines the amount of QPoints you can use for the piece. V0, V1, V2, V3, V4- This sets the armor value(s) for TYPE_ARMOR. Also used for setting furniture flags. Show- Displays the status of the Qgen piece being worked on. Wear- Sets the WEAR flag. Type 'qgen ? Wear' for a full list. Points- Shows how many Qpoints you have used. Delete- Deletes the piece being worked on. Condition- Sets the CONDITION of the item. Leave at 100. Weight- Sets the weight of the piece. Material- Sets the material the piece is made of. Extra- Sets the EXTRA flags for the piece. Type 'qgen ? Extra' for a list. Affects- This command adds the stats to the piece. Type 'qgen affect' to see a list. Name- Sets the name of the piece. (Note your name is automatically added to this) Short- This sets the SHORT description. (How it appears in your inventory when being worn) Long- This sets the LONG description (How it appears when you 'examine' the piece or see it lying on the ground. `RNote`w- All these commands MUST be preceded by 'qgen' IE 'qgen start' 'qgen finish' etc. Typing 'qgen' without a arguement will display a list of commands. Make sure you check your work before typing 'qgen finish'. Once thats been done the QuestEQ can not be changed. The file HELP EQUIPMENT_POINTS lists all the possible stats you can add and their cost(s). QGen written by Gary McNickle for The Wheel of Time Project. wotmud.tarmongaidon.org:5000 ~ 51 EQUIPMENT_POINTS~ EQUIPMENT POINTS Equipment Points (EP) are a measure of the statistical strength of an item. Here is a complete list of all addaffects, flags, and anything else that will cost your object EP. ep - equipment points ITEM_LIGHT * 1ep / 200hours (max 4ep) * 5ep / -1 (infinite) ITEM_ARMOR * ep = v0+v1+v2+v3 /8 FLAGS * Burnproof = 2ep * Neverbreak = 3ep * Visdeath/Bless = 2ep * Glow/Hum = 1ep * Dark/AntiAlign = 0ep * Evil = -2ep * Nodrop = 2ep APPLIES * str/dex/int/wis/con = 1ep/per pt. * -2ac = 1ep * 10endurance = 1ep * 5hp = 1ep * -1save = 2ep * +1 hit or dam = 2 ep Written by Phil Shortman for The Wheel of Time Project. wotmud.tarmongaidon.org:5000 ~