original_code:
void acid_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   acid_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   acid_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  OBJ_DATA *obj = (OBJ_DATA *) vo;
  OBJ_DATA *t_obj,*n_obj;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch (obj->item_type)
  {
   default:
   return;
   case 15:
   case 24:
   case 23:
   msg = "$p fumes and dissolves.";
   break;
   case 9:
   msg = "$p is pitted and etched.";
   break;
   case 11:
   msg = "$p is corroded into scrap.";
   break;
   case 4:
   case 3:
   chance -= 10;
   msg = "$p corrodes and breaks.";
   break;
   case 2:
   chance += 10;
   msg = "$p is burned into waste.";
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
 if (obj->item_type == 9)
  {
   AFFECT_DATA *paf;
   bool af_found = 0;
   int i;
   affect_enchant(obj);
   for ( paf = obj->affected; paf != ((void *)0); paf = paf->next)
   {
    if ( paf->location == 17)
    {
     af_found = 1;
     paf->type = -1;
     paf->modifier += 1;
     paf->level = ((paf->level) > (level) ? (paf->level) : (level));
     break;
    }
   }
   if (!af_found)
   {
    paf = new_affect();
    paf->type = -1;
    paf->level = level;
    paf->duration = -1;
    paf->location = 17;
    paf->modifier = 1;
    paf->bitvector = 0;
    paf->next = obj->affected;
    obj->affected = paf;
   }
   if (obj->carried_by != ((void *)0) && obj->wear_loc != -1)
    {
     for (i = 0; i < 4; i++)
      {
       obj->carried_by->armor[i] += 1;
      }
    }
    return;
   }
 if (obj->contains)
   {
    for (t_obj = obj->contains; t_obj != ((void *)0); t_obj = n_obj)
    {
     n_obj = t_obj->next_content;
     obj_from_obj(t_obj);
     if (obj->in_room != ((void *)0))
      obj_to_room(t_obj,obj->in_room);
     else if (obj->carried_by != ((void *)0))
      obj_to_room(t_obj,obj->carried_by->in_room);
     else
     {
      extract_obj(t_obj);
      continue;
     }
     acid_effect(t_obj,level/2,dam/2,1);
    }
   }
   extract_obj(obj);
   return;
  }
}

canonical_original_code:
void acid_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  struct room_index_data *room = (ROOM_INDEX_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   acid_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  struct char_data *victim = (CHAR_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   acid_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  struct obj_data *obj = (OBJ_DATA *) vo;
  struct obj_data *t_obj; struct obj_data *n_obj;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch (obj->item_type)
  {
   default:
   return;
   case 15:
   case 24:
   case 23:
   msg = "$p fumes and dissolves.";
   break;
   case 9:
   msg = "$p is pitted and etched.";
   break;
   case 11:
   msg = "$p is corroded into scrap.";
   break;
   case 4:
   case 3:
   chance -= 10;
   msg = "$p corrodes and breaks.";
   break;
   case 2:
   chance += 10;
   msg = "$p is burned into waste.";
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
 if (obj->item_type == 9)
  {
   struct affect_data *paf;
   unsigned char af_found = 0;
   int i;
   affect_enchant(obj);
   for ( paf = obj->affected; paf != ((void *)0); paf = paf->next)
   {
    if ( paf->location == 17)
    {
     af_found = 1;
     paf->type = -1;
     paf->modifier += 1;
     paf->level = ((paf->level) > (level) ? (paf->level) : (level));
     break;
    }
   }
   if (!af_found)
   {
    paf = new_affect();
    paf->type = -1;
    paf->level = level;
    paf->duration = -1;
    paf->location = 17;
    paf->modifier = 1;
    paf->bitvector = 0;
    paf->next = obj->affected;
    obj->affected = paf;
   }
   if (obj->carried_by != ((void *)0) && obj->wear_loc != -1)
    {
     for (i = 0; i < 4; i++)
      {
       obj->carried_by->armor[i] += 1;
      }
    }
    return;
   }
 if (obj->contains)
   {
    for (t_obj = obj->contains; t_obj != ((void *)0); t_obj = n_obj)
    {
     n_obj = t_obj->next_content;
     obj_from_obj(t_obj);
     if (obj->in_room != ((void *)0))
      obj_to_room(t_obj,obj->in_room);
     else if (obj->carried_by != ((void *)0))
      obj_to_room(t_obj,obj->carried_by->in_room);
     else
     {
      extract_obj(t_obj);
      continue;
     }
     acid_effect(t_obj,level/2,dam/2,1);
    }
   }
   extract_obj(obj);
   return;
  }
}

variable_types:
vo
void *

variable_types: level int

variable_types: dam int

variable_types: target int

variable_types: struct room_index_data { struct room_index_data *next; struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; } *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *pShop; struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; } *mprogs; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; } *pIndexData; struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t { int WriteOOB; enum bool_t { false=0, true=1 } Negotiated[-1]; enum bool_t { false=0, true=1 } bIACMode; enum bool_t { false=0, true=1 } bNegotiated; enum bool_t { false=0, true=1 } bRenegotiate; enum bool_t { false=0, true=1 } bNeedMXPVersion; enum bool_t { false=0, true=1 } bBlockMXP; enum bool_t { false=0, true=1 } bTTYPE; enum bool_t { false=0, true=1 } bECHO; enum bool_t { false=0, true=1 } bNAWS; enum bool_t { false=0, true=1 } bCHARSET; enum bool_t { false=0, true=1 } bMSDP; enum bool_t { false=0, true=1 } bMSSP; enum bool_t { false=0, true=1 } bATCP; enum bool_t { false=0, true=1 } bMSP; enum bool_t { false=0, true=1 } bMXP; enum bool_t { false=0, true=1 } bMCCP; enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 } b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t { enum bool_t { false=0, true=1 } bReport; enum bool_t { false=0, true=1 } bDirty; int ValueInt; char *pValueString; } **pVariables; } *pProtocol; } *desc; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; } *pnote; struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct affect_data *affected; struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; } *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data { struct pc_data *next; struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; } *pcdata; struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; } *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; } *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *exit[6]; struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; } *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; } *

