const.hpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef CONFIG_CONST_H
  4. #define CONFIG_CONST_H
  5. /**
  6. * rAthena configuration file (http://rathena.org)
  7. * For detailed guidance on these check http://rathena.org/wiki/SRC/config/
  8. **/
  9. /**
  10. * @INFO: This file holds constants that aims at making code smoother and more efficient
  11. */
  12. /**
  13. * "Sane Checks" to save you from compiling with cool bugs
  14. **/
  15. #if SECURE_NPCTIMEOUT_INTERVAL <= 0
  16. #error SECURE_NPCTIMEOUT_INTERVAL should be at least 1 (1s)
  17. #endif
  18. #if NPC_SECURE_TIMEOUT_INPUT < 0
  19. #error NPC_SECURE_TIMEOUT_INPUT cannot be lower than 0
  20. #endif
  21. #if NPC_SECURE_TIMEOUT_MENU < 0
  22. #error NPC_SECURE_TIMEOUT_MENU cannot be lower than 0
  23. #endif
  24. #if NPC_SECURE_TIMEOUT_NEXT < 0
  25. #error NPC_SECURE_TIMEOUT_NEXT cannot be lower than 0
  26. #endif
  27. /**
  28. * Path within the /db folder to (non-)renewal specific db files
  29. **/
  30. #ifdef RENEWAL
  31. #define DBPATH "re/"
  32. #else
  33. #define DBPATH "pre-re/"
  34. #endif
  35. #define DBIMPORT "import"
  36. /**
  37. * DefType
  38. **/
  39. #ifdef RENEWAL
  40. typedef short defType;
  41. #define DEFTYPE_MIN SHRT_MIN
  42. #define DEFTYPE_MAX SHRT_MAX
  43. #else
  44. typedef signed char defType;
  45. #define DEFTYPE_MIN CHAR_MIN
  46. #define DEFTYPE_MAX CHAR_MAX
  47. #endif
  48. /* pointer size fix which fixes several gcc warnings */
  49. #ifdef __64BIT__
  50. #define __64BPRTSIZE(y) (intptr)y
  51. #else
  52. #define __64BPRTSIZE(y) y
  53. #endif
  54. /* ATCMD_FUNC(mobinfo) HIT and FLEE calculations */
  55. #ifdef RENEWAL
  56. #define MOB_FLEE(mob) ( mob->lv + mob->status.agi + 100 )
  57. #define MOB_HIT(mob) ( mob->lv + mob->status.dex + 175 )
  58. #else
  59. #define MOB_FLEE(mob) ( mob->lv + mob->status.agi )
  60. #define MOB_HIT(mob) ( mob->lv + mob->status.dex )
  61. #endif
  62. /* Renewal's dmg level modifier, used as a macro for a easy way to turn off. */
  63. #ifdef RENEWAL_LVDMG
  64. #define RE_LVL_DMOD(val) \
  65. if( status_get_lv(src) > 99 && val > 0 ) \
  66. skillratio = skillratio * status_get_lv(src) / val;
  67. #define RE_LVL_MDMOD(val) \
  68. if( status_get_lv(src) > 99 && val > 0) \
  69. md.damage = md.damage * status_get_lv(src) / val;
  70. /* ranger traps special */
  71. #define RE_LVL_TMDMOD() \
  72. if( status_get_lv(src) > 99 ) \
  73. md.damage = md.damage * 150 / 100 + md.damage * status_get_lv(src) / 100;
  74. #else
  75. #define RE_LVL_DMOD(val)
  76. #define RE_LVL_MDMOD(val)
  77. #define RE_LVL_TMDMOD()
  78. #endif
  79. // Renewal variable cast time reduction
  80. #ifdef RENEWAL_CAST
  81. #define VARCAST_REDUCTION(val){ \
  82. if( (varcast_r += val) != 0 && varcast_r >= 0 ) \
  83. time = time * (1 - (float)min(val, 100) / 100); \
  84. }
  85. #endif
  86. /**
  87. * Default coordinate for new char
  88. * That map should be loaded by a mapserv
  89. **/
  90. #ifdef RENEWAL
  91. #define MAP_DEFAULT_NAME "iz_int"
  92. #define MAP_DEFAULT_X 18
  93. #define MAP_DEFAULT_Y 26
  94. #else
  95. #define MAP_DEFAULT_NAME "new_1-1"
  96. #define MAP_DEFAULT_X 53
  97. #define MAP_DEFAULT_Y 111
  98. #endif
  99. /**
  100. * End of File
  101. **/
  102. #endif /* CONFIG_CONST_H */