00001
00002
00003
00004
00005
00006
00007
00008
00009
00015 #ifndef NPCS_INCLUDE
00016 #define NPCS_INCLUDE
00017
00018 char* getRandomName(char * namelist);
00019 void setrandomname(P_CHAR pc, char * namelist);
00020 COLOR addrandomcolor(cObject* po, char *colorlist);
00021
00022 namespace npcs
00023 {
00024 enum {
00025 MAGIC_SPHERE_CLASSIC = 0,
00026 MAGIC_SPHERE_WATER,
00027 MAGIC_SPHERE_FIRE,
00028 MAGIC_SPHERE_EARTH,
00029 MAGIC_SPHERE_AIR,
00030 MAGIC_SPHERE_MENTAL,
00031 MAGIC_SPHERE_CLERICAL,
00032 MAGIC_SPHERE_NECROMANCY,
00033 MAGIC_SPHERE_POISON,
00034 MAGIC_MAXSPHERES
00035 };
00036
00037 void SpawnGuard( P_CHAR pc, P_CHAR pc_i, Location where);
00038 void SpawnGuard( P_CHAR pc, P_CHAR pc_i, int x, int y, signed char z);
00039 void initNpcSpells();
00040 void npcCastSpell(P_CHAR pc_att, P_CHAR pc_def);
00041 void npcMagicAttack(P_CHAR pc_att, P_CHAR pc_def);
00042
00043 P_CHAR AddNPC(NXWSOCKET s, P_ITEM pi, int npcNum, UI16 x1, UI16 y1, SI08 z1);
00044 P_CHAR AddNPC(NXWSOCKET s, P_ITEM pi, int npcNum, Location where);
00045 P_CHAR addNpc(int npcNum, UI16 x, UI16 y, SI08 z);
00046
00047 P_CHAR AddRespawnNPC(P_ITEM pi, int npcNum);
00048 P_CHAR AddRespawnNPC(P_CHAR pc, int npcNum);
00049
00050 P_CHAR AddNPCxyz(NXWSOCKET s, int npcNum, Location where);
00051 P_CHAR AddNPCxyz(NXWSOCKET s, int npcNum, int x1, int y1, signed char z1);
00052
00053 P_ITEM AddRandomLoot(P_ITEM pack, char * lootlist);
00054
00055 int AddRandomNPC(int s, char *npclist);
00056
00057 void checkAI(P_CHAR pc );
00058
00059 P_CHAR SpawnRandomMonster(P_CHAR pc, char* cList, char* cNpcID);
00060
00061
00062 }
00063
00064
00065 typedef struct {
00066 SERIAL script;
00067 COLOR color;
00068 UI32 amount;
00069 UI32 id;
00070 } vendor_item;
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 #define CREATURE_CAN_FLY 1
00089 #define CREATURE_ANTI_BLINK 2
00090
00091 class cCreatureInfo {
00092
00093 private:
00094
00095 std::vector<SOUND>* sounds[ALL_MONSTER_SOUND];
00096
00097 public:
00098
00099 UI08 flag;
00100 SERIAL icon;
00101
00102 cCreatureInfo();
00103 ~cCreatureInfo();
00104
00105 bool canFly() { return flag&CREATURE_CAN_FLY; }
00106 bool needAntiBlink() { return flag&CREATURE_ANTI_BLINK; }
00107 SOUND getSound( MonsterSound type );
00108 void addSound( MonsterSound type, SOUND sound );
00109
00110 };
00111
00112 typedef cCreatureInfo* P_CREATURE_INFO;
00113
00114 #define CREATURE_COUNT 2048
00115
00116 class cAllCreatures {
00117
00118 P_CREATURE_INFO allCreatures[CREATURE_COUNT];
00119
00120 public:
00121
00122 cAllCreatures();
00123 ~cAllCreatures();
00124
00125 void load();
00126 P_CREATURE_INFO getCreature( UI16 id );
00127
00128 };
00129
00130 extern cAllCreatures creatures;
00131
00132 #endif