decompiled_code:
__int64 __fastcall do_wizhelp(__int64 a1)
{
const char **v1; // rdx
const char *v2; // rsi
__int64 v3; // rbx
char *v4; // rax
int v5; // ecx
char *v6; // rbp
const char *i; // rdx
char *v8; // rbx
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // r14
char **v12; // r12
__int16 v13; // si
__int64 v14; // rax
__int64 result; // rax
__int64 v16; // [rsp+0h] [rbp-12048h]
char v17; // [rsp+Ch] [rbp-1203Ch]
char base[73784]; // [rsp+10h] [rbp-12038h] BYREF

v1 = (const char **)(unsigned int)((_DWORD)&cmd_table + 48);
v2 = "east";
v3 = 0LL;
v4 = base;
while ( 1 )
{
*(_DWORD *)v4 = v3;
v4 += 4;
v5 = v3 + 1;
if ( !*v2 )
break;
v2 = *v1;
v3 = v5;
v1 += 3;
}
v6 = &base[4 * v3 + 4];
qsort(base, v5, 4uLL, (__compar_fn_t)sort_cmd_table);
v16 = 52LL;
for ( i = "Squires "; ; i = wiz_title_list[-result + 60] )
{
v8 = base;
v9 = Format("\n\r\tWLevel\tn: %d (\tO%s\tn)\n\r", (unsigned int)v16, i);
send_to_char(v9, a1);
v17 = 0;
do
{
while ( 1 )
{
v10 = *(int *)v8;
v11 = 3 * v10;
v12 = &(&cmd_table)[3 * v10];
v13 = *((_WORD *)v12 + 9);
if ( v13 > 50 && v13 <= (int)get_trust(a1) )
{
if ( *((_WORD *)v12 + 11) )
{
if ( v13 == (_DWORD)v16 )
{
v14 = Format(
"[\tC%-3d\tn] \t<send href='help %s' hint='Click to see help on %s'>%-12s\t</send> |",
(unsigned int)v13,
(&cmd_table)[v11],
(&cmd_table)[v11],
(&cmd_table)[v11]);
send_to_char(v14, a1);
if ( (++v17 & 3) == 0 )
break;
}
}
}
v8 += 4;
if ( v8 == v6 )
goto LABEL_13;
}
v8 += 4;
send_to_char("\n\r", a1);
}
while ( v8 != v6 );
LABEL_13:
if ( (v17 & 3) == 0 )
break;
send_to_char("\n\r", a1);
result = ++v16;
if ( v16 == 61 )
return result;
LABEL_15:
;
}
result = ++v16;
if ( v16 != 61 )
goto LABEL_15;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
const char **v1; // rdx
const char *v2; // rsi
__int64 v3; // rbx
char *v4; // rax
int v5; // ecx
char *v6; // rbp
const char *i; // rdx
char *v8; // rbx
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // r14
char **v12; // r12
__int16 v13; // si
__int64 v14; // rax
__int64 result; // rax
__int64 v16; // [rsp+0h] [rbp-12048h]
char v17; // [rsp+Ch] [rbp-1203Ch]
char base[73784]; // [rsp+10h] [rbp-12038h] BYREF

v1 = (const char **)(unsigned int)((_DWORD)&cmd_table + 48);
v2 = "east";
v3 = 0LL;
v4 = base;
while ( 1 )
{
*(_DWORD *)v4 = v3;
v4 += 4;
v5 = v3 + 1;
if ( !*v2 )
break;
v2 = *v1;
v3 = v5;
v1 += 3;
}
v6 = &base[4 * v3 + 4];
qsort(base, v5, 4uLL, (__compar_fn_t)sort_cmd_table);
v16 = 52LL;
for ( i = "Squires "; ; i = wiz_title_list[-result + 60] )
{
v8 = base;
v9 = Format("\n\r\tWLevel\tn: %d (\tO%s\tn)\n\r", (unsigned int)v16, i);
send_to_char(v9, a1);
v17 = 0;
do
{
while ( 1 )
{
v10 = *(int *)v8;
v11 = 3 * v10;
v12 = &(&cmd_table)[3 * v10];
v13 = *((_WORD *)v12 + 9);
if ( v13 > 50 && v13 <= (int)get_trust(a1) )
{
if ( *((_WORD *)v12 + 11) )
{
if ( v13 == (_DWORD)v16 )
{
v14 = Format(
"[\tC%-3d\tn] \t<send href='help %s' hint='Click to see help on %s'>%-12s\t</send> |",
(unsigned int)v13,
(&cmd_table)[v11],
(&cmd_table)[v11],
(&cmd_table)[v11]);
send_to_char(v14, a1);
if ( (++v17 & 3) == 0 )
break;
}
}
}
v8 += 4;
if ( v8 == v6 )
goto LABEL_13;
}
v8 += 4;
send_to_char("\n\r", a1);
}
while ( v8 != v6 );
LABEL_13:
if ( (v17 & 3) == 0 )
break;
send_to_char("\n\r", a1);
result = ++v16;
if ( v16 == 61 )
return result;
LABEL_15:
;
}
result = ++v16;
if ( v16 != 61 )
goto LABEL_15;
return result;
}

