summaryrefslogblamecommitdiff
path: root/src/map/clif.h
blob: c93169a778f0900ebb8520b44fcd43107b0316f0 (plain) (tree)
1
2
3
4
5
6
7
8
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735


                                                           



                
                                 




                   
            
                    
                     
                  
                 

                        
                
                

                 
                      
                  
                 


                  
                         
             
                             
 










                                                                                                     

                               
                            
  
 
                          































                                                                         
              
 
                           























































































                                                             
                 
             

               
                       




                         

           
                                        






                                                                                                                                        

  
                                
























                                                           

  
                                             



















































































                                                                         

  



                                    



                  
                  
        
                 
  













                                                                       
                                     
 











































































































































































































































































































































































































                                                                                                                                                                                             
 
                     
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams

#ifndef _CLIF_H_
#define _CLIF_H_

#include "../common/cbasetypes.h"
#include <stdarg.h>

/**
 * Declarations
 **/
struct item;
struct storage_data;
struct guild_storage;
struct block_list;
struct unit_data;
struct map_session_data;
struct homun_data;
struct pet_data;
struct mob_data;
struct npc_data;
struct chat_data;
struct flooritem_data;
struct skill_unit;
struct s_vending;
struct party;
struct party_data;
struct guild;
struct battleground_data;
struct quest;
struct party_booking_ad_info;

/**
 * Defines
 **/
#define SERVER 0 /* reserved for server use */
#define packet_len(cmd) packet_db[SERVER][cmd].len
#define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;

/**
 * Enumerations
 **/
enum {// packet DB
	MAX_PACKET_DB  = 0xF00,
	MAX_PACKET_VER = 32,
	MAX_PACKET_POS = 20,
};

typedef enum send_target {
	ALL_CLIENT,
	ALL_SAMEMAP,
	AREA,				// area
	AREA_WOS,			// area, without self
	AREA_WOC,			// area, without chatrooms
	AREA_WOSC,			// area, without own chatroom
	AREA_CHAT_WOC,		// hearable area, without chatrooms
	CHAT,				// current chatroom
	CHAT_WOS,			// current chatroom, without self
	PARTY,
	PARTY_WOS,
	PARTY_SAMEMAP,
	PARTY_SAMEMAP_WOS,
	PARTY_AREA,
	PARTY_AREA_WOS,
	GUILD,
	GUILD_WOS,
	GUILD_SAMEMAP,
	GUILD_SAMEMAP_WOS,
	GUILD_AREA,
	GUILD_AREA_WOS,
	GUILD_NOBG,
	DUEL,
	DUEL_WOS,
	CHAT_MAINCHAT,		// everyone on main chat
	SELF,
	BG,					// BattleGround System
	BG_WOS,
	BG_SAMEMAP,
	BG_SAMEMAP_WOS,
	BG_AREA,
	BG_AREA_WOS,
} send_target;

typedef enum emotion_type {
	E_GASP = 0,     // /!
	E_WHAT,         // /?
	E_HO,
	E_LV,
	E_SWT,
	E_IC,
	E_AN,
	E_AG,
	E_CASH,         // /$
	E_DOTS,         // /...
	E_SCISSORS,     // /gawi --- 10
	E_ROCK,         // /bawi
	E_PAPER,        // /bo
	E_KOREA,
	E_LV2,
	E_THX,
	E_WAH,
	E_SRY,
	E_HEH,
	E_SWT2,
	E_HMM,          // --- 20
	E_NO1,
	E_NO,           // /??
	E_OMG,
	E_OH,
	E_X,
	E_HLP,
	E_GO,
	E_SOB,
	E_GG,
	E_KIS,          // --- 30
	E_KIS2,
	E_PIF,
	E_OK,
	E_MUTE,         // red /... used for muted characters
	E_INDONESIA,
	E_BZZ,          // /bzz, /stare
	E_RICE,
	E_AWSM,         // /awsm, /cool
	E_MEH,
	E_SHY,          // --- 40
	E_PAT,          // /pat, /goodboy
	E_MP,           // /mp, /sptime
	E_SLUR,
	E_COM,          // /com, /comeon
	E_YAWN,         // /yawn, /sleepy
	E_GRAT,         // /grat, /congrats
	E_HP,           // /hp, /hptime
	E_PHILIPPINES,
	E_MALAYSIA,
	E_SINGAPORE,    // --- 50
	E_BRAZIL,
	E_FLASH,        // /fsh
	E_SPIN,         // /spin
	E_SIGH,
	E_DUM,          // /dum
	E_LOUD,         // /crwd
	E_OTL,          // /otl, /desp
	E_DICE1,
	E_DICE2,
	E_DICE3,        // --- 60
	E_DICE4,
	E_DICE5,
	E_DICE6,
	E_INDIA,
	E_LUV,          // /love
	E_RUSSIA,
	E_VIRGIN,
	E_MOBILE,
	E_MAIL,
	E_CHINESE,      // --- 70
	E_ANTENNA1,
	E_ANTENNA2,
	E_ANTENNA3,
	E_HUM,
	E_ABS,
	E_OOPS,
	E_SPIT,
	E_ENE,
	E_PANIC,
	E_WHISP,        // --- 80
	E_YUT1,
	E_YUT2,
	E_YUT3,
	E_YUT4,
	E_YUT5,
	E_YUT6,
	E_YUT7,
	/* ... */
	E_MAX
} emotion_type;