variable_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; } *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *pShop; struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; } *mprogs; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; } *pIndexData; struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t { int WriteOOB; enum bool_t { false=0, true=1 } Negotiated[-1]; enum bool_t { false=0, true=1 } bIACMode; enum bool_t { false=0, true=1 } bNegotiated; enum bool_t { false=0, true=1 } bRenegotiate; enum bool_t { false=0, true=1 } bNeedMXPVersion; enum bool_t { false=0, true=1 } bBlockMXP; enum bool_t { false=0, true=1 } bTTYPE; enum bool_t { false=0, true=1 } bECHO; enum bool_t { false=0, true=1 } bNAWS; enum bool_t { false=0, true=1 } bCHARSET; enum bool_t { false=0, true=1 } bMSDP; enum bool_t { false=0, true=1 } bMSSP; enum bool_t { false=0, true=1 } bATCP; enum bool_t { false=0, true=1 } bMSP; enum bool_t { false=0, true=1 } bMXP; enum bool_t { false=0, true=1 } bMCCP; enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 } b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t { enum bool_t { false=0, true=1 } bReport; enum bool_t { false=0, true=1 } bDirty; int ValueInt; char *pValueString; } **pVariables; } *pProtocol; } *desc; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; } *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct area_data *area; struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *exit[6]; struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; } *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; } *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data { struct pc_data *next; struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; } *pcdata; struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; } *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; } *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; } *

variable_types: chance int

variable_types:
msg
char *

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }

user_defined_types: struct help_area_data { struct help_area_data *next; struct help_data *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; }


repo: ptrayal/dungeonworld

original_code:
void cold_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   cold_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  if (!saves_spell(level/4 + dam / 20, victim, 5))
  {
   AFFECT_DATA af;
   act_new(("$n turns blue and shivers."),(victim),(((void *)0)),(((void *)0)),(0),5);
   act_new(("A chill sinks deep into your bones."),(victim),(((void *)0)),(((void *)0)),(3),5);
   af.where = 0;
   af.type = skill_lookup("chill touch");
   af.level = level;
   af.duration = 6;
   af.location = 1;
   af.modifier = -1;
   af.bitvector = 0;
   affect_join( victim, &af );
  }
  if (!((((victim)->act) & ((1)))))
   gain_condition(victim,3,dam/20);
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   cold_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  OBJ_DATA *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch(obj->item_type)
  {
   default:
   return;
   case 10:
   msg = "$p freezes and shatters!";
   chance += 25;
   break;
   case 17:
   msg = "$p freezes and shatters!";
   chance += 5;
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  extract_obj(obj);
  return;
 }
}