original_code:
void do_wizhelp( CHAR_DATA *ch, char *argument )
{
 int index[4608*4];
 int cmd = 0;
 int col = 0;
 int clevel = 0;
 int i = 0;
 int count = 0;
 for ( count = 0; cmd_table[count].name[0] != '\0'; count++ )
    {
     index[count] = count;
    }
 qsort(index, count, sizeof(int), sort_cmd_table);
 for( clevel = (60 - 9) + 1; clevel < 60 + 1; clevel++ )
 {
  send_to_char(Format("\n\r\tWLevel\tn: %d (\tO%s\tn)\n\r", clevel, wiz_title_list[60 -clevel]), ch);
     for ( i = 0; i < count; i++ )
  {
   cmd = index[i];
   if ( cmd_table[cmd].level >= (60 - 9)
    && cmd_table[cmd].level <= get_trust( ch )
    && cmd_table[cmd].show
    && cmd_table[cmd].level == clevel)
   {
    send_to_char( Format("[\tC%-3d\tn] \t<send href='help %s' hint='Click to see help on %s'>%-12s\t</send> |", cmd_table[cmd].level, cmd_table[cmd].name, cmd_table[cmd].name, cmd_table[cmd].name), ch );
    if ( ++col % 4 == 0 )
     send_to_char( "\n\r", ch );
   }
  }
  if ( col % 4 != 0 )
   send_to_char( "\n\r", ch );
  col = 0;
 }
 return;
}

canonical_original_code:
void do_wizhelp(struct char_data *ch, char *argument)
{
 int index[-1];
 int cmd = 0;
 int col = 0;
 int clevel = 0;
 int i = 0;
 int count = 0;
 for ( count = 0; cmd_table[count].name[0] != '\0'; count++ )
    {
     index[count] = count;
    }
 qsort(index, count, sizeof(int), sort_cmd_table);
 for( clevel = (60 - 9) + 1; clevel < 60 + 1; clevel++ )
 {
  send_to_char(Format("\n\r\tWLevel\tn: %d (\tO%s\tn)\n\r", clevel, wiz_title_list[60 -clevel]), ch);
     for ( i = 0; i < count; i++ )
  {
   cmd = index[i];
   if ( cmd_table[cmd].level >= (60 - 9)
    && cmd_table[cmd].level <= get_trust( ch )
    && cmd_table[cmd].show
    && cmd_table[cmd].level == clevel)
   {
    send_to_char( Format("[\tC%-3d\tn] \t<send href='help %s' hint='Click to see help on %s'>%-12s\t</send> |", cmd_table[cmd].level, cmd_table[cmd].name, cmd_table[cmd].name, cmd_table[cmd].name), ch );
    if ( ++col % 4 == 0 )
     send_to_char( "\n\r", ch );
   }
  }
  if ( col % 4 != 0 )
   send_to_char( "\n\r", ch );
  col = 0;
 }
 return;
}

variable_types: clevel int

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 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; }

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_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }


repo: ptrayal/dungeonworld

decompiled_code:
__int64 __fastcall do_function(__int64 a1, __int64 (__fastcall *a2)(__int64, __int64), __int64 a3)
{
return a2(a1, a3);
}

original_code:
void do_function (CHAR_DATA *ch, DO_FUN *do_fun, const char *argument)
{
 (*do_fun) (ch, (char *)argument);
}

canonical_original_code:
void do_function(struct char_data *ch, void (*do_fun)(struct char_data *ch, char *argument), char *argument)
{
 (*do_fun) (ch, (char *)argument);
}

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; } *

variable_types: void (*)(struct char_data *ch, char *argument)

variable_types:
argument
char *

