const.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _RRCONFIGS_CONST_
  4. #define _RRCONFIGS_CONST_
  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 SECURE_NPCTIMEOUT < 0
  19. #error SECURE_NPCTIMEOUT cannot be lower than 0
  20. #endif
  21. /**
  22. * Path within the /db folder to (non-)renewal specific db files
  23. **/
  24. #ifdef RENEWAL
  25. #define DBPATH "re/"
  26. #else
  27. #define DBPATH "pre-re/"
  28. #endif
  29. /**
  30. * DefType
  31. **/
  32. #ifdef RENEWAL
  33. typedef short defType;
  34. #define DEFTYPE_MIN SHRT_MIN
  35. #define DEFTYPE_MAX SHRT_MAX
  36. #else
  37. typedef signed char defType;
  38. #define DEFTYPE_MIN CHAR_MIN
  39. #define DEFTYPE_MAX CHAR_MAX
  40. #endif
  41. /* pointer size fix which fixes several gcc warnings */
  42. #ifdef __64BIT__
  43. #define __64BPRTSIZE(y) (intptr)y
  44. #else
  45. #define __64BPRTSIZE(y) y
  46. #endif
  47. /* ATCMD_FUNC(mobinfo) HIT and FLEE calculations */
  48. #ifdef RENEWAL
  49. #define MOB_FLEE(mob) ( mob->lv + mob->status.agi + 100 )
  50. #define MOB_HIT(mob) ( mob->lv + mob->status.dex + 175 )
  51. #else
  52. #define MOB_FLEE(mob) ( mob->lv + mob->status.agi )
  53. #define MOB_HIT(mob) ( mob->lv + mob->status.dex )
  54. #endif
  55. /* Renewal's dmg level modifier, used as a macro for a easy way to turn off. */
  56. #ifdef RENEWAL_LVDMG
  57. #define RE_LVL_DMOD(val) \
  58. if( status_get_lv(src) > 100 && val > 0 ) \
  59. skillratio = skillratio * status_get_lv(src) / val;
  60. #define RE_LVL_MDMOD(val) \
  61. if( status_get_lv(src) > 100 && val > 0) \
  62. md.damage = md.damage * status_get_lv(src) / val;
  63. /* ranger traps special */
  64. #define RE_LVL_TMDMOD() \
  65. if( status_get_lv(src) > 100 ) \
  66. md.damage = md.damage * 150 / 100 + md.damage * status_get_lv(src) / 100;
  67. #else
  68. #define RE_LVL_DMOD(val)
  69. #define RE_LVL_MDMOD(val)
  70. #define RE_LVL_TMDMOD()
  71. #endif
  72. /* Feb 1st 2012 */
  73. #if PACKETVER >= 20120201
  74. #define NEW_CARTS
  75. #define MAX_CARTS 9
  76. #else
  77. #define MAX_CARTS 5
  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. * End of File
  88. **/
  89. #endif