npc.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _NPC_H_
  4. #define _NPC_H_
  5. #define START_NPC_NUM 110000000
  6. #define WARP_CLASS 45
  7. #define WARP_DEBUG_CLASS 722
  8. #define INVISIBLE_CLASS 32767
  9. #define MAX_NPC_CLASS 1000
  10. //Checks if a given id is a valid npc id. [Skotlex]
  11. //Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001)
  12. #define npcdb_checkid(id) ((id >= 46 && id <= 125) || id == 139 || (id >= 700 && id <= MAX_NPC_CLASS) || id == INVISIBLE_CLASS)
  13. #ifdef PCRE_SUPPORT
  14. void npc_chat_finalize(struct npc_data *nd);
  15. int mob_chat_sub(struct block_list *bl, va_list ap);
  16. #endif
  17. //Script NPC events.
  18. enum {
  19. NPCE_LOGIN,
  20. NPCE_LOGOUT,
  21. NPCE_LOADMAP,
  22. NPCE_BASELVUP,
  23. NPCE_JOBLVUP,
  24. NPCE_DIE,
  25. NPCE_KILLPC,
  26. NPCE_KILLNPC,
  27. NPCE_MAX
  28. };
  29. struct view_data* npc_get_viewdata(int class_);
  30. int npc_chat_sub(struct block_list *bl, va_list ap);
  31. int npc_event_dequeue(struct map_session_data *sd);
  32. int npc_event_timer(int tid,unsigned int tick,int id,int data);
  33. int npc_event(struct map_session_data *sd,const unsigned char *npcname,int);
  34. int npc_timer_event(const unsigned char *eventname); // Added by RoVeRT
  35. int npc_command(struct map_session_data *sd,const unsigned char *npcname,char *command);
  36. int npc_touch_areanpc(struct map_session_data *,int,int,int);
  37. int npc_touch_areanpc2(struct block_list *bl); // [Skotlex]
  38. int npc_click(struct map_session_data *sd,struct npc_data *nd);
  39. int npc_scriptcont(struct map_session_data *,int);
  40. TBL_NPC *npc_checknear(struct map_session_data *sd,struct block_list *bl);
  41. int npc_checknear2(struct map_session_data *sd,struct block_list *bl);
  42. int npc_buysellsel(struct map_session_data *,int,int);
  43. int npc_buylist(struct map_session_data *,int,unsigned short *);
  44. int npc_selllist(struct map_session_data *,int,unsigned short *);
  45. int npc_parse_mob(char *w1,char *w2,char *w3,char *w4);
  46. int npc_parse_mob2 (struct spawn_data*, int index); // [Wizputer]
  47. int npc_parse_warp(char *w1,char *w2,char *w3,char *w4);
  48. int npc_globalmessage(const char *name,char *mes);
  49. int npc_enable(const char *name,int flag);
  50. int npc_changename(const char *name, const char *newname, short look); // [Lance]
  51. struct npc_data* npc_name2id(const char *name);
  52. int npc_get_new_npc_id(void);
  53. void npc_addsrcfile(char *);
  54. void npc_delsrcfile(char *);
  55. void npc_parsesrcfile(char *);
  56. int do_final_npc(void);
  57. int do_init_npc(void);
  58. int npc_event_do_oninit(void);
  59. int npc_do_ontimer(int,int);
  60. int npc_event_doall(const unsigned char *name);
  61. int npc_event_do(const unsigned char *name);
  62. int npc_event_doall_id(const unsigned char *name, int id);
  63. int npc_timerevent_start(struct npc_data *nd, int rid);
  64. int npc_timerevent_stop(struct npc_data *nd);
  65. void npc_timerevent_quit(struct map_session_data *sd);
  66. int npc_gettimerevent_tick(struct npc_data *nd);
  67. int npc_settimerevent_tick(struct npc_data *nd,int newtimer);
  68. int npc_remove_map(struct npc_data *nd);
  69. int npc_unload(struct npc_data *nd);
  70. int npc_reload(void);
  71. int npc_script_event(TBL_PC* sd, int type);
  72. extern char *current_file;
  73. struct npc_data *fake_nd;
  74. #endif