status.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _STATUS_H_
  4. #define _STATUS_H_
  5. #include "map.h"
  6. //Use this to refer the max refinery level [Skotlex]
  7. #define MAX_REFINE 10
  8. #define MAX_REFINE_BONUS 5
  9. extern unsigned long StatusChangeFlagTable[];
  10. // Status changes listing. These code are for use by the server.
  11. enum {
  12. //First we enumerate common status ailments which are often used around.
  13. SC_STONE = 0,
  14. SC_FREEZE,
  15. SC_STUN,
  16. SC_SLEEP,
  17. SC_POISON,
  18. SC_CURSE,
  19. SC_SILENCE,
  20. SC_CONFUSION,
  21. SC_BLIND,
  22. SC_BLEEDING,
  23. SC_DPOISON, //10
  24. //Next up, we continue on 20, to leave enough room for additional "common" ailments in the future.
  25. SC_PROVOKE = 20,
  26. SC_ENDURE,
  27. SC_TWOHANDQUICKEN,
  28. SC_CONCENTRATE,
  29. SC_HIDING,
  30. SC_CLOAKING,
  31. SC_ENCPOISON,
  32. SC_POISONREACT,
  33. SC_QUAGMIRE,
  34. SC_ANGELUS,
  35. SC_BLESSING, //30
  36. SC_SIGNUMCRUCIS,
  37. SC_INCREASEAGI,
  38. SC_DECREASEAGI,
  39. SC_SLOWPOISON,
  40. SC_IMPOSITIO ,
  41. SC_SUFFRAGIUM,
  42. SC_ASPERSIO,
  43. SC_BENEDICTIO,
  44. SC_KYRIE,
  45. SC_MAGNIFICAT, //40
  46. SC_GLORIA,
  47. SC_AETERNA,
  48. SC_ADRENALINE,
  49. SC_WEAPONPERFECTION,
  50. SC_OVERTHRUST,
  51. SC_MAXIMIZEPOWER,
  52. SC_TRICKDEAD,
  53. SC_LOUD,
  54. SC_ENERGYCOAT,
  55. SC_BROKENARMOR, //50 - NOTE: These two aren't used anywhere, and they have an icon...
  56. SC_BROKENWEAPON,
  57. SC_HALLUCINATION,
  58. SC_WEIGHT50,
  59. SC_WEIGHT90,
  60. SC_ASPDPOTION0,
  61. SC_ASPDPOTION1,
  62. SC_ASPDPOTION2,
  63. SC_ASPDPOTION3,
  64. SC_SPEEDUP0,
  65. SC_SPEEDUP1, //60
  66. SC_ATKPOTION,
  67. SC_MATKPOTION,
  68. SC_WEDDING,
  69. SC_SLOWDOWN,
  70. SC_ANKLE,
  71. SC_KEEPING,
  72. SC_BARRIER,
  73. SC_STRIPWEAPON,
  74. SC_STRIPSHIELD,
  75. SC_STRIPARMOR, //70
  76. SC_STRIPHELM,
  77. SC_CP_WEAPON,
  78. SC_CP_SHIELD,
  79. SC_CP_ARMOR,
  80. SC_CP_HELM,
  81. SC_AUTOGUARD,
  82. SC_REFLECTSHIELD,
  83. SC_SPLASHER,
  84. SC_PROVIDENCE,
  85. SC_DEFENDER, //80
  86. SC_MAGICROD,
  87. SC_SPELLBREAKER,
  88. SC_AUTOSPELL,
  89. SC_SIGHTTRASHER,
  90. SC_AUTOBERSERK,
  91. SC_SPEARQUICKEN,
  92. SC_AUTOCOUNTER,
  93. SC_SIGHT,
  94. SC_SAFETYWALL,
  95. SC_RUWACH, //90
  96. SC_EXTREMITYFIST,
  97. SC_EXPLOSIONSPIRITS,
  98. SC_COMBO,
  99. SC_BLADESTOP_WAIT,
  100. SC_BLADESTOP,
  101. SC_FIREWEAPON,
  102. SC_WATERWEAPON,
  103. SC_WINDWEAPON,
  104. SC_EARTHWEAPON,
  105. SC_VOLCANO, //100,
  106. SC_DELUGE,
  107. SC_VIOLENTGALE,
  108. SC_WATK_ELEMENT,
  109. SC_LANDPROTECTOR,
  110. SC_ARMOR_ELEMENT,
  111. SC_NOCHAT,
  112. SC_BABY,
  113. SC_AURABLADE,
  114. SC_PARRYING,
  115. SC_CONCENTRATION, //110
  116. SC_TENSIONRELAX,
  117. SC_BERSERK,
  118. SC_FURY,
  119. SC_GOSPEL,
  120. SC_ASSUMPTIO,
  121. SC_BASILICA,
  122. SC_GUILDAURA,
  123. SC_MAGICPOWER,
  124. SC_EDP,
  125. SC_TRUESIGHT, //120
  126. SC_WINDWALK,
  127. SC_MELTDOWN,
  128. SC_CARTBOOST,
  129. SC_CHASEWALK,
  130. SC_REJECTSWORD,
  131. SC_MARIONETTE,
  132. SC_MARIONETTE2,
  133. SC_MOONLIT,
  134. SC_JOINTBEAT,
  135. SC_MINDBREAKER, //130
  136. SC_MEMORIZE,
  137. SC_FOGWALL,
  138. SC_SPIDERWEB,
  139. SC_DEVOTION,
  140. SC_SACRIFICE,
  141. SC_STEELBODY,
  142. SC_ORCISH,
  143. SC_READYSTORM,
  144. SC_READYDOWN,
  145. SC_READYTURN, //140
  146. SC_READYCOUNTER,
  147. SC_DODGE,
  148. SC_RUN,
  149. SC_SHADOWWEAPON,
  150. SC_ADRENALINE2,
  151. SC_GHOSTWEAPON,
  152. SC_KAIZEL,
  153. SC_KAAHI,
  154. SC_KAUPE,
  155. SC_ONEHAND, //150
  156. SC_PRESERVE,
  157. SC_BATTLEORDERS,
  158. SC_REGENERATION,
  159. SC_DOUBLECAST,
  160. SC_GRAVITATION,
  161. SC_MAXOVERTHRUST,
  162. SC_LONGING,
  163. SC_HERMODE,
  164. SC_SHRINK,
  165. SC_SIGHTBLASTER, //160
  166. SC_WINKCHARM,
  167. SC_CLOSECONFINE,
  168. SC_CLOSECONFINE2,
  169. SC_DANCING,
  170. SC_ELEMENTALCHANGE,
  171. SC_RICHMANKIM,
  172. SC_ETERNALCHAOS,
  173. SC_DRUMBATTLE,
  174. SC_NIBELUNGEN,
  175. SC_ROKISWEIL, //170
  176. SC_INTOABYSS,
  177. SC_SIEGFRIED,
  178. SC_WHISTLE,
  179. SC_ASSNCROS,
  180. SC_POEMBRAGI,
  181. SC_APPLEIDUN,
  182. SC_MODECHANGE,
  183. SC_HUMMING,
  184. SC_DONTFORGETME,
  185. SC_FORTUNE, //180
  186. SC_SERVICE4U,
  187. SC_STOP, //Prevents inflicted chars from walking. [Skotlex]
  188. SC_SPURT,
  189. SC_SPIRIT,
  190. SC_COMA, //Not a real SC_, it makes a char's HP/SP hit 1.
  191. SC_INTRAVISION,
  192. SC_INCALLSTATUS,
  193. SC_INCSTR,
  194. SC_INCAGI,
  195. SC_INCVIT, //190
  196. SC_INCINT,
  197. SC_INCDEX,
  198. SC_INCLUK,
  199. SC_INCHIT,
  200. SC_INCHITRATE,
  201. SC_INCFLEE,
  202. SC_INCFLEERATE,
  203. SC_INCMHPRATE,
  204. SC_INCMSPRATE,
  205. SC_INCATKRATE, //200
  206. SC_INCMATKRATE,
  207. SC_INCDEFRATE,
  208. SC_STRFOOD,
  209. SC_AGIFOOD,
  210. SC_VITFOOD,
  211. SC_INTFOOD,
  212. SC_DEXFOOD,
  213. SC_LUKFOOD,
  214. SC_HITFOOD,
  215. SC_FLEEFOOD, //210
  216. SC_BATKFOOD,
  217. SC_WATKFOOD,
  218. SC_MATKFOOD,
  219. SC_SCRESIST, //Increases resistance to status changes.
  220. SC_XMAS, // Xmas Suit [Valaris]
  221. SC_WARM, //SG skills [Komurka]
  222. SC_SUN_COMFORT,
  223. SC_MOON_COMFORT,
  224. SC_STAR_COMFORT,
  225. SC_FUSION, //220
  226. SC_SKILLRATE_UP,
  227. SC_SKE,
  228. SC_KAITE,
  229. SC_SWOO, // [marquis007]
  230. SC_SKA, // [marquis007]
  231. SC_TKREST, // [marquis007]
  232. SC_MIRACLE, //SG 'hidden' skill [Komurka]
  233. //Ninja/GS states
  234. SC_MADNESSCANCEL,
  235. SC_ADJUSTMENT,
  236. SC_INCREASING, //230
  237. SC_GATLINGFEVER,
  238. SC_TATAMIGAESHI,
  239. SC_UTSUSEMI,
  240. SC_KAENSIN,
  241. SC_SUITON,
  242. SC_NEN,
  243. SC_KNOWLEDGE,
  244. SC_SMA,
  245. SC_MAX, //Automatically updated max, used in for's and at startup to check we are within bounds. [Skotlex]
  246. };
  247. extern int SkillStatusChangeTable[MAX_SKILL];
  248. extern int StatusSkillChangeTable[SC_MAX];
  249. //Numerates the Number for the status changes (client-dependent), imported from jA
  250. enum {
  251. SI_BLANK = -1,
  252. SI_PROVOKE = 0,
  253. SI_ENDURE = 1,
  254. SI_TWOHANDQUICKEN = 2,
  255. SI_CONCENTRATE = 3,
  256. SI_HIDING = 4,
  257. SI_CLOAKING = 5,
  258. SI_ENCPOISON = 6,
  259. SI_POISONREACT = 7,
  260. SI_QUAGMIRE = 8,
  261. SI_ANGELUS = 9,
  262. SI_BLESSING = 10,
  263. SI_SIGNUMCRUCIS = 11,
  264. SI_INCREASEAGI = 12,
  265. SI_DECREASEAGI = 13,
  266. SI_SLOWPOISON = 14,
  267. SI_IMPOSITIO = 15,
  268. SI_SUFFRAGIUM = 16,
  269. SI_ASPERSIO = 17,
  270. SI_BENEDICTIO = 18,
  271. SI_KYRIE = 19,
  272. SI_MAGNIFICAT = 20,
  273. SI_GLORIA = 21,
  274. SI_AETERNA = 22,
  275. SI_ADRENALINE = 23,
  276. SI_WEAPONPERFECTION = 24,
  277. SI_OVERTHRUST = 25,
  278. SI_MAXIMIZEPOWER = 26,
  279. SI_RIDING = 27,
  280. SI_FALCON = 28,
  281. SI_TRICKDEAD = 29,
  282. SI_LOUD = 30,
  283. SI_ENERGYCOAT = 31,
  284. SI_BROKENARMOR = 32,
  285. SI_BROKENWEAPON = 33,
  286. SI_HALLUCINATION = 34,
  287. SI_WEIGHT50 = 35,
  288. SI_WEIGHT90 = 36,
  289. SI_ASPDPOTION = 37,
  290. //38: Again Aspd Potion
  291. //39: Again Aspd Potion
  292. //40: Again Aspd Potion
  293. SI_SPEEDPOTION = 41,
  294. //42: Again Speed Up
  295. SI_STRIPWEAPON = 50,
  296. SI_STRIPSHIELD = 51,
  297. SI_STRIPARMOR = 52,
  298. SI_STRIPHELM = 53,
  299. SI_CP_WEAPON = 54,
  300. SI_CP_SHIELD = 55,
  301. SI_CP_ARMOR = 56,
  302. SI_CP_HELM = 57,
  303. SI_AUTOGUARD = 58,
  304. SI_REFLECTSHIELD = 59,
  305. SI_PROVIDENCE = 61,
  306. SI_DEFENDER = 62,
  307. SI_AUTOSPELL = 65,
  308. SI_SPEARQUICKEN = 68,
  309. SI_EXPLOSIONSPIRITS = 86,
  310. SI_FURY = 87,
  311. SI_FIREWEAPON = 90,
  312. SI_WATERWEAPON = 91,
  313. SI_WINDWEAPON = 92,
  314. SI_EARTHWEAPON = 93,
  315. // 102 = again gloria - from what I saw on screenshots, I wonder if it isn't gospel... [DracoRPG]
  316. SI_AURABLADE = 103,
  317. SI_PARRYING = 104,
  318. SI_CONCENTRATION = 105,
  319. SI_TENSIONRELAX = 106,
  320. SI_BERSERK = 107,
  321. SI_ASSUMPTIO = 110,
  322. SI_GUILDAURA = 112,
  323. SI_MAGICPOWER = 113,
  324. SI_EDP = 114,
  325. SI_TRUESIGHT = 115,
  326. SI_WINDWALK = 116,
  327. SI_MELTDOWN = 117,
  328. SI_CARTBOOST = 118,
  329. SI_REJECTSWORD = 120,
  330. SI_MARIONETTE = 121,
  331. SI_MARIONETTE2 = 122,
  332. SI_MOONLIT = 123,
  333. SI_BLEEDING = 124,
  334. SI_JOINTBEAT = 125,
  335. SI_DEVOTION = 130,
  336. SI_STEELBODY = 132,
  337. SI_CHASEWALK = 134,
  338. SI_READYSTORM = 135,
  339. SI_READYDOWN = 137,
  340. SI_READYTURN = 139,
  341. SI_READYCOUNTER = 141,
  342. SI_DODGE = 143,
  343. SI_RUN = 144,
  344. SI_SPURT = 145,
  345. SI_SHADOWWEAPON = 146,
  346. SI_ADRENALINE2 = 147,
  347. SI_GHOSTWEAPON = 148,
  348. SI_NIGHT = 149,
  349. SI_SPIRIT = 149,
  350. SI_DEVIL = 152,
  351. SI_KAITE = 153,
  352. SI_KAIZEL = 156,
  353. SI_KAAHI = 157,
  354. SI_KAUPE = 158,
  355. SI_SMA = 159,
  356. // 160
  357. SI_ONEHAND = 161,
  358. SI_WARM = 165,
  359. // 166 | The three show the exact same display: ultra red character (165, 166, 167)
  360. // 167 |
  361. SI_SUN_COMFORT = 169,
  362. SI_MOON_COMFORT = 170,
  363. SI_STAR_COMFORT = 171,
  364. SI_PRESERVE = 181,
  365. SI_BATTLEORDERS = 182,
  366. SI_INTRAVISION = 184, //WTF?? creates the black shape of 4_m_02 NPC, with NPC talk cursor. Supposedly intravision shows this.
  367. SI_DOUBLECAST = 186,
  368. SI_MAXOVERTHRUST = 188,
  369. SI_TAROT = 191, // the icon allows no doubt... but what is it really used for ?? [DracoRPG]
  370. SI_SHRINK = 197,
  371. SI_SIGHTBLASTER = 198,
  372. SI_WINKCHARM = 199,
  373. SI_CLOSECONFINE = 200,
  374. SI_CLOSECONFINE2 = 201,
  375. SI_MADNESSCANCEL = 203, //[blackhole89]
  376. SI_GATLINGFEVER = 204,
  377. SI_TKREST = 205, // 205 = Gloria again (but TK- Happy State looks like it)
  378. SI_MAEMI = 206,
  379. // 207 = crash
  380. SI_NEN = 208,
  381. SI_ADJUSTMENT = 209,
  382. SI_ACCURACY = 210
  383. };
  384. extern int current_equip_item_index;
  385. extern int current_equip_card_id;
  386. extern int percentrefinery[5][MAX_REFINE+1]; //The last slot always has a 0% success chance [Skotlex]
  387. //Mode definitions to clear up code reading. [Skotlex]
  388. #define MD_CANMOVE 0x001
  389. #define MD_LOOTER 0x002
  390. //MD_ANGRY mobs are also aggressive.
  391. #define MD_AGGRESSIVE 0x804
  392. #define MD_ASSIST 0x008
  393. #define MD_CASTSENSOR 0x010
  394. #define MD_BOSS 0x020
  395. #define MD_PLANT 0x040
  396. #define MD_CANATTACK 0x080
  397. #define MD_DETECTOR 0x100
  398. //#define MD_CHANGETARGET 0x200 //Mode deprecated, figured out through mob_can_changetarget()
  399. #define MD_CHANGECHASE 0x400
  400. #define MD_ANGRY 0x800
  401. #define MD_MASK 0xFFF
  402. //Status change option definitions (options are what makes status changes visible to chars
  403. //who were not on your field of sight when it happened)
  404. //opt1: Non stackable status changes.
  405. enum {
  406. OPT1_STONE = 1, //Petrified
  407. OPT1_FREEZE,
  408. OPT1_STUN,
  409. OPT1_SLEEP,
  410. //What is 5?
  411. OPT1_STONEWAIT=6 //Petrifying
  412. };
  413. //opt2: Stackable status changes.
  414. #define OPT2_POISON 0x001
  415. #define OPT2_CURSE 0x002
  416. #define OPT2_SILENCE 0x004
  417. #define OPT2_SIGNUMCRUCIS 0x008
  418. #define OPT2_BLIND 0x010
  419. //0x020 - nothing
  420. //0x040 - nothing
  421. #define OPT2_DPOISON 0x080
  422. //0x100
  423. //Opt3: Skill state changes, stackable.
  424. #define OPT3_SPEEDUP 0x001 //Quicken skills
  425. #define OPT3_POWERUP 0x002 //Power Thrust
  426. #define OPT3_SHIELD 0x004 //Energy Coat
  427. #define OPT3_FURY 0x008 //Explosion spirits
  428. #define OPT3_ELECTRIC 0x010 //Steel Body
  429. #define OPT3_STOP 0x020 //Blade Stop
  430. //64 Unknown
  431. #define OPT3_BERSERK 0x080 //Berserk
  432. //256 Unknown
  433. //512 Unknown
  434. #define OPT3_PINKAURA 0x400 //Marionette
  435. #define OPT3_AURASHIELD 0x800 //Assumptio
  436. #define OPT3_HEAT 0x1000 //Warmth Skills
  437. #define OPTION_SIGHT 0x0001
  438. #define OPTION_HIDE 0x0002
  439. #define OPTION_CLOAK 0x0004
  440. #define OPTION_CART1 0x0008
  441. #define OPTION_FALCON 0x0010
  442. #define OPTION_RIDING 0x0020
  443. #define OPTION_INVISIBLE 0x0040
  444. #define OPTION_CART2 0x0080
  445. #define OPTION_CART3 0x0100
  446. #define OPTION_CART4 0x0200
  447. #define OPTION_CART5 0x0400
  448. #define OPTION_ORCISH 0x0800
  449. #define OPTION_WEDDING 0x1000
  450. #define OPTION_RUWACH 0x2000
  451. #define OPTION_CHASEWALK 0x4000
  452. #define OPTION_FLYING 0x8000
  453. //TODO: Get these Missing options...
  454. #define OPTION_SIGHTTRASHER 0x0001
  455. //Define flags for the status_calc_bl function. [Skotlex]
  456. #define SCB_NONE 0x00000000
  457. #define SCB_BASE 0x00000001
  458. #define SCB_MAXHP 0x00000002
  459. #define SCB_MAXSP 0x00000004
  460. #define SCB_STR 0x00000008
  461. #define SCB_AGI 0x00000010
  462. #define SCB_VIT 0x00000020
  463. #define SCB_INT 0x00000040
  464. #define SCB_DEX 0x00000080
  465. #define SCB_LUK 0x00000100
  466. #define SCB_BATK 0x00000200
  467. #define SCB_WATK 0x00000400
  468. #define SCB_MATK 0x00000800
  469. #define SCB_HIT 0x00001000
  470. #define SCB_FLEE 0x00002000
  471. #define SCB_DEF 0x00004000
  472. #define SCB_DEF2 0x00008000
  473. #define SCB_MDEF 0x00010000
  474. #define SCB_MDEF2 0x00020000
  475. #define SCB_SPEED 0x00040000
  476. #define SCB_ASPD 0x00080000
  477. #define SCB_DSPD 0x00100000
  478. #define SCB_CRI 0x00200000
  479. #define SCB_FLEE2 0x00400000
  480. #define SCB_ATK_ELE 0x00800000
  481. #define SCB_DEF_ELE 0x01000000
  482. #define SCB_MODE 0x02000000
  483. #define SCB_SIZE 0x04000000
  484. #define SCB_RACE 0x08000000
  485. #define SCB_RANGE 0x10000000
  486. #define SCB_PC 0x80000000
  487. #define SCB_ALL 0x7FFFFFFF
  488. int status_damage(struct block_list *src,struct block_list *target,unsigned int hp, unsigned sp, int walkdelay, int flag);
  489. //Define for standard HP damage attacks.
  490. #define status_fix_damage(src, target, hp, walkdelay) status_damage(src, target, hp, 0, walkdelay, 0)
  491. //Define for standard HP/SP damage triggers.
  492. #define status_zap(bl, hp, sp) status_damage(NULL, bl, hp, sp, 0, 1)
  493. //Define for standard HP/SP skill-related cost triggers (mobs require no HP/SP to use skills)
  494. #define status_charge(bl, hp, sp) ((bl)->type != BL_PC || status_damage(NULL, bl, hp, sp, 0, 3))
  495. int status_percent_change(struct block_list *src,struct block_list *target,char hp_rate, char sp_rate, int flag);
  496. //Easier handling of status_percent_change
  497. #define status_percent_heal(bl, hp_rate, sp_rate) status_percent_change(NULL, bl, -(hp_rate), -(sp_rate), 1)
  498. #define status_percent_damage(src, target, hp_rate, sp_rate) status_percent_change(src, target, hp_rate, sp_rate, 0)
  499. //Instant kill with no drops/exp/etc
  500. //
  501. #define status_kill(bl) status_percent_damage(NULL, bl, 100, 0)
  502. int status_heal(struct block_list *bl,unsigned int hp,unsigned int sp, int flag);
  503. int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp);
  504. //Define for copying a status_data structure from b to a, without overwriting current Hp and Sp, nor messing the lhw pointer.
  505. #define status_cpy(a, b) { memcpy(&((a)->max_hp), &((b)->max_hp), sizeof(struct status_data)-(sizeof((a)->hp)+sizeof((a)->sp)+sizeof((a)->lhw))); \
  506. if ((a)->lhw && (b)->lhw) { memcpy((a)->lhw, (b)->lhw, sizeof(struct weapon_atk)); }}
  507. struct status_data *status_get_status_data(struct block_list *bl);
  508. struct status_data *status_get_base_status(struct block_list *bl);
  509. int status_get_class(struct block_list *bl);
  510. int status_get_lv(struct block_list *bl);
  511. #define status_get_range(bl) status_get_status_data(bl)->rhw.range
  512. #define status_get_hp(bl) status_get_status_data(bl)->hp
  513. #define status_get_max_hp(bl) status_get_status_data(bl)->max_hp
  514. #define status_get_sp(bl) status_get_status_data(bl)->sp
  515. #define status_get_max_sp(bl) status_get_status_data(bl)->max_sp
  516. #define status_get_str(bl) status_get_status_data(bl)->str
  517. #define status_get_agi(bl) status_get_status_data(bl)->agi
  518. #define status_get_vit(bl) status_get_status_data(bl)->vit
  519. #define status_get_int(bl) status_get_status_data(bl)->int_
  520. #define status_get_dex(bl) status_get_status_data(bl)->dex
  521. #define status_get_luk(bl) status_get_status_data(bl)->luk
  522. #define status_get_hit(bl) status_get_status_data(bl)->hit
  523. #define status_get_flee(bl) status_get_status_data(bl)->flee
  524. int status_get_def(struct block_list *bl);
  525. #define status_get_mdef(bl) status_get_status_data(bl)->mdef
  526. #define status_get_flee2(bl) status_get_status_data(bl)->flee2
  527. #define status_get_def2(bl) status_get_status_data(bl)->def2
  528. #define status_get_mdef2(bl) status_get_status_data(bl)->mdef2
  529. #define status_get_critical(bl) status_get_status_data(bl)->cri
  530. #define status_get_batk(bl) status_get_status_data(bl)->batk
  531. #define status_get_watk(bl) status_get_status_data(bl)->rhw.atk
  532. #define status_get_watk2(bl) status_get_status_data(bl)->rhw.atk2
  533. #define status_get_matk_max(bl) status_get_status_data(bl)->matk_max
  534. #define status_get_matk_min(bl) status_get_status_data(bl)->matk_min
  535. int status_get_lwatk(struct block_list *bl);
  536. int status_get_lwatk2(struct block_list *bl);
  537. int status_get_speed(struct block_list *bl);
  538. #define status_get_adelay(bl) status_get_status_data(bl)->adelay
  539. #define status_get_amotion(bl) status_get_status_data(bl)->amotion
  540. #define status_get_dmotion(bl) status_get_status_data(bl)->dmotion
  541. #define status_get_element(bl) status_get_status_data(bl)->def_ele
  542. #define status_get_element_level(bl) status_get_status_data(bl)->ele_lv
  543. unsigned char status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element);
  544. #define status_get_attack_sc_element(bl, sc) status_calc_attack_element(bl, sc, 0)
  545. #define status_get_attack_element(bl) status_get_status_data(bl)->rhw.ele
  546. int status_get_attack_lelement(struct block_list *bl);
  547. #define status_get_race(bl) status_get_status_data(bl)->race
  548. #define status_get_size(bl) status_get_status_data(bl)->size
  549. #define status_get_mode(bl) status_get_status_data(bl)->mode
  550. int status_get_party_id(struct block_list *bl);
  551. int status_get_guild_id(struct block_list *bl);
  552. int status_get_mexp(struct block_list *bl);
  553. int status_get_race2(struct block_list *bl);
  554. struct view_data *status_get_viewdata(struct block_list *bl);
  555. void status_set_viewdata(struct block_list *bl, int class_);
  556. void status_change_init(struct block_list *bl);
  557. struct status_change *status_get_sc(struct block_list *bl);
  558. int status_isdead(struct block_list *bl);
  559. int status_isimmune(struct block_list *bl);
  560. int status_get_sc_def(struct block_list *bl, int type);
  561. #define status_get_sc_def_mdef(bl) (status_get_sc_def(bl, SP_MDEF1))
  562. #define status_get_sc_def_vit(bl) (status_get_sc_def(bl, SP_DEF2))
  563. #define status_get_sc_def_int(bl) (status_get_sc_def(bl, SP_MDEF2))
  564. #define status_get_sc_def_luk(bl) (status_get_sc_def(bl, SP_LUK))
  565. //Short version, receives rate in 1->100 range, and does not uses a flag setting.
  566. #define sc_start(bl, type, rate, val1, tick) status_change_start(bl,type,100*(rate),val1,0,0,0,tick,0)
  567. #define sc_start4(bl, type, rate, val1, val2, val3, val4, tick) status_change_start(bl,type,100*(rate),val1,val2,val3,val4,tick,0)
  568. int status_change_start(struct block_list *bl,int type,int rate,int val1,int val2,int val3,int val4,int tick,int flag);
  569. int status_change_end( struct block_list* bl , int type,int tid );
  570. int kaahi_heal_timer(int tid, unsigned int tick, int id, int data);
  571. int status_change_timer(int tid, unsigned int tick, int id, int data);
  572. int status_change_timer_sub(struct block_list *bl, va_list ap );
  573. int status_change_clear(struct block_list *bl,int type);
  574. int status_change_clear_buffs(struct block_list *bl, int type);
  575. void status_calc_bl(struct block_list *bl, unsigned long flag);
  576. int status_calc_pet(struct pet_data* pd, int first); // [Skotlex]
  577. int status_calc_pc(struct map_session_data* sd,int first);
  578. int status_calc_mob(struct mob_data* md, int first); //[Skotlex]
  579. void status_calc_misc(struct status_data *status, int level);
  580. void status_freecast_switch(struct map_session_data *sd);
  581. int status_getrefinebonus(int lv,int type);
  582. int status_check_skilluse(struct block_list *src, struct block_list *target, int skill_num, int flag); // [Skotlex]
  583. int status_readdb(void);
  584. int do_init_status(void);
  585. #endif