I put in forge but it seems to be upping the damage by way too much on our weapons.
I would like to dial it down some but unsure of the best way how.
so theoretically players could take a 1d37 weapon and even upping it by +1 would make it way too much
Code:
ACMD(do_forge)
{
/* PLEASE NOTE!!! This command alters the object_values of the target
weapon, and this will save to the rent files.
Mortals can only forge a weapon once so it uses GET_OBJ_FORGED
from one of the enchant slots in Utils.H to put a check on this.
Weapons can only be forged once.
*/
struct obj_data *weapon = NULL;
struct obj_data *obj, *next_obj;
char weapon_name[MAX_STRING_LENGTH];
char buf[MAX_INPUT_LENGTH];
int found = FALSE, prob = 0, dam = 0;
one_argument(argument, weapon_name);
/*if ((GET_CLASS(ch) == CLASS_WARLOCK || GET_CLASS(ch) == CLASS_NECROMANCER) &&
GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "You have no idea how to forge weapons!\r\n");
return;
}*/
if (!can_see_room(ch, IN_ROOM(ch))) {
send_to_char(ch, "It's too dark for you to forge!\r\n");
return;
}
/* No forging while fighting */
if (IS_FIGHTING(ch)) {
send_to_char(ch, "You are too busy fighting to forge right now!\r\n");
return;
}
if (!*weapon_name) {
send_to_char(ch, "What do you wish to forge?\r\n");
return;
}
for (obj = ch->carrying; obj; obj = next_obj) {
next_obj = obj->next_content;
if (obj == NULL)
return;
else if (!(weapon = get_obj_in_list_vis(ch->carrying, ch, weapon_name)))
continue;
else
found = TRUE;
}
if (found == FALSE) {
sprintf(buf, "You don't have %s in your inventory!\r\n", weapon_name);
send_to_char(ch, buf);
return;
}
if (found && (GET_OBJ_TYPE(weapon) != ITEM_WEAPON)) {
sprintf(buf, "It doesn't look like %s would make a good weapon...\r\n", weapon_name);
send_to_char(ch, buf);
return;
}
if (GET_OBJ_FORGED(weapon) == 1) {
send_to_char(ch, "You cannot forge a weapon more than once!\r\n");
return;
}
if (GET_OBJ_EXTRA(weapon) == ITEM_MAGIC) {
send_to_char(ch, "The weapon is imbued with magical powers beyond your grasp.\r\nYou cannot further affect its form.\r\n");
return;
}
/* determine success probability */
prob += (GET_LEVEL(ch) << 1) + ((GET_TOT_DEX(ch) - 11) << 1);
prob += ((GET_TOT_STR(ch) - 11) << 1) + (100 >> 3);
if ((rand_number(10, 100) > prob) && (GET_LEVEL(ch) < LVL_IMMORT)) {
send_to_char(ch, "As you pound out the dents in the weapon, you hit a weak spot and it explodes!\r\n");
act("$n tries to forge a weapon, but it explodes!", FALSE, ch, 0,0, TO_ROOM);
extract_obj(weapon);
dam = rand_number(20, 60);
GET_HIT(ch) -= dam;
update_pos(ch);
return;
}
GET_OBJ_FORGED(weapon) += 1; //Prevents mortals from forging the same weapon more than once
GET_OBJ_VAL(weapon, 1) += (GET_LEVEL(ch) % 3) + rand_number(-1, 2); //Random Ave Dam upgrade or downgrade
GET_OBJ_RENT(weapon) += (GET_LEVEL(ch) << 3); //Adjusts Rent cost
/*Forge will cost a lot of resources*/
if (GET_WOOD(ch) > 0 && GET_STONE(ch) > 0) {
GET_WOOD(ch) -= 500;
GET_STONE(ch) -= 500;
send_to_char(ch, "You have forged new life into the weapon!\r\n");
act("$n vigorously pounds on a weapon!", FALSE, ch, 0, 0, TO_ROOM);
}
else {
send_to_char(ch, "You don't have enough resources to forge!\r\n");
return;
}
}