canonical_original_code:
void cold_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  struct room_index_data *room = (ROOM_INDEX_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   cold_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  struct char_data *victim = (CHAR_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  if (!saves_spell(level/4 + dam / 20, victim, 5))
  {
   struct affect_data af;
   act_new(("$n turns blue and shivers."),(victim),(((void *)0)),(((void *)0)),(0),5);
   act_new(("A chill sinks deep into your bones."),(victim),(((void *)0)),(((void *)0)),(3),5);
   af.where = 0;
   af.type = skill_lookup("chill touch");
   af.level = level;
   af.duration = 6;
   af.location = 1;
   af.modifier = -1;
   af.bitvector = 0;
   affect_join( victim, &af );
  }
  if (!((((victim)->act) & ((1)))))
   gain_condition(victim,3,dam/20);
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   cold_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  struct obj_data *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch(obj->item_type)
  {
   default:
   return;
   case 10:
   msg = "$p freezes and shatters!";
   chance += 25;
   break;
   case 17:
   msg = "$p freezes and shatters!";
   chance += 5;
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  extract_obj(obj);
  return;
 }
}

variable_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; } *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *pShop; struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; } *mprogs; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; } *pIndexData; struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t { int WriteOOB; enum bool_t { false=0, true=1 } Negotiated[-1]; enum bool_t { false=0, true=1 } bIACMode; enum bool_t { false=0, true=1 } bNegotiated; enum bool_t { false=0, true=1 } bRenegotiate; enum bool_t { false=0, true=1 } bNeedMXPVersion; enum bool_t { false=0, true=1 } bBlockMXP; enum bool_t { false=0, true=1 } bTTYPE; enum bool_t { false=0, true=1 } bECHO; enum bool_t { false=0, true=1 } bNAWS; enum bool_t { false=0, true=1 } bCHARSET; enum bool_t { false=0, true=1 } bMSDP; enum bool_t { false=0, true=1 } bMSSP; enum bool_t { false=0, true=1 } bATCP; enum bool_t { false=0, true=1 } bMSP; enum bool_t { false=0, true=1 } bMXP; enum bool_t { false=0, true=1 } bMCCP; enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 } b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t { enum bool_t { false=0, true=1 } bReport; enum bool_t { false=0, true=1 } bDirty; int ValueInt; char *pValueString; } **pVariables; } *pProtocol; } *desc; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; } *pnote; struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct affect_data *affected; struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *pIndexData; struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *exit[6]; struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; } *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; } *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; } *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data { struct pc_data *next; struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; } *pcdata; struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; } *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; } *

return_type: void

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


original_code:
void fire_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   fire_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  if (!((((victim)->affected_by) & (((1)))))
   && !saves_spell(level / 4 + dam / 20, victim,4))
  {
   AFFECT_DATA af;
   act_new(("$n is blinded by smoke!"),(victim),(((void *)0)),(((void *)0)),(0),5);
   act_new(("Your eyes tear up from smoke...you can't see a thing!"),(victim),(((void *)0)),(((void *)0)),(3),5);
   af.where = 0;
   af.type = skill_lookup("fire breath");
   af.level = level;
   af.duration = number_range(0,level/10);
   af.location = 18;
   af.modifier = -4;
   af.bitvector = (1);
   affect_to_char(victim,&af);
  }
  if (!((((victim)->act) & ((1)))))
   gain_condition(victim,2,dam/20);
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   fire_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  OBJ_DATA *obj = (OBJ_DATA *) vo;
  OBJ_DATA *t_obj,*n_obj;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch ( obj->item_type )
  {
   default:
   return;
   case 15:
   msg = "$p ignites and burns!";
   break;
   case 10:
   chance += 25;
   msg = "$p bubbles and boils!";
   break;
   case 2:
   chance += 50;
   msg = "$p crackles and burns!";
   break;
   case 4:
   chance += 10;
   msg = "$p smokes and chars!";
   break;
   case 3:
   msg = "$p sparks and sputters!";
   break;
   case 19:
   msg = "$p blackens and crisps!";
   break;
   case 26:
   msg = "$p melts and drips!";
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  if (obj->contains)
  {
   for (t_obj = obj->contains; t_obj != ((void *)0); t_obj = n_obj)
   {
    n_obj = t_obj->next_content;
    obj_from_obj(t_obj);
    if (obj->in_room != ((void *)0))
     obj_to_room(t_obj,obj->in_room);
    else if (obj->carried_by != ((void *)0))
     obj_to_room(t_obj,obj->carried_by->in_room);
    else
    {
     extract_obj(t_obj);
     continue;
    }
    fire_effect(t_obj,level/2,dam/2,1);
   }
  }
  extract_obj( obj );
  return;
 }
}

