#ifndef D2MERCS_H #define D2MERCS_H #include "d2char.h" #include "d2strings.h" // The values here are the offsets of each merc's names in the table. // i.e: Merc names from pos 41 to 61 are Desert mercs // // We use these values as offsets later to get the correct name using the relative ID the game provides typedef enum D2S_MERCTYPE { D2S_MERCTYPE_UNKNOWN = -1, D2S_MERCTYPE_ROGUE = 0, D2S_MERCTYPE_DESERT = 41, D2S_MERCTYPE_SORCEROR = 62, D2S_MERCTYPE_BARBARIAN = 82 } D2S_MERCTYPE; typedef enum D2S_MERCSUBTYPE { D2S_MERCSUBTYPE_NONE = 0, D2S_MERCSUBTYPE_FIRE_ARROW = 1, D2S_MERCSUBTYPE_COLD_ARROW = 2, D2S_MERCSUBTYPE_COMBAT = 3, D2S_MERCSUBTYPE_DEFENSIVE = 4, D2S_MERCSUBTYPE_OFFENSIVE = 5, D2S_MERCSUBTYPE_FIRE = 6, D2S_MERCSUBTYPE_COLD = 7, D2S_MERCSUBTYPE_LIGHTNING = 8 } D2S_MERCSUBTYPE; const char* const mercNames[] = { D2S_MERC_NAME_0, D2S_MERC_NAME_1, D2S_MERC_NAME_2, D2S_MERC_NAME_3, D2S_MERC_NAME_4, D2S_MERC_NAME_5, D2S_MERC_NAME_6, D2S_MERC_NAME_7, D2S_MERC_NAME_8, D2S_MERC_NAME_9, D2S_MERC_NAME_10, D2S_MERC_NAME_11, D2S_MERC_NAME_12, D2S_MERC_NAME_13, D2S_MERC_NAME_14, D2S_MERC_NAME_15, D2S_MERC_NAME_16, D2S_MERC_NAME_17, D2S_MERC_NAME_18, D2S_MERC_NAME_19, D2S_MERC_NAME_20, D2S_MERC_NAME_21, D2S_MERC_NAME_22, D2S_MERC_NAME_23, D2S_MERC_NAME_24, D2S_MERC_NAME_25, D2S_MERC_NAME_26, D2S_MERC_NAME_27, D2S_MERC_NAME_28, D2S_MERC_NAME_29, D2S_MERC_NAME_30, D2S_MERC_NAME_31, D2S_MERC_NAME_32, D2S_MERC_NAME_33, D2S_MERC_NAME_34, D2S_MERC_NAME_35, D2S_MERC_NAME_36, D2S_MERC_NAME_37, D2S_MERC_NAME_38, D2S_MERC_NAME_39, D2S_MERC_NAME_40, D2S_MERC_NAME_41, D2S_MERC_NAME_42, D2S_MERC_NAME_43, D2S_MERC_NAME_44, D2S_MERC_NAME_45, D2S_MERC_NAME_46, D2S_MERC_NAME_47, D2S_MERC_NAME_48, D2S_MERC_NAME_49, D2S_MERC_NAME_50, D2S_MERC_NAME_51, D2S_MERC_NAME_52, D2S_MERC_NAME_53, D2S_MERC_NAME_54, D2S_MERC_NAME_55, D2S_MERC_NAME_56, D2S_MERC_NAME_57, D2S_MERC_NAME_58, D2S_MERC_NAME_59, D2S_MERC_NAME_60, D2S_MERC_NAME_61, D2S_MERC_NAME_62, D2S_MERC_NAME_63, D2S_MERC_NAME_64, D2S_MERC_NAME_65, D2S_MERC_NAME_66, D2S_MERC_NAME_67, D2S_MERC_NAME_68, D2S_MERC_NAME_69, D2S_MERC_NAME_70, D2S_MERC_NAME_71, D2S_MERC_NAME_72, D2S_MERC_NAME_73, D2S_MERC_NAME_74, D2S_MERC_NAME_75, D2S_MERC_NAME_76, D2S_MERC_NAME_77, D2S_MERC_NAME_78, D2S_MERC_NAME_79, D2S_MERC_NAME_80, D2S_MERC_NAME_81, D2S_MERC_NAME_82, D2S_MERC_NAME_83, D2S_MERC_NAME_84, D2S_MERC_NAME_85, D2S_MERC_NAME_86, D2S_MERC_NAME_87, D2S_MERC_NAME_88, D2S_MERC_NAME_89, D2S_MERC_NAME_90, D2S_MERC_NAME_91, D2S_MERC_NAME_92, D2S_MERC_NAME_93, D2S_MERC_NAME_94, D2S_MERC_NAME_95, D2S_MERC_NAME_96, D2S_MERC_NAME_97, D2S_MERC_NAME_98, D2S_MERC_NAME_99, D2S_MERC_NAME_100, D2S_MERC_NAME_101, D2S_MERC_NAME_102, D2S_MERC_NAME_103, D2S_MERC_NAME_104, D2S_MERC_NAME_105, D2S_MERC_NAME_106, D2S_MERC_NAME_107, D2S_MERC_NAME_108, D2S_MERC_NAME_109, D2S_MERC_NAME_110, D2S_MERC_NAME_111, D2S_MERC_NAME_112, D2S_MERC_NAME_113, D2S_MERC_NAME_114, D2S_MERC_NAME_115, D2S_MERC_NAME_116, D2S_MERC_NAME_117, D2S_MERC_NAME_118, D2S_MERC_NAME_119, D2S_MERC_NAME_120, D2S_MERC_NAME_121, D2S_MERC_NAME_122, D2S_MERC_NAME_123, D2S_MERC_NAME_124, D2S_MERC_NAME_125, D2S_MERC_NAME_126, D2S_MERC_NAME_127, D2S_MERC_NAME_128, D2S_MERC_NAME_129, D2S_MERC_NAME_130, D2S_MERC_NAME_131, D2S_MERC_NAME_132, D2S_MERC_NAME_133, D2S_MERC_NAME_134, D2S_MERC_NAME_135, D2S_MERC_NAME_136, D2S_MERC_NAME_137, D2S_MERC_NAME_138, D2S_MERC_NAME_139, D2S_MERC_NAME_140, D2S_MERC_NAME_141, D2S_MERC_NAME_142, D2S_MERC_NAME_143, D2S_MERC_NAME_144, D2S_MERC_NAME_145, D2S_MERC_NAME_146, D2S_MERC_NAME_147, D2S_MERC_NAME_148 }; // Returns static string from library memory, no need to free const char* getMercName(uint16_t mercID, uint16_t mercNameID); D2S_MERCTYPE getMercType(uint16_t mercID); D2S_MERCSUBTYPE getMercSubType(uint16_t mercID); D2S_DIFFICULTY getMercDifficulty(uint16_t mercID); int setMerc(D2S_MERCTYPE type, D2S_MERCSUBTYPE subtype, D2S_DIFFICULTY difficulty); #endif