typedef enum clr_type {
	CLR_OUTSIGHT = 0,
	CLR_DEAD,
	CLR_RESPAWN,
	CLR_TELEPORT,
	CLR_TRICKDEAD,
} clr_type;

enum map_property { // clif_map_property
	MAPPROPERTY_NOTHING       = 0,
	MAPPROPERTY_FREEPVPZONE   = 1,
	MAPPROPERTY_EVENTPVPZONE  = 2,
	MAPPROPERTY_AGITZONE      = 3,
	MAPPROPERTY_PKSERVERZONE  = 4, // message "You are in a PK area. Please beware of sudden attacks." in color 0x9B9BFF (light red)
	MAPPROPERTY_PVPSERVERZONE = 5,
	MAPPROPERTY_DENYSKILLZONE = 6,
};

enum map_type { // clif_map_type
	MAPTYPE_VILLAGE              = 0,
	MAPTYPE_VILLAGE_IN           = 1,
	MAPTYPE_FIELD                = 2,
	MAPTYPE_DUNGEON              = 3,
	MAPTYPE_ARENA                = 4,
	MAPTYPE_PENALTY_FREEPKZONE   = 5,
	MAPTYPE_NOPENALTY_FREEPKZONE = 6,
	MAPTYPE_EVENT_GUILDWAR       = 7,
	MAPTYPE_AGIT                 = 8,
	MAPTYPE_DUNGEON2             = 9,
	MAPTYPE_DUNGEON3             = 10,
	MAPTYPE_PKSERVER             = 11,
	MAPTYPE_PVPSERVER            = 12,
	MAPTYPE_DENYSKILL            = 13,
	MAPTYPE_TURBOTRACK           = 14,
	MAPTYPE_JAIL                 = 15,
	MAPTYPE_MONSTERTRACK         = 16,
	MAPTYPE_PORINGBATTLE         = 17,
	MAPTYPE_AGIT_SIEGEV15        = 18,
	MAPTYPE_BATTLEFIELD          = 19,
	MAPTYPE_PVP_TOURNAMENT       = 20,
	//Map types 21 - 24 not used.
	MAPTYPE_SIEGE_LOWLEVEL       = 25,
	//Map types 26 - 28 remains opens for future types.
	MAPTYPE_UNUSED               = 29,
};