canonical_original_code:
void fire_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  struct room_index_data *room = (ROOM_INDEX_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   fire_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  struct char_data *victim = (CHAR_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  if (!((((victim)->affected_by) & (((1)))))
   && !saves_spell(level / 4 + dam / 20, victim,4))
  {
   struct affect_data af;
   act_new(("$n is blinded by smoke!"),(victim),(((void *)0)),(((void *)0)),(0),5);
   act_new(("Your eyes tear up from smoke...you can't see a thing!"),(victim),(((void *)0)),(((void *)0)),(3),5);
   af.where = 0;
   af.type = skill_lookup("fire breath");
   af.level = level;
   af.duration = number_range(0,level/10);
   af.location = 18;
   af.modifier = -4;
   af.bitvector = (1);
   affect_to_char(victim,&af);
  }
  if (!((((victim)->act) & ((1)))))
   gain_condition(victim,2,dam/20);
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   fire_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  struct obj_data *obj = (OBJ_DATA *) vo;
  struct obj_data *t_obj; struct obj_data *n_obj;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch ( obj->item_type )
  {
   default:
   return;
   case 15:
   msg = "$p ignites and burns!";
   break;
   case 10:
   chance += 25;
   msg = "$p bubbles and boils!";
   break;
   case 2:
   chance += 50;
   msg = "$p crackles and burns!";
   break;
   case 4:
   chance += 10;
   msg = "$p smokes and chars!";
   break;
   case 3:
   msg = "$p sparks and sputters!";
   break;
   case 19:
   msg = "$p blackens and crisps!";
   break;
   case 26:
   msg = "$p melts and drips!";
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  if (obj->contains)
  {
   for (t_obj = obj->contains; t_obj != ((void *)0); t_obj = n_obj)
   {
    n_obj = t_obj->next_content;
    obj_from_obj(t_obj);
    if (obj->in_room != ((void *)0))
     obj_to_room(t_obj,obj->in_room);
    else if (obj->carried_by != ((void *)0))
     obj_to_room(t_obj,obj->carried_by->in_room);
    else
    {
     extract_obj(t_obj);
     continue;
    }
    fire_effect(t_obj,level/2,dam/2,1);
   }
  }
  extract_obj( obj );
  return;
 }
}

variable_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; }

user_defined_types: struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; }

user_defined_types: struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; }

user_defined_types: struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; }

user_defined_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; }

user_defined_types: struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; }

user_defined_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; }

user_defined_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; }

user_defined_types: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }

user_defined_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }


original_code:
void poison_effect(void *vo,int level, int dam, int target)
{
 if (target == 2)
 {
  ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   poison_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  if (!saves_spell(level / 4 + dam / 20,victim,8))
  {
   AFFECT_DATA af;
   send_to_char("You feel poison coursing through your veins.\n\r", victim);
   act_new(("$n looks very ill."),(victim),(((void *)0)),(((void *)0)),(0),5);
   af.where = 0;
   af.type = gsn_poison;
   af.level = level;
   af.duration = level / 2;
   af.location = 1;
   af.modifier = -1;
   af.bitvector = (4096);
   affect_join( victim, &af );
  }
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   poison_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  OBJ_DATA *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((256)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  chance -= obj->level * 2;
  switch (obj->item_type)
  {
   default:
   return;
   case 19:
   break;
   case 17:
   if (obj->value[0] == obj->value[1])
    return;
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  obj->value[3] = 1;
  return;
 }
}

canonical_original_code:
void poison_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  struct room_index_data *room = (ROOM_INDEX_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   poison_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  struct char_data *victim = (CHAR_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  if (!saves_spell(level / 4 + dam / 20,victim,8))
  {
   struct affect_data af;
   send_to_char("You feel poison coursing through your veins.\n\r", victim);
   act_new(("$n looks very ill."),(victim),(((void *)0)),(((void *)0)),(0),5);
   af.where = 0;
   af.type = gsn_poison;
   af.level = level;
   af.duration = level / 2;
   af.location = 1;
   af.modifier = -1;
   af.bitvector = (4096);
   affect_join( victim, &af );
  }
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   poison_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  struct obj_data *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((256)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) / 2 + 50;
  chance -= obj->level * 2;
  switch (obj->item_type)
  {
   default:
   return;
   case 19:
   break;
   case 17:
   if (obj->value[0] == obj->value[1])
    return;
   break;
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  obj->value[3] = 1;
  return;
 }
}

user_defined_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; }

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }


original_code:
void shock_effect(void *vo,int level, int dam, int target)
{
 if (target == 2)
 {
  ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  if (!saves_spell(level/4 + dam/20,victim,6))
  {
   send_to_char("Your muscles stop responding.\n\r",victim);
   ((victim)->daze = (((victim)->daze) > ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20)))) ? ((victim)->daze) : ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20))))));
  }
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  OBJ_DATA *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) /2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch(obj->item_type)
  {
   default:
   return;
   case 3:
   case 4:
   chance += 10;
   msg = "$p overloads and explodes!";
   break;
   case 33:
   chance -= 10;
   msg = "$p is fused into a worthless lump.";
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  extract_obj(obj);
  return;
 }
}

canonical_original_code:
void shock_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  struct room_index_data *room = (ROOM_INDEX_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  struct char_data *victim = (CHAR_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  if (!saves_spell(level/4 + dam/20,victim,6))
  {
   send_to_char("Your muscles stop responding.\n\r",victim);
   ((victim)->daze = (((victim)->daze) > ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20)))) ? ((victim)->daze) : ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20))))));
  }
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  struct obj_data *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) /2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch(obj->item_type)
  {
   default:
   return;
   case 3:
   case 4:
   chance += 10;
   msg = "$p overloads and explodes!";
   break;
   case 33:
   chance -= 10;
   msg = "$p is fused into a worthless lump.";
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  extract_obj(obj);
  return;
 }
}

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct help_area_data { struct help_area_data *next; struct help_data *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; }