return_type: void

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 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 is_number(char *a1)
{
__int64 result; // rax
__int64 v2; // rbx
char *v3; // rbp
const unsigned __int16 *v4; // rax

result = 0LL;
v2 = *a1;
if ( (_BYTE)v2 )
{
v3 = a1;
if ( (((_BYTE)v2 - 43) & 0xFD) == 0 )
{
v2 = a1[1];
if ( !(_BYTE)v2 )
return 1LL;
v3 = a1 + 1;
}
v4 = *_ctype_b_loc();
while ( (v4[v2] & 0x800) != 0 )
{
v2 = *++v3;
if ( !(_BYTE)v2 )
return 1LL;
}
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(char *a1)
{
__int64 result; // rax
__int64 v2; // rbx
char *v3; // rbp
const unsigned __int16 *v4; // rax

result = 0LL;
v2 = *a1;
if ( (_BYTE)v2 )
{
v3 = a1;
if ( (((_BYTE)v2 - 43) & 0xFD) == 0 )
{
v2 = a1[1];
if ( !(_BYTE)v2 )
return 1LL;
v3 = a1 + 1;
}
v4 = *_ctype_b_loc();
while ( (v4[v2] & 0x800) != 0 )
{
v2 = *++v3;
if ( !(_BYTE)v2 )
return 1LL;
}
result = 0LL;
}
return result;
}

original_code:
bool is_number ( const char *arg )
{
 if ( *arg == '\0' )
  return 0;
 if ( *arg == '+' || *arg == '-' )
  arg++;
 for ( ; *arg != '\0'; arg++ )
 {
  if ( !((*__ctype_b_loc ())[(int) ((*arg))] & (unsigned short int) _ISdigit) )
   return 0;
 }
 return 1;
}

canonical_original_code:
unsigned char is_number(char *arg)
{
 if ( *arg == '\0' )
  return 0;
 if ( *arg == '+' || *arg == '-' )
  arg++;
 for ( ; *arg != '\0'; arg++ )
 {
  if ( !((*__ctype_b_loc ())[(int) ((*arg))] & (unsigned short) _ISdigit) )
   return 0;
 }
 return 1;
}

variable_types:
arg
char *

return_type: unsigned char


decompiled_code:
__int64 __fastcall number_argument(char *src, char *dest)
{
char v2; // al
char *v3; // rbp
char *v4; // rbx
int v5; // eax
unsigned int v6; // er13
__int64 result; // rax

v2 = *src;
if ( *src )
{
v3 = src;
while ( 1 )
{
v4 = v3++;
if ( v2 == 46 )
break;
v2 = *v3;
if ( !*v3 )
goto LABEL_6;
}
*v4 = 0;
v5 = atoi(src);
*v4 = 46;
v6 = v5;
strcpy(dest, v3);
result = v6;
}
else
{
LABEL_6:
strcpy(dest, src);
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(char *src, char *dest)
{
char v2; // al
char *v3; // rbp
char *v4; // rbx
int v5; // eax
unsigned int v6; // er13
__int64 result; // rax

v2 = *src;
if ( *src )
{
v3 = src;
while ( 1 )
{
v4 = v3++;
if ( v2 == 46 )
break;
v2 = *v3;
if ( !*v3 )
goto LABEL_6;
}
*v4 = 0;
v5 = atoi(src);
*v4 = 46;
v6 = v5;
strcpy(dest, v3);
result = v6;
}
else
{
LABEL_6:
strcpy(dest, src);
result = 1LL;
}
return result;
}

original_code:
int number_argument( char *argument, char *arg )
{
 char *pdot;
 int number;
 for ( pdot = argument; *pdot != '\0'; pdot++ )
 {
 if ( *pdot == '.' )
 {
  *pdot = '\0';
  number = atoi( argument );
  *pdot = '.';
  strcpy( arg, pdot+1 );
  return number;
 }
 }
 strcpy( arg, argument );
 return 1;
}

canonical_original_code:
int number_argument(char *argument, char *arg)
{
 char *pdot;
 int number;
 for ( pdot = argument; *pdot != '\0'; pdot++ )
 {
 if ( *pdot == '.' )
 {
  *pdot = '\0';
  number = atoi( argument );
  *pdot = '.';
  strcpy( arg, pdot+1 );
  return number;
 }
 }
 strcpy( arg, argument );
 return 1;
}

variable_types:
pdot
char *

variable_types: number int

return_type: int


decompiled_code:
__int64 __fastcall mult_argument(char *src, char *dest)
{
char v2; // al
char *v3; // rbp
char *v4; // rbx
int v5; // eax
unsigned int v6; // er13
__int64 result; // rax

v2 = *src;
if ( *src )
{
v3 = src;
while ( 1 )
{
v4 = v3++;
if ( v2 == 42 )
break;
v2 = *v3;
if ( !*v3 )
goto LABEL_6;
}
*v4 = 0;
v5 = atoi(src);
*v4 = 42;
v6 = v5;
strcpy(dest, v3);
result = v6;
}
else
{
LABEL_6:
strcpy(dest, src);
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(char *src, char *dest)
{
char v2; // al
char *v3; // rbp
char *v4; // rbx
int v5; // eax
unsigned int v6; // er13
__int64 result; // rax

v2 = *src;
if ( *src )
{
v3 = src;
while ( 1 )
{
v4 = v3++;
if ( v2 == 42 )
break;
v2 = *v3;
if ( !*v3 )
goto LABEL_6;
}
*v4 = 0;
v5 = atoi(src);
*v4 = 42;
v6 = v5;
strcpy(dest, v3);
result = v6;
}
else
{
LABEL_6:
strcpy(dest, src);
result = 1LL;
}
return result;
}

original_code:
int mult_argument(char *argument, char *arg)
{
 char *pdot;
 int number;
 for ( pdot = argument; *pdot != '\0'; pdot++ )
 {
  if ( *pdot == '*' )
  {
   *pdot = '\0';
   number = atoi( argument );
   *pdot = '*';
   strcpy( arg, pdot+1 );
   return number;
  }
 }
 strcpy( arg, argument );
 return 1;
}


original_code:
char *one_argument( char *argument, char *arg_first )
{
 char cEnd;
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short int) _ISspace) )
 argument++;
 cEnd = ' ';
 if ( *argument == '\'' || *argument == '"' )
 cEnd = *argument++;
 while ( *argument != '\0' )
 {
 if ( *argument == cEnd )
 {
  argument++;
  break;
 }
 *arg_first = ((*argument) >= 'A' && (*argument) <= 'Z' ? (*argument)+'a'-'A' : (*argument));
 arg_first++;
 argument++;
 }
 *arg_first = '\0';
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short int) _ISspace) )
 argument++;
 return argument;
}

