root/src/map/status.h @ 19

Revision 19, 24.1 kB (checked in by jinshiro, 17 years ago)

Now Compiles with Cygwin GCC

RevLine 
[1]1// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
2// For more information, see LICENCE in the main folder
3
4#ifndef _STATUS_H_
5#define _STATUS_H_
6
7struct block_list;
8struct mob_data;
9struct pet_data;
10struct homun_data;
11struct status_change;
12
13//Use this to refer the max refinery level [Skotlex]
14#define MAX_REFINE 10
15#define MAX_REFINE_BONUS 5
16
17extern unsigned long StatusChangeFlagTable[];
18
19
20// Status changes listing. These code are for use by the server.
21typedef enum sc_type {
22        SC_NONE = -1,
23
24        //First we enumerate common status ailments which are often used around.
25        SC_STONE = 0,
26        SC_COMMON_MIN = 0, // begin
27        SC_FREEZE,
28        SC_STUN,
29        SC_SLEEP,
30        SC_POISON,
31        SC_CURSE,
32        SC_SILENCE,
33        SC_CONFUSION,
34        SC_BLIND,
35        SC_BLEEDING,
36        SC_DPOISON, //10
37        SC_COMMON_MAX = 10, // end
38       
39        //Next up, we continue on 20, to leave enough room for additional "common" ailments in the future.
40        SC_PROVOKE = 20,
41        SC_ENDURE,
42        SC_TWOHANDQUICKEN,
43        SC_CONCENTRATE,
44        SC_HIDING,
45        SC_CLOAKING,
46        SC_ENCPOISON,
47        SC_POISONREACT,
48        SC_QUAGMIRE,
49        SC_ANGELUS,
50        SC_BLESSING, //30
51        SC_SIGNUMCRUCIS,
52        SC_INCREASEAGI,
53        SC_DECREASEAGI,
54        SC_SLOWPOISON,
55        SC_IMPOSITIO  ,
56        SC_SUFFRAGIUM,
57        SC_ASPERSIO,
58        SC_BENEDICTIO,
59        SC_KYRIE,
60        SC_MAGNIFICAT, //40
61        SC_GLORIA,
62        SC_AETERNA,
63        SC_ADRENALINE,
64        SC_WEAPONPERFECTION,
65        SC_OVERTHRUST,
66        SC_MAXIMIZEPOWER,
67        SC_TRICKDEAD,
68        SC_LOUD,
69        SC_ENERGYCOAT,
70        SC_BROKENARMOR, //50 - NOTE: These two aren't used anywhere, and they have an icon...
71        SC_BROKENWEAPON,
72        SC_HALLUCINATION,
73        SC_WEIGHT50,
74        SC_WEIGHT90,
75        SC_ASPDPOTION0,
76        SC_ASPDPOTION1,
77        SC_ASPDPOTION2,
78        SC_ASPDPOTION3,
79        SC_SPEEDUP0,
80        SC_SPEEDUP1, //60
81        SC_ATKPOTION,
82        SC_MATKPOTION,
83        SC_WEDDING,
84        SC_SLOWDOWN,
85        SC_ANKLE,
86        SC_KEEPING,
87        SC_BARRIER,
88        SC_STRIPWEAPON,
89        SC_STRIPSHIELD,
90        SC_STRIPARMOR, //70
91        SC_STRIPHELM,
92        SC_CP_WEAPON,
93        SC_CP_SHIELD,
94        SC_CP_ARMOR,
95        SC_CP_HELM,
96        SC_AUTOGUARD,
97        SC_REFLECTSHIELD,
98        SC_SPLASHER,
99        SC_PROVIDENCE,
100        SC_DEFENDER, //80
101        SC_MAGICROD,
102        SC_SPELLBREAKER,
103        SC_AUTOSPELL,
104        SC_SIGHTTRASHER,
105        SC_AUTOBERSERK,
106        SC_SPEARQUICKEN,
107        SC_AUTOCOUNTER,
108        SC_SIGHT,
109        SC_SAFETYWALL,
110        SC_RUWACH, //90
111        SC_EXTREMITYFIST,
112        SC_EXPLOSIONSPIRITS,
113        SC_COMBO,
114        SC_BLADESTOP_WAIT,
115        SC_BLADESTOP,
116        SC_FIREWEAPON,
117        SC_WATERWEAPON,
118        SC_WINDWEAPON,
119        SC_EARTHWEAPON,
120        SC_VOLCANO, //100,
121        SC_DELUGE,
122        SC_VIOLENTGALE,
123        SC_WATK_ELEMENT,
124        SC_ARMOR,
125        SC_ARMOR_ELEMENT,
126        SC_NOCHAT,
127        SC_BABY,
128        SC_AURABLADE,
129        SC_PARRYING,
130        SC_CONCENTRATION, //110
131        SC_TENSIONRELAX,
132        SC_BERSERK,
133        SC_FURY,
134        SC_GOSPEL,
135        SC_ASSUMPTIO,
136        SC_BASILICA,
137        SC_GUILDAURA,
138        SC_MAGICPOWER,
139        SC_EDP,
140        SC_TRUESIGHT, //120
141        SC_WINDWALK,
142        SC_MELTDOWN,
143        SC_CARTBOOST,
144        SC_CHASEWALK,
145        SC_REJECTSWORD,
146        SC_MARIONETTE,
147        SC_MARIONETTE2,
148        SC_CHANGEUNDEAD,
149        SC_JOINTBEAT,
150        SC_MINDBREAKER, //130
151        SC_MEMORIZE,
152        SC_FOGWALL,
153        SC_SPIDERWEB,
154        SC_DEVOTION,
155        SC_SACRIFICE,
156        SC_STEELBODY,
157        SC_ORCISH,
158        SC_READYSTORM,
159        SC_READYDOWN,
160        SC_READYTURN, //140
161        SC_READYCOUNTER,
162        SC_DODGE,
163        SC_RUN,
164        SC_SHADOWWEAPON,
165        SC_ADRENALINE2,
166        SC_GHOSTWEAPON,
167        SC_KAIZEL,
168        SC_KAAHI,
169        SC_KAUPE,
170        SC_ONEHAND, //150
171        SC_PRESERVE,
172        SC_BATTLEORDERS,
173        SC_REGENERATION,
174        SC_DOUBLECAST,
175        SC_GRAVITATION,
176        SC_MAXOVERTHRUST,
177        SC_LONGING,
178        SC_HERMODE,
179        SC_SHRINK,
180        SC_SIGHTBLASTER, //160
181        SC_WINKCHARM,
182        SC_CLOSECONFINE,
183        SC_CLOSECONFINE2,
184        SC_DANCING,
185        SC_ELEMENTALCHANGE,
186        SC_RICHMANKIM,
187        SC_ETERNALCHAOS,
188        SC_DRUMBATTLE,
189        SC_NIBELUNGEN,
190        SC_ROKISWEIL, //170
191        SC_INTOABYSS,
192        SC_SIEGFRIED,
193        SC_WHISTLE,
194        SC_ASSNCROS,
195        SC_POEMBRAGI,
196        SC_APPLEIDUN,
197        SC_MODECHANGE,
198        SC_HUMMING,
199        SC_DONTFORGETME,
200        SC_FORTUNE, //180
201        SC_SERVICE4U,
202        SC_STOP,        //Prevents inflicted chars from walking. [Skotlex]
203        SC_SPURT,
204        SC_SPIRIT,
205        SC_COMA, //Not a real SC_, it makes a char's HP/SP hit 1.
206        SC_INTRAVISION,
207        SC_INCALLSTATUS,
208        SC_INCSTR,
209        SC_INCAGI,
210        SC_INCVIT, //190
211        SC_INCINT,
212        SC_INCDEX,
213        SC_INCLUK,
214        SC_INCHIT,
215        SC_INCHITRATE,
216        SC_INCFLEE,
217        SC_INCFLEERATE,
218        SC_INCMHPRATE,
219        SC_INCMSPRATE,
220        SC_INCATKRATE, //200
221        SC_INCMATKRATE,
222        SC_INCDEFRATE,
223        SC_STRFOOD,
224        SC_AGIFOOD,
225        SC_VITFOOD,
226        SC_INTFOOD,
227        SC_DEXFOOD,
228        SC_LUKFOOD,
229        SC_HITFOOD,
230        SC_FLEEFOOD, //210
231        SC_BATKFOOD,
232        SC_WATKFOOD,
233        SC_MATKFOOD,
234        SC_SCRESIST, //Increases resistance to status changes.
235        SC_XMAS, // Xmas Suit [Valaris]
236        SC_WARM, //SG skills [Komurka]
237        SC_SUN_COMFORT,
238        SC_MOON_COMFORT,
239        SC_STAR_COMFORT,
240        SC_FUSION, //220
241        SC_SKILLRATE_UP,
242        SC_SKE,
243        SC_KAITE,
244        SC_SWOO, // [marquis007]
245        SC_SKA, // [marquis007]
246        SC_TKREST, // [marquis007]
247        SC_MIRACLE, //SG 'hidden' skill [Komurka]
248        SC_MADNESSCANCEL,
249        SC_ADJUSTMENT,
250        SC_INCREASING,  //230
251        SC_GATLINGFEVER,
252        SC_TATAMIGAESHI,
253        SC_UTSUSEMI,
254        SC_BUNSINJYUTSU,
255        SC_KAENSIN,
256        SC_SUITON,
257        SC_NEN,
258        SC_KNOWLEDGE,
259        SC_SMA,
260        SC_FLING,       //240
261        SC_AVOID,
262        SC_CHANGE,
263        SC_BLOODLUST,
264        SC_FLEET,
265        SC_SPEED,
266        SC_DEFENCE,
267        SC_INCASPDRATE,
268        SC_INCFLEE2,
269        SC_JAILED,
270        SC_ENCHANTARMS, //250
271        SC_MAGICALATTACK,
272        SC_ARMORCHANGE,
273        SC_CRITICALWOUND,
274        SC_MAGICMIRROR,
275        SC_SLOWCAST,
276        SC_SUMMER,
277        SC_EXPBOOST,
278        SC_ITEMBOOST,
279        SC_BOSSMAPINFO, 
280        SC_LIFEINSURANCE, //260
281        SC_INCCRI,
282        SC_INCDEF,
283        SC_INCBASEATK,
284        SC_FASTCAST,
285        SC_MDEF_RATE,
286        SC_HPREGEN,
287        SC_INCHEALRATE,
288        SC_PNEUMA,
289        SC_AUTOTRADE,
290        SC_KSPROTECTED,
291        SC_ARMOR_RESIST,
292        SC_SPCOST_RATE,
293        SC_COMMONSC_RESIST,
294        SC_SEVENWIND,
295        SC_DEF_RATE,
[19]296        SC_DECREPIFY, // New status [brain]
297        SC_LUST,
298        SC_DARKMOON,
299        SC_REQUIEM,
300        SC_DEATHPACT,
301        SC_ATFIELD,
302        SC_SUFFER,
303        SC_SEARING,
304        SC_IMMOLATE,
305        SC_AGONY,
306        SC_CURSETONGUES,
307        SC_DOOM,
308        SC_CURSEWEAKNESS,
309        SC_CURSEEXHAUST,
310        SC_OVERWHELMING,
311        SC_FEAR,
[1]312        SC_SPREGEN,
313        SC_WALKSPEED,
[19]314<<<<<<< .mine
315=======
[10]316        //Custom Jobs (blackmagic)
[13]317        SC_DECREPIFY, // New status [brain]
318        SC_LUST,
319        SC_DARKMOON,
320        SC_REQUIEM,
321        SC_DEATHPACT,
322        SC_ATFIELD,
323        SC_SUFFER,
324        SC_SEARING,
325        SC_IMMOLATE,
326        SC_AGONY,
327        SC_CURSETONGUES,
328        SC_DOOM,
329        SC_CURSEWEAKNESS,
330        SC_CURSEEXHAUST,
331        SC_OVERWHELMING,
[10]332        SC_FEAR,
333//Custom Job End
[19]334>>>>>>> .r18
[1]335        SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
336} sc_type;
337
338//Numerates the Number for the status changes (client-dependent), imported from jA
339enum si_type {
340        SI_BLANK                = -1,
341        SI_PROVOKE              = 0,
342        SI_ENDURE               = 1,
343        SI_TWOHANDQUICKEN       = 2,
344        SI_CONCENTRATE          = 3,
345        SI_HIDING               = 4,
346        SI_CLOAKING             = 5,
347        SI_ENCPOISON            = 6,
348        SI_POISONREACT          = 7,
349        SI_QUAGMIRE             = 8,
350        SI_ANGELUS              = 9,
351        SI_BLESSING             = 10,
352        SI_SIGNUMCRUCIS         = 11,
353        SI_INCREASEAGI          = 12,
354        SI_DECREASEAGI          = 13,
355        SI_SLOWPOISON           = 14,
356        SI_IMPOSITIO            = 15,
357        SI_SUFFRAGIUM           = 16,
358        SI_ASPERSIO             = 17,
359        SI_BENEDICTIO           = 18,
360        SI_KYRIE                = 19,
361        SI_MAGNIFICAT           = 20,
362        SI_GLORIA               = 21,
363        SI_AETERNA              = 22,
364        SI_ADRENALINE           = 23,
365        SI_WEAPONPERFECTION     = 24,
366        SI_OVERTHRUST           = 25,
367        SI_MAXIMIZEPOWER        = 26,
368        SI_RIDING               = 27,
369        SI_FALCON               = 28,
370        SI_TRICKDEAD            = 29,
371        SI_LOUD                 = 30,
372        SI_ENERGYCOAT           = 31,
373        SI_BROKENARMOR          = 32,
374        SI_BROKENWEAPON         = 33,
375        SI_HALLUCINATION        = 34,
376        SI_WEIGHT50             = 35,
377        SI_WEIGHT90             = 36,
378        SI_ASPDPOTION           = 37,
379        //38: Again Aspd Potion
380        //39: Again Aspd Potion
381        //40: Again Aspd Potion
382        SI_SPEEDPOTION1         = 41,
383        SI_SPEEDPOTION2         = 42,
384        SI_STRIPWEAPON          = 50,
385        SI_STRIPSHIELD          = 51,
386        SI_STRIPARMOR           = 52,
387        SI_STRIPHELM            = 53,
388        SI_CP_WEAPON            = 54,
389        SI_CP_SHIELD            = 55,
390        SI_CP_ARMOR             = 56,
391        SI_CP_HELM              = 57,
392        SI_AUTOGUARD            = 58,
393        SI_REFLECTSHIELD        = 59,
394        SI_PROVIDENCE           = 61,
395        SI_DEFENDER             = 62,
396        SI_AUTOSPELL            = 65,
397        SI_SPEARQUICKEN         = 68,
398        SI_EXPLOSIONSPIRITS     = 86,
399        SI_STEELBODY            = 87,
400        SI_FIREWEAPON           = 90,
401        SI_WATERWEAPON          = 91,
402        SI_WINDWEAPON           = 92,
403        SI_EARTHWEAPON          = 93,
404        SI_STOP                 = 95,
405        SI_UNDEAD               = 97,
406// 102 = again gloria - from what I saw on screenshots, I wonder if it isn't gospel... [DracoRPG]
407        SI_AURABLADE            = 103,
408        SI_PARRYING             = 104,
409        SI_CONCENTRATION        = 105,
410        SI_TENSIONRELAX         = 106,
411        SI_BERSERK              = 107,
412        SI_ASSUMPTIO            = 110,
413        SI_LANDENDOW            = 112,
414        SI_MAGICPOWER           = 113,
415        SI_EDP                  = 114,
416        SI_TRUESIGHT            = 115,
417        SI_WINDWALK             = 116,
418        SI_MELTDOWN             = 117,
419        SI_CARTBOOST            = 118,
420        //119, blank
421        SI_REJECTSWORD          = 120,
422        SI_MARIONETTE           = 121,
423        SI_MARIONETTE2          = 122,
424        SI_MOONLIT              = 123,
425        SI_BLEEDING             = 124,
426        SI_JOINTBEAT            = 125,
427        SI_BABY                 = 130,
428        SI_AUTOBERSERK          = 132,
429        SI_RUN                  = 133,
430        SI_BUMP                 = 134,
431        SI_READYSTORM           = 135,
432        SI_READYDOWN            = 137,
433        SI_READYTURN            = 139,
434        SI_READYCOUNTER         = 141,
435        SI_DODGE                = 143,
436        //SI_RUN                = 144,  //is not RUN. need info on what this is.
437        SI_SPURT                = 145,
438        SI_SHADOWWEAPON         = 146,
439        SI_ADRENALINE2          = 147,
440        SI_GHOSTWEAPON          = 148,
441        SI_SPIRIT               = 149,
442        SI_DEVIL                = 152,
443        SI_KAITE                = 153,
444        SI_KAIZEL               = 156,
445        SI_KAAHI                = 157,
446        SI_KAUPE                = 158,
447        SI_SMA                  = 159,
448        SI_NIGHT                = 160,
449        SI_ONEHAND              = 161,
450        SI_WARM                 = 165, 
451//      166 | The three show the exact same display: ultra red character (165, 166, 167)       
452//      167 |   
453        SI_SUN_COMFORT          = 169,
454        SI_MOON_COMFORT         = 170, 
455        SI_STAR_COMFORT         = 171, 
456        SI_PRESERVE             = 181,
457        SI_INCSTR               = 182,
458        SI_INTRAVISION          = 184,
459        SI_DOUBLECAST           = 186,
460        SI_MAXOVERTHRUST        = 188,
461        SI_TAROT                = 191, // the icon allows no doubt... but what is it really used for ?? [DracoRPG]
462        SI_SHRINK               = 197,
463        SI_SIGHTBLASTER         = 198,
464        SI_WINKCHARM            = 199,
465        SI_CLOSECONFINE         = 200,
466        SI_CLOSECONFINE2        = 201,
467        SI_MADNESSCANCEL        = 203,  //[blackhole89]
468        SI_GATLINGFEVER         = 204,
469        SI_TKREST = 205, // 205 = Gloria again (but TK- Happy State looks like it)
470        SI_UTSUSEMI             = 206,
471        SI_BUNSINJYUTSU         = 207,
472        SI_NEN                  = 208,
473        SI_ADJUSTMENT           = 209,
474        SI_ACCURACY             = 210,
475        SI_FOODSTR              = 241,
476        SI_FOODAGI              = 242,
477        SI_FOODVIT              = 243,
478        SI_FOODDEX              = 244,
479        SI_FOODINT              = 245,
480        SI_FOODLUK              = 246,
481        SI_FOODFLEE             = 247,
482        SI_FOODHIT              = 248,
483        SI_FOODCRI              = 249,
484        SI_EXPBOOST             = 250,
485        SI_LIFEINSURANCE        = 251,
486        SI_ITEMBOOST            = 252,
487        SI_BOSSMAPINFO          = 253,
488        //SI_TURTLEGENERAL      = 260, //All mobs display as Turtle General
[10]489        SI_BIOMOBTRICKDEAD      = 263, //Bio Mob effect on you and SI_TRICKDEAD
[1]490        //SI_BLURRY             = 264, //For short time blurry screen and get Gloria icon
491        //SI_FOODSTR            = 271, //Same as 241
492        //SI_FOODAGI            = 272, //Same as 242
493        //SI_FOODVIT            = 273, //Same as 243
494        //SI_FOODDEX            = 274, //Same as 244
495        //SI_FOODINT            = 275, //Same as 245
496        //SI_FOODLUK            = 276, //Same as 246
497        SI_SLOWCAST             = 282,
498        SI_CRITICALWOUND        = 286,
499        SI_DEF_RATE             = 290,
500        SI_MDEF_RATE    = 291,
501        SI_INCCRI               = 292,
502        SI_INCHEALRATE  = 293,
503        SI_HPREGEN              = 294,
504        // 295 Sword ?
505        SI_SPCOST_RATE  = 300,
506        SI_COMMONSC_RESIST      = 301,
507        SI_ARMOR_RESIST = 302,
508};
509
510// JOINTBEAT stackable ailments
511#define BREAK_ANKLE    0x01 // MoveSpeed reduced by 50%
512#define BREAK_WRIST    0x02 // ASPD reduced by 25%
513#define BREAK_KNEE     0x04 // MoveSpeed reduced by 30%, ASPD reduced by 10%
514#define BREAK_SHOULDER 0x08 // DEF reduced by 50%
515#define BREAK_WAIST    0x10 // DEF reduced by 25%, ATK reduced by 25%
516#define BREAK_NECK     0x20 // current attack does 2x damage, inflicts 'bleeding' for 30 seconds
517#define BREAK_FLAGS    ( BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK )
518
519extern int current_equip_item_index;
520extern int current_equip_card_id;
521
522extern int percentrefinery[5][MAX_REFINE+1]; //The last slot always has a 0% success chance [Skotlex]
523
524//Mode definitions to clear up code reading. [Skotlex]
525#define MD_CANMOVE 0x0001
526#define MD_LOOTER 0x0002
527#define MD_AGGRESSIVE 0x0004
528#define MD_ASSIST 0x0008
529#define MD_CASTSENSOR_IDLE 0x0010
530#define MD_BOSS 0x0020
531#define MD_PLANT 0x0040
532#define MD_CANATTACK 0x0080
533#define MD_DETECTOR 0x0100
534#define MD_CASTSENSOR_CHASE 0x0200
535#define MD_CHANGECHASE 0x0400
536#define MD_ANGRY 0x0800
537#define MD_CHANGETARGET_MELEE 0x1000
538#define MD_CHANGETARGET_CHASE 0x2000
539#define MD_MASK 0xFFFF
540
541//Status change option definitions (options are what makes status changes visible to chars
542//who were not on your field of sight when it happened)
543//opt1: Non stackable status changes.
544enum {
545        OPT1_STONE = 1, //Petrified
546        OPT1_FREEZE,
547        OPT1_STUN,
548        OPT1_SLEEP,
549        //Aegis uses OPT1 = 5 to identify undead enemies (which also grants them immunity to the other opt1 changes)
550        OPT1_STONEWAIT=6 //Petrifying
551};
552
553//opt2: Stackable status changes.
554#define OPT2_POISON       0x0001
555#define OPT2_CURSE        0x0002
556#define OPT2_SILENCE      0x0004
557#define OPT2_SIGNUMCRUCIS 0x0008
558#define OPT2_BLIND        0x0010
559#define OPT2_ANGELUS      0x0020
560#define OPT2_BLEEDING     0x0040
561#define OPT2_DPOISON      0x0080
562
563#define OPTION_SIGHT 0x00000001
564#define OPTION_HIDE 0x00000002
565#define OPTION_CLOAK 0x00000004
566#define OPTION_CART1 0x00000008
567#define OPTION_FALCON 0x00000010
568#define OPTION_RIDING 0x00000020
569#define OPTION_INVISIBLE 0x00000040
570#define OPTION_CART2 0x00000080
571#define OPTION_CART3 0x00000100
572#define OPTION_CART4 0x00000200
573#define OPTION_CART5 0x00000400
574#define OPTION_ORCISH 0x00000800
575#define OPTION_WEDDING 0x00001000
576#define OPTION_RUWACH 0x00002000
577#define OPTION_CHASEWALK 0x00004000
578//Note that clientside Flying and Xmas are 0x8000 for clients prior to 2007.
579#define OPTION_FLYING 0x0008000
580#define OPTION_XMAS 0x00010000
581#define OPTION_SUMMER 0x00040000
582
583#define OPTION_CART (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5)
584
585#define OPTION_MASK ~0x40
586
587//Defines for the manner system [Skotlex]
588#define MANNER_NOCHAT 0x01
589#define MANNER_NOSKILL 0x02
590#define MANNER_NOCOMMAND 0x04
591#define MANNER_NOITEM 0x08
592#define MANNER_NOROOM 0x10
593
594//Define flags for the status_calc_bl function. [Skotlex]
595enum scb_flag
596{
597        SCB_NONE    = 0x00000000,
598        SCB_BASE    = 0x00000001,
599        SCB_MAXHP   = 0x00000002,
600        SCB_MAXSP   = 0x00000004,
601        SCB_STR     = 0x00000008,
602        SCB_AGI     = 0x00000010,
603        SCB_VIT     = 0x00000020,
604        SCB_INT     = 0x00000040,
605        SCB_DEX     = 0x00000080,
606        SCB_LUK     = 0x00000100,
607        SCB_BATK    = 0x00000200,
608        SCB_WATK    = 0x00000400,
609        SCB_MATK    = 0x00000800,
610        SCB_HIT     = 0x00001000,
611        SCB_FLEE    = 0x00002000,
612        SCB_DEF     = 0x00004000,
613        SCB_DEF2    = 0x00008000,
614        SCB_MDEF    = 0x00010000,
615        SCB_MDEF2   = 0x00020000,
616        SCB_SPEED   = 0x00040000,
617        SCB_ASPD    = 0x00080000,
618        SCB_DSPD    = 0x00100000,
619        SCB_CRI     = 0x00200000,
620        SCB_FLEE2   = 0x00400000,
621        SCB_ATK_ELE = 0x00800000,
622        SCB_DEF_ELE = 0x01000000,
623        SCB_MODE    = 0x02000000,
624        SCB_SIZE    = 0x04000000,
625        SCB_RACE    = 0x08000000,
626        SCB_RANGE   = 0x10000000,
627        SCB_REGEN   = 0x20000000,
628        SCB_DYE     = 0x40000000, // force cloth-dye change to 0 to avoid client crashes.
629        SCB_PC      = 0x80000000,
630
631        SCB_ALL     = 0x3FFFFFFF
632};
633
634//Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex]
635#define BL_CONSUME (BL_PC|BL_HOM)
636//Define to determine who has regen
637#define BL_REGEN (BL_PC|BL_HOM)
638
639
640//Basic damage info of a weapon
641//Required because players have two of these, one in status_data
642//and another for their left hand weapon.
643struct weapon_atk {
644        unsigned short atk, atk2;
645        unsigned short range;
646        unsigned char ele;
647};
648
649
650//For holding basic status (which can be modified by status changes)
651struct status_data {
652        unsigned int
653                hp, sp,
654                max_hp, max_sp;
655        unsigned short
656                str, agi, vit, int_, dex, luk,
657                batk,
658                matk_min, matk_max,
659                speed,
660                amotion, adelay, dmotion,
661                mode;
662        short 
663                hit, flee, cri, flee2,
664                def2, mdef2,
665                aspd_rate;
666        unsigned char
667                def_ele, ele_lv,
668                size, race;
669        signed char
670                def, mdef;
671        struct weapon_atk rhw, lhw; //Right Hand/Left Hand Weapon.
672};
673
674//Additional regen data that only players have.
675struct regen_data_sub {
676        unsigned short
677                hp,sp;
678
679        //tick accumulation before healing.
680        struct {
681                unsigned int hp,sp;
682        } tick;
683       
684        //Regen rates (where every 1 means +100% regen)
685        struct {
686                unsigned char hp,sp;
687        } rate;
688};
689
690struct regen_data {
691
692        unsigned short flag; //Marks what stuff you may heal or not.
693        unsigned short
694                hp,sp,shp,ssp;
695
696        //tick accumulation before healing.
697        struct {
698                unsigned int hp,sp,shp,ssp;
699        } tick;
700       
701        //Regen rates (where every 1 means +100% regen)
702        struct {
703                unsigned char
704                hp,sp,shp,ssp;
705        } rate;
706       
707        struct {
708                unsigned walk:1; //Can you regen even when walking?
709                unsigned gc:1;  //Tags when you should have double regen due to GVG castle
710                unsigned overweight :2; //overweight state (1: 50%, 2: 90%)
711                unsigned block :2; //Block regen flag (1: Hp, 2: Sp)
712        } state;
713
714        //skill-regen, sitting-skill-regen (since not all chars with regen need it)
715        struct regen_data_sub *sregen, *ssregen;
716};
717
718struct status_change_entry {
719        int timer;
720        int val1,val2,val3,val4;
721};
722
723struct status_change {
724        unsigned int option;// effect state (bitfield)
725        unsigned int opt3;// skill state (bitfield)
726        unsigned short opt1;// body state
727        unsigned short opt2;// health state (bitfield)
728        unsigned char count;
729        //TODO: See if it is possible to implement the following SC's without requiring extra parameters while the SC is inactive.
730        unsigned char jb_flag; //Joint Beat type flag
731        unsigned short mp_matk_min, mp_matk_max; //Previous matk min/max for ground spells (Amplify magic power)
732        int sg_id; //ID of the previous Storm gust that hit you
733        unsigned char sg_counter; //Storm gust counter (previous hits from storm gust)
734        struct status_change_entry *data[SC_MAX];
735};
736
737// for looking up associated data
738sc_type status_skill2sc(int skill);
739int status_sc2skill(sc_type sc);
740
741int status_damage(struct block_list *src,struct block_list *target,int hp,int sp, int walkdelay, int flag);
742//Define for standard HP damage attacks.
743#define status_fix_damage(src, target, hp, walkdelay) status_damage(src, target, hp, 0, walkdelay, 0)
744//Define for standard HP/SP damage triggers.
745#define status_zap(bl, hp, sp) status_damage(NULL, bl, hp, sp, 0, 1)
746//Define for standard HP/SP skill-related cost triggers (mobs require no HP/SP to use skills)
747int status_charge(struct block_list* bl, int hp, int sp);
748int status_percent_change(struct block_list *src,struct block_list *target,signed char hp_rate, signed char sp_rate, int flag);
749//Easier handling of status_percent_change
750#define status_percent_heal(bl, hp_rate, sp_rate) status_percent_change(NULL, bl, -(hp_rate), -(sp_rate), 0)
751#define status_percent_damage(src, target, hp_rate, sp_rate, kill) status_percent_change(src, target, hp_rate, sp_rate, (kill)?1:2)
752//Instant kill with no drops/exp/etc
753#define status_kill(bl) status_percent_damage(NULL, bl, 100, 0, true)
754//Used to set the hp/sp of an object to an absolute value (can't kill)
755int status_set_hp(struct block_list *bl, unsigned int hp, int flag);
756int status_set_sp(struct block_list *bl, unsigned int sp, int flag);
757int status_heal(struct block_list *bl,int hp,int sp, int flag);
758int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp);
759
760//Define for copying a status_data structure from b to a, without overwriting current Hp and Sp
761#define status_cpy(a, b) \
762        memcpy(&((a)->max_hp), &((b)->max_hp), sizeof(struct status_data)-(sizeof((a)->hp)+sizeof((a)->sp)))
763
764struct regen_data *status_get_regen_data(struct block_list *bl);
765struct status_data *status_get_status_data(struct block_list *bl);
766struct status_data *status_get_base_status(struct block_list *bl);
767const char * status_get_name(struct block_list *bl);
768int status_get_class(struct block_list *bl);
769int status_get_lv(struct block_list *bl);
770#define status_get_range(bl) status_get_status_data(bl)->rhw.range
771#define status_get_hp(bl) status_get_status_data(bl)->hp
772#define status_get_max_hp(bl) status_get_status_data(bl)->max_hp
773#define status_get_sp(bl) status_get_status_data(bl)->sp
774#define status_get_max_sp(bl) status_get_status_data(bl)->max_sp
775#define status_get_str(bl) status_get_status_data(bl)->str
776#define status_get_agi(bl) status_get_status_data(bl)->agi
777#define status_get_vit(bl) status_get_status_data(bl)->vit
778#define status_get_int(bl) status_get_status_data(bl)->int_
779#define status_get_dex(bl) status_get_status_data(bl)->dex
780#define status_get_luk(bl) status_get_status_data(bl)->luk
781#define status_get_hit(bl) status_get_status_data(bl)->hit
782#define status_get_flee(bl) status_get_status_data(bl)->flee
783signed char status_get_def(struct block_list *bl);
784#define status_get_mdef(bl) status_get_status_data(bl)->mdef
785#define status_get_flee2(bl) status_get_status_data(bl)->flee2
786#define status_get_def2(bl) status_get_status_data(bl)->def2
787#define status_get_mdef2(bl) status_get_status_data(bl)->mdef2
788#define status_get_critical(bl)  status_get_status_data(bl)->cri
789#define status_get_batk(bl) status_get_status_data(bl)->batk
790#define status_get_watk(bl) status_get_status_data(bl)->rhw.atk
791#define status_get_watk2(bl) status_get_status_data(bl)->rhw.atk2
792#define status_get_matk_max(bl) status_get_status_data(bl)->matk_max
793#define status_get_matk_min(bl) status_get_status_data(bl)->matk_min
794#define status_get_lwatk(bl) status_get_status_data(bl)->lhw.atk
795#define status_get_lwatk2(bl) status_get_status_data(bl)->lhw.atk2
796unsigned short status_get_speed(struct block_list *bl);
797#define status_get_adelay(bl) status_get_status_data(bl)->adelay
798#define status_get_amotion(bl) status_get_status_data(bl)->amotion
799#define status_get_dmotion(bl) status_get_status_data(bl)->dmotion
800#define status_get_element(bl) status_get_status_data(bl)->def_ele
801#define status_get_element_level(bl) status_get_status_data(bl)->ele_lv
802unsigned char status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element);
803#define status_get_attack_sc_element(bl, sc) status_calc_attack_element(bl, sc, 0)
804#define status_get_attack_element(bl) status_get_status_data(bl)->rhw.ele
805#define status_get_attack_lelement(bl) status_get_status_data(bl)->lhw.ele
806#define status_get_race(bl) status_get_status_data(bl)->race
807#define status_get_size(bl) status_get_status_data(bl)->size
808#define status_get_mode(bl) status_get_status_data(bl)->mode
809int status_get_party_id(struct block_list *bl);
810int status_get_guild_id(struct block_list *bl);
811int status_get_emblem_id(struct block_list *bl);
812int status_get_mexp(struct block_list *bl);
813int status_get_race2(struct block_list *bl);
814
815struct view_data *status_get_viewdata(struct block_list *bl);
816void status_set_viewdata(struct block_list *bl, int class_);
817void status_change_init(struct block_list *bl);
818struct status_change *status_get_sc(struct block_list *bl);
819
820int status_isdead(struct block_list *bl);
821int status_isimmune(struct block_list *bl);
822
823int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int tick, int flag);
824//Short version, receives rate in 1->100 range, and does not uses a flag setting.
825#define sc_start(bl, type, rate, val1, tick) status_change_start(bl,type,100*(rate),val1,0,0,0,tick,0)
826#define sc_start2(bl, type, rate, val1, val2, tick) status_change_start(bl,type,100*(rate),val1,val2,0,0,tick,0)
827#define sc_start4(bl, type, rate, val1, val2, val3, val4, tick) status_change_start(bl,type,100*(rate),val1,val2,val3,val4,tick,0)
828
829int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,int flag);
830int status_change_end(struct block_list* bl, enum sc_type type, int tid);
831int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr data);
832int status_change_timer(int tid, unsigned int tick, int id, intptr data);
833int status_change_timer_sub(struct block_list* bl, va_list ap);
834int status_change_clear(struct block_list* bl, int type);
835int status_change_clear_buffs(struct block_list* bl, int type);
836
837void status_calc_bl(struct block_list *bl, unsigned long flag);
838int status_calc_pet(struct pet_data* pd, int first); // [Skotlex]
839int status_calc_pc(struct map_session_data* sd,int first);
840int status_calc_mob(struct mob_data* md, int first); //[Skotlex]
841int status_calc_homunculus(struct homun_data *hd, int first);
842void status_calc_misc(struct block_list *bl, struct status_data *status, int level);
843void status_calc_regen(struct block_list *bl, struct status_data *status, struct regen_data *regen);
844void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, struct status_change *sc);
845
846void status_freecast_switch(struct map_session_data *sd);
847int status_getrefinebonus(int lv,int type);
848int status_check_skilluse(struct block_list *src, struct block_list *target, int skill_num, int flag); // [Skotlex]
849int status_check_visibility(struct block_list *src, struct block_list *target); //[Skotlex]
850
851int status_readdb(void);
852int do_init_status(void);
853void do_final_status(void);
854
855#endif /* _STATUS_H_ */
Note: See TracBrowser for help on using the browser.