user_defined_types: struct MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


original_code:
bool hedit_show(CHAR_DATA *ch, char*argument)
{
 HELP_DATA * help;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 send_to_char( Format("Keyword : [%s]\n\r"
  "Level   : [%d]\n\r"
  "Text    :\n\r"
  "%s-END-\n\r",
  help->keyword,
  help->level,
  help->text), ch );
 return 0;
}

canonical_original_code:
unsigned char hedit_show(struct char_data *ch, char *argument)
{
 struct help_data *help;
 ( help = (struct help_data *) ch->desc->pEdit );
 send_to_char( Format("Keyword : [%s]\n\r"
  "Level   : [%d]\n\r"
  "Text    :\n\r"
  "%s-END-\n\r",
  help->keyword,
  help->level,
  help->text), ch );
 return 0;
}

variable_types:
argument
char *

variable_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *

return_type: unsigned char

user_defined_types: struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; }

user_defined_types: struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; }

user_defined_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; }

user_defined_types: struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; }

user_defined_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; }

user_defined_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; }

user_defined_types: struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; }


decompiled_code:
__int64 __fastcall hedit_level(__int64 a1, const char *a2)
{
__int64 result; // rax
__int64 v3; // r12
int v4; // eax

if ( a2 && *a2 && (v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL), (unsigned __int8)is_number(a2)) )
{
v4 = atoi(a2);
if ( (unsigned int)(v4 + 1) > 0x3D )
{
printf_to_char(a1, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60LL);
result = 0LL;
}
else
{
*(_WORD *)(v3 + 16) = v4;
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
}
else
{
send_to_char("Syntax : level [-1..MAX_LEVEL]\n\r", a1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, const char *a2)
{
__int64 result; // rax
__int64 v3; // r12
int v4; // eax

if ( a2 && *a2 && (v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL), (unsigned __int8)is_number(a2)) )
{
v4 = atoi(a2);
if ( (unsigned int)(v4 + 1) > 0x3D )
{
printf_to_char(a1, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60LL);
result = 0LL;
}
else
{
*(_WORD *)(v3 + 16) = v4;
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
}
else
{
send_to_char("Syntax : level [-1..MAX_LEVEL]\n\r", a1);
result = 0LL;
}
return result;
}

original_code:
bool hedit_level(CHAR_DATA *ch, char*argument)
{
 HELP_DATA *help;
 int lev = 0;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') || !is_number(argument) )
 {
  send_to_char( "Syntax : level [-1..MAX_LEVEL]\n\r", ch );
  return 0;
 }
 lev = atoi(argument);
 if ( lev < -1 || lev > 60 )
 {
  printf_to_char( ch, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60 );
  return 0;
 }
 help->level = lev;
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

canonical_original_code:
unsigned char hedit_level(struct char_data *ch, char *argument)
{
 struct help_data *help;
 int lev = 0;
 ( help = (struct help_data *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') || !is_number(argument) )
 {
  send_to_char( "Syntax : level [-1..MAX_LEVEL]\n\r", ch );
  return 0;
 }
 lev = atoi(argument);
 if ( lev < -1 || lev > 60 )
 {
  printf_to_char( ch, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60 );
  return 0;
 }
 help->level = lev;
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

variable_types: lev int

user_defined_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }


decompiled_code:
__int64 __fastcall hedit_keyword(__int64 a1, _BYTE *a2)
{
__int64 v3; // rbp
void *v4; // rdi
__int64 result; // rax
__int64 v6; // rax

if ( a2 && *a2 )
{
v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
v4 = *(void **)(v3 + 24);
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v6 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"hedit.c",
"hedit_keyword",
119LL);
log_string(v6);
}
*(_QWORD *)(v3 + 24) = 0LL;
*(_QWORD *)(v3 + 24) = str_dup(a2, "hedit.c", "hedit_keyword", 120LL);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
send_to_char("Syntax : keyword [keyword(s)]\n\r", a1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, _BYTE *a2)
{
__int64 v3; // rbp
void *v4; // rdi
__int64 result; // rax
__int64 v6; // rax

if ( a2 && *a2 )
{
v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
v4 = *(void **)(v3 + 24);
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v6 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"hedit.c",
"hedit_keyword",
119LL);
log_string(v6);
}
*(_QWORD *)(v3 + 24) = 0LL;
*(_QWORD *)(v3 + 24) = str_dup(a2, "hedit.c", "hedit_keyword", 120LL);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
send_to_char("Syntax : keyword [keyword(s)]\n\r", a1);
result = 0LL;
}
return result;
}

original_code:
bool hedit_keyword(CHAR_DATA *ch, char*argument)
{
 HELP_DATA *help;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : keyword [keyword(s)]\n\r", ch );
  return 0;
 }
 do { if(help->keyword) { free((void *)help->keyword); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "hedit.c", __FUNCTION__, 119)); } } help->keyword = ((void *)0); } while(0);
 help->keyword = _str_dup(argument, "hedit.c", __FUNCTION__, 120);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