canonical_original_code:
char *one_argument(char *argument, char *arg_first)
{
 char cEnd;
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short) _ISspace) )
 argument++;
 cEnd = ' ';
 if ( *argument == '\'' || *argument == '"' )
 cEnd = *argument++;
 while ( *argument != '\0' )
 {
 if ( *argument == cEnd )
 {
  argument++;
  break;
 }
 *arg_first = ((*argument) >= 'A' && (*argument) <= 'Z' ? (*argument)+'a'-'A' : (*argument));
 arg_first++;
 argument++;
 }
 *arg_first = '\0';
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short) _ISspace) )
 argument++;
 return argument;
}

variable_types: cEnd char

return_type: char *


decompiled_code:
__int64 __fastcall check_social(__int64 a1, _BYTE *a2, char *a3)
{
char v3; // al
char *v5; // rbp
int v6; // ebx
__int16 v7; // ax
__int64 result; // rax
char *v9; // rbx
__int64 v10; // rbp
_QWORD *v11; // r12
int v12; // eax
char *v13; // rbx
__int64 v14; // rbx
char v15[296]; // [rsp+0h] [rbp-128h] BYREF

v3 = social_table[0];
if ( !social_table[0] )
return 0LL;
v5 = social_table;
v6 = 0;
while ( *a2 != v3 || (unsigned __int8)str_prefix(a2, v5) )
{
v3 = v5[88];
v5 += 88;
++v6;
if ( !v3 )
return 0LL;
}
if ( (*(_BYTE *)(a1 + 320) & 1) == 0 && (*(_BYTE *)(a1 + 330) & 8) != 0 )
{
send_to_char("You are anti-social!\n\r", a1);
return 1LL;
}
v7 = *(_WORD *)(a1 + 384);
if ( v7 == 3 )
{
send_to_char("You are too stunned to do that.\n\r", a1);
return 1LL;
}
if ( v7 > 3 )
{
if ( v7 == 4 && (unsigned __int8)_strcmp(v5, "snore", "interp.c", "check_social", 602LL) )
{
send_to_char("In your dreams, or what?\n\r", a1);
return 1LL;
}
}
else
{
if ( !v7 )
{
send_to_char("Lie still; you are DEAD.\n\r", a1);
return 1LL;
}
if ( (unsigned __int16)(v7 - 1) <= 1u )
{
send_to_char("You are hurt far too bad for that.\n\r", a1);
return 1LL;
}
}
one_argument(a3, v15);
if ( !v15[0] )
{
v9 = &social_table[88 * v6];
act_new(*((_QWORD *)v9 + 4), a1, 0LL, 0LL, 0LL, 5LL);
act_new(*((_QWORD *)v9 + 3), a1, 0LL, 0LL, 3LL, 5LL);
return 1LL;
}
v10 = get_char_room(a1, v15);
if ( v10 )
{
if ( a1 == v10 )
{
v13 = &social_table[88 * v6];
act_new(*((_QWORD *)v13 + 10), a1, 0LL, a1, 0LL, 5LL);
act_new(*((_QWORD *)v13 + 9), a1, 0LL, a1, 3LL, 5LL);
result = 1LL;
}
else
{
v11 = &social_table[88 * v6];
act_new(v11[6], a1, 0LL, v10, 1LL, 5LL);
act_new(v11[5], a1, 0LL, v10, 3LL, 5LL);
act_new(v11[7], a1, 0LL, v10, 2LL, 5LL);
result = 1LL;
if ( (*(_BYTE *)(a1 + 320) & 1) == 0
&& (*(_BYTE *)(v10 + 320) & 1) != 0
&& (*(_BYTE *)(v10 + 378) & 4) == 0
&& *(__int16 *)(v10 + 384) > 4
&& !*(_QWORD *)(v10 + 88) )
{
v12 = number_bits(4LL);
if ( v12 > 8 )
{
if ( (unsigned int)(v12 - 9) <= 3 )
{
act_new("$n slaps $N.", v10, 0LL, a1, 1LL, 5LL);
act_new("You slap $N.", v10, 0LL, a1, 3LL, 5LL);
act_new("$n slaps you.", v10, 0LL, a1, 2LL, 5LL);
}
return 1LL;
}
if ( v12 < 0 )
return 1LL;
v14 = 88LL * v6;
act_new(*(_QWORD *)&social_table[v14 + 48], v10, 0LL, a1, 1LL, 5LL);
act_new(*(_QWORD *)&social_table[v14 + 40], v10, 0LL, a1, 3LL, 5LL);
act_new(*(_QWORD *)&social_table[v14 + 56], v10, 0LL, a1, 2LL, 5LL);
result = 1LL;
}
}
}
else
{
send_to_char("They aren't here.\n\r", a1);
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, _BYTE *a2, char *a3)
{
char v3; // al
char *v5; // rbp
int v6; // ebx
__int16 v7; // ax
__int64 result; // rax
char *v9; // rbx
__int64 v10; // rbp
_QWORD *v11; // r12
int v12; // eax
char *v13; // rbx
__int64 v14; // rbx
char v15[296]; // [rsp+0h] [rbp-128h] BYREF

v3 = social_table[0];
if ( !social_table[0] )
return 0LL;
v5 = social_table;
v6 = 0;
while ( *a2 != v3 || (unsigned __int8)str_prefix(a2, v5) )
{
v3 = v5[88];
v5 += 88;
++v6;
if ( !v3 )
return 0LL;
}
if ( (*(_BYTE *)(a1 + 320) & 1) == 0 && (*(_BYTE *)(a1 + 330) & 8) != 0 )
{
send_to_char("You are anti-social!\n\r", a1);
return 1LL;
}
v7 = *(_WORD *)(a1 + 384);
if ( v7 == 3 )
{
send_to_char("You are too stunned to do that.\n\r", a1);
return 1LL;
}
if ( v7 > 3 )
{
if ( v7 == 4 && (unsigned __int8)_strcmp(v5, "snore", "interp.c", "check_social", 602LL) )
{
send_to_char("In your dreams, or what?\n\r", a1);
return 1LL;
}
}
else
{
if ( !v7 )
{
send_to_char("Lie still; you are DEAD.\n\r", a1);
return 1LL;
}
if ( (unsigned __int16)(v7 - 1) <= 1u )
{
send_to_char("You are hurt far too bad for that.\n\r", a1);
return 1LL;
}
}
func7(a3, v15);
if ( !v15[0] )
{
v9 = &social_table[88 * v6];
act_new(*((_QWORD *)v9 + 4), a1, 0LL, 0LL, 0LL, 5LL);
act_new(*((_QWORD *)v9 + 3), a1, 0LL, 0LL, 3LL, 5LL);
return 1LL;
}
v10 = get_char_room(a1, v15);
if ( v10 )
{
if ( a1 == v10 )
{
v13 = &social_table[88 * v6];
act_new(*((_QWORD *)v13 + 10), a1, 0LL, a1, 0LL, 5LL);
act_new(*((_QWORD *)v13 + 9), a1, 0LL, a1, 3LL, 5LL);
result = 1LL;
}
else
{
v11 = &social_table[88 * v6];
act_new(v11[6], a1, 0LL, v10, 1LL, 5LL);
act_new(v11[5], a1, 0LL, v10, 3LL, 5LL);
act_new(v11[7], a1, 0LL, v10, 2LL, 5LL);
result = 1LL;
if ( (*(_BYTE *)(a1 + 320) & 1) == 0
&& (*(_BYTE *)(v10 + 320) & 1) != 0
&& (*(_BYTE *)(v10 + 378) & 4) == 0
&& *(__int16 *)(v10 + 384) > 4
&& !*(_QWORD *)(v10 + 88) )
{
v12 = number_bits(4LL);
if ( v12 > 8 )
{
if ( (unsigned int)(v12 - 9) <= 3 )
{
act_new("$n slaps $N.", v10, 0LL, a1, 1LL, 5LL);
act_new("You slap $N.", v10, 0LL, a1, 3LL, 5LL);
act_new("$n slaps you.", v10, 0LL, a1, 2LL, 5LL);
}
return 1LL;
}
if ( v12 < 0 )
return 1LL;
v14 = 88LL * v6;
act_new(*(_QWORD *)&social_table[v14 + 48], v10, 0LL, a1, 1LL, 5LL);
act_new(*(_QWORD *)&social_table[v14 + 40], v10, 0LL, a1, 3LL, 5LL);
act_new(*(_QWORD *)&social_table[v14 + 56], v10, 0LL, a1, 2LL, 5LL);
result = 1LL;
}
}
}
else
{
send_to_char("They aren't here.\n\r", a1);
result = 1LL;
}
return result;
}

original_code:
bool check_social( CHAR_DATA *ch, char *command, char *argument )
{
 char arg[256];
 CHAR_DATA *victim;
 int cmd;
 bool found;
 found = 0;
 for ( cmd = 0; social_table[cmd].name[0] != '\0'; cmd++ )
 {
 if ( command[0] == social_table[cmd].name[0]
 && !str_prefix( command, social_table[cmd].name ) )
 {
  found = 1;
  break;
 }
 }
 if ( !found )
 return 0;
 if ( !((((ch)->act) & ((1)))) && ((ch->comm) & ((524288))) )
 {
 send_to_char( "You are anti-social!\n\r", ch );
 return 1;
 }
 switch ( ch->position )
 {
 case 0:
 send_to_char( "Lie still; you are DEAD.\n\r", ch );
 return 1;
 case 2:
 case 1:
 send_to_char( "You are hurt far too bad for that.\n\r", ch );
 return 1;
 case 3:
 send_to_char( "You are too stunned to do that.\n\r", ch );
 return 1;
 case 4:
 if ( !__strcmp(social_table[cmd].name, "snore", "interp.c", __FUNCTION__, 602) )
  break;
 send_to_char( "In your dreams, or what?\n\r", ch );
 return 1;
 }
 one_argument( argument, arg );
 victim = ((void *)0);
 if ( arg[0] == '\0' )
 {
 act_new((social_table[cmd].others_no_arg),(ch),(((void *)0)),(victim),(0),5);
 act_new((social_table[cmd].char_no_arg),(ch),(((void *)0)),(victim),(3),5);
 }
 else if ( ( victim = get_char_room( ch, arg ) ) == ((void *)0) )
 {
 send_to_char( "They aren't here.\n\r", ch );
 }
 else if ( victim == ch )
 {
 act_new((social_table[cmd].others_auto),(ch),(((void *)0)),(victim),(0),5);
 act_new((social_table[cmd].char_auto),(ch),(((void *)0)),(victim),(3),5);
 }
 else
 {
 act_new((social_table[cmd].others_found),(ch),(((void *)0)),(victim),(1),5);
 act_new((social_table[cmd].char_found),(ch),(((void *)0)),(victim),(3),5);
 act_new((social_table[cmd].vict_found),(ch),(((void *)0)),(victim),(2),5);
 if ( !((((ch)->act) & ((1)))) && ((((victim)->act) & ((1))))
 && !((((victim)->affected_by) & (((262144)))))
 && (victim->position > 4)
 && victim->desc == ((void *)0))
 {
  switch ( number_bits( 4 ) )
  {
  case 0:
  case 1: case 2: case 3: case 4:
  case 5: case 6: case 7: case 8:
  act_new((social_table[cmd].others_found),(victim),(((void *)0)),(ch),(1),5);
  act_new((social_table[cmd].char_found),(victim),(((void *)0)),(ch),(3),5);
  act_new((social_table[cmd].vict_found),(victim),(((void *)0)),(ch),(2),5);
  break;
  case 9: case 10: case 11: case 12:
  act_new(("$n slaps $N."),(victim),(((void *)0)),(ch),(1),5);
  act_new(("You slap $N."),(victim),(((void *)0)),(ch),(3),5);
  act_new(("$n slaps you."),(victim),(((void *)0)),(ch),(2),5);
  break;
  }
 }
 }
 return 1;
}

canonical_original_code:
unsigned char check_social(struct char_data *ch, char *command, char *argument)
{
 char arg[256];
 struct char_data *victim;
 int cmd;
 unsigned char found;
 found = 0;
 for ( cmd = 0; social_table[cmd].name[0] != '\0'; cmd++ )
 {
 if ( command[0] == social_table[cmd].name[0]
 && !str_prefix( command, social_table[cmd].name ) )
 {
  found = 1;
  break;
 }
 }
 if ( !found )
 return 0;
 if ( !((((ch)->act) & ((1)))) && ((ch->comm) & ((524288))) )
 {
 send_to_char( "You are anti-social!\n\r", ch );
 return 1;
 }
 switch ( ch->position )
 {
 case 0:
 send_to_char( "Lie still; you are DEAD.\n\r", ch );
 return 1;
 case 2:
 case 1:
 send_to_char( "You are hurt far too bad for that.\n\r", ch );
 return 1;
 case 3:
 send_to_char( "You are too stunned to do that.\n\r", ch );
 return 1;
 case 4:
 if ( !__strcmp(social_table[cmd].name, "snore", "interp.c", __FUNCTION__, 602) )
  break;
 send_to_char( "In your dreams, or what?\n\r", ch );
 return 1;
 }
 one_argument( argument, arg );
 victim = ((void *)0);
 if ( arg[0] == '\0' )
 {
 act_new((social_table[cmd].others_no_arg),(ch),(((void *)0)),(victim),(0),5);
 act_new((social_table[cmd].char_no_arg),(ch),(((void *)0)),(victim),(3),5);
 }
 else if ( ( victim = get_char_room( ch, arg ) ) == ((void *)0) )
 {
 send_to_char( "They aren't here.\n\r", ch );
 }
 else if ( victim == ch )
 {
 act_new((social_table[cmd].others_auto),(ch),(((void *)0)),(victim),(0),5);
 act_new((social_table[cmd].char_auto),(ch),(((void *)0)),(victim),(3),5);
 }
 else
 {
 act_new((social_table[cmd].others_found),(ch),(((void *)0)),(victim),(1),5);
 act_new((social_table[cmd].char_found),(ch),(((void *)0)),(victim),(3),5);
 act_new((social_table[cmd].vict_found),(ch),(((void *)0)),(victim),(2),5);
 if ( !((((ch)->act) & ((1)))) && ((((victim)->act) & ((1))))
 && !((((victim)->affected_by) & (((262144)))))
 && (victim->position > 4)
 && victim->desc == ((void *)0))
 {
  switch ( number_bits( 4 ) )
  {
  case 0:
  case 1: case 2: case 3: case 4:
  case 5: case 6: case 7: case 8:
  act_new((social_table[cmd].others_found),(victim),(((void *)0)),(ch),(1),5);
  act_new((social_table[cmd].char_found),(victim),(((void *)0)),(ch),(3),5);
  act_new((social_table[cmd].vict_found),(victim),(((void *)0)),(ch),(2),5);
  break;
  case 9: case 10: case 11: case 12:
  act_new(("$n slaps $N."),(victim),(((void *)0)),(ch),(1),5);
  act_new(("You slap $N."),(victim),(((void *)0)),(ch),(3),5);
  act_new(("$n slaps you."),(victim),(((void *)0)),(ch),(2),5);
  break;
  }
 }
 }
 return 1;
}

variable_types:
command
char *

variable_types:
arg
char [256]

variable_types: cmd int

variable_types:
found
unsigned char

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

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 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 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: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }

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

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; }