enum useskill_fail_cause { // clif_skill_fail
	USESKILL_FAIL_LEVEL = 0,
	USESKILL_FAIL_SP_INSUFFICIENT = 1,
	USESKILL_FAIL_HP_INSUFFICIENT = 2,
	USESKILL_FAIL_STUFF_INSUFFICIENT = 3,
	USESKILL_FAIL_SKILLINTERVAL = 4,
	USESKILL_FAIL_MONEY = 5,
	USESKILL_FAIL_THIS_WEAPON = 6,
	USESKILL_FAIL_REDJAMSTONE = 7,
	USESKILL_FAIL_BLUEJAMSTONE = 8,
	USESKILL_FAIL_WEIGHTOVER = 9,
	USESKILL_FAIL = 10,
	USESKILL_FAIL_TOTARGET = 11,
	USESKILL_FAIL_ANCILLA_NUMOVER = 12,
	USESKILL_FAIL_HOLYWATER = 13,
	USESKILL_FAIL_ANCILLA = 14,
	USESKILL_FAIL_DUPLICATE_RANGEIN = 15,
	USESKILL_FAIL_NEED_OTHER_SKILL = 16,
	USESKILL_FAIL_NEED_HELPER = 17,
	USESKILL_FAIL_INVALID_DIR = 18,
	USESKILL_FAIL_SUMMON = 19,
	USESKILL_FAIL_SUMMON_NONE = 20,
	USESKILL_FAIL_IMITATION_SKILL_NONE = 21,
	USESKILL_FAIL_DUPLICATE = 22,
	USESKILL_FAIL_CONDITION = 23,
	USESKILL_FAIL_PAINTBRUSH = 24,
	USESKILL_FAIL_DRAGON = 25,
	USESKILL_FAIL_POS = 26,
	USESKILL_FAIL_HELPER_SP_INSUFFICIENT = 27,
	USESKILL_FAIL_NEER_WALL = 28,
	USESKILL_FAIL_NEED_EXP_1PERCENT = 29,
	USESKILL_FAIL_CHORUS_SP_INSUFFICIENT = 30,
	USESKILL_FAIL_GC_WEAPONBLOCKING = 31,
	USESKILL_FAIL_GC_POISONINGWEAPON = 32,
	USESKILL_FAIL_MADOGEAR = 33,
	USESKILL_FAIL_NEED_EQUIPMENT_KUNAI = 34,
	USESKILL_FAIL_TOTARGET_PLAYER = 35,
	USESKILL_FAIL_SIZE = 36,
	USESKILL_FAIL_CANONBALL = 37,
	//XXX_USESKILL_FAIL_II_MADOGEAR_ACCELERATION = 38,
	//XXX_USESKILL_FAIL_II_MADOGEAR_HOVERING_BOOSTER = 39,
	USESKILL_FAIL_MADOGEAR_HOVERING = 40,
	//XXX_USESKILL_FAIL_II_MADOGEAR_SELFDESTRUCTION_DEVICE = 41,
	//XXX_USESKILL_FAIL_II_MADOGEAR_SHAPESHIFTER = 42,
	USESKILL_FAIL_GUILLONTINE_POISON = 43,
	//XXX_USESKILL_FAIL_II_MADOGEAR_COOLING_DEVICE = 44,
	//XXX_USESKILL_FAIL_II_MADOGEAR_MAGNETICFIELD_GENERATOR = 45,
	//XXX_USESKILL_FAIL_II_MADOGEAR_BARRIER_GENERATOR = 46,
	//XXX_USESKILL_FAIL_II_MADOGEAR_OPTICALCAMOUFLAGE_GENERATOR = 47,
	//XXX_USESKILL_FAIL_II_MADOGEAR_REPAIRKIT = 48,
	//XXX_USESKILL_FAIL_II_MONKEY_SPANNER = 49,
	USESKILL_FAIL_MADOGEAR_RIDE = 50,
	USESKILL_FAIL_SPELLBOOK = 51,
	USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP = 52,
	USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT = 53,
	USESKILL_FAIL_SPELLBOOK_READING = 54,
	//XXX_USESKILL_FAIL_II_FACE_PAINTS = 55,
	//XXX_USESKILL_FAIL_II_MAKEUP_BRUSH = 56,
	USESKILL_FAIL_CART = 57,
	//XXX_USESKILL_FAIL_II_THORNS_SEED = 58,
	//XXX_USESKILL_FAIL_II_BLOOD_SUCKER_SEED = 59,
	USESKILL_FAIL_NO_MORE_SPELL = 60,
	//XXX_USESKILL_FAIL_II_BOMB_MUSHROOM_SPORE = 61,
	//XXX_USESKILL_FAIL_II_GASOLINE_BOOMB = 62,
	//XXX_USESKILL_FAIL_II_OIL_BOTTLE = 63,
	//XXX_USESKILL_FAIL_II_EXPLOSION_POWDER = 64,
	//XXX_USESKILL_FAIL_II_SMOKE_POWDER = 65,
	//XXX_USESKILL_FAIL_II_TEAR_GAS = 66,
	//XXX_USESKILL_FAIL_II_HYDROCHLORIC_ACID_BOTTLE = 67,
	//XXX_USESKILL_FAIL_II_HELLS_PLANT_BOTTLE = 68,
	//XXX_USESKILL_FAIL_II_MANDRAGORA_FLOWERPOT = 69,
	USESKILL_FAIL_MANUAL_NOTIFY = 70,
	USESKILL_FAIL_NEED_ITEM = 71,
	USESKILL_FAIL_NEED_EQUIPMENT = 72,
	USESKILL_FAIL_COMBOSKILL = 73,
	USESKILL_FAIL_SPIRITS = 74,
	USESKILL_FAIL_EXPLOSIONSPIRITS = 75,
	USESKILL_FAIL_HP_TOOMANY = 76,
	USESKILL_FAIL_NEED_ROYAL_GUARD_BANDING = 77,
	USESKILL_FAIL_NEED_EQUIPPED_WEAPON_CLASS = 78,
	USESKILL_FAIL_EL_SUMMON = 79,
	USESKILL_FAIL_RELATIONGRADE = 80,
	USESKILL_FAIL_STYLE_CHANGE_FIGHTER = 81,
	USESKILL_FAIL_STYLE_CHANGE_GRAPPLER = 82,
	USESKILL_FAIL_THERE_ARE_NPC_AROUND = 83,
};

enum clif_messages {
	SKILL_CANT_USE_AREA = 0x536,
};

/**
 * Color Table
 **/
enum clif_colors {
	COLOR_RED,
	
	COLOR_MAX
};

/**
 * Structures
 **/
struct s_packet_db {
	short len;
	void (*func)(int, struct map_session_data *);
	short pos[MAX_PACKET_POS];
};

/**
 * Vars
 **/
extern struct s_packet_db packet_db[MAX_PACKET_VER+1][MAX_PACKET_DB+1];
unsigned long color_table[COLOR_MAX];

/**
 * Clif.c Interface
 **/