canonical_original_code:
unsigned char hedit_keyword(struct char_data *ch, char *argument)
{
 struct help_data *help;
 ( help = (struct help_data *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : keyword [keyword(s)]\n\r", ch );
  return 0;
 }
 do { if(help->keyword) { free((void *)help->keyword); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "hedit.c", __FUNCTION__, 119)); } } help->keyword = ((void *)0); } while(0);
 help->keyword = _str_dup(argument, "hedit.c", __FUNCTION__, 120);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; }


decompiled_code:
__int64 __fastcall hedit_text(__int64 a1, _BYTE *a2)
{
__int64 result; // rax

if ( a2 && *a2 )
{
send_to_char("Syntax: text\n\r", a1);
result = 0LL;
}
else
{
string_append(a1, *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL) + 32LL);
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, _BYTE *a2)
{
__int64 result; // rax

if ( a2 && *a2 )
{
send_to_char("Syntax: text\n\r", a1);
result = 0LL;
}
else
{
string_append(a1, *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL) + 32LL);
result = 1LL;
}
return result;
}

original_code:
bool hedit_text(CHAR_DATA *ch, char*argument)
{
 HELP_DATA *help;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 if ( !((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax: text\n\r", ch );
  return 0;
 }
 string_append( ch, &help->text );
 return 1;
}

canonical_original_code:
unsigned char hedit_text(struct char_data *ch, char *argument)
{
 struct help_data *help;
 ( help = (struct help_data *) ch->desc->pEdit );
 if ( !((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax: text\n\r", ch );
  return 0;
 }
 string_append( ch, &help->text );
 return 1;
}

user_defined_types: struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; }

user_defined_types: struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; }

user_defined_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; }

user_defined_types: struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; }

user_defined_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; }

user_defined_types: struct help_area_data { struct help_area_data *next; struct help_data *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; }

user_defined_types: struct MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


