void oedit_setup_existing(struct descriptor_data *d, int real_num) { struct obj_data *obj; /* * Allocate object in memory. */ CREATE(obj, struct obj_data, 1); copy_object(obj, &obj_proto[real_num]); /* * Attach new object to player's descriptor. */ OLC_OBJ(d) = obj; OLC_VAL(d) = 0; OLC_ITEM_TYPE(d) = OBJ_TRIGGER; dg_olc_script_copy(d); /* * The edited obj must not have a script. * It will be assigned to the updated obj later, after editing. */ SCRIPT(obj) = NULL; OLC_OBJ(d)->proto_script = NULL; oedit_disp_menu(d); }
void redit_setup_new(struct descriptor_data *d) { CREATE(OLC_ROOM(d), struct room_data, 1); OLC_ROOM(d)->name = str_dup("An unfinished room"); OLC_ROOM(d)->description = str_dup("You are in an unfinished room.\r\n"); OLC_ROOM(d)->number = NOWHERE; OLC_ITEM_TYPE(d) = WLD_TRIGGER; redit_disp_menu(d); OLC_VAL(d) = 0; }
static void oedit_setup_new(struct descriptor_data *d) { CREATE(OLC_OBJ(d), struct obj_data, 1); clear_object(OLC_OBJ(d)); OLC_OBJ(d)->name = strdup("unfinished object"); OLC_OBJ(d)->description = strdup("An unfinished object is lying here."); OLC_OBJ(d)->short_description = strdup("an unfinished object"); SET_BIT_AR(GET_OBJ_WEAR(OLC_OBJ(d)), ITEM_WEAR_TAKE); OLC_VAL(d) = 0; OLC_ITEM_TYPE(d) = OBJ_TRIGGER; SCRIPT(OLC_OBJ(d)) = NULL; OLC_OBJ(d)->proto_script = OLC_SCRIPT(d) = NULL; }
void medit_setup_existing(struct descriptor_data *d, int rmob_num) { struct char_data *mob; /* Allocate a scratch mobile structure. */ CREATE(mob, struct char_data, 1); copy_mobile(mob, mob_proto + rmob_num); OLC_MOB(d) = mob; OLC_ITEM_TYPE(d) = MOB_TRIGGER; dg_olc_script_copy(d); /* * The edited mob must not have a script. * It will be assigned to the updated mob later, after editing. */ SCRIPT(mob) = NULL; OLC_MOB(d)->proto_script = NULL; }
void medit_setup_existing(struct descriptor_data *d, int rmob_num) { struct char_data *mob; #if defined(OASIS_MPROG) MPROG_DATA *temp; MPROG_DATA *head; #endif /* * Allocate a scratch mobile structure. */ CREATE(mob, struct char_data, 1); copy_mobile(mob, mob_proto + rmob_num); #if defined(OASIS_MPROG) /* * I think there needs to be a brace from the if statement to the #endif * according to the way the original patch was indented. If this crashes, * try it with the braces and report to [email protected] on if that works. */ if (GET_MPROG(mob)) CREATE(OLC_MPROGL(d), MPROG_DATA, 1); head = OLC_MPROGL(d); for (temp = GET_MPROG(mob); temp;temp = temp->next) { OLC_MPROGL(d)->type = temp->type; OLC_MPROGL(d)->arglist = str_dup(temp->arglist); OLC_MPROGL(d)->comlist = str_dup(temp->comlist); if (temp->next) { CREATE(OLC_MPROGL(d)->next, MPROG_DATA, 1); OLC_MPROGL(d) = OLC_MPROGL(d)->next; } } OLC_MPROGL(d) = head; OLC_MPROG(d) = OLC_MPROGL(d); #endif OLC_MOB(d) = mob; OLC_ITEM_TYPE(d) = MOB_TRIGGER; dg_olc_script_copy(d); medit_disp_menu(d); }
static void medit_setup_new(struct descriptor_data *d) { struct char_data *mob; /* Allocate a scratch mobile structure. */ CREATE(mob, struct char_data, 1); init_mobile(mob); GET_MOB_RNUM(mob) = NOBODY; /* Set up some default strings. */ GET_ALIAS(mob) = strdup("mob unfinished"); GET_SDESC(mob) = strdup("the unfinished mob"); GET_LDESC(mob) = strdup("An unfinished mob stands here.\r\n"); GET_DDESC(mob) = strdup("It looks unfinished.\r\n"); SCRIPT(mob) = NULL; mob->proto_script = OLC_SCRIPT(d) = NULL; OLC_MOB(d) = mob; /* Has changed flag. (It hasn't so far, we just made it.) */ OLC_VAL(d) = FALSE; OLC_ITEM_TYPE(d) = MOB_TRIGGER; }