/*************************************************************************** * OBLIVION 1.2 is copyright by Wes Wagner August, 1996 * * by using this code you have agreed to the terms of the Oblivion License* **************************************************************************/ /*************************************************************************** * Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, * * Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. * * * * Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael * * Chastain, Michael Quan, and Mitchell Tse. * * * * In order to use any part of this Merc Diku Mud, you must comply with * * both the original Diku license in 'license.doc' as well the Merc * * license in 'license.txt'. In particular, you may not remove either of * * these copyright notices. * * * * Much time and thought has gone into this software and you are * * benefitting. We hope that you share your changes too. What goes * * around, comes around. * ***************************************************************************/ /*************************************************************************** * ROM 2.4 is copyright 1993-1995 Russ Taylor * * ROM has been brought to you by the ROM consortium * * Russ Taylor (rtaylor@pacinfo.com) * * Gabrielle Taylor (gtaylor@pacinfo.com) * * Brian Moore (rom@rom.efn.org) * * By using this code, you have agreed to follow the terms of the * * ROM license, in the file Rom24/doc/rom.license * ***************************************************************************/ #if defined(macintosh) #include <types.h> #else #include <sys/types.h> #endif #include <stdio.h> #include <time.h> #include "merc.h" #include "tables.h" int clan_lookup(const char *name) { int clan; for (clan = 0; clan < MAX_CLAN; clan++) { if (LOWER(name[0]) == LOWER(clan_table[clan].name[0]) && !str_prefix(name,clan_table[clan].name)) return clan; } return 0; } int clan_rlookup(const char *rank, int clan) { int rnk; if(clan==0) return 0; for (rnk = 0; rnk < MAX_RANK; rnk++) { if (LOWER(rank[0])==LOWER(clan_table[clan].clan_rank_title[rnk][0]) && !str_prefix(rank,clan_table[clan].clan_rank_title[rnk])) return rnk; } return 0; } int position_lookup (const char *name) { int pos; for (pos = 0; position_table[pos].name != NULL; pos++) { if (LOWER(name[0]) == LOWER(position_table[pos].name[0]) && !str_prefix(name,position_table[pos].name)) return pos; } return -1; } int sex_lookup (const char *name) { int sex; for (sex = 0; sex_table[sex].name != NULL; sex++) { if (LOWER(name[0]) == LOWER(sex_table[sex].name[0]) && !str_prefix(name,sex_table[sex].name)) return sex; } return -1; } int size_lookup (const char *name) { int size; for ( size = 0; size_table[size].name != NULL; size++) { if (LOWER(name[0]) == LOWER(size_table[size].name[0]) && !str_prefix( name,size_table[size].name)) return size; } return -1; }