atcommand.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _ATCOMMAND_H_
  4. #define _ATCOMMAND_H_
  5. //This is the distance at which @autoloot works,
  6. //if the item drops farther from the player than this,
  7. //it will not be autolooted. [Skotlex]
  8. //Note: The range is unlimited unless this define is set.
  9. //#define AUTOLOOT_DISTANCE AREA_SIZE
  10. #include "map.h"
  11. enum AtCommandType {
  12. AtCommand_None = -1,
  13. AtCommand_Broadcast = 0,
  14. AtCommand_LocalBroadcast,
  15. AtCommand_MapMove,
  16. AtCommand_ResetState,
  17. AtCommand_RuraP,
  18. AtCommand_Rura,
  19. AtCommand_Warp,
  20. AtCommand_Where,
  21. AtCommand_JumpTo,
  22. AtCommand_Jump,
  23. AtCommand_Who,
  24. AtCommand_Who2,
  25. AtCommand_Who3,
  26. AtCommand_WhoMap,
  27. AtCommand_WhoMap2,
  28. AtCommand_WhoMap3,
  29. AtCommand_WhoGM,
  30. AtCommand_Save,
  31. AtCommand_Load,
  32. AtCommand_Speed,
  33. AtCommand_CharSpeed,
  34. AtCommand_Storage,
  35. AtCommand_GuildStorage,
  36. AtCommand_Option,
  37. AtCommand_Hide,
  38. AtCommand_JobChange,
  39. AtCommand_JobChange2,
  40. AtCommand_JobChange3,
  41. AtCommand_Die,
  42. AtCommand_Kill,
  43. AtCommand_Alive,
  44. AtCommand_Kami,
  45. AtCommand_KamiB,
  46. AtCommand_KamiC, //LuzZza
  47. AtCommand_Heal,
  48. AtCommand_Item,
  49. AtCommand_Item2,
  50. AtCommand_ItemReset,
  51. AtCommand_BaseLevelUp,
  52. AtCommand_JobLevelUp,
  53. AtCommand_H,
  54. AtCommand_Help,
  55. AtCommand_H2,
  56. AtCommand_Help2,
  57. AtCommand_GM,
  58. AtCommand_PvPOff,
  59. AtCommand_PvPOn,
  60. AtCommand_GvGOff,
  61. AtCommand_GvGOn,
  62. AtCommand_Model,
  63. AtCommand_Go,
  64. AtCommand_Spawn,
  65. AtCommand_MonsterSmall,
  66. AtCommand_MonsterBig,
  67. AtCommand_KillMonster,
  68. AtCommand_KillMonster2,
  69. AtCommand_Refine,
  70. AtCommand_Produce,
  71. AtCommand_Memo,
  72. AtCommand_GAT,
  73. AtCommand_DisplayStatus,
  74. AtCommand_StatusPoint,
  75. AtCommand_SkillPoint,
  76. AtCommand_Zeny,
  77. AtCommand_Param,
  78. AtCommand_Strength,
  79. AtCommand_Agility,
  80. AtCommand_Vitality,
  81. AtCommand_Intelligence,
  82. AtCommand_Dexterity,
  83. AtCommand_Luck,
  84. AtCommand_GuildLevelUp,
  85. AtCommand_MakeEgg,
  86. AtCommand_PetFriendly,
  87. AtCommand_PetHungry,
  88. AtCommand_PetRename,
  89. AtCommand_Recall,
  90. AtCommand_Night,
  91. AtCommand_Day,
  92. AtCommand_Doom,
  93. AtCommand_DoomMap,
  94. AtCommand_Raise,
  95. AtCommand_RaiseMap,
  96. AtCommand_Kick,
  97. AtCommand_KickAll,
  98. AtCommand_AllSkill,
  99. AtCommand_QuestSkill,
  100. AtCommand_LostSkill,
  101. AtCommand_SpiritBall,
  102. AtCommand_Party,
  103. AtCommand_Guild,
  104. AtCommand_AgitStart,
  105. AtCommand_AgitEnd,
  106. AtCommand_MapExit,
  107. AtCommand_IDSearch,
  108. AtCommand_RecallAll,
  109. AtCommand_ReloadItemDB,
  110. AtCommand_ReloadMobDB,
  111. AtCommand_ReloadSkillDB,
  112. AtCommand_ReloadScript,
  113. AtCommand_ReloadGMDB,
  114. AtCommand_ReloadAtcommand,
  115. AtCommand_ReloadBattleConf,
  116. AtCommand_ReloadStatusDB,
  117. AtCommand_ReloadPcDB,
  118. AtCommand_ReloadMOTD, // [Valaris]
  119. AtCommand_MapInfo,
  120. AtCommand_Dye,
  121. AtCommand_Hstyle,
  122. AtCommand_Hcolor,
  123. AtCommand_StatAll,
  124. AtCommand_CharBlock, // by Yor
  125. AtCommand_CharBan, // by Yor
  126. AtCommand_CharUnBlock, // by Yor
  127. AtCommand_CharUnBan, // by Yor
  128. AtCommand_MountPeco, // by Valaris
  129. AtCommand_GuildSpy, // [Syrus22]
  130. AtCommand_PartySpy, // [Syrus22]
  131. AtCommand_RepairAll, // [Valaris]
  132. AtCommand_GuildRecall, // by Yor
  133. AtCommand_PartyRecall, // by Yor
  134. AtCommand_Nuke, // [Valaris]
  135. AtCommand_Shownpc,
  136. AtCommand_Hidenpc,
  137. AtCommand_Loadnpc,
  138. AtCommand_Unloadnpc,
  139. AtCommand_ServerTime, // by Yor
  140. AtCommand_Jail, // by Yor
  141. AtCommand_UnJail, // by Yor
  142. AtCommand_JailFor, // Meruru
  143. AtCommand_JailTime, // Coltaro
  144. AtCommand_Disguise, // [Valaris]
  145. AtCommand_UnDisguise, // by Yor
  146. AtCommand_EMail, // by Yor
  147. AtCommand_Hatch,
  148. AtCommand_Effect, // by Apple
  149. AtCommand_AddWarp, // by MouseJstr
  150. AtCommand_Follow, // by MouseJstr
  151. AtCommand_SkillOn, // by MouseJstr
  152. AtCommand_SkillOff, // by MouseJstr
  153. AtCommand_Killer, // by MouseJstr
  154. AtCommand_NpcMove, // by MouseJstr
  155. AtCommand_Killable, // by MouseJstr
  156. AtCommand_Dropall, // by MouseJstr
  157. AtCommand_Storeall, // by MouseJstr
  158. AtCommand_Skillid, // by MouseJstr
  159. AtCommand_Useskill, // by MouseJstr
  160. AtCommand_DisplaySkill,
  161. AtCommand_Summon,
  162. AtCommand_Rain,
  163. AtCommand_Snow,
  164. AtCommand_Sakura,
  165. AtCommand_Clouds,
  166. AtCommand_Clouds2, // [Valaris]
  167. AtCommand_Fog,
  168. AtCommand_Fireworks,
  169. AtCommand_Leaves,
  170. AtCommand_AdjGmLvl, // MouseJstr
  171. AtCommand_AdjCmdLvl, // MouseJstr
  172. AtCommand_Trade, // MouseJstr
  173. AtCommand_Send,
  174. AtCommand_SetBattleFlag,
  175. AtCommand_UnMute,
  176. AtCommand_Clearweather, // by Dexity
  177. AtCommand_UpTime, // by MC Cameri
  178. AtCommand_ChangeSex, // by MC Cameri
  179. AtCommand_Mute, // [celest]
  180. AtCommand_WhoZeny, // [Valaris] <-- LOL...(MC Cameri) worth it.
  181. AtCommand_Refresh, // by MC Cameri
  182. AtCommand_PetId, // by MC Cameri
  183. AtCommand_Identify, // by MC Cameri
  184. AtCommand_Gmotd, // Added by MC Cameri, created by davidsiaw
  185. AtCommand_MiscEffect, // by MC Cameri
  186. AtCommand_MobSearch,
  187. AtCommand_CleanMap,
  188. AtCommand_NpcTalk,
  189. AtCommand_PetTalk,
  190. AtCommand_Users,
  191. AtCommand_SkillTree, // by MouseJstr
  192. AtCommand_Marry, // by MouseJstr
  193. AtCommand_Divorce, // by MouseJstr
  194. AtCommand_Me, //added by massdriller, code by lordalfa
  195. AtCommand_DMStart, // by MouseJstr
  196. AtCommand_DMTick, // by MouseJstr
  197. AtCommand_JumpToId2, // by Dino9021
  198. AtCommand_RecallId2, // by Dino9021
  199. AtCommand_KickId2, // by Dino9021
  200. AtCommand_ReviveId2, // by Dino9021
  201. AtCommand_KillId2, // by Dino9021
  202. AtCommand_Sound,
  203. AtCommand_UndisguiseAll,
  204. AtCommand_DisguiseAll,
  205. AtCommand_ChangeLook,
  206. AtCommand_AutoLoot, //by Upa-Kun
  207. AtCommand_MobInfo, //by Lupus
  208. AtCommand_Exp, // by Skotlex
  209. AtCommand_Adopt, // by Veider
  210. AtCommand_Version, // by Ancyker
  211. AtCommand_MuteArea, // MouseJstr
  212. AtCommand_Rates, // MouseJstr
  213. AtCommand_ItemInfo, // Lupus
  214. AtCommand_WhoDrops, // Skotlex
  215. AtCommand_MapFlag, // Lupus
  216. AtCommand_MonsterIgnore, // [Valaris]
  217. AtCommand_FakeName, // [Valaris]
  218. AtCommand_Size, // [Valaris]
  219. AtCommand_ShowDelay,
  220. AtCommand_ShowExp,
  221. AtCommand_ShowZeny,
  222. AtCommand_AutoTrade,//durf
  223. AtCommand_ChangeGM,//durf
  224. AtCommand_ChangeLeader,
  225. AtCommand_PartyOption,
  226. AtCommand_Invite, // By LuzZza
  227. AtCommand_Duel, // By LuzZza
  228. AtCommand_Leave, // By LuzZza
  229. AtCommand_Accept, // By LuzZza
  230. AtCommand_Reject, // By LuzZza
  231. AtCommand_Away, // LuzZza
  232. AtCommand_Main, // LuzZza
  233. AtCommand_Clone, // [Valaris]
  234. AtCommand_ToNPC, // LuzZza
  235. AtCommand_Commands, // [Skotlex]
  236. AtCommand_NoAsk, // [LuzZza]
  237. AtCommand_Request, // [Skotlex]
  238. AtCommand_HomLevel, //[orn]
  239. AtCommand_HomEvolution, //[orn]
  240. AtCommand_MakeHomun, //[orn]
  241. AtCommand_HomFriendly, //[orn]
  242. AtCommand_HomHungry, //[orn]
  243. AtCommand_HomTalk, //[orn]
  244. AtCommand_HomInfo, //[Toms]
  245. AtCommand_HomStats, //[Skotlex]
  246. AtCommand_HomShuffle, //[Skotlex]
  247. AtCommand_ShowMobs, //KarLaeda
  248. AtCommand_FeelReset, //[HiddenDragon]
  249. AtCommand_HappyHappyJoyJoy,
  250. // SQL-only commands start
  251. #ifndef TXT_ONLY
  252. AtCommand_CheckMail, // [Valaris]
  253. AtCommand_ListMail, // [Valaris]
  254. AtCommand_ListNewMail, // [Valaris]
  255. AtCommand_ReadMail, // [Valaris]
  256. AtCommand_SendMail, // [Valaris]
  257. AtCommand_DeleteMail, // [Valaris]
  258. AtCommand_SendPriorityMail, // [Valaris]
  259. AtCommand_RefreshOnline, // [Valaris]
  260. // SQL-only commands end
  261. #endif
  262. // No more commands after this line
  263. AtCommand_Unknown,
  264. AtCommand_MAX
  265. };
  266. typedef enum AtCommandType AtCommandType;
  267. typedef struct AtCommandInfo {
  268. AtCommandType type;
  269. const char* command;
  270. int level;
  271. int (*proc)(const int fd, struct map_session_data* sd, const char* command, const char* message);
  272. } AtCommandInfo;
  273. AtCommandType is_atcommand(const int fd, struct map_session_data* sd, const char* message);
  274. AtCommandType is_atcommand_sub(const int fd, struct map_session_data* sd, const char* str, int gmlvl);
  275. AtCommandType atcommand(struct map_session_data *sd, const int level, const char* message, AtCommandInfo* info);
  276. int get_atcommand_level(const AtCommandType type);
  277. char* msg_txt(int msg_number); // [Yor]
  278. char* player_title_txt(int level); // [Lupus]
  279. void do_init_atcommand(void);
  280. void do_final_atcommand(void);
  281. int atcommand_item(const int fd, struct map_session_data* sd,const char* command, const char* message); // [Valaris]
  282. int atcommand_rura(const int fd, struct map_session_data* sd,const char* command, const char* message); // [Yor]
  283. int atcommand_jumpto(const int fd, struct map_session_data* sd, const char* command, const char* message); // [Yor]
  284. int atcommand_recall(const int fd, struct map_session_data* sd, const char* command, const char* message); // [Yor]
  285. int atcommand_monster(const int fd, struct map_session_data* sd, const char* command, const char* message);
  286. int atcommand_config_read(const char *cfgName);
  287. int msg_config_read(const char *cfgName);
  288. void do_final_msg(void);
  289. char* estr_lower(char* str);
  290. extern char atcommand_symbol;
  291. #define MAX_MSG 1000
  292. extern char* msg_table[MAX_MSG];
  293. #endif /* _ATCOMMAND_H_ */