root/src/map/status.h @ 25

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