root/src/map/status.h @ 1

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