interpret

original_code:
void interpret( CHAR_DATA *ch, char *argument )
{
 char command[256];
 char logline[256];
 int cmd;
 int trust;
 bool found;
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short int) _ISspace) )
 argument++;
 if ( argument[0] == '\0' )
 return;
 ((ch->affected_by) &= ~((65536)));
 if ( !((((ch)->act) & ((1)))) && ((ch->act) & ((16777216))) )
 {
 send_to_char( "You're totally frozen!\n\r", ch );
 return;
 }
 strcpy( logline, argument );
 if ( !((*__ctype_b_loc ())[(int) ((argument[0]))] & (unsigned short int) _ISalpha) && !((*__ctype_b_loc ())[(int) ((argument[0]))] & (unsigned short int) _ISdigit) )
 {
 command[0] = argument[0];
 command[1] = '\0';
 argument++;
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short int) _ISspace) )
  argument++;
 }
 else
 {
 argument = one_argument( argument, command );
 }
 found = 0;
 trust = get_trust( ch );
 for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ )
 {
 if ( command[0] == cmd_table[cmd].name[0]
 && !str_prefix( command, cmd_table[cmd].name )
 && cmd_table[cmd].level <= trust )
 {
  found = 1;
  break;
 }
 }
 if ( cmd_table[cmd].log == 2 )
 strcpy( logline, "" );
 if ( ( !((((ch)->act) & ((1)))) && ((ch->act) & ((4194304))) )
 || fLogAll
 || cmd_table[cmd].log == 1 )
 {
 wiznet(Format("Log %s: %s", ch->name, logline ),ch,((void *)0),(4096),0,get_trust(ch));
 log_string( Format("Log %s: %s", ch->name, logline ) );
 }
 if ( ch->desc != ((void *)0) && ch->desc->snoop_by != ((void *)0) )
 {
 write_to_buffer( ch->desc->snoop_by, "% ", 2 );
 write_to_buffer( ch->desc->snoop_by, logline, 0 );
 write_to_buffer( ch->desc->snoop_by, "\n\r", 2 );
 }
 if ( !found )
 {
 if ( !check_social( ch, command, argument ) )
  send_to_char( "Huh?\n\r", ch );
 return;
 }
 if ( ch->position < cmd_table[cmd].position )
 {
 switch( ch->position )
 {
 case 0:
  send_to_char( "Lie still; you are DEAD.\n\r", ch );
  break;
 case 1:
 case 2:
  send_to_char( "You are hurt far too bad for that.\n\r", ch );
  break;
 case 3:
  send_to_char( "You are too stunned to do that.\n\r", ch );
  break;
 case 4:
  send_to_char( "In your dreams, or what?\n\r", ch );
  break;
 case 5:
  send_to_char( "Nah... You feel too relaxed...\n\r", ch);
  break;
 case 6:
  send_to_char( "Better stand up first.\n\r",ch);
  break;
 case 7:
  send_to_char( "No way!  You are still fighting!\n\r", ch);
  break;
 }
 return;
 }
 (*cmd_table[cmd].do_fun) ( ch, argument );
 tail_chain( );
 return;
}

