root/src/map/status.h @ 13

Revision 13, 23.8 kB (checked in by jinshiro, 17 years ago)
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,
296        SC_SPREGEN,
297        SC_WALKSPEED,
[10]298        //Custom Jobs (blackmagic)
[13]299        SC_DECREPIFY, // New status [brain]
300        SC_LUST,
301        SC_DARKMOON,
302        SC_REQUIEM,
303        SC_DEATHPACT,
304        SC_ATFIELD,
305        SC_SUFFER,
306        SC_SEARING,
307        SC_IMMOLATE,
308        SC_AGONY,
309        SC_CURSETONGUES,
310        SC_DOOM,
311        SC_CURSEWEAKNESS,
312        SC_CURSEEXHAUST,
313        SC_OVERWHELMING,
[10]314        SC_FEAR,
315//Custom Job End
[1]316        SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
317} sc_type;
318
319//Numerates the Number for the status changes (client-dependent), imported from jA
320enum si_type {
321        SI_BLANK                = -1,
322        SI_PROVOKE              = 0,
323        SI_ENDURE               = 1,
324        SI_TWOHANDQUICKEN       = 2,
325        SI_CONCENTRATE          = 3,
326        SI_HIDING               = 4,
327        SI_CLOAKING             = 5,
328        SI_ENCPOISON            = 6,
329        SI_POISONREACT          = 7,
330        SI_QUAGMIRE             = 8,
331        SI_ANGELUS              = 9,
332        SI_BLESSING             = 10,
333        SI_SIGNUMCRUCIS         = 11,
334        SI_INCREASEAGI          = 12,
335        SI_DECREASEAGI          = 13,
336        SI_SLOWPOISON           = 14,
337        SI_IMPOSITIO            = 15,
338        SI_SUFFRAGIUM           = 16,
339        SI_ASPERSIO             = 17,
340        SI_BENEDICTIO           = 18,
341        SI_KYRIE                = 19,
342        SI_MAGNIFICAT           = 20,
343        SI_GLORIA               = 21,
344        SI_AETERNA              = 22,
345        SI_ADRENALINE           = 23,
346        SI_WEAPONPERFECTION     = 24,
347        SI_OVERTHRUST           = 25,
348        SI_MAXIMIZEPOWER        = 26,
349        SI_RIDING               = 27,
350        SI_FALCON               = 28,
351        SI_TRICKDEAD            = 29,
352        SI_LOUD                 = 30,
353        SI_ENERGYCOAT           = 31,
354        SI_BROKENARMOR          = 32,
355        SI_BROKENWEAPON         = 33,
356        SI_HALLUCINATION        = 34,
357        SI_WEIGHT50             = 35,
358        SI_WEIGHT90             = 36,
359        SI_ASPDPOTION           = 37,
360        //38: Again Aspd Potion
361        //39: Again Aspd Potion
362        //40: Again Aspd Potion
363        SI_SPEEDPOTION1         = 41,
364        SI_SPEEDPOTION2         = 42,
365        SI_STRIPWEAPON          = 50,
366        SI_STRIPSHIELD          = 51,
367        SI_STRIPARMOR           = 52,
368        SI_STRIPHELM            = 53,
369        SI_CP_WEAPON            = 54,
370        SI_CP_SHIELD            = 55,
371        SI_CP_ARMOR             = 56,
372        SI_CP_HELM              = 57,
373        SI_AUTOGUARD            = 58,
374        SI_REFLECTSHIELD        = 59,
375        SI_PROVIDENCE           = 61,
376        SI_DEFENDER             = 62,
377        SI_AUTOSPELL            = 65,
378        SI_SPEARQUICKEN         = 68,
379        SI_EXPLOSIONSPIRITS     = 86,
380        SI_STEELBODY            = 87,
381        SI_FIREWEAPON           = 90,
382        SI_WATERWEAPON          = 91,
383        SI_WINDWEAPON           = 92,
384        SI_EARTHWEAPON          = 93,
385        SI_STOP                 = 95,
386        SI_UNDEAD               = 97,
387// 102 = again gloria - from what I saw on screenshots, I wonder if it isn't gospel... [DracoRPG]
388        SI_AURABLADE            = 103,
389        SI_PARRYING             = 104,
390        SI_CONCENTRATION        = 105,
391        SI_TENSIONRELAX         = 106,
392        SI_BERSERK              = 107,
393        SI_ASSUMPTIO            = 110,
394        SI_LANDENDOW            = 112,
395        SI_MAGICPOWER           = 113,
396        SI_EDP                  = 114,
397        SI_TRUESIGHT            = 115,
398        SI_WINDWALK             = 116,
399        SI_MELTDOWN             = 117,
400        SI_CARTBOOST            = 118,
401        //119, blank
402        SI_REJECTSWORD          = 120,
403        SI_MARIONETTE           = 121,
404        SI_MARIONETTE2          = 122,
405        SI_MOONLIT              = 123,
406        SI_BLEEDING             = 124,
407        SI_JOINTBEAT            = 125,
408        SI_BABY                 = 130,
409        SI_AUTOBERSERK          = 132,
410        SI_RUN                  = 133,
411        SI_BUMP                 = 134,
412        SI_READYSTORM           = 135,
413        SI_READYDOWN            = 137,
414        SI_READYTURN            = 139,
415        SI_READYCOUNTER         = 141,
416        SI_DODGE                = 143,
417        //SI_RUN                = 144,  //is not RUN. need info on what this is.
418        SI_SPURT                = 145,
419        SI_SHADOWWEAPON         = 146,
420        SI_ADRENALINE2          = 147,
421        SI_GHOSTWEAPON          = 148,
422        SI_SPIRIT               = 149,
423        SI_DEVIL                = 152,
424        SI_KAITE                = 153,
425        SI_KAIZEL               = 156,
426        SI_KAAHI                = 157,
427        SI_KAUPE                = 158,
428        SI_SMA                  = 159,
429        SI_NIGHT                = 160,
430        SI_ONEHAND              = 161,
431        SI_WARM                 = 165, 
432//      166 | The three show the exact same display: ultra red character (165, 166, 167)       
433//      167 |   
434        SI_SUN_COMFORT          = 169,
435        SI_MOON_COMFORT         = 170, 
436        SI_STAR_COMFORT         = 171, 
437        SI_PRESERVE             = 181,
438        SI_INCSTR               = 182,
439        SI_INTRAVISION          = 184,
440        SI_DOUBLECAST           = 186,
441        SI_MAXOVERTHRUST        = 188,
442        SI_TAROT                = 191, // the icon allows no doubt... but what is it really used for ?? [DracoRPG]
443        SI_SHRINK               = 197,
444        SI_SIGHTBLASTER         = 198,
445        SI_WINKCHARM            = 199,
446        SI_CLOSECONFINE         = 200,
447        SI_CLOSECONFINE2        = 201,
448        SI_MADNESSCANCEL        = 203,  //[blackhole89]
449        SI_GATLINGFEVER         = 204,
450        SI_TKREST = 205, // 205 = Gloria again (but TK- Happy State looks like it)
451        SI_UTSUSEMI             = 206,
452        SI_BUNSINJYUTSU         = 207,
453        SI_NEN                  = 208,
454        SI_ADJUSTMENT           = 209,
455        SI_ACCURACY             = 210,
456        SI_FOODSTR              = 241,
457        SI_FOODAGI              = 242,
458        SI_FOODVIT              = 243,
459        SI_FOODDEX              = 244,
460        SI_FOODINT              = 245,
461        SI_FOODLUK              = 246,
462        SI_FOODFLEE             = 247,
463        SI_FOODHIT              = 248,
464        SI_FOODCRI              = 249,
465        SI_EXPBOOST             = 250,
466        SI_LIFEINSURANCE        = 251,
467        SI_ITEMBOOST            = 252,
468        SI_BOSSMAPINFO          = 253,
469        //SI_TURTLEGENERAL      = 260, //All mobs display as Turtle General
[10]470        SI_BIOMOBTRICKDEAD      = 263, //Bio Mob effect on you and SI_TRICKDEAD
[1]471        //SI_BLURRY             = 264, //For short time blurry screen and get Gloria icon
472        //SI_FOODSTR            = 271, //Same as 241
473        //SI_FOODAGI            = 272, //Same as 242
474        //SI_FOODVIT            = 273, //Same as 243
475        //SI_FOODDEX            = 274, //Same as 244
476        //SI_FOODINT            = 275, //Same as 245
477        //SI_FOODLUK            = 276, //Same as 246
478        SI_SLOWCAST             = 282,
479        SI_CRITICALWOUND        = 286,
480        SI_DEF_RATE             = 290,
481        SI_MDEF_RATE    = 291,
482        SI_INCCRI               = 292,
483        SI_INCHEALRATE  = 293,
484        SI_HPREGEN              = 294,
485        // 295 Sword ?
486        SI_SPCOST_RATE  = 300,
487        SI_COMMONSC_RESIST      = 301,
488        SI_ARMOR_RESIST = 302,
489};
490
491// JOINTBEAT stackable ailments
492#define BREAK_ANKLE    0x01 // MoveSpeed reduced by 50%
493#define BREAK_WRIST    0x02 // ASPD reduced by 25%
494#define BREAK_KNEE     0x04 // MoveSpeed reduced by 30%, ASPD reduced by 10%
495#define BREAK_SHOULDER 0x08 // DEF reduced by 50%
496#define BREAK_WAIST    0x10 // DEF reduced by 25%, ATK reduced by 25%
497#define BREAK_NECK     0x20 // current attack does 2x damage, inflicts 'bleeding' for 30 seconds
498#define BREAK_FLAGS    ( BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK )
499
500extern int current_equip_item_index;
501extern int current_equip_card_id;
502
503extern int percentrefinery[5][MAX_REFINE+1]; //The last slot always has a 0% success chance [Skotlex]
504
505//Mode definitions to clear up code reading. [Skotlex]
506#define MD_CANMOVE 0x0001
507#define MD_LOOTER 0x0002
508#define MD_AGGRESSIVE 0x0004
509#define MD_ASSIST 0x0008
510#define MD_CASTSENSOR_IDLE 0x0010
511#define MD_BOSS 0x0020
512#define MD_PLANT 0x0040
513#define MD_CANATTACK 0x0080
514#define MD_DETECTOR 0x0100
515#define MD_CASTSENSOR_CHASE 0x0200
516#define MD_CHANGECHASE 0x0400
517#define MD_ANGRY 0x0800
518#define MD_CHANGETARGET_MELEE 0x1000
519#define MD_CHANGETARGET_CHASE 0x2000
520#define MD_MASK 0xFFFF
521
522//Status change option definitions (options are what makes status changes visible to chars
523//who were not on your field of sight when it happened)
524//opt1: Non stackable status changes.
525enum {
526        OPT1_STONE = 1, //Petrified
527        OPT1_FREEZE,
528        OPT1_STUN,
529        OPT1_SLEEP,
530        //Aegis uses OPT1 = 5 to identify undead enemies (which also grants them immunity to the other opt1 changes)
531        OPT1_STONEWAIT=6 //Petrifying
532};
533
534//opt2: Stackable status changes.
535#define OPT2_POISON       0x0001
536#define OPT2_CURSE        0x0002
537#define OPT2_SILENCE      0x0004
538#define OPT2_SIGNUMCRUCIS 0x0008
539#define OPT2_BLIND        0x0010
540#define OPT2_ANGELUS      0x0020
541#define OPT2_BLEEDING     0x0040
542#define OPT2_DPOISON      0x0080
543
544#define OPTION_SIGHT 0x00000001
545#define OPTION_HIDE 0x00000002
546#define OPTION_CLOAK 0x00000004
547#define OPTION_CART1 0x00000008
548#define OPTION_FALCON 0x00000010
549#define OPTION_RIDING 0x00000020
550#define OPTION_INVISIBLE 0x00000040
551#define OPTION_CART2 0x00000080
552#define OPTION_CART3 0x00000100
553#define OPTION_CART4 0x00000200
554#define OPTION_CART5 0x00000400
555#define OPTION_ORCISH 0x00000800
556#define OPTION_WEDDING 0x00001000
557#define OPTION_RUWACH 0x00002000
558#define OPTION_CHASEWALK 0x00004000
559//Note that clientside Flying and Xmas are 0x8000 for clients prior to 2007.
560#define OPTION_FLYING 0x0008000
561#define OPTION_XMAS 0x00010000
562#define OPTION_SUMMER 0x00040000
563
564#define OPTION_CART (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5)
565
566#define OPTION_MASK ~0x40
567
568//Defines for the manner system [Skotlex]
569#define MANNER_NOCHAT 0x01
570#define MANNER_NOSKILL 0x02
571#define MANNER_NOCOMMAND 0x04
572#define MANNER_NOITEM 0x08
573#define MANNER_NOROOM 0x10
574
575//Define flags for the status_calc_bl function. [Skotlex]
576enum scb_flag
577{
578        SCB_NONE    = 0x00000000,
579        SCB_BASE    = 0x00000001,
580        SCB_MAXHP   = 0x00000002,
581        SCB_MAXSP   = 0x00000004,
582        SCB_STR     = 0x00000008,
583        SCB_AGI     = 0x00000010,
584        SCB_VIT     = 0x00000020,
585        SCB_INT     = 0x00000040,
586        SCB_DEX     = 0x00000080,
587        SCB_LUK     = 0x00000100,
588        SCB_BATK    = 0x00000200,
589        SCB_WATK    = 0x00000400,
590        SCB_MATK    = 0x00000800,
591        SCB_HIT     = 0x00001000,
592        SCB_FLEE    = 0x00002000,
593        SCB_DEF     = 0x00004000,
594        SCB_DEF2    = 0x00008000,
595        SCB_MDEF    = 0x00010000,
596        SCB_MDEF2   = 0x00020000,
597        SCB_SPEED   = 0x00040000,
598        SCB_ASPD    = 0x00080000,
599        SCB_DSPD    = 0x00100000,
600        SCB_CRI     = 0x00200000,
601        SCB_FLEE2   = 0x00400000,
602        SCB_ATK_ELE = 0x00800000,
603        SCB_DEF_ELE = 0x01000000,
604        SCB_MODE    = 0x02000000,
605        SCB_SIZE    = 0x04000000,
606        SCB_RACE    = 0x08000000,
607        SCB_RANGE   = 0x10000000,
608        SCB_REGEN   = 0x20000000,
609        SCB_DYE     = 0x40000000, // force cloth-dye change to 0 to avoid client crashes.
610        SCB_PC      = 0x80000000,
611
612        SCB_ALL     = 0x3FFFFFFF
613};
614
615//Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex]
616#define BL_CONSUME (BL_PC|BL_HOM)
617//Define to determine who has regen
618#define BL_REGEN (BL_PC|BL_HOM)
619
620
621//Basic damage info of a weapon
622//Required because players have two of these, one in status_data
623//and another for their left hand weapon.
624struct weapon_atk {
625        unsigned short atk, atk2;
626        unsigned short range;
627        unsigned char ele;
628};
629
630
631//For holding basic status (which can be modified by status changes)
632struct status_data {
633        unsigned int
634                hp, sp,
635                max_hp, max_sp;
636        unsigned short
637                str, agi, vit, int_, dex, luk,
638                batk,
639                matk_min, matk_max,
640                speed,
641                amotion, adelay, dmotion,
642                mode;
643        short 
644                hit, flee, cri, flee2,
645                def2, mdef2,
646                aspd_rate;
647        unsigned char
648                def_ele, ele_lv,
649                size, race;
650        signed char
651                def, mdef;
652        struct weapon_atk rhw, lhw; //Right Hand/Left Hand Weapon.
653};
654
655//Additional regen data that only players have.
656struct regen_data_sub {
657        unsigned short
658                hp,sp;
659
660        //tick accumulation before healing.
661        struct {
662                unsigned int hp,sp;
663        } tick;
664       
665        //Regen rates (where every 1 means +100% regen)
666        struct {
667                unsigned char hp,sp;
668        } rate;
669};
670
671struct regen_data {
672
673        unsigned short flag; //Marks what stuff you may heal or not.
674        unsigned short
675                hp,sp,shp,ssp;
676
677        //tick accumulation before healing.
678        struct {
679                unsigned int hp,sp,shp,ssp;
680        } tick;
681       
682        //Regen rates (where every 1 means +100% regen)
683        struct {
684                unsigned char
685                hp,sp,shp,ssp;
686        } rate;
687       
688        struct {
689                unsigned walk:1; //Can you regen even when walking?
690                unsigned gc:1;  //Tags when you should have double regen due to GVG castle
691                unsigned overweight :2; //overweight state (1: 50%, 2: 90%)
692                unsigned block :2; //Block regen flag (1: Hp, 2: Sp)
693        } state;
694
695        //skill-regen, sitting-skill-regen (since not all chars with regen need it)
696        struct regen_data_sub *sregen, *ssregen;
697};
698
699struct status_change_entry {
700        int timer;
701        int val1,val2,val3,val4;
702};
703
704struct status_change {
705        unsigned int option;// effect state (bitfield)
706        unsigned int opt3;// skill state (bitfield)
707        unsigned short opt1;// body state
708        unsigned short opt2;// health state (bitfield)
709        unsigned char count;
710        //TODO: See if it is possible to implement the following SC's without requiring extra parameters while the SC is inactive.
711        unsigned char jb_flag; //Joint Beat type flag
712        unsigned short mp_matk_min, mp_matk_max; //Previous matk min/max for ground spells (Amplify magic power)
713        int sg_id; //ID of the previous Storm gust that hit you
714        unsigned char sg_counter; //Storm gust counter (previous hits from storm gust)
715        struct status_change_entry *data[SC_MAX];
716};
717
718// for looking up associated data
719sc_type status_skill2sc(int skill);
720int status_sc2skill(sc_type sc);
721
722int status_damage(struct block_list *src,struct block_list *target,int hp,int sp, int walkdelay, int flag);
723//Define for standard HP damage attacks.
724#define status_fix_damage(src, target, hp, walkdelay) status_damage(src, target, hp, 0, walkdelay, 0)
725//Define for standard HP/SP damage triggers.
726#define status_zap(bl, hp, sp) status_damage(NULL, bl, hp, sp, 0, 1)
727//Define for standard HP/SP skill-related cost triggers (mobs require no HP/SP to use skills)
728int status_charge(struct block_list* bl, int hp, int sp);
729int status_percent_change(struct block_list *src,struct block_list *target,signed char hp_rate, signed char sp_rate, int flag);
730//Easier handling of status_percent_change
731#define status_percent_heal(bl, hp_rate, sp_rate) status_percent_change(NULL, bl, -(hp_rate), -(sp_rate), 0)
732#define status_percent_damage(src, target, hp_rate, sp_rate, kill) status_percent_change(src, target, hp_rate, sp_rate, (kill)?1:2)
733//Instant kill with no drops/exp/etc
734#define status_kill(bl) status_percent_damage(NULL, bl, 100, 0, true)
735//Used to set the hp/sp of an object to an absolute value (can't kill)
736int status_set_hp(struct block_list *bl, unsigned int hp, int flag);
737int status_set_sp(struct block_list *bl, unsigned int sp, int flag);
738int status_heal(struct block_list *bl,int hp,int sp, int flag);
739int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp);
740
741//Define for copying a status_data structure from b to a, without overwriting current Hp and Sp
742#define status_cpy(a, b) \
743        memcpy(&((a)->max_hp), &((b)->max_hp), sizeof(struct status_data)-(sizeof((a)->hp)+sizeof((a)->sp)))
744
745struct regen_data *status_get_regen_data(struct block_list *bl);
746struct status_data *status_get_status_data(struct block_list *bl);
747struct status_data *status_get_base_status(struct block_list *bl);
748const char * status_get_name(struct block_list *bl);
749int status_get_class(struct block_list *bl);
750int status_get_lv(struct block_list *bl);
751#define status_get_range(bl) status_get_status_data(bl)->rhw.range
752#define status_get_hp(bl) status_get_status_data(bl)->hp
753#define status_get_max_hp(bl) status_get_status_data(bl)->max_hp
754#define status_get_sp(bl) status_get_status_data(bl)->sp
755#define status_get_max_sp(bl) status_get_status_data(bl)->max_sp
756#define status_get_str(bl) status_get_status_data(bl)->str
757#define status_get_agi(bl) status_get_status_data(bl)->agi
758#define status_get_vit(bl) status_get_status_data(bl)->vit
759#define status_get_int(bl) status_get_status_data(bl)->int_
760#define status_get_dex(bl) status_get_status_data(bl)->dex
761#define status_get_luk(bl) status_get_status_data(bl)->luk
762#define status_get_hit(bl) status_get_status_data(bl)->hit
763#define status_get_flee(bl) status_get_status_data(bl)->flee
764signed char status_get_def(struct block_list *bl);
765#define status_get_mdef(bl) status_get_status_data(bl)->mdef
766#define status_get_flee2(bl) status_get_status_data(bl)->flee2
767#define status_get_def2(bl) status_get_status_data(bl)->def2
768#define status_get_mdef2(bl) status_get_status_data(bl)->mdef2
769#define status_get_critical(bl)  status_get_status_data(bl)->cri
770#define status_get_batk(bl) status_get_status_data(bl)->batk
771#define status_get_watk(bl) status_get_status_data(bl)->rhw.atk
772#define status_get_watk2(bl) status_get_status_data(bl)->rhw.atk2
773#define status_get_matk_max(bl) status_get_status_data(bl)->matk_max
774#define status_get_matk_min(bl) status_get_status_data(bl)->matk_min
775#define status_get_lwatk(bl) status_get_status_data(bl)->lhw.atk
776#define status_get_lwatk2(bl) status_get_status_data(bl)->lhw.atk2
777unsigned short status_get_speed(struct block_list *bl);
778#define status_get_adelay(bl) status_get_status_data(bl)->adelay
779#define status_get_amotion(bl) status_get_status_data(bl)->amotion
780#define status_get_dmotion(bl) status_get_status_data(bl)->dmotion
781#define status_get_element(bl) status_get_status_data(bl)->def_ele
782#define status_get_element_level(bl) status_get_status_data(bl)->ele_lv
783unsigned char status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element);
784#define status_get_attack_sc_element(bl, sc) status_calc_attack_element(bl, sc, 0)
785#define status_get_attack_element(bl) status_get_status_data(bl)->rhw.ele
786#define status_get_attack_lelement(bl) status_get_status_data(bl)->lhw.ele
787#define status_get_race(bl) status_get_status_data(bl)->race
788#define status_get_size(bl) status_get_status_data(bl)->size
789#define status_get_mode(bl) status_get_status_data(bl)->mode
790int status_get_party_id(struct block_list *bl);
791int status_get_guild_id(struct block_list *bl);
792int status_get_emblem_id(struct block_list *bl);
793int status_get_mexp(struct block_list *bl);
794int status_get_race2(struct block_list *bl);
795
796struct view_data *status_get_viewdata(struct block_list *bl);
797void status_set_viewdata(struct block_list *bl, int class_);
798void status_change_init(struct block_list *bl);
799struct status_change *status_get_sc(struct block_list *bl);
800
801int status_isdead(struct block_list *bl);
802int status_isimmune(struct block_list *bl);
803
804int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int tick, int flag);
805//Short version, receives rate in 1->100 range, and does not uses a flag setting.
806#define sc_start(bl, type, rate, val1, tick) status_change_start(bl,type,100*(rate),val1,0,0,0,tick,0)
807#define sc_start2(bl, type, rate, val1, val2, tick) status_change_start(bl,type,100*(rate),val1,val2,0,0,tick,0)
808#define sc_start4(bl, type, rate, val1, val2, val3, val4, tick) status_change_start(bl,type,100*(rate),val1,val2,val3,val4,tick,0)
809
810int 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);
811int status_change_end(struct block_list* bl, enum sc_type type, int tid);
812int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr data);
813int status_change_timer(int tid, unsigned int tick, int id, intptr data);
814int status_change_timer_sub(struct block_list* bl, va_list ap);
815int status_change_clear(struct block_list* bl, int type);
816int status_change_clear_buffs(struct block_list* bl, int type);
817
818void status_calc_bl(struct block_list *bl, unsigned long flag);
819int status_calc_pet(struct pet_data* pd, int first); // [Skotlex]
820int status_calc_pc(struct map_session_data* sd,int first);
821int status_calc_mob(struct mob_data* md, int first); //[Skotlex]
822int status_calc_homunculus(struct homun_data *hd, int first);
823void status_calc_misc(struct block_list *bl, struct status_data *status, int level);
824void status_calc_regen(struct block_list *bl, struct status_data *status, struct regen_data *regen);
825void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, struct status_change *sc);
826
827void status_freecast_switch(struct map_session_data *sd);
828int status_getrefinebonus(int lv,int type);
829int status_check_skilluse(struct block_list *src, struct block_list *target, int skill_num, int flag); // [Skotlex]
830int status_check_visibility(struct block_list *src, struct block_list *target); //[Skotlex]
831
832int status_readdb(void);
833int do_init_status(void);
834void do_final_status(void);
835
836#endif /* _STATUS_H_ */
Note: See TracBrowser for help on using the browser.