ILAB OLC Beta 1.1 Jason Dinkel May. 15 1995 SPECIAL.C This file contains modifications needed to stock Envy 1.0 special.c. Only the lines commented with /* OLC */ need to be added. The surrounding code is for getting ones bearings. In the original version of OLC a string (spec_name) was added to the mob_index_data structure and the display functions in OLC would use this string to keep the name of the special function the mobile was using. I thought that this was wasteful and this lead me to write the following procedures. I would recommend that you use them in act_wiz.c to display special functions names as well. There is a single change to this file. Just replace the olc spec_lookup function with these tables and functions. This code doesn't change any workings of the game. Be sure to add any special functions to the list that you have added yourself, of course. /* * Special Functions Table. OLC */ const struct spec_type spec_table [ ] = { /* * Special function commands. */ { "spec_breath_any", spec_breath_any }, { "spec_breath_acid", spec_breath_acid }, { "spec_breath_fire", spec_breath_fire }, { "spec_breath_frost", spec_breath_frost }, { "spec_breath_gas", spec_breath_gas }, { "spec_breath_lightning", spec_breath_lightning }, { "spec_cast_adept", spec_cast_adept }, { "spec_cast_cleric", spec_cast_cleric }, { "spec_cast_ghost", spec_cast_ghost }, { "spec_cast_judge", spec_cast_judge }, { "spec_cast_mage", spec_cast_mage }, { "spec_cast_psionicist", spec_cast_psionicist }, { "spec_cast_undead", spec_cast_undead }, { "spec_executioner", spec_executioner }, { "spec_fido", spec_fido }, { "spec_guard", spec_guard }, { "spec_janitor", spec_janitor }, { "spec_mayor", spec_mayor }, { "spec_poison", spec_poison }, { "spec_repairman", spec_repairman }, { "spec_thief", spec_thief }, /* * End of list. */ { "", 0 } }; /***************************************************************************** Name: spec_string Purpose: Given a function, return the appropriate name. Called by: <???> ****************************************************************************/ char *spec_string( SPEC_FUN *fun ) /* OLC */ { int cmd; for ( cmd = 0; *spec_table[cmd].spec_fun; cmd++ ) /* OLC 1.1b */ if ( fun == spec_table[cmd].spec_fun ) return spec_table[cmd].spec_name; return 0; } /***************************************************************************** Name: spec_lookup Purpose: Given a name, return the appropriate spec fun. Called by: do_mset(act_wiz.c) load_specials,reset_area(db.c) ****************************************************************************/ SPEC_FUN *spec_lookup( const char *name ) /* OLC */ { int cmd; for ( cmd = 0; *spec_table[cmd].spec_name; cmd++ ) /* OLC 1.1b */ if ( !str_cmp( name, spec_table[cmd].spec_name ) ) return spec_table[cmd].spec_fun; return 0; } END OF FILE SPECIAL.C