canonical_original_code:
void interpret(struct char_data *ch, char *argument)
{
 char command[256];
 char logline[256];
 int cmd;
 int trust;
 unsigned char found;
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short) _ISspace) )
 argument++;
 if ( argument[0] == '\0' )
 return;
 ((ch->affected_by) &= ~((65536)));
 if ( !((((ch)->act) & ((1)))) && ((ch->act) & ((16777216))) )
 {
 send_to_char( "You're totally frozen!\n\r", ch );
 return;
 }
 strcpy( logline, argument );
 if ( !((*__ctype_b_loc ())[(int) ((argument[0]))] & (unsigned short) _ISalpha) && !((*__ctype_b_loc ())[(int) ((argument[0]))] & (unsigned short) _ISdigit) )
 {
 command[0] = argument[0];
 command[1] = '\0';
 argument++;
 while ( ((*__ctype_b_loc ())[(int) ((*argument))] & (unsigned short) _ISspace) )
  argument++;
 }
 else
 {
 argument = one_argument( argument, command );
 }
 found = 0;
 trust = get_trust( ch );
 for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ )
 {
 if ( command[0] == cmd_table[cmd].name[0]
 && !str_prefix( command, cmd_table[cmd].name )
 && cmd_table[cmd].level <= trust )
 {
  found = 1;
  break;
 }
 }
 if ( cmd_table[cmd].log == 2 )
 strcpy( logline, "" );
 if ( ( !((((ch)->act) & ((1)))) && ((ch->act) & ((4194304))) )
 || fLogAll
 || cmd_table[cmd].log == 1 )
 {
 wiznet(Format("Log %s: %s", ch->name, logline ),ch,((void *)0),(4096),0,get_trust(ch));
 log_string( Format("Log %s: %s", ch->name, logline ) );
 }
 if ( ch->desc != ((void *)0) && ch->desc->snoop_by != ((void *)0) )
 {
 write_to_buffer( ch->desc->snoop_by, "% ", 2 );
 write_to_buffer( ch->desc->snoop_by, logline, 0 );
 write_to_buffer( ch->desc->snoop_by, "\n\r", 2 );
 }
 if ( !found )
 {
 if ( !check_social( ch, command, argument ) )
  send_to_char( "Huh?\n\r", ch );
 return;
 }
 if ( ch->position < cmd_table[cmd].position )
 {
 switch( ch->position )
 {
 case 0:
  send_to_char( "Lie still; you are DEAD.\n\r", ch );
  break;
 case 1:
 case 2:
  send_to_char( "You are hurt far too bad for that.\n\r", ch );
  break;
 case 3:
  send_to_char( "You are too stunned to do that.\n\r", ch );
  break;
 case 4:
  send_to_char( "In your dreams, or what?\n\r", ch );
  break;
 case 5:
  send_to_char( "Nah... You feel too relaxed...\n\r", ch);
  break;
 case 6:
  send_to_char( "Better stand up first.\n\r",ch);
  break;
 case 7:
  send_to_char( "No way!  You are still fighting!\n\r", ch);
  break;
 }
 return;
 }
 (*cmd_table[cmd].do_fun) ( ch, argument );
 tail_chain( );
 return;
}

variable_types:
command
char [256]

variable_types:
logline
char [256]

variable_types: trust int

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 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; }

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 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 *

variable_types: i int

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 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:
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; } *


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 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 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 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 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 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 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 }