decompiled_code:
__int64 __fastcall hedit_delete(__int64 a1)
{
__int64 v1; // rbx
__int64 *v2; // rbp
_QWORD *v3; // rax
__int64 result; // rax
_QWORD *v5; // rcx
__int64 v6; // rsi
__int64 v7; // rax

v1 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
v2 = (__int64 *)descriptor_list;
if ( descriptor_list )
{
do
{
if ( *((_DWORD *)v2 + 412) == 6 && v2[204] == v1 )
edit_done(v2[2]);
v2 = (__int64 *)*v2;
}
while ( v2 );
}
v3 = (_QWORD *)help_first;
if ( help_first == v1 )
{
help_first = *help_first;
}
else
{
while ( 1 )
{
if ( !v3 )
{
bugf("hedit_delete : help '%s' not found in the help_first list!", *(const char **)(v1 + 24));
return 0LL;
}
if ( *v3 == v1 )
break;
v3 = (_QWORD *)*v3;
}
*v3 = *(_QWORD *)v1;
}
v5 = (_QWORD *)had_list;
if ( !had_list )
goto LABEL_24;
v6 = 0LL;
do
{
v7 = v5[1];
if ( v7 == v1 )
{
v5[1] = *(_QWORD *)(v7 + 8);
v6 = 1LL;
}
else
{
while ( v7 )
{
if ( *(_QWORD *)(v7 + 8) == v1 )
{
*(_QWORD *)(v7 + 8) = *(_QWORD *)(v1 + 8);
goto LABEL_23;
}
v7 = *(_QWORD *)(v7 + 8);
}
}
v5 = (_QWORD *)*v5;
}
while ( v5 );
if ( (_BYTE)v6 )
{
LABEL_23:
free_help(v1, v6);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
LABEL_24:
bugf("hedit_delete : help %s not found in had_list!", *(const char **)(v1 + 24));
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
__int64 v1; // rbx
__int64 *v2; // rbp
_QWORD *v3; // rax
__int64 result; // rax
_QWORD *v5; // rcx
__int64 v6; // rsi
__int64 v7; // rax

v1 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
v2 = (__int64 *)descriptor_list;
if ( descriptor_list )
{
do
{
if ( *((_DWORD *)v2 + 412) == 6 && v2[204] == v1 )
edit_done(v2[2]);
v2 = (__int64 *)*v2;
}
while ( v2 );
}
v3 = (_QWORD *)help_first;
if ( help_first == v1 )
{
help_first = *help_first;
}
else
{
while ( 1 )
{
if ( !v3 )
{
bugf("hedit_delete : help '%s' not found in the help_first list!", *(const char **)(v1 + 24));
return 0LL;
}
if ( *v3 == v1 )
break;
v3 = (_QWORD *)*v3;
}
*v3 = *(_QWORD *)v1;
}
v5 = (_QWORD *)had_list;
if ( !had_list )
goto LABEL_24;
v6 = 0LL;
do
{
v7 = v5[1];
if ( v7 == v1 )
{
v5[1] = *(_QWORD *)(v7 + 8);
v6 = 1LL;
}
else
{
while ( v7 )
{
if ( *(_QWORD *)(v7 + 8) == v1 )
{
*(_QWORD *)(v7 + 8) = *(_QWORD *)(v1 + 8);
goto LABEL_23;
}
v7 = *(_QWORD *)(v7 + 8);
}
}
v5 = (_QWORD *)*v5;
}
while ( v5 );
if ( (_BYTE)v6 )
{
LABEL_23:
free_help(v1, v6);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
LABEL_24:
bugf("hedit_delete : help %s not found in had_list!", *(const char **)(v1 + 24));
result = 0LL;
}
return result;
}

original_code:
bool hedit_delete(CHAR_DATA *ch, char*argument)
{
 HELP_DATA * pHelp, * temp;
 HELP_AREA * had;
 DESCRIPTOR_DATA *d;
 bool found = 0;
 ( pHelp = (HELP_DATA *) ch->desc->pEdit );
 for ( d = descriptor_list; d; d = d->next )
  if ( d->editor == 6 && pHelp == (HELP_DATA *) d->pEdit )
   edit_done(d->character);
 if (help_first == pHelp)
  help_first = help_first->next;
 else
 {
  for ( temp = help_first; temp; temp = temp->next )
   if ( temp->next == pHelp )
    break;
  if ( !temp )
  {
   bugf( "hedit_delete : help '%s' not found in the help_first list!", pHelp->keyword );
   return 0;
  }
  temp->next = pHelp->next;
 }
 for ( had = had_list; had; had = had->next )
  if ( pHelp == had->first )
  {
   found = 1;
   had->first = had->first->next_area;
  }
  else
  {
   for ( temp = had->first; temp; temp = temp->next_area )
    if ( temp->next_area == pHelp )
     break;
   if ( temp )
   {
    temp->next_area = pHelp->next_area;
    found = 1;
    break;
   }
  }
 if ( !found )
 {
  bugf( "hedit_delete : help %s not found in had_list!", pHelp->keyword );
  return 0;
 }
 free_help(pHelp);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

canonical_original_code:
unsigned char hedit_delete(struct char_data *ch, char *argument)
{
 struct help_data *pHelp; struct help_data *temp;
 struct help_area_data *had;
 struct descriptor_data *d;
 unsigned char found = 0;
 ( pHelp = (struct help_data *) ch->desc->pEdit );
 for ( d = descriptor_list; d; d = d->next )
  if ( d->editor == 6 && pHelp == (struct help_data *) d->pEdit )
   edit_done(d->character);
 if (help_first == pHelp)
  help_first = help_first->next;
 else
 {
  for ( temp = help_first; temp; temp = temp->next )
   if ( temp->next == pHelp )
    break;
  if ( !temp )
  {
   bugf( "hedit_delete : help '%s' not found in the help_first list!", pHelp->keyword );
   return 0;
  }
  temp->next = pHelp->next;
 }
 for ( had = had_list; had; had = had->next )
  if ( pHelp == had->first )
  {
   found = 1;
   had->first = had->first->next_area;
  }
  else
  {
   for ( temp = had->first; temp; temp = temp->next_area )
    if ( temp->next_area == pHelp )
     break;
   if ( temp )
   {
    temp->next_area = pHelp->next_area;
    found = 1;
    break;
   }
  }
 if ( !found )
 {
  bugf( "hedit_delete : help %s not found in had_list!", pHelp->keyword );
  return 0;
 }
 free_help(pHelp);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

variable_types: struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; char *filename; unsigned char changed; } *

variable_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; } *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *pShop; struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; } *mprogs; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; } *pIndexData; struct descriptor_data *desc; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; } *pnote; struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct affect_data *affected; struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *pIndexData; struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *exit[6]; struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; } *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; } *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; } *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data { struct pc_data *next; struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; } *pcdata; struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; } *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; } *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t { int WriteOOB; enum bool_t { false=0, true=1 } Negotiated[-1]; enum bool_t { false=0, true=1 } bIACMode; enum bool_t { false=0, true=1 } bNegotiated; enum bool_t { false=0, true=1 } bRenegotiate; enum bool_t { false=0, true=1 } bNeedMXPVersion; enum bool_t { false=0, true=1 } bBlockMXP; enum bool_t { false=0, true=1 } bTTYPE; enum bool_t { false=0, true=1 } bECHO; enum bool_t { false=0, true=1 } bNAWS; enum bool_t { false=0, true=1 } bCHARSET; enum bool_t { false=0, true=1 } bMSDP; enum bool_t { false=0, true=1 } bMSSP; enum bool_t { false=0, true=1 } bATCP; enum bool_t { false=0, true=1 } bMSP; enum bool_t { false=0, true=1 } bMXP; enum bool_t { false=0, true=1 } bMCCP; enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 } b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t { enum bool_t { false=0, true=1 } bReport; enum bool_t { false=0, true=1 } bDirty; int ValueInt; char *pValueString; } **pVariables; } *pProtocol; } *

