00001 /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 00002 || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net] || 00003 || || 00004 || This software is free software released under GPL2 license. || 00005 || You can find detailed license information in nox-wizard.cpp file. || 00006 || || 00007 || For any question post to NoX-Wizard forums. || 00008 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ 00009 00016 #ifndef __TYPEDEFS_H__ 00017 #define __TYPEDEFS_H__ 00018 #include <set> 00019 00020 00021 typedef double R64; //< 64 bits floating point 00022 typedef float R32; //< 32 bits floating point 00023 00024 #if defined __GNUC__ 00025 #include <bits/types.h> 00026 typedef uint8_t UI08; 00027 typedef uint16_t UI16; 00028 typedef uint32_t UI32; 00029 typedef uint64_t UI64; 00030 typedef int8_t SI08; 00031 typedef int16_t SI16; 00032 typedef int32_t SI32; 00033 typedef int64_t SI64; 00034 #elif defined __BORLANDC__ 00035 typedef unsigned __int8 UI08; 00036 typedef unsigned __int16 UI16; 00037 typedef unsigned __int32 UI32; 00038 typedef unsigned __int64 UI64; 00039 00040 typedef signed __int8 SI08; 00041 typedef signed __int16 SI16; 00042 typedef signed __int32 SI32; 00043 typedef signed __int64 SI64; 00044 00045 //typedef __int8 UI08; 00046 //typedef __int16 UI16; 00047 //typedef __int32 UI32; 00048 //typedef __int64 UI64; 00049 #else 00050 #ifdef _MSC_VER 00051 #if _MSC_VER<=1200 00052 typedef unsigned long UI64; 00053 typedef signed long SI64; 00054 #else 00055 typedef unsigned __int64 UI64; 00056 typedef signed __int64 SI64; 00057 #endif 00058 #else 00059 typedef unsigned long long UI64; 00060 typedef long long SI64; 00061 #endif 00062 typedef unsigned int UI32; 00063 typedef signed int SI32; 00064 typedef unsigned short int UI16; 00065 typedef signed short int SI16; 00066 typedef unsigned char UI08; 00067 typedef signed char SI08; 00068 #endif 00069 00070 typedef bool LOGICAL; 00071 typedef char TEXT; 00072 typedef UI08 ARMORCLASS; 00073 typedef SI32 CHARACTER; 00074 typedef UI16 COLOR; 00075 typedef SI32 SOUND; 00076 00077 typedef SI32 ITEM; 00078 typedef class cNxwClientObj* NXWCLIENT; 00079 typedef SI32 NXWSOCKET; 00080 typedef unsigned char BYTE; 00081 typedef class cChar* P_CHAR; 00082 typedef const class cChar* PC_CHAR; 00083 typedef class cItem* P_ITEM; 00084 typedef const class cItem* PC_ITEM; 00085 typedef class cHouse* P_HOUSE; 00086 typedef const class cHouse* PC_HOUSE; 00087 typedef class cObject* P_OBJECT; 00088 typedef SI32 SERIAL; 00089 typedef UI32 TIMERVAL; 00090 typedef SI32 ACCOUNT; 00091 typedef SI32 FUNCIDX; 00092 typedef std::vector<UI32> UI32VECTOR; 00093 typedef std::vector<SERIAL> SERIAL_VECTOR; 00094 typedef slist<SERIAL> SERIAL_SLIST; 00095 typedef SERIAL SCRIPTID; 00096 typedef std::set<SERIAL> SERIAL_SET; 00097 typedef std::vector< P_OBJECT > POBJECT_VECTOR; 00098 typedef POBJECT_VECTOR::iterator POBJECT_VECTOR_IT; 00099 typedef std::vector< P_CHAR > PCHAR_VECTOR; 00100 typedef PCHAR_VECTOR::iterator PCHAR_VECTOR_IT; 00101 typedef std::vector< P_ITEM > PITEM_VECTOR; 00102 typedef PITEM_VECTOR::iterator PITEM_VECTOR_IT; 00103 typedef class cPartyMember* P_PARTY_MEMBER; 00104 typedef class cParty* P_PARTY; 00105 typedef class cBasicMenu* P_MENU; 00106 typedef class cGuild* P_GUILD; 00107 typedef class cGuildMember* P_GUILD_MEMBER; 00108 typedef class cGuildRecruit* P_GUILD_RECRUIT; 00109 typedef class cClient* P_CLIENT; 00110 00111 00112 00113 00114 00115 00116 00117 #if defined __GNUC__ && (__GNUC__ < 3 || defined(WIN32)) 00118 typedef std::basic_string <wchar_t> wstring; 00119 #else 00120 using std::wstring; 00121 #endif 00122 00123 #ifdef __BORLANDC__ 00124 #include <stlport/hash_map> 00125 #else 00126 //#include <hashmap> 00127 #endif 00128 00129 00130 00131 template < class T > 00132 class cPoint{ 00133 public: 00134 00135 cPoint( T a=0, T b=0 ) { this->a=a; this->b=b; }; 00136 00137 T a; 00138 T b; 00139 }; 00140 00146 struct UI32_s { 00147 UI32 value; 00148 UI32 save1; 00149 UI32 save2; 00150 UI32 save3; 00151 }; 00152 00153 struct lookuptr_st //Tauriel used to create pointers to the items dynamically allocated 00154 { // so don't mess with it unless you know what you are doing! 00155 SI32 max; 00156 SI32 *pointer; 00157 }; 00158 00159 struct location_st 00160 { 00161 SI32 x1; 00162 SI32 y1; 00163 SI32 x2; 00164 SI32 y2; 00165 //char region; 00166 UI08 region; 00167 }; 00168 00169 struct logout_st//Instalog 00170 { 00171 UI32 x1; 00172 UI32 y1; 00173 UI32 x2; 00174 UI32 y2; 00175 }; 00176 00177 struct path_st { 00178 UI32 x; 00179 UI32 y; 00180 }; 00181 00182 00183 //REPSYS 00184 struct repsys_st 00185 { 00186 SI32 murderdecay; 00187 UI32 maxkills; 00188 SI32 crimtime; 00189 }; 00190 00191 00192 struct resource_st 00193 { 00194 UI32 logs; 00195 TIMERVAL logtime; 00196 TIMERVAL lograte;//AntiChrist 00197 UI32 logarea; 00198 SI32 logtrigger;//AntiChrist 00199 SI32 logstamina;//AntiChrist 00200 }; 00201 00202 00203 struct creat_st 00204 { 00205 SI32 basesound; 00206 UI08 soundflag; 00207 UI08 who_am_i; 00208 SI32 icon; 00209 }; 00210 00211 00212 00213 00214 // XYZZY 00215 struct unitile_st 00216 { 00217 SI08 basez; 00218 UI08 type; // 0=Terrain, 1=Item 00219 UI16 id; 00220 UI08 flag1; 00221 UI08 flag2; 00222 UI08 flag3; 00223 UI08 flag4; 00224 SI08 height; 00225 UI08 weight; 00226 } PACK_NEEDED; 00227 00228 00229 00230 00231 00232 00233 00234 00235 /* 00236 Sparhawk -- moved to regions.h 00237 00238 struct region_st 00239 { 00240 LOGICAL inUse; 00241 TEXT name[50]; 00242 SI32 midilist; 00243 UI08 priv; // 0x01 guarded, 0x02, mark allowed, 0x04, gate allowed, 0x08, recall 00244 // 0x10 raining, 0x20, snowing, 0x40 magic damage reduced to 0 00245 TEXT guardowner[50]; 00246 UI08 snowchance; 00247 UI08 rainchance; 00248 UI08 drychance; 00249 UI08 keepchance; 00250 UI08 wtype; 00251 SI32 guardnum[10]; 00252 SI32 goodsell[256]; // Magius(CHE) 00253 SI32 goodbuy[256]; // Magius(CHE) 00254 SI32 goodrnd1[256]; // Magius(CHE) (2) 00255 SI32 goodrnd2[256]; // Magius(CHE) (2) 00256 SI32 forcedseason; 00257 LOGICAL ignoreseason; 00258 }; 00259 */ 00260 00261 struct skill_st 00262 { 00263 SI32 st; 00264 SI32 dx; 00265 SI32 in; 00266 SI32 unhide_onuse; 00267 SI32 unhide_onfail; 00268 SI32 advance_index; 00269 TEXT madeword[50]; // Added by Magius(CHE) 00270 }; 00271 00272 struct advance_st 00273 { 00274 UI08 skill; 00275 SI32 base; 00276 SI32 success; 00277 SI32 failure; 00278 }; 00279 00280 #ifndef DOXYGEN // this definitions are used when compiling 00281 00282 struct Serial{ 00283 #define ser1 aa._ser1 00284 #define ser2 aa._ser2 00285 #define ser3 aa._ser3 00286 #define ser4 aa._ser4 00287 union{ 00288 struct { BYTE _ser4, _ser3, _ser2, _ser1; }aa; 00289 SI32 serial32; 00290 }; 00291 }; 00292 00293 struct Color{ 00294 union{ 00295 UI16 color16; 00296 struct{ BYTE _ser2, _ser1; }aa; 00297 }; 00298 }; 00299 00300 #else // these are only for doxygen to make a good documentation 00301 00307 struct Serial{ 00308 BYTE ser1; 00309 BYTE ser2; 00310 BYTE ser3; 00311 BYTE ser4; 00312 SI32 serial32; 00313 }; 00314 00320 struct Color{ 00321 BYTE ser1; 00322 BYTE ser2; 00323 UI16 color16; 00324 } 00325 #endif // DOXYGEN 00326 00327 struct gmpage_st 00328 { 00329 TEXT reason[80]; 00330 Serial serial; 00331 TEXT timeofcall[9]; 00332 TEXT name[20]; 00333 SI32 handled; 00334 } PACK_NEEDED; 00335 00336 struct begging_st 00337 { 00338 SI32 timer; 00339 UI32 range; 00340 TEXT text[3][256]; 00341 }; 00342 00343 struct fishing_st 00344 { 00345 TIMERVAL basetime; 00346 TIMERVAL randomtime; 00347 }; 00348 00349 struct spiritspeak_st 00350 { 00351 TIMERVAL spiritspeaktimer; 00352 }; 00353 00358 struct speed_st 00359 { 00360 SI32 nice; 00361 R32 itemtime; 00362 TIMERVAL srtime; 00363 R32 npctime; 00364 R32 tamednpctime; 00365 R32 npcfollowtime; 00366 R32 npcaitime; 00367 }; 00368 00369 00373 struct title_st 00374 { 00375 TEXT fame[50]; 00376 TEXT skill[50]; 00377 TEXT prowess[50]; 00378 TEXT other[50]; 00379 }; 00380 00386 struct Location{ 00387 UI16 x, y; 00388 SI08 z, dispz; // dispz is used for the char location 00389 // SI08 m; // map level reserved for future 00390 }; 00391 00392 00393 struct tele_locations_st { 00394 Location destination, origem; 00395 }; 00396 00397 00404 typedef struct { 00405 TIMERVAL timer; 00406 UI32 rate_eff; 00407 UI32 rate_real; 00408 } regen_st; 00409 00410 #endif //__TYPEDEFS_H__