struct clif_interface {
	/* vars */
	uint32 map_ip;
	uint32 bind_ip;
	uint16 map_port;
	char map_ip_str[128];
	int map_fd;
	/* core */
	int (*init) (void);
	void (*final) (void);
	int (*setip) (const char* ip);
	void (*setbindip) (const char* ip);
	void (*setport) (uint16 port);
	uint32 (*refresh_ip) (void);
	int (*send) (const uint8* buf, int len, struct block_list* bl, enum send_target type);
	/* auth */
	void (*authok) (struct map_session_data *sd);
	void (*authrefuse) (int fd, uint8 error_code);
	void (*authfail_fd) (int fd, int type);
	void (*charselectok) (int id, uint8 ok);
	/* item-related */
	void (*dropflooritem) (struct flooritem_data* fitem);
	void (*clearflooritem) (struct flooritem_data *fitem, int fd);
	void (*additem) (struct map_session_data *sd, int n, int amount, int fail);
	void (*dropitem) (struct map_session_data *sd,int n,int amount);
	void (*delitem) (struct map_session_data *sd,int n,int amount, short reason);
	void (*takeitem) (struct block_list* src, struct block_list* dst);
	void (*arrowequip) (struct map_session_data *sd,int val);
	void (*arrow_fail) (struct map_session_data *sd,int type);
	void (*use_card) (struct map_session_data *sd,int idx);
	void (*cart_additem) (struct map_session_data *sd,int n,int amount,int fail);
	void (*cart_delitem) (struct map_session_data *sd,int n,int amount);
	void (*equipitemack) (struct map_session_data *sd,int n,int pos,int ok);
	void (*unequipitemack) (struct map_session_data *sd,int n,int pos,int ok);
	void (*useitemack) (struct map_session_data *sd,int index,int amount,bool ok);
	/* unit-related */
	void (*clearunit_single) (int id, clr_type type, int fd);
	void (*clearunit_area) (struct block_list* bl, clr_type type);
	void (*clearunit_delayed) (struct block_list* bl, clr_type type, unsigned int tick);
	void (*walkok) (struct map_session_data *sd);
	void (*move) (struct unit_data *ud);
	void (*blown) (struct block_list *bl);
	void (*slide) (struct block_list *bl, int x, int y);
	void (*fixpos) (struct block_list *bl);
	void (*changelook) (struct block_list *bl,int type,int val);
	void (*changetraplook) (struct block_list *bl,int val);
	void (*refreshlook) (struct block_list *bl,int id,int type,int val,enum send_target target);
	void (*class_change) (struct block_list *bl,int class_,int type);
	void (*skill_setunit) (struct skill_unit *unit);
	void (*skill_delunit) (struct skill_unit *unit);
	void (*skillunit_update) (struct block_list* bl);
	/* main unit spawn */
	int (*spawn) (struct block_list *bl);
	/* map-related */
	void (*changemap) (struct map_session_data *sd, short map, int x, int y);
	void (*changemapcell) (int fd, int16 m, int x, int y, int type, enum send_target target);
	void (*map_property) (struct map_session_data* sd, enum map_property property);
	void (*pvpset) (struct map_session_data *sd, int pvprank, int pvpnum,int type);
	void (*map_property_mapall) (int map, enum map_property property);
	void (*bossmapinfo) (int fd, struct mob_data *md, short flag);
	/* multi-map-server */
	void (*changemapserver) (struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
	/* npc-shop-related */
	void (*npcbuysell) (struct map_session_data* sd, int id);
	void (*buylist) (struct map_session_data *sd, struct npc_data *nd);
	void (*selllist) (struct map_session_data *sd);
	void (*cashshop_show) (struct map_session_data *sd, struct npc_data *nd);
	/* npc-script-related */
	void (*scriptmes) (struct map_session_data *sd, int npcid, const char *mes);
	void (*scriptnext) (struct map_session_data *sd,int npcid);
	void (*scriptclose) (struct map_session_data *sd, int npcid);
	void (*scriptmenu) (struct map_session_data* sd, int npcid, const char* mes);
	void (*scriptinput) (struct map_session_data *sd, int npcid);
	void (*scriptinputstr) (struct map_session_data *sd, int npcid);
	void (*cutin) (struct map_session_data* sd, const char* image, int type);
	void (*sendfakenpc) (struct map_session_data *sd, int npcid);
	/* client-user-interface-related */
	void (*viewpoint) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color);
	int (*damage) (struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int damage, int div, int type, int damage2);
	void (*sitting) (struct block_list* bl);
	void (*standing) (struct block_list* bl);
	void (*arrow_create_list) (struct map_session_data *sd);
	void (*refresh) (struct map_session_data *sd);
	void (*fame_blacksmith) (struct map_session_data *sd, int points);
	void (*fame_alchemist) (struct map_session_data *sd, int points);
	void (*fame_taekwon) (struct map_session_data *sd, int points);
	void (*hotkeys) (struct map_session_data *sd);
	int (*insight) (struct block_list *bl,va_list ap);
	int (*outsight) (struct block_list *bl,va_list ap);
	void (*skillcastcancel) (struct block_list* bl);
	void (*skill_fail) (struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype);
	void (*skill_cooldown) (struct map_session_data *sd, uint16 skill_id, unsigned int tick);
	void (*skill_memomessage) (struct map_session_data* sd, int type);
	void (*skill_teleportmessage) (struct map_session_data *sd, int type);
	void (*skill_produce_mix_list) (struct map_session_data *sd, int skill_id, int trigger);
	void (*cooking_list) (struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
	void (*autospell) (struct map_session_data *sd,uint16 skill_lv);
	void (*combo_delay) (struct block_list *bl,int wait);
	void (*status_change) (struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3);
	void (*insert_card) (struct map_session_data *sd,int idx_equip,int idx_card,int flag);
	void (*inventorylist) (struct map_session_data *sd);
	void (*equiplist) (struct map_session_data *sd);
	void (*cartlist) (struct map_session_data *sd);
	void (*clearcart) (int fd);
	void (*item_identify_list) (struct map_session_data *sd);
	void (*item_identified) (struct map_session_data *sd,int idx,int flag);
	void (*item_repair_list) (struct map_session_data *sd, struct map_session_data *dstsd, int lv);
	void (*item_repaireffect) (struct map_session_data *sd, int idx, int flag);
	void (*item_damaged) (struct map_session_data* sd, unsigned short position);
	void (*item_refine_list) (struct map_session_data *sd);
	void (*item_skill) (struct map_session_data *sd,uint16 skill_id,uint16 skill_lv);
	void (*mvp_item) (struct map_session_data *sd,int nameid);
	void (*mvp_exp) (struct map_session_data *sd, unsigned int exp);
	void (*mvp_noitem) (struct map_session_data* sd);
	void (*changed_dir) (struct block_list *bl, enum send_target target);
	void (*charnameack) (int fd, struct block_list *bl);
	void (*monster_hp_bar) ( struct mob_data* md, int fd );
	void (*hpmeter_single) (int fd, int id, unsigned int hp, unsigned int maxhp);
	void (*upgrademessage) (int fd, int result, int item_id);
	void (*get_weapon_view) (struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand);
	void (*gospel_info) (struct map_session_data *sd, int type);
	void (*feel_req) (int fd, struct map_session_data *sd, uint16 skill_lv);
	void (*starskill) (struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
	void (*feel_info) (struct map_session_data* sd, unsigned char feel_level, unsigned char type);
	void (*hate_info) (struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
	void (*mission_info) (struct map_session_data *sd, int mob_id, unsigned char progress);
	void (*feel_hate_reset) (struct map_session_data *sd);
	void (*equiptickack) (struct map_session_data* sd, int flag);
	void (*viewequip_ack) (struct map_session_data* sd, struct map_session_data* tsd);
	void (*viewequip_fail) (struct map_session_data* sd);
	void (*equipcheckbox) (struct map_session_data* sd);
	void (*displayexp) (struct map_session_data *sd, unsigned int exp, char type, bool quest);
	void (*font) (struct map_session_data *sd);
	void (*progressbar) (struct map_session_data * sd, unsigned long color, unsigned int second);
	void (*progressbar_abort) (struct map_session_data * sd);
	void (*showdigit) (struct map_session_data* sd, unsigned char type, int value);
	int (*elementalconverter_list) (struct map_session_data *sd);
	int (*spellbook_list) (struct map_session_data *sd);
	int (*magicdecoy_list) (struct map_session_data *sd, uint16 skill_lv, short x, short y);
	int (*poison_list) (struct map_session_data *sd, uint16 skill_lv);
	int (*autoshadowspell_list) (struct map_session_data *sd);
	int (*skill_itemlistwindow) ( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
	int (*sc_notick) (struct block_list *bl,int type,int flag,int val1, int val2, int val3);
	int (*sc_single) (int fd, int id,int type,int flag,int val1, int val2, int val3);
	/* player-unit-specific-related */
	void (*updatestatus) (struct map_session_data *sd,int type);
	void (*changestatus) (struct map_session_data* sd,int type,int val);
	void (*statusupack) (struct map_session_data *sd,int type,int ok,int val);
	void (*movetoattack) (struct map_session_data *sd,struct block_list *bl);
	void (*solved_charname) (int fd, int charid, const char* name);
	void (*charnameupdate) (struct map_session_data *ssd);
	/* visual effects client-side */
	void (*misceffect) (struct block_list* bl,int type);
	void (*changeoption) (struct block_list* bl);
	void (*changeoption2) (struct block_list* bl);
	void (*emotion) (struct block_list *bl,int type);
	void (*talkiebox) (struct block_list* bl, const char* talkie);
	void (*wedding_effect) (struct block_list *bl);
	void (*divorced) (struct map_session_data* sd, const char* name);
	void (*callpartner) (struct map_session_data *sd);
	int (*skill_damage) (struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,uint16 skill_id,uint16 skill_lv,int type);
	int (*skill_nodamage) (struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail);
	void (*skill_poseffect) (struct block_list *src,uint16 skill_id,int val,int x,int y,int tick);
	void (*skill_estimation) (struct map_session_data *sd,struct block_list *dst);
	void (*skill_warppoint) (struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
	void (*skillcasting) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime);
	void (*produce_effect) (struct map_session_data* sd,int flag,int nameid);
	void (*devotion) (struct block_list *src, struct map_session_data *tsd);
	void (*spiritball) (struct block_list *bl);
	void (*bladestop) (struct block_list *src, int dst_id, int active);
	void (*mvp_effect) (struct map_session_data *sd);
	void (*heal) (int fd,int type,int val);
	void (*resurrection) (struct block_list *bl,int type);
	void (*refine) (int fd, int fail, int index, int val);
	void (*weather) (int16 m);
	void (*specialeffect) (struct block_list* bl, int type, enum send_target target);
	void (*specialeffect_single) (struct block_list* bl, int type, int fd);
	void (*specialeffect_value) (struct block_list* bl, int effect_id, int num, send_target target);
	void (*millenniumshield) (struct map_session_data *sd, short shields );
	void (*talisman) (struct map_session_data *sd, short type);
	void (*snap) ( struct block_list *bl, short x, short y );
	/* sound effects client-side */
	void (*playBGM) (struct map_session_data* sd, const char* name);
	void (*soundeffect) (struct map_session_data* sd, struct block_list* bl, const char* name, int type);
	void (*soundeffectall) (struct block_list* bl, const char* name, int type, enum send_target coverage);
	/* chat/message-related */
	void (*GlobalMessage) (struct block_list* bl, const char* message);
	void (*createchat) (struct map_session_data* sd, int flag);
	void (*dispchat) (struct chat_data* cd, int fd);
	void (*joinchatfail) (struct map_session_data *sd,int flag);
	void (*joinchatok) (struct map_session_data *sd,struct chat_data* cd);
	void (*addchat) (struct chat_data* cd,struct map_session_data *sd);
	void (*changechatowner) (struct chat_data* cd, struct map_session_data* sd);
	void (*clearchat) (struct chat_data *cd,int fd);
	void (*leavechat) (struct chat_data* cd, struct map_session_data* sd, bool flag);
	void (*changechatstatus) (struct chat_data* cd);
	void (*wis_message) (int fd, const char* nick, const char* mes, int mes_len);
	void (*wis_end) (int fd, int flag);
	void (*displaymessage) (const int fd, const char* mes);
	void (*disp_onlyself) (struct map_session_data *sd, const char *mes, int len);
	void (*disp_message) (struct block_list* src, const char* mes, int len, enum send_target target);
	void (*broadcast) (struct block_list* bl, const char* mes, int len, int type, enum send_target target);
	void (*MainChatMessage) (const char* message);
	void (*broadcast2) (struct block_list* bl, const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
	void (*messagecolor) (struct block_list* bl, unsigned long color, const char* msg);
	void (*message) (struct block_list* bl, const char* msg);
	void (*disp_overhead) (struct map_session_data *sd, const char* mes);
	void (*msg) (struct map_session_data* sd, unsigned short id);
	void (*msg_value) (struct map_session_data* sd, unsigned short id, int value);
	void (*msg_skill) (struct map_session_data* sd, uint16 skill_id, int msg_id);
	void (*msgtable) (int fd, int line);
	void (*msgtable_num) (int fd, int line, int num);
	int (*colormes) (struct map_session_data * sd, enum clif_colors color, const char* msg);
	/* trade handling */
	void (*traderequest) (struct map_session_data* sd, const char* name);
	void (*tradestart) (struct map_session_data* sd, uint8 type);
	void (*tradeadditem) (struct map_session_data* sd, struct map_session_data* tsd, int index, int amount);
	void (*tradeitemok) (struct map_session_data* sd, int index, int fail);
	void (*tradedeal_lock) (struct map_session_data* sd, int fail);
	void (*tradecancelled) (struct map_session_data* sd);
	void (*tradecompleted) (struct map_session_data* sd, int fail);
	void (*tradeundo) (struct map_session_data* sd);
	/* vending handling */
	void (*openvendingreq) (struct map_session_data* sd, int num);
	void (*showvendingboard) (struct block_list* bl, const char* message, int fd);
	void (*closevendingboard) (struct block_list* bl, int fd);
	void (*vendinglist) (struct map_session_data* sd, int id, struct s_vending* vending);
	void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail);
	void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending);
	void (*vendingreport) (struct map_session_data* sd, int index, int amount);
	/* storage handling */
	void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length);
	void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount);
	void (*storageitemadded) (struct map_session_data* sd, struct item* i, int index, int amount);
	void (*storageitemremoved) (struct map_session_data* sd, int index, int amount);
	void (*storageclose) (struct map_session_data* sd);
	/* skill-list handling */
	void (*skillinfoblock) (struct map_session_data *sd);
	void (*skillup) (struct map_session_data *sd,uint16 skill_id);
	void (*skillinfo) (struct map_session_data *sd,int skill, int inf);
	void (*addskill) (struct map_session_data *sd, int id);
	void (*deleteskill) (struct map_session_data *sd, int id);
	/* party-specific */
	void (*party_created) (struct map_session_data *sd,int result);
	void (*party_member_info) (struct party_data *p, struct map_session_data *sd);
	void (*party_info) (struct party_data* p, struct map_session_data *sd);
	void (*party_invite) (struct map_session_data *sd,struct map_session_data *tsd);
	void (*party_inviteack) (struct map_session_data* sd, const char* nick, int result);
	void (*party_option) (struct party_data *p,struct map_session_data *sd,int flag);
	void (*party_withdraw) (struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag);
	void (*party_message) (struct party_data* p, int account_id, const char* mes, int len);
	void (*party_xy) (struct map_session_data *sd);
	void (*party_xy_single) (int fd, struct map_session_data *sd);
	void (*party_hp) (struct map_session_data *sd);
	void (*party_xy_remove) (struct map_session_data *sd);
	void (*party_show_picker) (struct map_session_data * sd, struct item * item_data);
	/* guild-specific */
	void (*guild_created) (struct map_session_data *sd,int flag);
	void (*guild_belonginfo) (struct map_session_data *sd, struct guild *g);
	void (*guild_masterormember) (struct map_session_data *sd);
	void (*guild_basicinfo) (struct map_session_data *sd);
	void (*guild_allianceinfo) (struct map_session_data *sd);
	void (*guild_memberlist) (struct map_session_data *sd);
	void (*guild_skillinfo) (struct map_session_data* sd);
	void (*guild_send_onlineinfo) (struct map_session_data *sd); //[LuzZza]
	void (*guild_memberlogin_notice) (struct guild *g,int idx,int flag);
	void (*guild_invite) (struct map_session_data *sd,struct guild *g);
	void (*guild_inviteack) (struct map_session_data *sd,int flag);
	void (*guild_leave) (struct map_session_data *sd,const char *name,const char *mes);
	void (*guild_expulsion) (struct map_session_data* sd, const char* name, const char* mes, int account_id);
	void (*guild_positionchanged) (struct guild *g,int idx);
	void (*guild_memberpositionchanged) (struct guild *g,int idx);
	void (*guild_emblem) (struct map_session_data *sd,struct guild *g);
	void (*guild_emblem_area) (struct block_list* bl);
	void (*guild_notice) (struct map_session_data* sd, struct guild* g);
	void (*guild_message) (struct guild *g,int account_id,const char *mes,int len);
	int (*guild_skillup) (struct map_session_data *sd,uint16 skill_id,int lv);
	void (*guild_reqalliance) (struct map_session_data *sd,int account_id,const char *name);
	void (*guild_allianceack) (struct map_session_data *sd,int flag);
	void (*guild_delalliance) (struct map_session_data *sd,int guild_id,int flag);
	void (*guild_oppositionack) (struct map_session_data *sd,int flag);
	void (*guild_broken) (struct map_session_data *sd,int flag);
	void (*guild_xy) (struct map_session_data *sd);
	void (*guild_xy_single) (int fd, struct map_session_data *sd);
	void (*guild_xy_remove) (struct map_session_data *sd);
	/* battleground-specific */
	void (*bg_hp) (struct map_session_data *sd);
	void (*bg_xy) (struct map_session_data *sd);
	void (*bg_xy_remove) (struct map_session_data *sd);
	void (*bg_message) (struct battleground_data *bg, int src_id, const char *name, const char *mes, int len);
	void (*bg_updatescore) (int16 m);
	void (*bg_updatescore_single) (struct map_session_data *sd);
	void (*sendbgemblem_area) (struct map_session_data *sd);
	void (*sendbgemblem_single) (int fd, struct map_session_data *sd);
	/* instance-related */
	int (*instance) (int instance_id, int type, int flag);
	void (*instance_join) (int fd, int instance_id);
	void (*instance_leave) (int fd);
	/* pet-related */
	void (*catch_process) (struct map_session_data *sd);
	void (*pet_roulette) (struct map_session_data *sd,int data);
	void (*sendegg) (struct map_session_data *sd);
	void (*send_petstatus) (struct map_session_data *sd);
	void (*send_petdata) (struct map_session_data* sd, struct pet_data* pd, int type, int param);
	void (*pet_emotion) (struct pet_data *pd,int param);
	void (*pet_food) (struct map_session_data *sd,int foodid,int fail);
	/* friend-related */
	int (*friendslist_toggle_sub) (struct map_session_data *sd,va_list ap);
	void (*friendslist_send) (struct map_session_data *sd);
	void (*friendslist_reqack) (struct map_session_data *sd, struct map_session_data *f_sd, int type);
	/* gm-related */
	void (*GM_kickack) (struct map_session_data *sd, int id);
	void (*GM_kick) (struct map_session_data *sd,struct map_session_data *tsd);
	void (*manner_message) (struct map_session_data* sd, uint32 type);
	void (*GM_silence) (struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
	/* hom-related */
	void (*hominfo) (struct map_session_data *sd, struct homun_data *hd, int flag);
	int (*homskillinfoblock) (struct map_session_data *sd);
	void (*homskillup) (struct map_session_data *sd, uint16 skill_id);
	int (*hom_food) (struct map_session_data *sd,int foodid,int fail);
	void (*send_homdata) (struct map_session_data *sd, int state, int param);
	/* questlog-related */
	void (*quest_send_list) (struct map_session_data * sd);
	void (*quest_send_mission) (struct map_session_data * sd);
	void (*quest_add) (struct map_session_data * sd, struct quest * qd, int index);
	void (*quest_delete) (struct map_session_data * sd, int quest_id);
	void (*quest_update_status) (struct map_session_data * sd, int quest_id, bool active);
	void (*quest_update_objective) (struct map_session_data * sd, struct quest * qd, int index);
	void (*quest_show_event) (struct map_session_data *sd, struct block_list *bl, short state, short color);
	/* mail-related */
	void (*mail_window) (int fd, int flag);
	void (*mail_read) (struct map_session_data *sd, int mail_id);
	void (*mail_delete) (int fd, int mail_id, short fail);
	void (*mail_return) (int fd, int mail_id, short fail);
	void (*mail_send) (int fd, bool fail);
	void (*mail_new) (int fd, int mail_id, const char *sender, const char *title);
	void (*mail_refreshinbox) (struct map_session_data *sd);
	void (*mail_getattachment) (int fd, uint8 flag);
	/* auction-related */
	void (*auction_openwindow) (struct map_session_data *sd);
	void (*auction_results) (struct map_session_data *sd, short count, short pages, uint8 *buf);
	void (*auction_message) (int fd, unsigned char flag);
	void (*auction_close) (int fd, unsigned char flag);
	/* mercenary-related */
	void (*mercenary_info) (struct map_session_data *sd);
	void (*mercenary_skillblock) (struct map_session_data *sd);
	void (*mercenary_message) (struct map_session_data* sd, int message);
	void (*mercenary_updatestatus) (struct map_session_data *sd, int type);
	/* item rental */
	void (*rental_time) (int fd, int nameid, int seconds);
	void (*rental_expired) (int fd, int index, int nameid);
	/* party booking related */
	void (*PartyBookingRegisterAck) (struct map_session_data *sd, int flag);
	void (*PartyBookingDeleteAck) (struct map_session_data* sd, int flag);
	void (*PartyBookingSearchAck) (int fd, struct party_booking_ad_info** results, int count, bool more_result);
	void (*PartyBookingUpdateNotify) (struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
	void (*PartyBookingDeleteNotify) (struct map_session_data* sd, int index);
	void (*PartyBookingInsertNotify) (struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
	/* buying store-related */
	void (*buyingstore_open) (struct map_session_data* sd);
	void (*buyingstore_open_failed) (struct map_session_data* sd, unsigned short result, unsigned int weight);
	void (*buyingstore_myitemlist) (struct map_session_data* sd);
	void (*buyingstore_entry) (struct map_session_data* sd);
	void (*buyingstore_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd);
	void (*buyingstore_disappear_entry) (struct map_session_data* sd);
	void (*buyingstore_disappear_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd);
	void (*buyingstore_itemlist) (struct map_session_data* sd, struct map_session_data* pl_sd);
	void (*buyingstore_trade_failed_buyer) (struct map_session_data* sd, short result);
	void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount);
	void (*buyingstore_delete_item) (struct map_session_data* sd, short index, unsigned short amount, int price);
	void (*buyingstore_trade_failed_seller) (struct map_session_data* sd, short result, unsigned short nameid);
	/* search store-related */
	void (*search_store_info_ack) (struct map_session_data* sd);
	void (*search_store_info_failed) (struct map_session_data* sd, unsigned char reason);
	void (*open_search_store_info) (struct map_session_data* sd);
	void (*search_store_info_click_ack) (struct map_session_data* sd, short x, short y);
	/* elemental-related */
	void (*elemental_info) (struct map_session_data *sd);
	void (*elemental_updatestatus) (struct map_session_data *sd, int type);
	/* misc-handling */
	void (*adopt_reply) (struct map_session_data *sd, int type);
	void (*readbook) (int fd, int book_id, int page);
	/*------------------------
	 *- Parse Incoming Packet
	 *------------------------*/
	void (*ActionRequest_sub) (struct map_session_data *sd, int action_type, int target_id, unsigned int tick);
	void (*LoadEndAck) (int fd,struct map_session_data *sd);
	void (*Auction_cancelreg) (int fd, struct map_session_data *sd);
} clif_s;

struct clif_interface *clif;

void clif_defaults(void);

#endif /* _CLIF_H_ */