variable_types:
found
unsigned char

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }


original_code:
bool hedit_list(CHAR_DATA *ch, char*argument)
{
 char buf[256]={'\0'};
 int cnt = 0;
 HELP_DATA *pHelp;
 BUFFER *buffer;
 ( pHelp = (HELP_DATA *) ch->desc->pEdit );
 if ( !__strcmp(argument, "all", "hedit.c", __FUNCTION__, 363) )
 {
  buffer = __new_buf("hedit.c", __FUNCTION__, 365);
  for ( pHelp = help_first; pHelp; pHelp = pHelp->next )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( !__strcmp(argument, "area", "hedit.c", __FUNCTION__, 382) )
 {
  if ( ch->in_room->area->helps == ((void *)0) )
  {
   send_to_char( "There are no helps in this area.\n\r", ch );
   return 0;
  }
  buffer = __new_buf("hedit.c", __FUNCTION__, 390);
  for ( pHelp = ch->in_room->area->helps->first; pHelp; pHelp = pHelp->next_area )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : list all\n\r", ch );
  send_to_char( "         list area\n\r", ch );
  return 0;
 }
 return 0;
}

canonical_original_code:
unsigned char hedit_list(struct char_data *ch, char *argument)
{
 char buf[256] = {'\0'};
 int cnt = 0;
 struct help_data *pHelp;
 struct buf_type *buffer;
 ( pHelp = (struct help_data *) ch->desc->pEdit );
 if ( !__strcmp(argument, "all", "hedit.c", __FUNCTION__, 363) )
 {
  buffer = __new_buf("hedit.c", __FUNCTION__, 365);
  for ( pHelp = help_first; pHelp; pHelp = pHelp->next )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( !__strcmp(argument, "area", "hedit.c", __FUNCTION__, 382) )
 {
  if ( ch->in_room->area->helps == ((void *)0) )
  {
   send_to_char( "There are no helps in this area.\n\r", ch );
   return 0;
  }
  buffer = __new_buf("hedit.c", __FUNCTION__, 390);
  for ( pHelp = ch->in_room->area->helps->first; pHelp; pHelp = pHelp->next_area )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : list all\n\r", ch );
  send_to_char( "         list area\n\r", ch );
  return 0;
 }
 return 0;
}

variable_types:
buf
char [256]

variable_types: cnt int

variable_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }

user_defined_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; }

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }

user_defined_types: struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; }


decompiled_code:
void __fastcall do_hedit(__int64 a1, __int64 a2)
{
__int64 v2; // rax

if ( (*(_BYTE *)(a1 + 320) & 1) == 0 )
{
v2 = help_lookup(a2);
if ( v2 )
{
*(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL) = v2;
*(_DWORD *)(*(_QWORD *)(a1 + 88) + 1648LL) = 6;
}
else
{
send_to_char("HEdit : That helpfile does not exist.\n\r", a1);
}
}
}

original_code:
void do_hedit(CHAR_DATA *ch, char *argument)
{
 HELP_DATA * pHelp;
 if ( ((((ch)->act) & ((1)))) )
  return;
 if ( (pHelp = help_lookup( argument )) == ((void *)0) )
 {
  send_to_char( "HEdit : That helpfile does not exist.\n\r", ch );
  return;
 }
 ch->desc->pEdit = (void *) pHelp;
 ch->desc->editor = 6;
 return;
}

canonical_original_code:
void do_hedit(struct char_data *ch, char *argument)
{
 struct help_data *pHelp;
 if ( ((((ch)->act) & ((1)))) )
  return;
 if ( (pHelp = help_lookup( argument )) == ((void *)0) )
 {
  send_to_char( "HEdit : That helpfile does not exist.\n\r", ch );
  return;
 }
 ch->desc->pEdit = (void *) pHelp;
 ch->desc->editor = 6;
 return;
}

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; }

user_defined_types: struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; }