瀏覽代碼

Cleaned struct tokens for map_session_data and status_change (#7490)

Fixes #7492
Singe Horizontal 2 年之前
父節點
當前提交
8eac71f57f
共有 71 個文件被更改,包括 2214 次插入2214 次删除
  1. 3 3
      src/common/mmo.hpp
  2. 15 15
      src/map/achievement.cpp
  3. 11 11
      src/map/achievement.hpp
  4. 53 53
      src/map/atcommand.cpp
  5. 3 3
      src/map/atcommand.hpp
  6. 99 99
      src/map/battle.cpp
  7. 4 4
      src/map/battle.hpp
  8. 23 23
      src/map/battleground.cpp
  9. 15 15
      src/map/battleground.hpp
  10. 12 12
      src/map/buyingstore.cpp
  11. 10 10
      src/map/buyingstore.hpp
  12. 2 2
      src/map/cashshop.cpp
  13. 3 3
      src/map/cashshop.hpp
  14. 29 29
      src/map/channel.cpp
  15. 23 23
      src/map/channel.hpp
  16. 7 7
      src/map/chat.cpp
  17. 8 8
      src/map/chat.hpp
  18. 23 23
      src/map/chrif.cpp
  19. 13 13
      src/map/chrif.hpp
  20. 6 6
      src/map/clan.cpp
  21. 7 7
      src/map/clan.hpp
  22. 120 120
      src/map/clif.cpp
  23. 310 310
      src/map/clif.hpp
  24. 13 13
      src/map/duel.cpp
  25. 8 8
      src/map/duel.hpp
  26. 45 45
      src/map/guild.cpp
  27. 24 24
      src/map/guild.hpp
  28. 17 17
      src/map/homunculus.cpp
  29. 10 10
      src/map/homunculus.hpp
  30. 7 7
      src/map/instance.cpp
  31. 3 3
      src/map/instance.hpp
  32. 46 46
      src/map/intif.cpp
  33. 17 17
      src/map/intif.hpp
  34. 2 2
      src/map/itemdb.cpp
  35. 8 8
      src/map/log.cpp
  36. 9 9
      src/map/log.hpp
  37. 11 11
      src/map/mail.cpp
  38. 11 11
      src/map/mail.hpp
  39. 32 32
      src/map/map.cpp
  40. 9 9
      src/map/map.hpp
  41. 15 15
      src/map/mob.cpp
  42. 4 4
      src/map/mob.hpp
  43. 43 43
      src/map/npc.cpp
  44. 24 24
      src/map/npc.hpp
  45. 3 3
      src/map/npc_chat.cpp
  46. 39 39
      src/map/party.cpp
  47. 25 25
      src/map/party.hpp
  48. 114 114
      src/map/pc.cpp
  49. 209 209
      src/map/pc.hpp
  50. 3 3
      src/map/pc_groups.cpp
  51. 1 1
      src/map/pc_groups.hpp
  52. 33 33
      src/map/pet.cpp
  53. 18 18
      src/map/pet.hpp
  54. 9 9
      src/map/quest.cpp
  55. 8 8
      src/map/quest.hpp
  56. 113 113
      src/map/script.cpp
  57. 15 15
      src/map/script.hpp
  58. 17 17
      src/map/searchstore.cpp
  59. 10 10
      src/map/searchstore.hpp
  60. 125 125
      src/map/skill.cpp
  61. 30 30
      src/map/skill.hpp
  62. 149 149
      src/map/status.cpp
  63. 10 10
      src/map/status.hpp
  64. 28 28
      src/map/storage.cpp
  65. 25 25
      src/map/storage.hpp
  66. 16 16
      src/map/trade.cpp
  67. 8 8
      src/map/trade.hpp
  68. 25 25
      src/map/unit.cpp
  69. 5 5
      src/map/unit.hpp
  70. 11 11
      src/map/vending.cpp
  71. 8 8
      src/map/vending.hpp

+ 3 - 3
src/common/mmo.hpp

@@ -693,14 +693,14 @@ struct party {
 	struct party_member member[MAX_PARTY];
 };
 
-struct map_session_data;
+class map_session_data;
 struct guild_member {
 	uint32 account_id, char_id;
 	short hair,hair_color,gender,class_,lv;
 	t_exp exp;
 	short online,position;
 	char name[NAME_LENGTH];
-	struct map_session_data *sd;
+	map_session_data *sd;
 	unsigned char modified;
 	uint32 last_login;
 };
@@ -1121,7 +1121,7 @@ struct clan{
 	char master[NAME_LENGTH];
 	char map[MAP_NAME_LENGTH_EXT];
 	short max_member, connect_member;
-	struct map_session_data *members[MAX_CLAN];
+	map_session_data *members[MAX_CLAN];
 	struct clan_alliance alliance[MAX_CLANALLIANCE];
 	unsigned short instance_id;
 };

+ 15 - 15
src/map/achievement.cpp

@@ -439,7 +439,7 @@ AchievementLevelDatabase achievement_level_db;
  * @param achievement_id: Achievement to add
  * @return NULL on failure, achievement data on success
  */
-struct achievement *achievement_add(struct map_session_data *sd, int achievement_id)
+struct achievement *achievement_add(map_session_data *sd, int achievement_id)
 {
 	int i, index;
 
@@ -485,7 +485,7 @@ struct achievement *achievement_add(struct map_session_data *sd, int achievement
  * @param achievement_id: Achievement to remove
  * @return True on success, false on failure
  */
-bool achievement_remove(struct map_session_data *sd, int achievement_id)
+bool achievement_remove(map_session_data *sd, int achievement_id)
 {
 	struct achievement dummy;
 	int i;
@@ -532,7 +532,7 @@ bool achievement_remove(struct map_session_data *sd, int achievement_id)
  * @param achievement_id: Achievement to check if it's complete
  * @return True on completed, false if not
  */
-static bool achievement_done(struct map_session_data *sd, int achievement_id) {
+static bool achievement_done(map_session_data *sd, int achievement_id) {
 	for (int i = 0; i < sd->achievement_data.count; i++) {
 		if (sd->achievement_data.achievements[i].achievement_id == achievement_id && sd->achievement_data.achievements[i].completed > 0)
 			return true;
@@ -547,7 +547,7 @@ static bool achievement_done(struct map_session_data *sd, int achievement_id) {
  * @param achievement_id: Achievement to check if it has a dependent
  * @return False on failure or not complete, true on complete or no dependents
  */
-bool achievement_check_dependent(struct map_session_data *sd, int achievement_id)
+bool achievement_check_dependent(map_session_data *sd, int achievement_id)
 {
 	nullpo_retr(false, sd);
 
@@ -573,7 +573,7 @@ bool achievement_check_dependent(struct map_session_data *sd, int achievement_id
  * @param sd: Achievement to compare for completed dependents
  * @return True if successful, false if not
  */
-static int achievement_check_groups(struct map_session_data *sd, struct s_achievement_db *ad)
+static int achievement_check_groups(map_session_data *sd, struct s_achievement_db *ad)
 {
 	int i;
 
@@ -604,7 +604,7 @@ static int achievement_check_groups(struct map_session_data *sd, struct s_achiev
  * @param complete: Complete state of an achievement
  * @return True if successful, false if not
  */
-bool achievement_update_achievement(struct map_session_data *sd, int achievement_id, bool complete)
+bool achievement_update_achievement(map_session_data *sd, int achievement_id, bool complete)
 {
 	int i;
 
@@ -658,7 +658,7 @@ bool achievement_update_achievement(struct map_session_data *sd, int achievement
  * @param sd: Player getting the reward
  * @param achievement_id: Achievement to get reward data
  */
-void achievement_get_reward(struct map_session_data *sd, int achievement_id, time_t rewarded)
+void achievement_get_reward(map_session_data *sd, int achievement_id, time_t rewarded)
 {
 	int i;
 
@@ -699,7 +699,7 @@ void achievement_get_reward(struct map_session_data *sd, int achievement_id, tim
  * @param sd: Player to get reward
  * @param achievement_id: Achievement to get reward data
  */
-void achievement_check_reward(struct map_session_data *sd, int achievement_id)
+void achievement_check_reward(map_session_data *sd, int achievement_id)
 {
 	int i;
 
@@ -735,7 +735,7 @@ void achievement_check_reward(struct map_session_data *sd, int achievement_id)
  */
 void achievement_get_titles(uint32 char_id)
 {
-	struct map_session_data *sd = map_charid2sd(char_id);
+	map_session_data *sd = map_charid2sd(char_id);
 
 	if (sd) {
 		sd->titles.clear();
@@ -757,7 +757,7 @@ void achievement_get_titles(uint32 char_id)
  * Frees the player's data for achievements
  * @param sd: Player's session
  */
-void achievement_free(struct map_session_data *sd)
+void achievement_free(map_session_data *sd)
 {
 	nullpo_retv(sd);
 
@@ -775,7 +775,7 @@ void achievement_free(struct map_session_data *sd)
  * @param type: Type to return
  * @return The type's data, -1 if player doesn't have achievement, -2 on failure/incorrect type
  */
-int achievement_check_progress(struct map_session_data *sd, int achievement_id, int type)
+int achievement_check_progress(map_session_data *sd, int achievement_id, int type)
 {
 	int i;
 
@@ -808,7 +808,7 @@ int achievement_check_progress(struct map_session_data *sd, int achievement_id,
  * @param flag: If the call should attempt to give the AG_GOAL_ACHIEVE achievement
  * @return Rollover and TNL EXP or 0 on failure
  */
-int *achievement_level(struct map_session_data *sd, bool flag)
+int *achievement_level(map_session_data *sd, bool flag)
 {
 	nullpo_retr(nullptr, sd);
 
@@ -872,7 +872,7 @@ int *achievement_level(struct map_session_data *sd, bool flag)
 	return info;
 }
 
-bool achievement_check_condition( struct script_code* condition, struct map_session_data* sd ){
+bool achievement_check_condition( struct script_code* condition, map_session_data* sd ){
 	// Save the old script the player was attached to
 	struct script_state* previous_st = sd->st;
 
@@ -927,7 +927,7 @@ static bool achievement_target_complete(std::shared_ptr<s_achievement_db> ad, st
  * @param update_count: Objective values from event
  * @return 1 on success and false on failure
  */
-static bool achievement_update_objectives(struct map_session_data *sd, std::shared_ptr<struct s_achievement_db> ad, enum e_achievement_group group, const std::array<int, MAX_ACHIEVEMENT_OBJECTIVES> &update_count)
+static bool achievement_update_objectives(map_session_data *sd, std::shared_ptr<struct s_achievement_db> ad, enum e_achievement_group group, const std::array<int, MAX_ACHIEVEMENT_OBJECTIVES> &update_count)
 {
 	if (!ad || !sd)
 		return false;
@@ -1087,7 +1087,7 @@ static bool achievement_update_objectives(struct map_session_data *sd, std::shar
  * @param sp_value: SP parameter value
  * @param arg_count: va_arg count
  */
-void achievement_update_objective(struct map_session_data *sd, enum e_achievement_group group, uint8 arg_count, ...)
+void achievement_update_objective(map_session_data *sd, enum e_achievement_group group, uint8 arg_count, ...)
 {
 	if (!battle_config.feature_achievement)
 		return;

+ 11 - 11
src/map/achievement.hpp

@@ -15,7 +15,7 @@
 #include "../common/database.hpp"
 #include "../common/db.hpp"
 
-struct map_session_data;
+class map_session_data;
 struct block_list;
 
 enum e_achievement_group {
@@ -134,17 +134,17 @@ public:
 
 extern AchievementLevelDatabase achievement_level_db;
 
-void achievement_get_reward(struct map_session_data *sd, int achievement_id, time_t rewarded);
-struct achievement *achievement_add(struct map_session_data *sd, int achievement_id);
-bool achievement_remove(struct map_session_data *sd, int achievement_id);
-bool achievement_update_achievement(struct map_session_data *sd, int achievement_id, bool complete);
-void achievement_check_reward(struct map_session_data *sd, int achievement_id);
-void achievement_free(struct map_session_data *sd);
-int achievement_check_progress(struct map_session_data *sd, int achievement_id, int type);
-int *achievement_level(struct map_session_data *sd, bool flag);
-bool achievement_check_condition(struct script_code* condition, struct map_session_data* sd);
+void achievement_get_reward(map_session_data *sd, int achievement_id, time_t rewarded);
+struct achievement *achievement_add(map_session_data *sd, int achievement_id);
+bool achievement_remove(map_session_data *sd, int achievement_id);
+bool achievement_update_achievement(map_session_data *sd, int achievement_id, bool complete);
+void achievement_check_reward(map_session_data *sd, int achievement_id);
+void achievement_free(map_session_data *sd);
+int achievement_check_progress(map_session_data *sd, int achievement_id, int type);
+int *achievement_level(map_session_data *sd, bool flag);
+bool achievement_check_condition(struct script_code* condition, map_session_data* sd);
 void achievement_get_titles(uint32 char_id);
-void achievement_update_objective(struct map_session_data *sd, enum e_achievement_group group, uint8 arg_count, ...);
+void achievement_update_objective(map_session_data *sd, enum e_achievement_group group, uint8 arg_count, ...);
 int achievement_update_objective_sub(block_list *bl, va_list ap);
 void achievement_read_db(void);
 void achievement_db_reload(void);

+ 53 - 53
src/map/atcommand.cpp

@@ -58,7 +58,7 @@
 using namespace rathena;
 
 #define ATCOMMAND_LENGTH 50
-#define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message)
+#define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, map_session_data* sd, const char* command, const char* message)
 
 typedef struct AtCommandInfo AtCommandInfo;
 
@@ -195,8 +195,8 @@ const char *parent_cmd;
 struct atcmd_binding_data** atcmd_binding;
 
 static AtCommandInfo* get_atcommandinfo_byname(const char *name); // @help
-static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand); // @help
-static void warp_get_suggestions(struct map_session_data* sd, const char *name); // @rura, @warp, @mapmove
+static void atcommand_get_suggestions(map_session_data* sd, const char *name, bool atcommand); // @help
+static void warp_get_suggestions(map_session_data* sd, const char *name); // @rura, @warp, @mapmove
 
 // @commands (script-based)
 struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
@@ -478,7 +478,7 @@ ACMD_FUNC(send)
  *
  * @author Euphy
  */
-static void warp_get_suggestions(struct map_session_data* sd, const char *name) {
+static void warp_get_suggestions(map_session_data* sd, const char *name) {
 	// Minimum length for suggestions is 2 characters
 	if( strlen( name ) < 2 ){
 		return;
@@ -637,7 +637,7 @@ ACMD_FUNC(mapmove)
  *------------------------------------------*/
 ACMD_FUNC(where)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 
 	nullpo_retr(-1, sd);
 	memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
@@ -667,7 +667,7 @@ ACMD_FUNC(where)
  *------------------------------------------*/
 ACMD_FUNC(jumpto)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 
 	nullpo_retr(-1, sd);
 
@@ -751,7 +751,7 @@ ACMD_FUNC(jump)
  * various info.
  *------------------------------------------*/
 ACMD_FUNC(who) {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	struct s_mapiterator *iter = NULL;	
 	char player_name[NAME_LENGTH] = "";
 	int count = 0;
@@ -855,7 +855,7 @@ ACMD_FUNC(who) {
  *------------------------------------------*/
 ACMD_FUNC(whogm)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 	int j, count;
 	int level;
@@ -3249,7 +3249,7 @@ ACMD_FUNC(petrename)
  *
  *------------------------------------------*/
 ACMD_FUNC(recall) {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 
 	nullpo_retr(-1, sd);
 
@@ -3479,7 +3479,7 @@ ACMD_FUNC(day)
  *------------------------------------------*/
 ACMD_FUNC(doom)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 
 	nullpo_retr(-1, sd);
@@ -3506,7 +3506,7 @@ ACMD_FUNC(doom)
  *------------------------------------------*/
 ACMD_FUNC(doommap)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 
 	nullpo_retr(-1, sd);
@@ -3531,7 +3531,7 @@ ACMD_FUNC(doommap)
 /*==========================================
  *
  *------------------------------------------*/
-static void atcommand_raise_sub(struct map_session_data* sd) {
+static void atcommand_raise_sub(map_session_data* sd) {
 
 	status_revive(&sd->bl, 100, 100);
 
@@ -3544,7 +3544,7 @@ static void atcommand_raise_sub(struct map_session_data* sd) {
  *------------------------------------------*/
 ACMD_FUNC(raise)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 
 	nullpo_retr(-1, sd);
@@ -3565,7 +3565,7 @@ ACMD_FUNC(raise)
  *------------------------------------------*/
 ACMD_FUNC(raisemap)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 
 	nullpo_retr(-1, sd);
@@ -3586,7 +3586,7 @@ ACMD_FUNC(raisemap)
  *------------------------------------------*/
 ACMD_FUNC(kick)
 {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	nullpo_retr(-1, sd);
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
@@ -3618,7 +3618,7 @@ ACMD_FUNC(kick)
  *------------------------------------------*/
 ACMD_FUNC(kickall)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 	nullpo_retr(-1, sd);
 
@@ -4021,7 +4021,7 @@ ACMD_FUNC(idsearch)
  *------------------------------------------*/
 ACMD_FUNC(recallall)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 	int count;
 	nullpo_retr(-1, sd);
@@ -4066,7 +4066,7 @@ ACMD_FUNC(recallall)
  *------------------------------------------*/
 ACMD_FUNC(guildrecall)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 	int count;
 	char guild_name[NAME_LENGTH];
@@ -4128,7 +4128,7 @@ ACMD_FUNC(guildrecall)
  *------------------------------------------*/
 ACMD_FUNC(partyrecall)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 	char party_name[NAME_LENGTH];
 	struct party_data *p;
@@ -4276,7 +4276,7 @@ ACMD_FUNC(reload) {
 		clif_displaymessage(fd, msg_txt(sd,268)); // Reloaded the Message of the Day.
 	} else if (strstr(command, "script") || strncmp(message, "script", 3) == 0) {
 		struct s_mapiterator* iter;
-		struct map_session_data* pl_sd;
+		map_session_data* pl_sd;
 		//atcommand_broadcast( fd, sd, "@broadcast", "Server is reloading scripts..." );
 		//atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" );
 
@@ -4356,7 +4356,7 @@ ACMD_FUNC(partysharelvl) {
  * 3 = Shows the chats in that map
  *------------------------------------------*/
 ACMD_FUNC(mapinfo) {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct s_mapiterator* iter;
 	struct chat_data *cd = NULL;
 	char direction[12];
@@ -4910,7 +4910,7 @@ ACMD_FUNC(repairall)
  *------------------------------------------*/
 ACMD_FUNC(nuke)
 {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	nullpo_retr(-1, sd);
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
@@ -5217,7 +5217,7 @@ ACMD_FUNC(servertime)
  *------------------------------------------*/
 ACMD_FUNC(jail)
 {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 
 	nullpo_retr(-1, sd);
 
@@ -5255,7 +5255,7 @@ ACMD_FUNC(jail)
  *------------------------------------------*/
 ACMD_FUNC(unjail)
 {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
 
@@ -5288,7 +5288,7 @@ ACMD_FUNC(unjail)
 }
 
 ACMD_FUNC(jailfor) {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	char * modif_p;
 	int jailtime = 0;
 
@@ -5442,7 +5442,7 @@ ACMD_FUNC(disguise)
 ACMD_FUNC(disguiseall)
 {
 	int mob_id=0;
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	struct s_mapiterator* iter;
 	nullpo_retr(-1, sd);
 
@@ -5508,7 +5508,7 @@ ACMD_FUNC(disguiseguild)
 	}
 
 	for( i = 0; i < g->max_member; i++ ){
-		struct map_session_data *pl_sd;
+		map_session_data *pl_sd;
 		if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) )
 			pc_disguise(pl_sd, id);
 	}
@@ -5540,7 +5540,7 @@ ACMD_FUNC(undisguise)
  *------------------------------------------*/
 ACMD_FUNC(undisguiseall)
 {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	struct s_mapiterator* iter;
 	nullpo_retr(-1, sd);
 
@@ -5578,7 +5578,7 @@ ACMD_FUNC(undisguiseguild)
 	}
 
 	for(i = 0; i < g->max_member; i++){
-		struct map_session_data *pl_sd;
+		map_session_data *pl_sd;
 		if( (pl_sd = g->member[i].sd) && pl_sd->disguise )
 			pc_disguise(pl_sd, 0);
 	}
@@ -5849,7 +5849,7 @@ ACMD_FUNC(addwarp)
  *------------------------------------------*/
 ACMD_FUNC(follow)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	nullpo_retr(-1, sd);
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
@@ -6117,7 +6117,7 @@ ACMD_FUNC(skillid) {
  *------------------------------------------*/
 ACMD_FUNC(useskill)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	struct block_list *bl;
 	uint16 skill_id;
 	uint16 skill_lv;
@@ -6254,7 +6254,7 @@ ACMD_FUNC(displayskillunit)
  *------------------------------------------*/
 ACMD_FUNC(skilltree)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	uint16 skill_id;
 	nullpo_retr(-1, sd);
 
@@ -6301,7 +6301,7 @@ ACMD_FUNC(skilltree)
 }
 
 // Hand a ring with partners name on it to this char
-void getring (struct map_session_data* sd)
+void getring (map_session_data* sd)
 {
 	char flag = 0;
 	t_itemid item_id;
@@ -6327,7 +6327,7 @@ void getring (struct map_session_data* sd)
  *------------------------------------------*/
 ACMD_FUNC(marry)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 
 	nullpo_retr(-1, sd);
 
@@ -6457,7 +6457,7 @@ ACMD_FUNC(autotrade) {
 ACMD_FUNC(changegm)
 {
 	struct guild *g;
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	nullpo_retr(-1, sd);
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
@@ -7219,7 +7219,7 @@ ACMD_FUNC(users)
 	iter = mapit_getallusers();
 	for(;;)
 	{
-		struct map_session_data* sd2 = (struct map_session_data*)mapit_next(iter);
+		map_session_data* sd2 = (map_session_data*)mapit_next(iter);
 		if( sd2 == NULL )
 			break;// no more users
 
@@ -7342,7 +7342,7 @@ ACMD_FUNC(adjgroup)
  *------------------------------------------*/
 ACMD_FUNC(trade)
 {
-    struct map_session_data *pl_sd = NULL;
+    map_session_data* pl_sd = nullptr;;
 	nullpo_retr(-1, sd);
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
@@ -7396,7 +7396,7 @@ ACMD_FUNC(setbattleflag)
  *------------------------------------------*/
 ACMD_FUNC(unmute)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	nullpo_retr(-1, sd);
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
@@ -7494,7 +7494,7 @@ ACMD_FUNC(changecharsex)
  *------------------------------------------------*/
 ACMD_FUNC(mute)
 {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	int manner;
 	nullpo_retr(-1, sd);
 
@@ -7545,7 +7545,7 @@ ACMD_FUNC(refresh)
 
 ACMD_FUNC(refreshall)
 {
-	struct map_session_data* iter_sd;
+	map_session_data* iter_sd;
 	struct s_mapiterator* iter;
 	nullpo_retr(-1, sd);
 
@@ -8400,7 +8400,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
 {
 
 	int time, id;
-	struct map_session_data *pl_sd = (struct map_session_data *)bl;
+	map_session_data *pl_sd = (map_session_data *)bl;
 	if (pl_sd == NULL)
 		return 0;
 
@@ -8534,7 +8534,7 @@ ACMD_FUNC(size)
 ACMD_FUNC(sizeall)
 {
 	int size;
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	struct s_mapiterator* iter;
 
 	size = atoi(message);
@@ -8565,7 +8565,7 @@ ACMD_FUNC(sizeguild)
 {
 	int size = SZ_SMALL, i;
 	char guild[NAME_LENGTH];
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 	struct guild *g;
 	nullpo_retr(-1, sd);
 
@@ -8798,7 +8798,7 @@ ACMD_FUNC(showdelay)
 ACMD_FUNC(invite)
 {
 	unsigned int did = sd->duel_group;
-	struct map_session_data *target_sd = NULL;
+	map_session_data *target_sd = NULL;
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
 	memset(atcmd_output, '\0', sizeof(atcmd_output));
@@ -8870,7 +8870,7 @@ ACMD_FUNC(duel)
 			}
 			duel_create(sd, maxpl);
 		} else {
-			struct map_session_data *target_sd = NULL;
+			map_session_data *target_sd = NULL;
 
 			memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
 			memset(atcmd_output, '\0', sizeof(atcmd_output));
@@ -9027,7 +9027,7 @@ ACMD_FUNC(cash)
 ACMD_FUNC(clone)
 {
 	int x=0,y=0,flag=0,master=0,i=0;
-	struct map_session_data *pl_sd=NULL;
+	map_session_data *pl_sd=NULL;
 
 	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
 
@@ -9605,7 +9605,7 @@ ACMD_FUNC(font)
 /*==========================================
  * type: 1 = commands (@), 2 = charcommands (#)
  *------------------------------------------*/
-static void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommandType type)
+static void atcommand_commands_sub(map_session_data* sd, const int fd, AtCommandType type)
 {
 	char line_buff[CHATBOX_SIZE];
 	char* cur = line_buff;
@@ -9992,7 +9992,7 @@ ACMD_FUNC(join){
  * Display available option for @channel command
  * @command : the name of used command (for alias case)
  */
-static inline void atcmd_channel_help(struct map_session_data *sd, const char *command)
+static inline void atcmd_channel_help(map_session_data *sd, const char *command)
 {
 	int fd = sd->fd;
 	bool can_delete = pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN);
@@ -10194,7 +10194,7 @@ ACMD_FUNC(langtype)
 
 #ifdef VIP_ENABLE
 ACMD_FUNC(vip) {
-	struct map_session_data *pl_sd = NULL;
+	map_session_data* pl_sd = nullptr;;
 	char * modif_p;
 	int32 vipdifftime = 0;
 	time_t now=time(NULL);
@@ -10383,7 +10383,7 @@ ACMD_FUNC(costume) {
 * @author [Cydh], [Antares]
 */
 ACMD_FUNC(cloneequip) {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 
 	nullpo_retr(-1, sd);
 
@@ -10456,7 +10456,7 @@ ACMD_FUNC(cloneequip) {
 * @author [Cydh], [Antares]
 */
 ACMD_FUNC(clonestat) {
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 
 	nullpo_retr(-1, sd);
 
@@ -11172,7 +11172,7 @@ static AtCommandInfo* get_atcommandinfo_byname(const char *name)
 }
 
 /// AtCommand suggestion
-static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) {
+static void atcommand_get_suggestions(map_session_data* sd, const char *name, bool atcommand) {
 	DBIterator* atcommand_iter;
 	AtCommandInfo* command_info = NULL;
 	AtCommandType type = atcommand ? COMMAND_ATCOMMAND : COMMAND_CHARCOMMAND;
@@ -11259,7 +11259,7 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
  *  2 : console (admin:@atcommand)
  *  3 : script call (useatcmd)
  */
-bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type)
+bool is_atcommand(const int fd, map_session_data* sd, const char* message, int type)
 {
 	char command[CHAT_SIZE_MAX], params[CHAT_SIZE_MAX];
 	char output[CHAT_SIZE_MAX];

+ 3 - 3
src/map/atcommand.hpp

@@ -7,7 +7,7 @@
 #include "../common/cbasetypes.hpp"
 #include "../common/mmo.hpp"
 
-struct map_session_data;
+class map_session_data;
 
 //global var
 extern char atcommand_symbol;
@@ -19,9 +19,9 @@ enum AtCommandType : uint8 {
 	COMMAND_CHARCOMMAND = 2,
 } ;
 
-typedef int (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message);
+typedef int (*AtCommandFunc)(const int fd, map_session_data* sd, const char* command, const char* message);
 
-bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type);
+bool is_atcommand(const int fd, map_session_data* sd, const char* message, int type);
 
 void do_init_atcommand(void);
 void do_final_atcommand(void);

+ 99 - 99
src/map/battle.cpp

@@ -123,7 +123,7 @@ int battle_gettarget(struct block_list* bl)
 {
 
 	switch (bl->type) {
-		case BL_PC:  return ((struct map_session_data*)bl)->ud.target;
+		case BL_PC:  return ((map_session_data*)bl)->ud.target;
 		case BL_MOB: return ((struct mob_data*)bl)->target_id;
 		case BL_PET: return ((struct pet_data*)bl)->target_id;
 		case BL_HOM: return ((struct homun_data*)bl)->ud.target;
@@ -334,7 +334,7 @@ TIMER_FUNC(battle_delay_damage_sub){
 			}
 		}
 
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 
 		if (sd && --sd->delayed_damage == 0 && sd->state.hold_recalc) {
 			sd->state.hold_recalc = false;
@@ -348,7 +348,7 @@ TIMER_FUNC(battle_delay_damage_sub){
 int battle_delay_damage(t_tick tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, t_tick ddelay, bool additional_effects, bool isspdamage)
 {
 	struct delay_damage *dat;
-	struct status_change *sc;
+	status_change *sc;
 	struct block_list *d_tbl = NULL;
 	struct block_list *e_tbl = NULL;
 
@@ -370,7 +370,7 @@ int battle_delay_damage(t_tick tick, int amotion, struct block_list *src, struct
 		&& skill_id != PA_PRESSURE
 #endif
 		) {
-		struct map_session_data* tsd = BL_CAST( BL_PC, target );
+		map_session_data* tsd = BL_CAST( BL_PC, target );
 
 		if( tsd && pc_issit( tsd ) && battle_config.devotion_standup_fix ){
 			pc_setstand( tsd, true );
@@ -424,7 +424,7 @@ int battle_delay_damage(t_tick tick, int amotion, struct block_list *src, struct
  */
 int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 damage,int atk_elem,int def_type, int def_lv)
 {
-	struct status_change *sc = NULL, *tsc = NULL;
+	status_change *sc = NULL, *tsc = NULL;
 	int ratio;
 
 	if (src) sc = status_get_sc(src);
@@ -654,7 +654,7 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
  * @return damage Damage diff between original damage and after calculation
  */
 int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_list *target, std::bitset<NK_MAX> nk, int rh_ele, int lh_ele, int64 damage, int left, int flag){
-	struct map_session_data *sd, ///< Attacker session data if BL_PC
+	map_session_data *sd, ///< Attacker session data if BL_PC
 		*tsd; ///< Target session data if BL_PC
 	int cardfix = 1000;
 	int s_class, ///< Attacker class
@@ -1060,7 +1060,7 @@ static void battle_absorb_damage(struct block_list *bl, struct Damage *d) {
 	switch (bl->type) {
 		case BL_PC:
 			{
-				struct map_session_data *sd = BL_CAST(BL_PC, bl);
+				map_session_data *sd = BL_CAST(BL_PC, bl);
 				if (!sd)
 					return;
 				dmg_ori = dmg_new = d->damage + d->damage2;
@@ -1106,7 +1106,7 @@ static void battle_absorb_damage(struct block_list *bl, struct Damage *d) {
  * @param skill_lv: Skill level
  * @return True: Damage inflicted, False: Missed
  **/
-bool battle_status_block_damage(struct block_list *src, struct block_list *target, struct status_change *sc, struct Damage *d, int64 &damage, uint16 skill_id, uint16 skill_lv) {
+bool battle_status_block_damage(struct block_list *src, struct block_list *target, status_change *sc, struct Damage *d, int64 &damage, uint16 skill_id, uint16 skill_lv) {
 	if (!src || !target || !sc || !d)
 		return true;
 
@@ -1413,8 +1413,8 @@ bool battle_status_block_damage(struct block_list *src, struct block_list *targe
  */
 int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = NULL, *tsd = BL_CAST(BL_PC, src);
-	struct status_change *sc;
+	map_session_data *sd = NULL, *tsd = BL_CAST(BL_PC, src);
+	status_change *sc;
 	struct status_change_entry *sce;
 	int div_ = d->div_, flag = d->flag;
 
@@ -1430,7 +1430,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
 		return 0;
 
 	if (bl->type == BL_PC) {
-		sd=(struct map_session_data *)bl;
+		sd=(map_session_data *)bl;
 		//Special no damage states
 		if(flag&BF_WEAPON && sd->special_state.no_weapon_damage)
 			damage -= damage * sd->special_state.no_weapon_damage / 100;
@@ -1868,7 +1868,7 @@ bool battle_can_hit_bg_target(struct block_list *src, struct block_list *bl, uin
 		if (status_bl_has_mode(bl, MD_SKILLIMMUNE) && flag&BF_SKILL) //Skill immunity.
 			return false;
 		if (src->type == BL_PC) {
-			struct map_session_data *sd = map_id2sd(src->id);
+			map_session_data *sd = map_id2sd(src->id);
 
 			if (sd && sd->bg_id == md->bg_id)
 				return false;
@@ -2059,7 +2059,7 @@ static int battle_calc_drain(int64 damage, int rate, int per)
  * @param type
  * @return damage
  */
-int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,int64 dmg,int type)
+int64 battle_addmastery(map_session_data *sd,struct block_list *target,int64 dmg,int type)
 {
 	int64 damage;
 	struct status_data *status = status_get_status_data(target);
@@ -2189,7 +2189,7 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in
 * @param damage Current damage
 * @param lr_type EQI_HAND_L:left-hand weapon, EQI_HAND_R:right-hand weapon
 */
-static void battle_add_weapon_damage(struct map_session_data *sd, int64 *damage, int lr_type) {
+static void battle_add_weapon_damage(map_session_data *sd, int64 *damage, int lr_type) {
 	if (!sd)
 		return;
 	//rodatazone says that Overrefine bonuses are part of baseatk
@@ -2209,7 +2209,7 @@ static void battle_add_weapon_damage(struct map_session_data *sd, int64 *damage,
 }
 
 #ifdef RENEWAL
-static int battle_calc_sizefix(int64 damage, struct map_session_data *sd, unsigned char t_size, unsigned char weapon_type, short flag)
+static int battle_calc_sizefix(int64 damage, map_session_data *sd, unsigned char t_size, unsigned char weapon_type, short flag)
 {
 	if (sd && !sd->special_state.no_sizefix && !flag) // Size fix only for players
 		damage = damage * (weapon_type == EQI_HAND_L ? sd->left_weapon.atkmods[t_size] : sd->right_weapon.atkmods[t_size]) / 100;
@@ -2234,7 +2234,7 @@ static int battle_calc_status_attack(struct status_data *status, short hand)
  * @param sd Player
  * @return Base weapon damage
  */
-static int battle_calc_base_weapon_attack(struct block_list *src, struct status_data *tstatus, struct weapon_atk *wa, struct map_session_data *sd, bool critical)
+static int battle_calc_base_weapon_attack(struct block_list *src, struct status_data *tstatus, struct weapon_atk *wa, map_session_data *sd, bool critical)
 {
 	struct status_data *status = status_get_status_data(src);
 	uint8 type = (wa == &status->lhw)?EQI_HAND_L:EQI_HAND_R;
@@ -2242,7 +2242,7 @@ static int battle_calc_base_weapon_attack(struct block_list *src, struct status_
 	uint16 atkmax = atkmin;
 	int64 damage = atkmin;
 	bool weapon_perfection = false;
-	struct status_change *sc = status_get_sc(src);
+	status_change *sc = status_get_sc(src);
 
 	if (sd && sd->equip_index[type] >= 0 && sd->inventory_data[sd->equip_index[type]]) {
 		short base_stat;
@@ -2307,12 +2307,12 @@ static int battle_calc_base_weapon_attack(struct block_list *src, struct status_
  *	Initial refactoring by Baalberith
  *	Refined and optimized by helvetica
  */
-static int64 battle_calc_base_damage(struct block_list *src, struct status_data *status, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, int flag)
+static int64 battle_calc_base_damage(struct block_list *src, struct status_data *status, struct weapon_atk *wa, status_change *sc, unsigned short t_size, int flag)
 {
 	unsigned int atkmin = 0, atkmax = 0;
 	short type = 0;
 	int64 damage = 0;
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 
 	nullpo_retr(damage, src);
 
@@ -2371,7 +2371,7 @@ static int64 battle_calc_base_damage(struct block_list *src, struct status_data
 		if (!(sd->special_state.no_sizefix || (flag&8)))
 			damage = damage * (type == EQI_HAND_L ? sd->left_weapon.atkmods[t_size] : sd->right_weapon.atkmods[t_size]) / 100;
 	} else if (src->type == BL_ELEM) {
-		struct status_change *ele_sc = status_get_sc(src);
+		status_change *ele_sc = status_get_sc(src);
 		int ele_class = status_get_class(src);
 
 		if (ele_sc) {
@@ -2434,7 +2434,7 @@ static int64 battle_calc_base_damage(struct block_list *src, struct status_data
  *	Initial refactoring by Baalberith
  *	Refined and optimized by helvetica
  */
-void battle_consume_ammo(struct map_session_data*sd, int skill, int lv)
+void battle_consume_ammo(map_session_data*sd, int skill, int lv)
 {
 	int qty = 1;
 
@@ -2505,7 +2505,7 @@ static int battle_range_type(struct block_list *src, struct block_list *target,
 	return BF_LONG;
 }
 
-static int battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id)
+static int battle_blewcount_bonus(map_session_data *sd, uint16 skill_id)
 {
 	if (sd->skillblown.empty())
 		return 0;
@@ -2615,7 +2615,7 @@ static int battle_skill_damage(struct block_list *src, struct block_list *target
  * @param sd: Player who has Chorus skill active
  * @return Bonus value based on party count
  */
-int battle_calc_chorusbonus(struct map_session_data *sd) {
+int battle_calc_chorusbonus(map_session_data *sd) {
 #ifdef RENEWAL // No bonus in renewal
 	return 0;
 #endif
@@ -2681,7 +2681,7 @@ static bool is_skill_using_arrow(struct block_list *src, int skill_id)
 {
 	if(src != NULL) {
 		struct status_data *sstatus = status_get_status_data(src);
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 
 		return ((sd && sd->state.arrow_atk) || (!sd && ((skill_id && skill_get_ammotype(skill_id)) || sstatus->rhw.range>3)) || (skill_id == HT_PHANTASMIC) || (skill_id == GS_GROUNDDRIFT));
 	} else
@@ -2699,7 +2699,7 @@ static bool is_skill_using_arrow(struct block_list *src, int skill_id)
 static bool is_attack_right_handed(struct block_list *src, int skill_id)
 {
 	if(src != NULL) {
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 
 		//Skills ALWAYS use ONLY your right-hand weapon (tested on Aegis 10.2)
 		if(!skill_id && sd && sd->weapontype1 == W_FIST && sd->weapontype2 != W_FIST)
@@ -2721,7 +2721,7 @@ static bool is_attack_left_handed(struct block_list *src, int skill_id)
 	if(src != NULL) {
 		//Skills ALWAYS use ONLY your right-hand weapon (tested on Aegis 10.2)
 		if(!skill_id) {
-			struct map_session_data *sd = BL_CAST(BL_PC, src);
+			map_session_data *sd = BL_CAST(BL_PC, src);
 
 			if (sd) {
 				if (sd->weapontype1 == W_FIST && sd->weapontype2 != W_FIST)
@@ -2763,7 +2763,7 @@ static bool is_attack_critical(struct Damage* wd, struct block_list *src, struct
 
 	if( sstatus->cri )
 	{
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 
 		if(wd->type == DMG_MULTI_HIT){	//Multiple Hit Attack Skills.
 			if(pc_checkskill(sd,GS_CHAINACTION) && !skill_get_nk(GS_CHAINACTION,NK_CRITICAL)) //Chain Action
@@ -2774,9 +2774,9 @@ static bool is_attack_critical(struct Damage* wd, struct block_list *src, struct
 		}
 
 		struct status_data *tstatus = status_get_status_data(target);
-		struct status_change *sc = status_get_sc(src);
-		struct status_change *tsc = status_get_sc(target);
-		struct map_session_data *tsd = BL_CAST(BL_PC, target);
+		status_change *sc = status_get_sc(src);
+		status_change *tsc = status_get_sc(target);
+		map_session_data *tsd = BL_CAST(BL_PC, target);
 		short cri = sstatus->cri;
 
 		if (sd) {
@@ -2856,7 +2856,7 @@ static int is_attack_piercing(struct Damage* wd, struct block_list *src, struct
 		return 2;
 
 	if(src != NULL) {
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 		struct status_data *tstatus = status_get_status_data(target);
 
 		if( skill_id != PA_SACRIFICE && skill_id != CR_GRANDCROSS && skill_id != NPC_GRANDDARKNESS && skill_id != PA_SHIELDCHAIN && skill_id != KO_HAPPOKUNAI
@@ -2917,9 +2917,9 @@ static bool is_attack_hitting(struct Damage* wd, struct block_list *src, struct
 {
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
-	struct status_change *sc = status_get_sc(src);
-	struct status_change *tsc = status_get_sc(target);
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
+	status_change *tsc = status_get_sc(target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
 	std::bitset<NK_MAX> nk = battle_skill_get_damage_properties(skill_id, wd->miscflag);
 	short flee, hitrate;
 
@@ -3105,8 +3105,8 @@ static bool is_attack_hitting(struct Damage* wd, struct block_list *src, struct
 static bool attack_ignores_def(struct Damage* wd, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, short weapon_position)
 {
 	struct status_data *tstatus = status_get_status_data(target);
-	struct status_change *sc = status_get_sc(src);
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
 	std::bitset<NK_MAX> nk = battle_skill_get_damage_properties(skill_id, wd->miscflag);
 
 #ifndef RENEWAL
@@ -3175,7 +3175,7 @@ static int battle_calc_equip_attack(struct block_list *src, int skill_id)
 	if(src != NULL) {
 		int eatk = 0;
 		struct status_data *status = status_get_status_data(src);
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 
 		if (sd) // add arrow atk if using an applicable skill
 			eatk += (is_skill_using_arrow(src, skill_id) ? sd->bonus.arrow_atk : 0);
@@ -3196,8 +3196,8 @@ static int battle_calc_equip_attack(struct block_list *src, int skill_id)
  */
 int battle_get_weapon_element(struct Damage* wd, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, short weapon_position, bool calc_for_damage_only)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct status_change *sc = status_get_sc(src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
 	struct status_data *sstatus = status_get_status_data(src);
 	int element = skill_get_ele(skill_id, skill_lv);
 
@@ -3290,8 +3290,8 @@ static void battle_calc_element_damage(struct Damage* wd, struct block_list *src
 
 	// Elemental attribute fix
 	if(!nk[NK_IGNOREELEMENT] && (wd->damage > 0 || wd->damage2 > 0)) {
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
-		struct status_change *sc = status_get_sc(src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
+		status_change *sc = status_get_sc(src);
 		struct status_data *sstatus = status_get_status_data(src);
 		struct status_data *tstatus = status_get_status_data(target);
 		int left_element = battle_get_weapon_element(wd, src, target, skill_id, skill_lv, EQI_HAND_L, true);
@@ -3391,8 +3391,8 @@ static void battle_calc_element_damage(struct Damage* wd, struct block_list *src
  */
 static void battle_calc_attack_masteries(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct status_change *sc = status_get_sc(src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
 	struct status_data *sstatus = status_get_status_data(src);
 	int t_class = status_get_class(target);
 
@@ -3488,7 +3488,7 @@ static void battle_calc_damage_parts(struct Damage* wd, struct block_list *src,s
 {
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
 	bool critical = false;
 
 	int right_element = battle_get_weapon_element(wd, src, target, skill_id, skill_lv, EQI_HAND_R, false);
@@ -3557,11 +3557,11 @@ static void battle_calc_damage_parts(struct Damage* wd, struct block_list *src,s
  */
 static void battle_calc_skill_base_damage(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct status_change *sc = status_get_sc(src);
+	status_change *sc = status_get_sc(src);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct map_session_data *tsd = BL_CAST(BL_PC, target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *tsd = BL_CAST(BL_PC, target);
 
 	uint16 i;
 	std::bitset<NK_MAX> nk = battle_skill_get_damage_properties(skill_id, wd->miscflag);
@@ -3818,9 +3818,9 @@ static void battle_apply_div_fix(struct Damage* d, uint16 skill_id)
  */
 static void battle_calc_multi_attack(struct Damage* wd, struct block_list *src,struct block_list *target, uint16 skill_id, uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct status_change *sc = status_get_sc(src);
-	struct status_change *tsc = status_get_sc(target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
+	status_change *tsc = status_get_sc(target);
 	struct status_data *tstatus = status_get_status_data(target);
 
 	if( sd && !skill_id ) {	// if no skill_id passed, check for double attack [helvetica]
@@ -3915,10 +3915,10 @@ static void battle_calc_multi_attack(struct Damage* wd, struct block_list *src,s
  */
 static int battle_calc_attack_skill_ratio(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct map_session_data *tsd = BL_CAST(BL_PC, target);
-	struct status_change *sc = status_get_sc(src);
-	struct status_change *tsc = status_get_sc(target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *tsd = BL_CAST(BL_PC, target);
+	status_change *sc = status_get_sc(src);
+	status_change *tsc = status_get_sc(target);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
 	int skillratio = 100;
@@ -5386,8 +5386,8 @@ static int battle_calc_attack_skill_ratio(struct Damage* wd, struct block_list *
  */
 static int64 battle_calc_skill_constant_addition(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct map_session_data *tsd = BL_CAST(BL_PC, target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *tsd = BL_CAST(BL_PC, target);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
 	int64 atk = 0;
@@ -5441,8 +5441,8 @@ static int64 battle_calc_skill_constant_addition(struct Damage* wd, struct block
  */
 static void battle_attack_sc_bonus(struct Damage* wd, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct status_change *sc = status_get_sc(src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
 	uint8 anger_id = 0; // SLS Anger
@@ -5634,10 +5634,10 @@ static void battle_attack_sc_bonus(struct Damage* wd, struct block_list *src, st
  */
 static void battle_calc_defense_reduction(struct Damage* wd, struct block_list *src,struct block_list *target, uint16 skill_id, uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct map_session_data *tsd = BL_CAST(BL_PC, target);
-	struct status_change *sc = status_get_sc(src);
-	struct status_change *tsc = status_get_sc(target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *tsd = BL_CAST(BL_PC, target);
+	status_change *sc = status_get_sc(src);
+	status_change *tsc = status_get_sc(target);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
 
@@ -5814,8 +5814,8 @@ static void battle_calc_defense_reduction(struct Damage* wd, struct block_list *
  */
 static void battle_calc_attack_post_defense(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct status_change *sc = status_get_sc(src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
 	struct status_data *sstatus = status_get_status_data(src);
 
 	// Post skill/vit reduction damage increases
@@ -5881,7 +5881,7 @@ static void battle_calc_attack_plant(struct Damage* wd, struct block_list *src,s
 	if( attack_hits || wd->damage > 0 )
 		wd->damage = 1; //In some cases, right hand no need to have a weapon to deal a damage
 	if( is_attack_left_handed(src, skill_id) && (attack_hits || wd->damage2 > 0) ) {
-		struct map_session_data *sd = BL_CAST(BL_PC, src);
+		map_session_data *sd = BL_CAST(BL_PC, src);
 
 		if (sd && sd->status.weapon == W_KATAR)
 			wd->damage2 = 0; //No backhand damage against plants
@@ -5890,7 +5890,7 @@ static void battle_calc_attack_plant(struct Damage* wd, struct block_list *src,s
 	}
 
 	if (attack_hits && target->type == BL_MOB) {
-		struct status_change *sc = status_get_sc(target);
+		status_change *sc = status_get_sc(target);
 		int64 damage_dummy = 1;
 
 		if (sc && !battle_status_block_damage(src, target, sc, wd, damage_dummy, skill_id, skill_lv)) { // Statuses that reduce damage to 0.
@@ -5938,7 +5938,7 @@ static void battle_calc_attack_plant(struct Damage* wd, struct block_list *src,s
  */
 static void battle_calc_attack_left_right_hands(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
 
 	if (sd) {
 		int skill;
@@ -5997,7 +5997,7 @@ struct block_list *battle_check_devotion(struct block_list *bl) {
 	struct block_list *d_bl = NULL;
 
 	if (battle_config.devotion_rdamage && battle_config.devotion_rdamage > rnd() % 100) {
-		struct status_change *sc = status_get_sc(bl);
+		status_change *sc = status_get_sc(bl);
 		if (sc && sc->getSCE(SC_DEVOTION))
 			d_bl = map_id2bl(sc->getSCE(SC_DEVOTION)->val1);
 	}
@@ -6019,7 +6019,7 @@ static void battle_calc_attack_gvg_bg(struct Damage* wd, struct block_list *src,
 			(!skill_id || skill_id ||
 			(src->type == BL_SKILL && (skill_id == SG_SUN_WARM || skill_id == SG_MOON_WARM || skill_id == SG_STAR_WARM))) ) {
 				int64 damage = wd->damage + wd->damage2, rdamage = 0;
-				struct map_session_data *tsd = BL_CAST(BL_PC, target);
+				map_session_data *tsd = BL_CAST(BL_PC, target);
 				struct status_data *sstatus = status_get_status_data(src);
 				t_tick tick = gettick(), rdelay = 0;
 
@@ -6078,10 +6078,10 @@ static void battle_calc_attack_gvg_bg(struct Damage* wd, struct block_list *src,
  */
 static void battle_calc_weapon_final_atk_modifiers(struct Damage* wd, struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv)
 {
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct map_session_data *tsd = BL_CAST(BL_PC, target);
-	struct status_change *sc = status_get_sc(src);
-	struct status_change *tsc = status_get_sc(target);
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *tsd = BL_CAST(BL_PC, target);
+	status_change *sc = status_get_sc(src);
+	status_change *tsc = status_get_sc(target);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
 	int skill_damage = 0;
@@ -6179,8 +6179,8 @@ static struct Damage initialize_weapon_data(struct block_list *src, struct block
 {
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
-	struct status_change *sc = status_get_sc(src);
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
+	status_change *sc = status_get_sc(src);
+	map_session_data *sd = BL_CAST(BL_PC, src);
 	struct Damage wd;
 
 	wd.type = DMG_NORMAL; //Normal attack
@@ -6348,8 +6348,8 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr
 		(src->type == BL_SKILL && (skill_id == SG_SUN_WARM || skill_id == SG_MOON_WARM || skill_id == SG_STAR_WARM ))))
 	{
 		int64 damage = wd->damage + wd->damage2, rdamage = 0;
-		struct map_session_data *tsd = BL_CAST(BL_PC, target);
-		struct status_change *tsc = status_get_sc(target);
+		map_session_data *tsd = BL_CAST(BL_PC, target);
+		status_change *tsc = status_get_sc(target);
 		struct status_data *sstatus = status_get_status_data(src);
 		struct unit_data *ud = unit_bl2ud(target);
 		t_tick tick = gettick(), rdelay = 0;
@@ -6397,10 +6397,10 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr
  */
 static struct Damage battle_calc_weapon_attack(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int wflag)
 {
-	struct map_session_data *sd, *tsd;
+	map_session_data *sd, *tsd;
 	struct Damage wd;
-	struct status_change *sc = status_get_sc(src);
-	struct status_change *tsc = status_get_sc(target);
+	status_change *sc = status_get_sc(src);
+	status_change *tsc = status_get_sc(target);
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
 	int right_element, left_element;
@@ -6794,7 +6794,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
 
 	TBL_PC *sd;
 	TBL_PC *tsd;
-	struct status_change *sc, *tsc;
+	status_change *sc, *tsc;
 	struct Damage ad;
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
@@ -7924,11 +7924,11 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
 	int skill_damage = 0;
 	short i, s_ele;
 
-	struct map_session_data *sd, *tsd;
+	map_session_data *sd, *tsd;
 	struct Damage md; //DO NOT CONFUSE with md of mob_data!
 	struct status_data *sstatus = status_get_status_data(src);
 	struct status_data *tstatus = status_get_status_data(target);
-	struct status_change *ssc = status_get_sc(src);
+	status_change *ssc = status_get_sc(src);
 
 	memset(&md,0,sizeof(md));
 
@@ -8109,7 +8109,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
 			{
 				short totaldef;
 				struct Damage atk = battle_calc_weapon_attack(src, target, skill_id, skill_lv, 0);
-				struct status_change *sc = status_get_sc(src);
+				status_change *sc = status_get_sc(src);
 
 				md.damage = (int64)sstatus->hp + (atk.damage * (int64)sstatus->hp * skill_lv) / (int64)sstatus->max_hp;
 
@@ -8188,7 +8188,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
 	}
 
 	if (!nk[NK_IGNOREFLEE]) {
-		struct status_change *sc = status_get_sc(target);
+		status_change *sc = status_get_sc(target);
 
 		i = 0; //Temp for "hit or no hit"
 		if(sc && sc->opt1 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING)
@@ -8298,7 +8298,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
  * @param target: Target to vanish HP/SP
  * @param flag: Damage struct battle flag
  */
-void battle_vanish_damage(struct map_session_data *sd, struct block_list *target, int flag)
+void battle_vanish_damage(map_session_data *sd, struct block_list *target, int flag)
 {
 	nullpo_retv(sd);
 	nullpo_retv(target);
@@ -8378,7 +8378,7 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
 	else // Some skills like Weaponry Research will cause damage even if attack is dodged
 		d.dmg_lv = ATK_DEF;
 
-	struct map_session_data *sd = BL_CAST(BL_PC, bl);
+	map_session_data *sd = BL_CAST(BL_PC, bl);
 
 	if (sd && d.damage + d.damage2 > 1)
 		battle_vanish_damage(sd, target, d.flag);
@@ -8511,7 +8511,7 @@ int64 battle_calc_return_damage(struct block_list* tbl, struct block_list *src,
  * @param wd: Damage struct reference
  * @return True on damage done or false if not
  */
-bool battle_vellum_damage(struct map_session_data *sd, struct block_list *target, struct Damage *wd)
+bool battle_vellum_damage(map_session_data *sd, struct block_list *target, struct Damage *wd)
 {
 	nullpo_retr(false, sd);
 	nullpo_retr(false, target);
@@ -8543,7 +8543,7 @@ bool battle_vellum_damage(struct map_session_data *sd, struct block_list *target
 /*===========================================
  * Perform battle drain effects (HP/SP loss)
  *-------------------------------------------*/
-void battle_drain(struct map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int class_)
+void battle_drain(map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int class_)
 {
 	struct weapon_data *wd;
 	int64 *damage;
@@ -8677,7 +8677,7 @@ void battle_autocast_aftercast(struct block_list* src, uint16 skill_id, uint16 s
  * @param tick: Server tick
  * @param flag: Special skill flags
  */
-void battle_autocast_elembuff_skill(struct map_session_data* sd, struct block_list* target, uint16 skill_id, t_tick tick, int flag)
+void battle_autocast_elembuff_skill(map_session_data* sd, struct block_list* target, uint16 skill_id, t_tick tick, int flag)
 {
 	uint16 skill_lv = pc_checkskill(sd, skill_id);
 
@@ -8695,9 +8695,9 @@ void battle_autocast_elembuff_skill(struct map_session_data* sd, struct block_li
  * Do a basic physical attack (call through unit_attack_timer)
  *------------------------------------------*/
 enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, t_tick tick, int flag) {
-	struct map_session_data *sd = NULL, *tsd = NULL;
+	map_session_data *sd = NULL, *tsd = NULL;
 	struct status_data *sstatus, *tstatus;
-	struct status_change *sc, *tsc;
+	status_change *sc, *tsc;
 	int64 damage;
 	int skillv;
 	struct Damage wd;
@@ -8981,10 +8981,10 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
 				// Only trigger if the devoted player was hit
 				if( damage > 0 ){
 					int64 devotion_damage = damage;
-					struct map_session_data* dsd = BL_CAST( BL_PC, d_bl );
+					map_session_data* dsd = BL_CAST( BL_PC, d_bl );
 
 					// Needed to check the devotion master for Rebound Shield status.
-					struct status_change *d_sc = status_get_sc(d_bl);
+					status_change *d_sc = status_get_sc(d_bl);
 
 					// The devoting player needs to stand up
 					if( dsd && pc_issit( dsd ) ){
@@ -9339,7 +9339,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 
 	switch( target->type ) { // Checks on actual target
 		case BL_PC: {
-				struct status_change* sc = status_get_sc(src);
+				status_change* sc = status_get_sc(src);
 
 				if (((TBL_PC*)target)->invincible_timer != INVALID_TIMER || pc_isinvisible((TBL_PC*)target))
 					return -1; //Cannot be targeted yet.
@@ -9430,8 +9430,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 
 	switch( t_bl->type ) { //Checks on target master
 		case BL_PC: {
-			struct map_session_data *sd;
-			struct status_change *sc = NULL;
+			map_session_data *sd;
+			status_change *sc = NULL;
 
 			if( t_bl == s_bl )
 				break;
@@ -9473,7 +9473,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 			break;
 		case BL_SKILL: {
 				struct skill_unit *su = (struct skill_unit *)src;
-				struct status_change* sc = status_get_sc(target);
+				status_change* sc = status_get_sc(target);
 				if (!su || !su->group)
 					return 0;
 
@@ -9502,7 +9502,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 	{	//Checks on source master
 		case BL_PC:
 		{
-			struct map_session_data *sd = BL_CAST(BL_PC, s_bl);
+			map_session_data *sd = BL_CAST(BL_PC, s_bl);
 			if( s_bl != t_bl )
 			{
 				if( sd->state.killer )

+ 4 - 4
src/map/battle.hpp

@@ -14,7 +14,7 @@
 #include "skill.hpp"
 
 //fwd declaration
-struct map_session_data;
+class map_session_data;
 struct mob_data;
 struct block_list;
 enum e_damage_type : uint8;
@@ -93,7 +93,7 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
 
 int64 battle_calc_return_damage(struct block_list *bl, struct block_list *src, int64 *, int flag, uint16 skill_id, bool status_reflect);
 
-void battle_drain(struct map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int class_);
+void battle_drain(map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int class_);
 
 int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 damage,int atk_elem,int def_type, int def_lv);
 int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_list *target, std::bitset<NK_MAX> nk, int s_ele, int s_ele_, int64 damage, int left, int flag);
@@ -107,7 +107,7 @@ int64 battle_calc_pk_damage(block_list &src, block_list &bl, int64 damage, uint1
 void battle_damage(struct block_list *src, struct block_list *target, int64 damage, t_tick delay, uint16 skill_lv, uint16 skill_id, enum damage_lv dmg_lv, unsigned short attack_type, bool additional_effects, t_tick tick, bool spdamage);
 int battle_delay_damage (t_tick tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, t_tick ddelay, bool additional_effects, bool spdamage);
 
-int battle_calc_chorusbonus(struct map_session_data *sd);
+int battle_calc_chorusbonus(map_session_data *sd);
 
 // Summary normal attack treatment (basic attack)
 enum damage_lv battle_weapon_attack( struct block_list *bl,struct block_list *target,t_tick tick,int flag);
@@ -123,7 +123,7 @@ int battle_check_undead(int race,int element);
 int battle_check_target(struct block_list *src, struct block_list *target,int flag);
 bool battle_check_range(struct block_list *src,struct block_list *bl,int range);
 
-void battle_consume_ammo(struct map_session_data* sd, int skill, int lv);
+void battle_consume_ammo(map_session_data* sd, int skill, int lv);
 
 bool is_infinite_defense(struct block_list *target, int flag);
 

+ 23 - 23
src/map/battleground.cpp

@@ -402,7 +402,7 @@ std::shared_ptr<s_battleground_queue> bg_search_queue(int queue_id)
  * @param bg: Battleground data
  * @return map_session_data
  */
-struct map_session_data* bg_getavailablesd(s_battleground_data *bg)
+map_session_data* bg_getavailablesd(s_battleground_data *bg)
 {
 	nullpo_retr(nullptr, bg);
 
@@ -463,7 +463,7 @@ bool bg_team_warp(int bg_id, unsigned short mapindex, short x, short y)
  * Remove a player's Battleground map marker
  * @param sd: Player data
  */
-void bg_send_dot_remove(struct map_session_data *sd)
+void bg_send_dot_remove(map_session_data *sd)
 {
 	nullpo_retv(sd);
 
@@ -479,7 +479,7 @@ void bg_send_dot_remove(struct map_session_data *sd)
  * @param is_queue: Joined from queue
  * @return True on success or false otherwise
  */
-bool bg_team_join(int bg_id, struct map_session_data *sd, bool is_queue)
+bool bg_team_join(int bg_id, map_session_data *sd, bool is_queue)
 {
 	if (!sd || sd->bg_id)
 		return false;
@@ -525,7 +525,7 @@ bool bg_team_join(int bg_id, struct map_session_data *sd, bool is_queue)
  * @param deserter: Whether to apply the deserter status or not
  * @return Remaining count in Battleground team or -1 on failure
  */
-int bg_team_leave(struct map_session_data *sd, bool quit, bool deserter)
+int bg_team_leave(map_session_data *sd, bool quit, bool deserter)
 {
 	if (!sd || !sd->bg_id)
 		return -1;
@@ -586,7 +586,7 @@ int bg_team_leave(struct map_session_data *sd, bool quit, bool deserter)
  * @param sd: Player data
  * @return True on success or false otherwise
  */
-bool bg_member_respawn(struct map_session_data *sd)
+bool bg_member_respawn(map_session_data *sd)
 {
 	if (!sd || !sd->bg_id || !pc_isdead(sd))
 		return false;
@@ -654,7 +654,7 @@ int bg_team_get_id(struct block_list *bl)
 				return ((TBL_PET*)bl)->master->bg_id;
 			break;
 		case BL_MOB: {
-			struct map_session_data *msd;
+			map_session_data *msd;
 			struct mob_data *md = (TBL_MOB*)bl;
 
 			if( md->special_state.ai && (msd = map_id2sd(md->master_id)) != nullptr )
@@ -683,7 +683,7 @@ int bg_team_get_id(struct block_list *bl)
  * @param mes: Message
  * @param len: Message length
  */
-void bg_send_message(struct map_session_data *sd, const char *mes, int len)
+void bg_send_message(map_session_data *sd, const char *mes, int len)
 {
 	nullpo_retv(sd);
 
@@ -704,7 +704,7 @@ void bg_send_message(struct map_session_data *sd, const char *mes, int len)
  */
 int bg_send_xy_timer_sub(std::shared_ptr<s_battleground_data> bg)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	for (auto &pl_sd : bg->members) {
 		sd = pl_sd.sd;
@@ -823,7 +823,7 @@ static TIMER_FUNC(bg_on_ready_start)
  * @param sd: Player data
  * @return True if in a battleground or false otherwise
  */
-bool bg_player_is_in_bg_map(struct map_session_data *sd)
+bool bg_player_is_in_bg_map(map_session_data *sd)
 {
 	nullpo_retr(false, sd);
 
@@ -843,7 +843,7 @@ bool bg_player_is_in_bg_map(struct map_session_data *sd)
  * @param name: Battleground name
  * @return True if the player is good to join a queue or false otherwise
  */
-static bool bg_queue_check_status(struct map_session_data* sd, const char *name)
+static bool bg_queue_check_status(map_session_data* sd, const char *name)
 {
 	nullpo_retr(false, sd);
 
@@ -878,7 +878,7 @@ static bool bg_queue_check_status(struct map_session_data* sd, const char *name)
  * @param name: Battleground name
  * @return True on success or false otherwise
  */
-bool bg_queue_check_joinable(std::shared_ptr<s_battleground_type> bg, struct map_session_data *sd, const char *name)
+bool bg_queue_check_joinable(std::shared_ptr<s_battleground_type> bg, map_session_data *sd, const char *name)
 {
 	nullpo_retr(false, sd);
 
@@ -953,7 +953,7 @@ bool bg_queue_reservation(const char *name, bool state, bool ended)
  * @param name: Battleground name
  * @param sd: Player who requested to join the battlegrounds
  */
-void bg_queue_join_solo(const char *name, struct map_session_data *sd)
+void bg_queue_join_solo(const char *name, map_session_data *sd)
 {
 	if (!sd) {
 		ShowError("bg_queue_join_solo: Tried to join non-existent player\n.");
@@ -980,7 +980,7 @@ void bg_queue_join_solo(const char *name, struct map_session_data *sd)
  * @param name: Battleground name
  * @param sd: Player who requested to join the battlegrounds
  */
-void bg_queue_join_party(const char *name, struct map_session_data *sd)
+void bg_queue_join_party(const char *name, map_session_data *sd)
 {
 	if (!sd) {
 		ShowError("bg_queue_join_party: Tried to join non-existent player\n.");
@@ -1021,14 +1021,14 @@ void bg_queue_join_party(const char *name, struct map_session_data *sd)
 			return; // Too many party members online
 		}
 
-		std::vector<struct map_session_data *> list;
+		std::vector<map_session_data *> list;
 
 		for (const auto &it : p->party.member) {
 			if (list.size() == bg->max_players)
 				break;
 
 			if (it.online) {
-				struct map_session_data *pl_sd = map_charid2sd(it.char_id);
+				map_session_data *pl_sd = map_charid2sd(it.char_id);
 
 				if (pl_sd)
 					list.push_back(pl_sd);
@@ -1048,7 +1048,7 @@ void bg_queue_join_party(const char *name, struct map_session_data *sd)
  * @param name: Battleground name
  * @param sd: Player who requested to join the battlegrounds
  */
-void bg_queue_join_guild(const char *name, struct map_session_data *sd)
+void bg_queue_join_guild(const char *name, map_session_data *sd)
 {
 	if (!sd) {
 		ShowError("bg_queue_join_guild: Tried to join non-existent player\n.");
@@ -1080,14 +1080,14 @@ void bg_queue_join_guild(const char *name, struct map_session_data *sd)
 			return; // Too many guild members online
 		}
 
-		std::vector<struct map_session_data *> list;
+		std::vector<map_session_data *> list;
 
 		for (const auto &it : g->member) {
 			if (list.size() == bg->max_players)
 				break;
 
 			if (it.online) {
-				struct map_session_data *pl_sd = map_charid2sd(it.char_id);
+				map_session_data *pl_sd = map_charid2sd(it.char_id);
 
 				if (pl_sd)
 					list.push_back(pl_sd);
@@ -1108,7 +1108,7 @@ void bg_queue_join_guild(const char *name, struct map_session_data *sd)
  * @param sd: Player who requested to join the battlegrounds
  * @param list: Contains all players including the player who requested to join
  */
-void bg_queue_join_multi(const char *name, struct map_session_data *sd, std::vector <map_session_data *> list)
+void bg_queue_join_multi(const char *name, map_session_data *sd, std::vector <map_session_data *> list)
 {
 	if (!sd) {
 		ShowError("bg_queue_join_multi: Tried to join non-existent player\n.");
@@ -1151,7 +1151,7 @@ void bg_queue_join_multi(const char *name, struct map_session_data *sd, std::vec
 		}
 
 		while (!list.empty() && team->size() < bg->max_players) {
-			struct map_session_data *sd2 = list.back();
+			map_session_data *sd2 = list.back();
 
 			list.pop_back();
 
@@ -1238,7 +1238,7 @@ void bg_queue_clear(std::shared_ptr<s_battleground_queue> queue, bool ended)
  * @param apply_sc: Apply the SC_ENTRY_QUEUE_APPLY_DELAY status on queue leave (default: true)
  * @return True on success or false otherwise
  */
-static bool bg_queue_leave_sub(struct map_session_data *sd, std::vector<map_session_data *> &members, bool apply_sc)
+static bool bg_queue_leave_sub(map_session_data *sd, std::vector<map_session_data *> &members, bool apply_sc)
 {
 	if (!sd)
 		return false;
@@ -1268,7 +1268,7 @@ static bool bg_queue_leave_sub(struct map_session_data *sd, std::vector<map_sess
  * @param apply_sc: Apply the SC_ENTRY_QUEUE_APPLY_DELAY status on queue leave (default: true)
  * @return True on success or false otherwise
  */
-bool bg_queue_leave(struct map_session_data *sd, bool apply_sc)
+bool bg_queue_leave(map_session_data *sd, bool apply_sc)
 {
 	if (!sd || sd->bg_queue_id == 0)
 		return false;
@@ -1456,7 +1456,7 @@ bool bg_mapflag_check(std::shared_ptr<s_battleground_queue> queue) {
  * @param queue: Battleground queue
  * @param sd: Player data
  */
-void bg_queue_on_accept_invite(struct map_session_data *sd)
+void bg_queue_on_accept_invite(map_session_data *sd)
 {
 	nullpo_retv(sd);
 

+ 15 - 15
src/map/battleground.hpp

@@ -16,7 +16,7 @@
 
 struct s_battleground_member_data {
 	unsigned short x, y;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	unsigned afk : 1;
 	struct point entry_point; ///< Battleground queue entry point
 };
@@ -128,32 +128,32 @@ extern std::vector<std::shared_ptr<s_battleground_queue>> bg_queues;
 
 std::shared_ptr<s_battleground_type> bg_search_name(const char *name);
 std::shared_ptr<s_battleground_queue> bg_search_queue(int queue_id);
-void bg_send_dot_remove(struct map_session_data *sd);
+void bg_send_dot_remove(map_session_data *sd);
 int bg_team_get_id(struct block_list *bl);
-struct map_session_data *bg_getavailablesd(s_battleground_data *bg);
+map_session_data *bg_getavailablesd(s_battleground_data *bg);
 
 bool bg_queue_reservation(const char *name, bool state, bool ended);
 #define bg_queue_reserve(name, end) (bg_queue_reservation(name, true, end))
 #define bg_queue_unbook(name) (bg_queue_reservation(name, false, false))
 
 int bg_create(uint16 mapindex, s_battleground_team* team);
-bool bg_team_join(int bg_id, struct map_session_data *sd, bool is_queue);
+bool bg_team_join(int bg_id, map_session_data *sd, bool is_queue);
 bool bg_team_delete(int bg_id);
-int bg_team_leave(struct map_session_data *sd, bool quit, bool deserter);
+int bg_team_leave(map_session_data *sd, bool quit, bool deserter);
 bool bg_team_warp(int bg_id, unsigned short mapindex, short x, short y);
-bool bg_player_is_in_bg_map(struct map_session_data *sd);
-bool bg_queue_check_joinable(std::shared_ptr<s_battleground_type> bg, struct map_session_data *sd, const char *name);
-void bg_queue_join_solo(const char *name, struct map_session_data *sd);
-void bg_queue_join_party(const char *name, struct map_session_data *sd);
-void bg_queue_join_guild(const char *name, struct map_session_data *sd);
-void bg_queue_join_multi(const char *name, struct map_session_data *sd, std::vector<map_session_data *> list);
+bool bg_player_is_in_bg_map(map_session_data *sd);
+bool bg_queue_check_joinable(std::shared_ptr<s_battleground_type> bg, map_session_data *sd, const char *name);
+void bg_queue_join_solo(const char *name, map_session_data *sd);
+void bg_queue_join_party(const char *name, map_session_data *sd);
+void bg_queue_join_guild(const char *name, map_session_data *sd);
+void bg_queue_join_multi(const char *name, map_session_data *sd, std::vector<map_session_data *> list);
 void bg_queue_clear(std::shared_ptr<s_battleground_queue> queue, bool ended);
-bool bg_queue_leave(struct map_session_data *sd, bool apply_sc = true);
+bool bg_queue_leave(map_session_data *sd, bool apply_sc = true);
 bool bg_queue_on_ready(const char *name, std::shared_ptr<s_battleground_queue> queue);
-void bg_queue_on_accept_invite(struct map_session_data *sd);
+void bg_queue_on_accept_invite(map_session_data *sd);
 void bg_queue_start_battleground(std::shared_ptr<s_battleground_queue> queue);
-bool bg_member_respawn(struct map_session_data *sd);
-void bg_send_message(struct map_session_data *sd, const char *mes, int len);
+bool bg_member_respawn(map_session_data *sd);
+void bg_send_message(map_session_data *sd, const char *mes, int len);
 
 void do_init_battleground(void);
 void do_final_battleground(void);

+ 12 - 12
src/map/buyingstore.cpp

@@ -19,7 +19,7 @@
 #include "clif.hpp"  // clif_buyingstore_*
 #include "log.hpp"  // log_pick_pc, log_zeny
 #include "npc.hpp"
-#include "pc.hpp"  // struct map_session_data
+#include "pc.hpp"  // map_session_data
 
 //Autotrader
 static DBMap *buyingstore_autotrader_db; /// Holds autotrader info: char_id -> struct s_autotrader
@@ -66,7 +66,7 @@ static unsigned int buyingstore_getuid(void)
 * @param slots Number of item on the list
 * @return 0 If success, 1 - Cannot open, 2 - Manner penalty, 3 - Mapflag restiction, 4 - Cell restriction
 */
-int8 buyingstore_setup(struct map_session_data* sd, unsigned char slots){
+int8 buyingstore_setup(map_session_data* sd, unsigned char slots){
 	nullpo_retr(1, sd);
 
 	if (!battle_config.feature_buying_store || sd->state.vending || sd->state.buyingstore || sd->state.trading || slots == 0) {
@@ -113,7 +113,7 @@ int8 buyingstore_setup(struct map_session_data* sd, unsigned char slots){
 * @param at Autotrader info, or NULL if requetsed not from autotrade persistance
 * @return 0 If success, 1 - Cannot open, 2 - Manner penalty, 3 - Mapflag restiction, 4 - Cell restriction, 5 - Invalid count/result, 6 - Cannot give item, 7 - Will be overweight
 */
-int8 buyingstore_create( struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub* itemlist, unsigned int count, struct s_autotrader *at ){
+int8 buyingstore_create( map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub* itemlist, unsigned int count, struct s_autotrader *at ){
 	unsigned int i, weight, listidx;
 	char message_sql[MESSAGE_SIZE*2];
 	StringBuf buf;
@@ -259,7 +259,7 @@ int8 buyingstore_create( struct map_session_data* sd, int zenylimit, unsigned ch
 * Close buying store and clear buying store data from tables
 * @param sd
 */
-void buyingstore_close(struct map_session_data* sd) {
+void buyingstore_close(map_session_data* sd) {
 	nullpo_retv(sd);
 
 	if( sd->state.buyingstore ) {
@@ -285,9 +285,9 @@ void buyingstore_close(struct map_session_data* sd) {
 * @param sd Player
 * @param account_id Buyer account ID
 */
-void buyingstore_open(struct map_session_data* sd, uint32 account_id)
+void buyingstore_open(map_session_data* sd, uint32 account_id)
 {
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 
 	nullpo_retv(sd);
 
@@ -323,10 +323,10 @@ void buyingstore_open(struct map_session_data* sd, uint32 account_id)
 * @param *itemlist List of sold items { <index>.W, <nameid>.W, <amount>.W }*
 * @param count Number of item on the itemlist
 */
-void buyingstore_trade( struct map_session_data* sd, uint32 account_id, unsigned int buyer_id, const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub* itemlist, unsigned int count ){
+void buyingstore_trade( map_session_data* sd, uint32 account_id, unsigned int buyer_id, const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub* itemlist, unsigned int count ){
 	int zeny = 0;
 	unsigned int weight;
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 
 	nullpo_retv(sd);
 
@@ -508,7 +508,7 @@ void buyingstore_trade( struct map_session_data* sd, uint32 account_id, unsigned
 
 
 /// Checks if an item is being bought in given player's buying store.
-bool buyingstore_search(struct map_session_data* sd, t_itemid nameid)
+bool buyingstore_search(map_session_data* sd, t_itemid nameid)
 {
 	unsigned int i;
 
@@ -531,7 +531,7 @@ bool buyingstore_search(struct map_session_data* sd, t_itemid nameid)
 
 /// Searches for all items in a buyingstore, that match given ids, price and possible cards.
 /// @return Whether or not the search should be continued.
-bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_store_search* s)
+bool buyingstore_searchall(map_session_data* sd, const struct s_search_store_search* s)
 {
 	unsigned int i, idx;
 	struct s_buyingstore_item* it;
@@ -596,7 +596,7 @@ bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_st
 * Open buyingstore for Autotrader
 * @param sd Player as autotrader
 */
-void buyingstore_reopen( struct map_session_data* sd ){
+void buyingstore_reopen( map_session_data* sd ){
 	struct s_autotrader *at = NULL;
 	int8 fail = -1;
 
@@ -702,7 +702,7 @@ void do_init_buyingstore_autotrade( void ) {
 					at->sit = battle_config.feature_autotrade_sit;
 
 				// initialize player
-				CREATE(at->sd, struct map_session_data, 1);
+				CREATE(at->sd, map_session_data, 1); // TODO: Dont use Memory Manager allocation anymore and rely on the C++ container
 				pc_setnewpc(at->sd, at->account_id, at->char_id, 0, gettick(), at->sex, 0);
 				at->sd->state.autotrade = 1|4;
 				if (battle_config.autotrade_monsterignore)

+ 10 - 10
src/map/buyingstore.hpp

@@ -9,7 +9,7 @@
 #include "map.hpp" //MESSAGE_SIZE
 
 struct s_search_store_search;
-struct map_session_data;
+class map_session_data;
 
 #define MAX_BUYINGSTORE_SLOTS 5
 
@@ -52,22 +52,22 @@ struct s_autotrader {
 	uint32 limit; ///< Maximum zeny to be spent (for buyingstore)
 	uint16 count; ///< Number of item in store
 	struct s_autotrade_entry **entries; ///< Store details
-	struct map_session_data *sd;
+	map_session_data *sd;
 };
 
-int8 buyingstore_setup(struct map_session_data* sd, unsigned char slots);
-int8 buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub* itemlist, unsigned int count, struct s_autotrader *at);
-void buyingstore_close(struct map_session_data* sd);
-void buyingstore_open(struct map_session_data* sd, uint32 account_id);
-void buyingstore_trade(struct map_session_data* sd, uint32 account_id, unsigned int buyer_id, const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub* itemlist, unsigned int count);
-bool buyingstore_search(struct map_session_data* sd, t_itemid nameid);
-bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_store_search* s);
+int8 buyingstore_setup(map_session_data* sd, unsigned char slots);
+int8 buyingstore_create(map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub* itemlist, unsigned int count, struct s_autotrader *at);
+void buyingstore_close(map_session_data* sd);
+void buyingstore_open(map_session_data* sd, uint32 account_id);
+void buyingstore_trade(map_session_data* sd, uint32 account_id, unsigned int buyer_id, const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub* itemlist, unsigned int count);
+bool buyingstore_search(map_session_data* sd, t_itemid nameid);
+bool buyingstore_searchall(map_session_data* sd, const struct s_search_store_search* s);
 DBMap *buyingstore_getdb(void);
 void do_final_buyingstore(void);
 void do_init_buyingstore(void);
 
 void do_init_buyingstore_autotrade( void );
-void buyingstore_reopen( struct map_session_data* sd );
+void buyingstore_reopen( map_session_data* sd );
 void buyingstore_update(map_session_data &sd);
 
 #endif /* BUYINGSTORE_HPP */

+ 2 - 2
src/map/cashshop.cpp

@@ -409,7 +409,7 @@ struct sale_item_data* sale_find_item( t_itemid nameid, bool onsale ){
 	return sale_items.item[i];
 }
 
-void sale_notify_login( struct map_session_data* sd ){
+void sale_notify_login( map_session_data* sd ){
 	int i;
 
 	for( i = 0; i < sale_items.count; i++ ){
@@ -467,7 +467,7 @@ static void cashshop_read_db( void ){
  * @param item_list Array of item ID
  * @return true: success, false: fail
  */
-bool cashshop_buylist( struct map_session_data* sd, uint32 kafrapoints, int n, struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST_sub* item_list ){
+bool cashshop_buylist( map_session_data* sd, uint32 kafrapoints, int n, struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST_sub* item_list ){
 	uint32 totalcash = 0;
 	uint32 totalweight = 0;
 	int i,new_;

+ 3 - 3
src/map/cashshop.hpp

@@ -10,12 +10,12 @@
 #include "../common/mmo.hpp" // t_itemid
 #include "../common/timer.hpp" // ShowWarning, ShowStatus
 
-struct map_session_data;
+class map_session_data;
 
 void do_init_cashshop( void );
 void do_final_cashshop( void );
 void cashshop_reloaddb( void );
-bool cashshop_buylist( struct map_session_data* sd, uint32 kafrapoints, int n, struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST_sub* item_list );
+bool cashshop_buylist( map_session_data* sd, uint32 kafrapoints, int n, struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST_sub* item_list );
 
 // Taken from AEGIS
 enum CASH_SHOP_TAB_CODE
@@ -94,7 +94,7 @@ extern struct sale_item_db sale_items;
 struct sale_item_data* sale_find_item(t_itemid nameid, bool onsale);
 enum e_sale_add_result sale_add_item(t_itemid nameid, int32 count, time_t from, time_t to);
 bool sale_remove_item(t_itemid nameid);
-void sale_notify_login( struct map_session_data* sd );
+void sale_notify_login( map_session_data* sd );
 #endif
 
 #endif /* CASHSHOP_HPP */

+ 29 - 29
src/map/channel.cpp

@@ -146,9 +146,9 @@ int channel_delete(struct Channel *channel, bool force) {
 	if(!force && channel->type == CHAN_TYPE_PUBLIC && runflag == MAPSERVER_ST_RUNNING) //only delete those serv stop
 		return -2;
 	if( db_size(channel->users)) {
-		struct map_session_data *sd;
+		map_session_data *sd;
 		DBIterator *iter = db_iterator(channel->users);
-		for( sd = (struct map_session_data *)dbi_first(iter); dbi_exists(iter); sd = (struct map_session_data *)dbi_next(iter) ) { //for all users
+		for( sd = (map_session_data *)dbi_first(iter); dbi_exists(iter); sd = (map_session_data *)dbi_next(iter) ) { //for all users
 			channel_clean(channel,sd,1); //make all quit
 		}
 		dbi_destroy(iter);
@@ -192,7 +192,7 @@ int channel_delete(struct Channel *channel, bool force) {
  *  -3: Player banned
  *  -4: Reached max limit
  */
-int channel_join(struct Channel *channel, struct map_session_data *sd) {
+int channel_join(struct Channel *channel, map_session_data *sd) {
 	if(!channel || !sd)
 		return -1;
 	if(sd->state.autotrade)
@@ -247,7 +247,7 @@ int channel_join(struct Channel *channel, struct map_session_data *sd) {
  *  -2: Player already in channel (channel_join)
  *  -3: Player banned (channel_join)
  */
-int channel_mjoin(struct map_session_data *sd) {
+int channel_mjoin(map_session_data *sd) {
 	char mout[60];
 	if(!sd) return -1;
 
@@ -275,7 +275,7 @@ int channel_mjoin(struct map_session_data *sd) {
  */
 int channel_ajoin(struct guild *g){
 	int i, j;
-	struct map_session_data *pl_sd;
+	map_session_data *pl_sd;
 
 	if(!g || !g->channel) return -1;
 	for (i = 0; i < MAX_GUILDALLIANCE; i++){
@@ -302,7 +302,7 @@ int channel_ajoin(struct guild *g){
  *  -1: Invalid player
  *  -2: Player has no guild attached
  */
-int channel_gjoin(struct map_session_data *sd, int flag){
+int channel_gjoin(map_session_data *sd, int flag){
 	struct Channel *channel;
 	struct guild *g;
 
@@ -341,7 +341,7 @@ int channel_gjoin(struct map_session_data *sd, int flag){
  *  0: Success
  * -1: Invalid player or channel
  */
-int channel_clean(struct Channel *channel, struct map_session_data *sd, int flag) {
+int channel_clean(struct Channel *channel, map_session_data *sd, int flag) {
 	unsigned char i;
 
 	if(!channel || !sd)
@@ -388,7 +388,7 @@ int channel_clean(struct Channel *channel, struct map_session_data *sd, int flag
  *  0: Success
  * -1: Invalid player
  */
-int channel_pcquit(struct map_session_data *sd, int type){
+int channel_pcquit(map_session_data *sd, int type){
 	int i;
 
 	//On closing state we could have clean all chan by sd but pcquit is more used to free unit when
@@ -438,7 +438,7 @@ int channel_pcquit(struct map_session_data *sd, int type){
  * -1: Invalid player, channel, or message
  * -2: Delay message from last message
  */
-int channel_send(struct Channel *channel, struct map_session_data *sd, const char *msg) {
+int channel_send(struct Channel *channel, map_session_data *sd, const char *msg) {
 	int idx = 0;
 
 	if(!channel || !sd || !msg || (idx = channel_pc_haschan(sd, channel)) < 0)
@@ -500,7 +500,7 @@ int channel_chk(char *chname, char *chpass, int type){
  * @param flag: Lookup types (1 - Create channel if it does not exist (map or ally only), 2 - Join the channel if not joined yet (map or ally only))
  * @return NULL on channel not found or channel data on success
  */
-struct Channel* channel_name2channel(char *chname, struct map_session_data *sd, int flag){
+struct Channel* channel_name2channel(char *chname, map_session_data *sd, int flag){
 	if(channel_chk(chname, NULL, 1))
 		return NULL;
 
@@ -533,7 +533,7 @@ struct Channel* channel_name2channel(char *chname, struct map_session_data *sd,
  *  0: Player not found or not banned
  *  1: Player is in channel
  */
-int channel_haspc(struct Channel *channel,struct map_session_data *sd){
+int channel_haspc(struct Channel *channel,map_session_data *sd){
 	if(!channel || !sd) return -1;
 	return (idb_exists(channel->users, sd->status.char_id))?1:0;
 }
@@ -545,7 +545,7 @@ int channel_haspc(struct Channel *channel,struct map_session_data *sd){
  *  0: Player not found or not banned
  *  1: Player is banned
  */
-int channel_haspcbanned(struct Channel *channel,struct map_session_data *sd){
+int channel_haspcbanned(struct Channel *channel,map_session_data *sd){
 	if(!channel || !sd) return -1;
 	return (idb_exists(channel->banned, sd->status.char_id))?1:0;
 }
@@ -560,7 +560,7 @@ int channel_haspcbanned(struct Channel *channel,struct map_session_data *sd){
  * -2: Player not found or not in channel
  * x > 0: has_channel at index x
  */
-int channel_pc_haschan(struct map_session_data *sd, struct Channel *channel){
+int channel_pc_haschan(map_session_data *sd, struct Channel *channel){
 	int k;
 	if(!channel || !sd) return -1; //channel or player doesn't exist
 	ARR_FIND(0, sd->channel_count, k, strcmpi(channel->name,sd->channels[k]->name) == 0);
@@ -577,7 +577,7 @@ int channel_pc_haschan(struct map_session_data *sd, struct Channel *channel){
  *   void: List of public channel and map and guild and number of users
  * @return 0 on success or -1 on failure
  */
-int channel_display_list(struct map_session_data *sd, const char *options){
+int channel_display_list(map_session_data *sd, const char *options){
 
 	if(!sd || !options)
 		return -1;
@@ -654,7 +654,7 @@ int channel_display_list(struct map_session_data *sd, const char *options){
  * @param chpass: Channel password
  * @return 0 on success or -1 on failure
  */
-int channel_pccreate(struct map_session_data *sd, char *chname, char *chpass){
+int channel_pccreate(map_session_data *sd, char *chname, char *chpass){
 	char output[CHAT_SIZE_MAX];
 	int8 res;
 
@@ -688,7 +688,7 @@ int channel_pccreate(struct map_session_data *sd, char *chname, char *chpass){
  * @param chname: Channel name
  * @return 0 on success or -1 on failure
  */
-int channel_pcdelete(struct map_session_data *sd, char *chname){
+int channel_pcdelete(map_session_data *sd, char *chname){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
 
@@ -719,7 +719,7 @@ int channel_pcdelete(struct map_session_data *sd, char *chname){
  * @param chname: Channel name
  * @return 0 on success or -1 on failure
  */
-int channel_pcleave(struct map_session_data *sd, char *chname){
+int channel_pcleave(map_session_data *sd, char *chname){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
 
@@ -767,7 +767,7 @@ int channel_pcleave(struct map_session_data *sd, char *chname){
  * @param pass: Channel password
  * @return 0 on success or -1 on failure
  */
-int channel_pcjoin(struct map_session_data *sd, char *chname, char *pass){
+int channel_pcjoin(map_session_data *sd, char *chname, char *pass){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
 
@@ -832,7 +832,7 @@ int channel_pcjoin(struct map_session_data *sd, char *chname, char *pass){
  * @param color: New color
  * @return 0 on success or -1 on failure
  */
-int channel_pccolor(struct map_session_data *sd, char *chname, char *color){
+int channel_pccolor(map_session_data *sd, char *chname, char *color){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
 	int k;
@@ -885,7 +885,7 @@ int channel_pccolor(struct map_session_data *sd, char *chname, char *color){
  * @param chname: Channel name
  * @return 0 on success, -1 on incorrect channel name, or -2 channel doesn't exist or player didn't join
  */
-int channel_pcbind(struct map_session_data *sd, char *chname){
+int channel_pcbind(map_session_data *sd, char *chname){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
 
@@ -914,7 +914,7 @@ int channel_pcbind(struct map_session_data *sd, char *chname){
  * @param sd: Player data
  * @return 0 on success or -1 on failure
  */
-int channel_pcunbind(struct map_session_data *sd){
+int channel_pcunbind(map_session_data *sd){
 	char output[CHAT_SIZE_MAX];
 
 	if(!sd)
@@ -938,10 +938,10 @@ int channel_pcunbind(struct map_session_data *sd){
  * @param flag: Ban options (0 - Ban, 1 - Unban, 2 - Unban all, 3 - Ban list)
  * @return 0 on success or -1 on failure
  */
-int channel_pcban(struct map_session_data *sd, char *chname, char *pname, int flag){
+int channel_pcban(map_session_data *sd, char *chname, char *pname, int flag){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
-	struct map_session_data *tsd = map_nick2sd(pname,false);
+	map_session_data *tsd = map_nick2sd(pname,false);
 
 	if( channel_chk(chname,NULL,1) ) {
 		clif_displaymessage(sd->fd, msg_txt(sd,1405));// Channel name must start with '#'.
@@ -1047,10 +1047,10 @@ int channel_pcban(struct map_session_data *sd, char *chname, char *pname, int fl
  * @param pname: Player name to kick
  * @return 0 on success or -1 on failure
  */
-int channel_pckick(struct map_session_data *sd, char *chname, char *pname) {
+int channel_pckick(map_session_data *sd, char *chname, char *pname) {
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
-	struct map_session_data *tsd = map_nick2sd(pname,false);
+	map_session_data *tsd = map_nick2sd(pname,false);
 
 	if( channel_chk(chname,NULL,1) ) {
 		clif_displaymessage(sd->fd, msg_txt(sd,1405));// Channel name must start with '#'.
@@ -1114,7 +1114,7 @@ int channel_pckick(struct map_session_data *sd, char *chname, char *pname) {
  * @param val: Option value
  * @return 0 on success or -1 on failure
  */
-int channel_pcsetopt(struct map_session_data *sd, char *chname, const char *option, const char *val){
+int channel_pcsetopt(map_session_data *sd, char *chname, const char *option, const char *val){
 	struct Channel *channel;
 	char output[CHAT_SIZE_MAX];
 	int k, s = 0, opt;
@@ -1266,11 +1266,11 @@ bool channel_pccheckgroup(struct Channel *channel, int group_id) {
  */
 int channel_pcautojoin_sub(DBKey key, DBData *data, va_list ap) {
 	struct Channel *channel = (struct Channel *)db_data2ptr(data);
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	char channame[CHAN_NAME_LENGTH+1];
 
 	nullpo_ret(channel);
-	nullpo_ret((sd = va_arg(ap, struct map_session_data *)));
+	nullpo_ret((sd = va_arg(ap, map_session_data *)));
 
 	if (channel->pass[0])
 		return 0;
@@ -1288,7 +1288,7 @@ int channel_pcautojoin_sub(DBKey key, DBData *data, va_list ap) {
  * Attempt to autojoin a player to a channel
  * @param sd: Player data
  */
-void channel_autojoin(struct map_session_data *sd) {
+void channel_autojoin(map_session_data *sd) {
 	nullpo_retv(sd);
 	if (sd->state.autotrade || !sd->fd)
 		return;

+ 23 - 23
src/map/channel.hpp

@@ -9,7 +9,7 @@
 
 //namespace rA {
 
-struct map_session_data;
+class map_session_data;
 struct guild;
 struct DBMap;
 
@@ -92,38 +92,38 @@ struct Channel* channel_create(struct Channel *tmp_chan);
 struct Channel* channel_create_simple(char *name, char *pass, enum Channel_Type chantype, unsigned int owner);
 int channel_delete(struct Channel *channel, bool force);
 
-int channel_join(struct Channel *channel, struct map_session_data *sd);
-int channel_mjoin(struct map_session_data *sd);
-int channel_gjoin(struct map_session_data *sd, int flag);
+int channel_join(struct Channel *channel, map_session_data *sd);
+int channel_mjoin(map_session_data *sd);
+int channel_gjoin(map_session_data *sd, int flag);
 int channel_ajoin(struct guild *g);
-int channel_clean(struct Channel *channel, struct map_session_data *sd, int flag);
-int channel_pcquit(struct map_session_data *sd, int type);
+int channel_clean(struct Channel *channel, map_session_data *sd, int flag);
+int channel_pcquit(map_session_data *sd, int type);
 
 unsigned long channel_getColor(const char *color_str);
 
-int channel_send(struct Channel *channel, struct map_session_data *sd, const char *msg);
+int channel_send(struct Channel *channel, map_session_data *sd, const char *msg);
 void channel_read_config(void);
 
 int channel_chk(char *name, char *pass, int type);
-struct Channel* channel_name2channel(char *chname, struct map_session_data *sd, int flag);
-int channel_haspc(struct Channel *channel,struct map_session_data *sd);
-int channel_haspcbanned(struct Channel *channel,struct map_session_data *sd);
-int channel_pc_haschan(struct map_session_data *sd, struct Channel *channel);
-int channel_display_list(struct map_session_data *sd, const char *option);
+struct Channel* channel_name2channel(char *chname, map_session_data *sd, int flag);
+int channel_haspc(struct Channel *channel,map_session_data *sd);
+int channel_haspcbanned(struct Channel *channel,map_session_data *sd);
+int channel_pc_haschan(map_session_data *sd, struct Channel *channel);
+int channel_display_list(map_session_data *sd, const char *option);
 
-void channel_autojoin(struct map_session_data *sd);
+void channel_autojoin(map_session_data *sd);
 bool channel_pccheckgroup(struct Channel *channel, int group_id);
 
-int channel_pccreate(struct map_session_data *sd, char *chname, char *pass);
-int channel_pcdelete(struct map_session_data *sd, char *chname);
-int channel_pcjoin(struct map_session_data *sd, char *chname, char *pass);
-int channel_pcleave(struct map_session_data *sd, char *chname);
-int channel_pccolor(struct map_session_data *sd, char *chname, char *color);
-int channel_pcbind(struct map_session_data *sd, char *chname);
-int channel_pcunbind(struct map_session_data *sd);
-int channel_pcban(struct map_session_data *sd, char *chname, char *pname, int flag);
-int channel_pckick(struct map_session_data *sd, char *chname, char *pname);
-int channel_pcsetopt(struct map_session_data *sd, char *chname, const char *option, const char *val);
+int channel_pccreate(map_session_data *sd, char *chname, char *pass);
+int channel_pcdelete(map_session_data *sd, char *chname);
+int channel_pcjoin(map_session_data *sd, char *chname, char *pass);
+int channel_pcleave(map_session_data *sd, char *chname);
+int channel_pccolor(map_session_data *sd, char *chname, char *color);
+int channel_pcbind(map_session_data *sd, char *chname);
+int channel_pcunbind(map_session_data *sd);
+int channel_pcban(map_session_data *sd, char *chname, char *pname, int flag);
+int channel_pckick(map_session_data *sd, char *chname, char *pname);
+int channel_pcsetopt(map_session_data *sd, char *chname, const char *option, const char *val);
 
 void do_init_channel(void);
 void do_final_channel(void);

+ 7 - 7
src/map/chat.cpp

@@ -74,7 +74,7 @@ static struct chat_data* chat_createchat(struct block_list* bl, const char* titl
  * @param pub : public or private
  * @return 0
  */
-int chat_createpcchat(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
+int chat_createpcchat(map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
 {
 	struct chat_data* cd;
 
@@ -125,7 +125,7 @@ int chat_createpcchat(struct map_session_data* sd, const char* title, const char
  * @param pass : password of chat room
  * @return 0
  */
-int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
+int chat_joinchat(map_session_data* sd, int chatid, const char* pass)
 {
 	struct chat_data* cd;
 
@@ -186,7 +186,7 @@ int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
  * @param kicked : for clif notification, kicked=1 or regular leave
  * @return 0:success, 1:failed
  */
-int chat_leavechat(struct map_session_data* sd, bool kicked)
+int chat_leavechat(map_session_data* sd, bool kicked)
 {
 	struct chat_data* cd;
 	int i;
@@ -257,10 +257,10 @@ int chat_leavechat(struct map_session_data* sd, bool kicked)
  * @param nextownername : string of new owner (name should be in chatroom)
  * @return 0:success, 1:failure
  */
-int chat_changechatowner(struct map_session_data* sd, const char* nextownername)
+int chat_changechatowner(map_session_data* sd, const char* nextownername)
 {
 	struct chat_data* cd;
-	struct map_session_data* tmpsd;
+	map_session_data* tmpsd;
 	int i;
 
 	nullpo_retr(1, sd);
@@ -309,7 +309,7 @@ int chat_changechatowner(struct map_session_data* sd, const char* nextownername)
  * @param pub : public or private
  * @return 1:success, 0:failure
  */
-int chat_changechatstatus(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
+int chat_changechatstatus(map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
 {
 	struct chat_data* cd;
 
@@ -355,7 +355,7 @@ int chat_npckickchat(struct chat_data* cd, const char* kickusername)
  * @param kickusername : player name to be kicked
  * @retur 1:success, 0:failure
  */
-int chat_kickchat(struct map_session_data* sd, const char* kickusername)
+int chat_kickchat(map_session_data* sd, const char* kickusername)
 {
 	struct chat_data* cd;
 	int i;

+ 8 - 8
src/map/chat.hpp

@@ -6,7 +6,7 @@
 
 #include "map.hpp" // struct block_list, CHATROOM_TITLE_SIZE
 
-struct map_session_data;
+class map_session_data;
 struct chat_data;
 
 #define MAX_CHAT_USERS 20
@@ -22,18 +22,18 @@ struct chat_data {
 	uint32 zeny;						 // required zeny to join
 	uint32 minLvl;					 // minimum base level to join
 	uint32 maxLvl;					 // maximum base level allowed to join
-	struct map_session_data* usersd[MAX_CHAT_USERS];
+	map_session_data* usersd[MAX_CHAT_USERS];
 	struct block_list* owner;
 	char npc_event[EVENT_NAME_LENGTH];
 	DBMap* kick_list;				//DBMap of users who were kicked from this chat
 };
 
-int chat_createpcchat(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
-int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass);
-int chat_leavechat(struct map_session_data* sd, bool kicked);
-int chat_changechatowner(struct map_session_data* sd, const char* nextownername);
-int chat_changechatstatus(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
-int chat_kickchat(struct map_session_data* sd, const char* kickusername);
+int chat_createpcchat(map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
+int chat_joinchat(map_session_data* sd, int chatid, const char* pass);
+int chat_leavechat(map_session_data* sd, bool kicked);
+int chat_changechatowner(map_session_data* sd, const char* nextownername);
+int chat_changechatstatus(map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
+int chat_kickchat(map_session_data* sd, const char* kickusername);
 
 int chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
 int chat_deletenpcchat(struct npc_data* nd);

+ 23 - 23
src/map/chrif.cpp

@@ -223,7 +223,7 @@ static bool chrif_auth_logout(TBL_PC* sd, enum sd_state state) {
 	return chrif_sd_to_auth(sd, state);
 }
 
-bool chrif_auth_finished(struct map_session_data* sd) {
+bool chrif_auth_finished(map_session_data* sd) {
 	struct auth_node *node= chrif_search(sd->status.account_id);
 
 	if ( node && node->sd == sd && node->state == ST_LOGIN ) {
@@ -292,7 +292,7 @@ int chrif_isconnected(void) {
  *  CSAVE_INVENTORY: Character changed inventory data
  *  CSAVE_CART: Character changed cart data
  */
-int chrif_save(struct map_session_data *sd, int flag) {
+int chrif_save(map_session_data *sd, int flag) {
 	uint16 mmo_charstatus_len = 0;
 
 	nullpo_retr(-1, sd);
@@ -450,7 +450,7 @@ static void chrif_save_ack(int fd) {
 }
 
 // request to move a character between mapservers
-int chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port) {
+int chrif_changemapserver(map_session_data* sd, uint32 ip, uint16 port) {
 	nullpo_retr(-1, sd);
 
 	if (other_mapserver_count < 1) {//No other map servers are online!
@@ -549,7 +549,7 @@ static int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
 			chrif_save(node->sd, CSAVE_QUIT|CSAVE_INVENTORY|CSAVE_CART);
 			break;
 		case ST_MAPCHANGE: { //Re-send map-change request.
-			struct map_session_data *sd = node->sd;
+			map_session_data *sd = node->sd;
 			uint32 ip;
 			uint16 port;
 
@@ -664,7 +664,7 @@ int chrif_skillcooldown_request(uint32 account_id, uint32 char_id) {
 /*==========================================
  * Request auth confirmation
  *------------------------------------------*/
-void chrif_authreq(struct map_session_data *sd, bool autotrade) {
+void chrif_authreq(map_session_data *sd, bool autotrade) {
 	struct auth_node *node= chrif_search(sd->bl.id);
 
 	if( node != NULL || !chrif_isconnected() ) {
@@ -812,7 +812,7 @@ TIMER_FUNC(auth_db_cleanup){
 /*==========================================
  *
  *------------------------------------------*/
-int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip) {
+int chrif_charselectreq(map_session_data* sd, uint32 s_ip) {
 	nullpo_retr(-1, sd);
 
 	if( !sd || !sd->bl.id || !sd->login_id1 )
@@ -905,7 +905,7 @@ int chrif_req_login_operation(int aid, const char* character_name, enum chrif_re
  * Send a sex change (for account or character) request to the login server (via char server).
  * @sd : Player requesting operation
  */
-int chrif_changesex(struct map_session_data *sd, bool change_account) {
+int chrif_changesex(map_session_data *sd, bool change_account) {
 	chrif_check(-1);
 
 	WFIFOHEAD(char_fd,44);
@@ -940,7 +940,7 @@ int chrif_changesex(struct map_session_data *sd, bool change_account) {
  *   3: login-server offline
  */
 static void chrif_ack_login_req(int aid, const char* player_name, uint16 type, uint16 answer) {
-	struct map_session_data* sd;
+	map_session_data* sd;
 	char action[25];
 	char output[256];
 
@@ -987,7 +987,7 @@ static void chrif_ack_login_req(int aid, const char* player_name, uint16 type, u
  *------------------------------------------*/
 int chrif_changedsex(int fd) {
 	int acc, sex;
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	acc = RFIFOL(fd,2);
 	sex = RFIFOL(fd,6);
@@ -1070,7 +1070,7 @@ int chrif_divorce(int partner_id1, int partner_id2) {
  * only used if 'partner_id' is offline
  *------------------------------------------*/
 int chrif_divorceack(uint32 char_id, int partner_id) {
-	struct map_session_data* sd;
+	map_session_data* sd;
 	int i;
 
 	if( !char_id || !partner_id )
@@ -1096,7 +1096,7 @@ int chrif_divorceack(uint32 char_id, int partner_id) {
  * Removes Baby from parents
  *------------------------------------------*/
 int chrif_deadopt(uint32 father_id, uint32 mother_id, uint32 child_id) {
-	struct map_session_data* sd;
+	map_session_data* sd;
 	uint16 idx = skill_get_index(WE_CALLBABY);
 
 	if( father_id && ( sd = map_charid2sd(father_id) ) != NULL && sd->status.child == child_id ) {
@@ -1123,7 +1123,7 @@ int chrif_deadopt(uint32 father_id, uint32 mother_id, uint32 child_id) {
  *------------------------------------------*/
 int chrif_ban(int fd) {
 	int id, res=0;
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	id = RFIFOL(fd,2);
 	res = RFIFOB(fd,6); // 0: change of statut, 1: ban, 2 charban
@@ -1189,7 +1189,7 @@ int chrif_req_charunban(int aid, const char* character_name){
 //Disconnect the player out of the game, simple packet
 //packet.w AID.L WHY.B 2+4+1 = 7byte
 int chrif_disconnectplayer(int fd) {
-	struct map_session_data* sd;
+	map_session_data* sd;
 	uint32 account_id = RFIFOL(fd, 2);
 
 	sd = map_id2sd(account_id);
@@ -1309,12 +1309,12 @@ int chrif_updatefamelist_ack(int fd) {
 	return 1;
 }
 
-int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the player and sends it to the char-server for saving. [Skotlex]
+int chrif_save_scdata(map_session_data *sd) { //parses the sc_data of the player and sends it to the char-server for saving. [Skotlex]
 #ifdef ENABLE_SC_SAVING
 	int i, count=0;
 	t_tick tick;
 	struct status_change_data data;
-	struct status_change *sc = &sd->sc;
+	status_change *sc = &sd->sc;
 	const struct TimerData *timer;
 
 	chrif_check(-1);
@@ -1356,7 +1356,7 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the
 	return 0;
 }
 
-int chrif_skillcooldown_save(struct map_session_data *sd) {
+int chrif_skillcooldown_save(map_session_data *sd) {
 	int i, count = 0;
 	struct skill_cooldown_data data;
 	t_tick tick;
@@ -1399,7 +1399,7 @@ int chrif_skillcooldown_save(struct map_session_data *sd) {
 int chrif_load_scdata(int fd) {
 
 #ifdef ENABLE_SC_SAVING
-	struct map_session_data *sd;
+	map_session_data *sd;
 	int aid, cid, i, count;
 
 	aid = RFIFOL(fd,4); //Player Account ID
@@ -1433,7 +1433,7 @@ int chrif_load_scdata(int fd) {
 //Retrieve and load skillcooldown for a player
 
 int chrif_skillcooldown_load(int fd) {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	int aid, cid, i, count;
 
 	aid = RFIFOL(fd, 4);
@@ -1459,7 +1459,7 @@ int chrif_skillcooldown_load(int fd) {
 /*=========================================
  * Tell char-server charcter disconnected [Wizputer]
  *-----------------------------------------*/
-int chrif_char_offline(struct map_session_data *sd) {
+int chrif_char_offline(map_session_data *sd) {
 	chrif_check(-1);
 
 	WFIFOHEAD(char_fd,10);
@@ -1512,7 +1512,7 @@ int chrif_char_reset_offline(void) {
  * Tell char-server charcter is online [Wizputer]
  *-----------------------------------------*/
 
-int chrif_char_online(struct map_session_data *sd) {
+int chrif_char_online(map_session_data *sd) {
 	chrif_check(-1);
 
 	WFIFOHEAD(char_fd,10);
@@ -1645,7 +1645,7 @@ int chrif_bsdata_request(uint32 char_id) {
  * @param sd
  * @author [Cydh]
  **/
-int chrif_bsdata_save(struct map_session_data *sd, bool quit) {
+int chrif_bsdata_save(map_session_data *sd, bool quit) {
 	uint8 i = 0;
 
 	chrif_check(-1);
@@ -1711,7 +1711,7 @@ int chrif_bsdata_save(struct map_session_data *sd, bool quit) {
  * @author [Cydh]
  **/
 int chrif_bsdata_received(int fd) {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	uint32 cid = RFIFOL(fd,4);
 	uint8 count = 0;
 
@@ -1853,7 +1853,7 @@ TIMER_FUNC(send_usercount_tochar){
  *------------------------------------------*/
 int send_users_tochar(void) {
 	int users = 0, i = 0;
-	struct map_session_data* sd;
+	map_session_data* sd;
 	struct s_mapiterator* iter;
 
 	chrif_check(-1);

+ 13 - 13
src/map/chrif.hpp

@@ -12,7 +12,7 @@
 #include "../common/socket.hpp" // enum chrif_req_op
 
 //fwd declaration
-struct map_session_data;
+class map_session_data;
 
 enum sd_state { ST_LOGIN, ST_LOGOUT, ST_MAPCHANGE };
 
@@ -30,7 +30,7 @@ struct auth_node {
 	uint32 account_id, char_id;
 	int login_id1, login_id2, sex, fd;
 	time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
-	struct map_session_data *sd;	//Data from logged on char.
+	map_session_data *sd;	//Data from logged on char.
 	struct mmo_charstatus *char_dat;	//Data from char server.
 	t_tick node_created; //timestamp for node timeouts
 	enum sd_state state; //To track whether player was login in/out or changing maps.
@@ -52,31 +52,31 @@ extern char charserver_name[NAME_LENGTH];
 struct auth_node* chrif_search(uint32 account_id);
 struct auth_node* chrif_auth_check(uint32 account_id, uint32 char_id, enum sd_state state);
 bool chrif_auth_delete(uint32 account_id, uint32 char_id, enum sd_state state);
-bool chrif_auth_finished(struct map_session_data* sd);
+bool chrif_auth_finished(map_session_data* sd);
 
-void chrif_authreq(struct map_session_data* sd, bool autotrade);
+void chrif_authreq(map_session_data* sd, bool autotrade);
 void chrif_authok(int fd);
 int chrif_scdata_request(uint32 account_id, uint32 char_id);
 int chrif_skillcooldown_request(uint32 account_id, uint32 char_id);
-int chrif_skillcooldown_save(struct map_session_data *sd);
+int chrif_skillcooldown_save(map_session_data *sd);
 int chrif_skillcooldown_load(int fd);
 
-int chrif_save(struct map_session_data* sd, int flag);
-int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip);
-int chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port);
+int chrif_save(map_session_data* sd, int flag);
+int chrif_charselectreq(map_session_data* sd, uint32 s_ip);
+int chrif_changemapserver(map_session_data* sd, uint32 ip, uint16 port);
 
 int chrif_searchcharid(uint32 char_id);
 int chrif_changeemail(int id, const char *actual_email, const char *new_email);
 int chrif_req_login_operation(int aid, const char* character_name, enum chrif_req_op operation_type, int32 timediff, int val1, int val2);
 int chrif_updatefamelist(map_session_data &sd, e_rank ranktype);
 int chrif_buildfamelist(void);
-int chrif_save_scdata(struct map_session_data *sd);
-int chrif_char_offline(struct map_session_data *sd);
+int chrif_save_scdata(map_session_data *sd);
+int chrif_char_offline(map_session_data *sd);
 int chrif_char_offline_nsd(uint32 account_id, uint32 char_id);
 int chrif_char_reset_offline(void);
 int send_users_tochar(void);
-int chrif_char_online(struct map_session_data *sd);
-int chrif_changesex(struct map_session_data *sd, bool change_account);
+int chrif_char_online(map_session_data *sd);
+int chrif_changesex(map_session_data *sd, bool change_account);
 int chrif_divorce(int partner_id1, int partner_id2);
 
 int chrif_removefriend(uint32 char_id, int friend_id);
@@ -87,7 +87,7 @@ int chrif_req_charban(int aid, const char* character_name, int32 timediff);
 int chrif_req_charunban(int aid, const char* character_name);
 
 int chrif_bsdata_request(uint32 char_id);
-int chrif_bsdata_save(struct map_session_data *sd, bool quit);
+int chrif_bsdata_save(map_session_data *sd, bool quit);
 
 void do_final_chrif(void);
 void do_init_chrif(void);

+ 6 - 6
src/map/clan.cpp

@@ -73,7 +73,7 @@ struct clan* clan_searchname( const char* name ){
 	return c;
 }
 
-struct map_session_data* clan_getavailablesd( struct clan* clan ){
+map_session_data* clan_getavailablesd( struct clan* clan ){
 	int i;
 
 	nullpo_retr(NULL, clan);
@@ -110,7 +110,7 @@ int clan_getNextFreeMemberIndex( struct clan* clan ){
 	}
 }
 
-void clan_member_joined( struct map_session_data* sd ){
+void clan_member_joined( map_session_data* sd ){
 	nullpo_retv(sd);
 
 	if( sd->clan != nullptr ){
@@ -136,7 +136,7 @@ void clan_member_joined( struct map_session_data* sd ){
 	}
 }
 
-void clan_member_left( struct map_session_data* sd ){
+void clan_member_left( map_session_data* sd ){
 	int index;
 	struct clan* clan;
 
@@ -152,7 +152,7 @@ void clan_member_left( struct map_session_data* sd ){
 	}
 }
 
-bool clan_member_join( struct map_session_data *sd, int clan_id, uint32 account_id, uint32 char_id ){
+bool clan_member_join( map_session_data *sd, int clan_id, uint32 account_id, uint32 char_id ){
 	struct clan *clan;
 
 	nullpo_ret(sd);
@@ -172,7 +172,7 @@ bool clan_member_join( struct map_session_data *sd, int clan_id, uint32 account_
 	return true;
 }
 
-bool clan_member_leave( struct map_session_data* sd, int clan_id, uint32 account_id, uint32 char_id ){
+bool clan_member_leave( map_session_data* sd, int clan_id, uint32 account_id, uint32 char_id ){
 	struct clan *clan;
 
 	nullpo_ret(sd);
@@ -199,7 +199,7 @@ void clan_recv_message(int clan_id,uint32 account_id,const char *mes,int len) {
 	clif_clan_message(clan,mes,len);
 }
 
-void clan_send_message( struct map_session_data *sd, const char *mes, int len ){
+void clan_send_message( map_session_data *sd, const char *mes, int len ){
 	nullpo_retv(sd);
 	nullpo_retv(sd->clan);
 

+ 7 - 7
src/map/clan.hpp

@@ -7,20 +7,20 @@
 #include "../common/mmo.hpp"
 
 struct clan;
-struct map_session_data;
+class map_session_data;
 
 void do_init_clan();
 void do_final_clan();
 struct clan* clan_search( int id );
 struct clan* clan_searchname( const char* name );
 void clan_load_clandata( int count, struct clan* clans );
-void clan_member_joined( struct map_session_data* sd );
-void clan_member_left( struct map_session_data* sd );
-bool clan_member_join( struct map_session_data *sd, int clan_id, uint32 account_id, uint32 char_id );
-bool clan_member_leave( struct map_session_data* sd, int clan_id, uint32 account_id, uint32 char_id );
-void clan_send_message( struct map_session_data *sd, const char *mes, int len );
+void clan_member_joined( map_session_data* sd );
+void clan_member_left( map_session_data* sd );
+bool clan_member_join( map_session_data *sd, int clan_id, uint32 account_id, uint32 char_id );
+bool clan_member_leave( map_session_data* sd, int clan_id, uint32 account_id, uint32 char_id );
+void clan_send_message( map_session_data *sd, const char *mes, int len );
 void clan_recv_message(int clan_id,uint32 account_id,const char *mes,int len);
-struct map_session_data* clan_getavailablesd( struct clan* clan );
+map_session_data* clan_getavailablesd( struct clan* clan );
 int clan_get_alliance_count( struct clan *clan, int flag );
 
 #endif /* CLAN_HPP */

文件差異過大導致無法顯示
+ 120 - 120
src/map/clif.cpp


+ 310 - 310
src/map/clif.hpp

@@ -23,7 +23,7 @@ struct s_storage;
 //#include "map.hpp"
 struct block_list;
 struct unit_data;
-struct map_session_data;
+class map_session_data;
 struct homun_data;
 struct pet_data;
 struct mob_data;
@@ -61,7 +61,7 @@ enum e_PacketDBVersion { // packet DB
 
 struct s_packet_db {
 	short len;
-	void (*func)(int, struct map_session_data *);
+	void (*func)(int, map_session_data *);
 	short pos[MAX_PACKET_POS];
 };
 
@@ -612,7 +612,7 @@ uint32 clif_getip(void);
 uint32 clif_refresh_ip(void);
 uint16 clif_getport(void);
 
-void clif_authok(struct map_session_data *sd);
+void clif_authok(map_session_data *sd);
 void clif_authrefuse(int fd, uint8 error_code);
 void clif_authfail_fd(int fd, int type);
 void clif_charselectok(int id, uint8 ok);
@@ -623,34 +623,34 @@ void clif_clearunit_single(int id, clr_type type, int fd);
 void clif_clearunit_area(struct block_list* bl, clr_type type);
 void clif_clearunit_delayed(struct block_list* bl, clr_type type, t_tick tick);
 int clif_spawn(struct block_list *bl, bool walking = false);	//area
-void clif_walkok(struct map_session_data *sd);	// self
+void clif_walkok(map_session_data *sd);	// self
 void clif_move(struct unit_data *ud); //area
-void clif_changemap(struct map_session_data *sd, short m, int x, int y);	//self
-void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);	//self
+void clif_changemap(map_session_data *sd, short m, int x, int y);	//self
+void clif_changemapserver(map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);	//self
 void clif_blown(struct block_list *bl); // area
 void clif_slide(struct block_list *bl, int x, int y); // area
 void clif_fixpos(struct block_list *bl);	// area
-void clif_npcbuysell(struct map_session_data* sd, int id);	//self
-void clif_buylist(struct map_session_data *sd, struct npc_data *nd);	//self
-void clif_selllist(struct map_session_data *sd);	//self
-void clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd);
-void clif_parse_NPCMarketClosed(int fd, struct map_session_data *sd);
-void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd);
-void clif_scriptmes( struct map_session_data& sd, uint32 npcid, const char *mes );
-void clif_scriptnext( struct map_session_data& sd, uint32 npcid );
-void clif_scriptclose(struct map_session_data *sd, int npcid);	//self
-void clif_scriptclear( struct map_session_data& sd, int npcid ); //self
-void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes);	//self
-void clif_scriptinput(struct map_session_data *sd, int npcid);	//self
-void clif_scriptinputstr(struct map_session_data *sd, int npcid);	// self
-void clif_cutin(struct map_session_data* sd, const char* image, int type);	//self
-void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color);	//self
-void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char fail); // self
-void clif_dropitem(struct map_session_data *sd,int n,int amount);	//self
-void clif_delitem(struct map_session_data *sd,int n,int amount, short reason); //self
+void clif_npcbuysell(map_session_data* sd, int id);	//self
+void clif_buylist(map_session_data *sd, struct npc_data *nd);	//self
+void clif_selllist(map_session_data *sd);	//self
+void clif_npc_market_open(map_session_data *sd, struct npc_data *nd);
+void clif_parse_NPCMarketClosed(int fd, map_session_data *sd);
+void clif_parse_NPCMarketPurchase(int fd, map_session_data *sd);
+void clif_scriptmes( map_session_data& sd, uint32 npcid, const char *mes );
+void clif_scriptnext( map_session_data& sd, uint32 npcid );
+void clif_scriptclose(map_session_data *sd, int npcid);	//self
+void clif_scriptclear( map_session_data& sd, int npcid ); //self
+void clif_scriptmenu(map_session_data* sd, int npcid, const char* mes);	//self
+void clif_scriptinput(map_session_data *sd, int npcid);	//self
+void clif_scriptinputstr(map_session_data *sd, int npcid);	// self
+void clif_cutin(map_session_data* sd, const char* image, int type);	//self
+void clif_viewpoint(map_session_data *sd, int npc_id, int type, int x, int y, int id, int color);	//self
+void clif_additem(map_session_data *sd, int n, int amount, unsigned char fail); // self
+void clif_dropitem(map_session_data *sd,int n,int amount);	//self
+void clif_delitem(map_session_data *sd,int n,int amount, short reason); //self
 void clif_update_hp(map_session_data &sd);
-void clif_updatestatus(struct map_session_data *sd,int type);	//self
-void clif_changestatus(struct map_session_data* sd,int type,int val);	//area
+void clif_updatestatus(map_session_data *sd,int type);	//self
+void clif_changestatus(map_session_data* sd,int type,int val);	//area
 int clif_damage(struct block_list* src, struct block_list* dst, t_tick tick, int sdelay, int ddelay, int64 sdamage, int div, enum e_damage_type type, int64 sdamage2, bool spdamage);	// area
 void clif_takeitem(struct block_list* src, struct block_list* dst);
 void clif_sitting(struct block_list* bl);
@@ -659,87 +659,87 @@ void clif_sprite_change(struct block_list *bl, int id, int type, int val, int va
 void clif_changelook(struct block_list *bl,int type,int val);	// area
 void clif_changetraplook(struct block_list *bl,int val); // area
 void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target); //area specified in 'target'
-void clif_arrowequip(struct map_session_data *sd,int val); //self
-void clif_arrow_fail(struct map_session_data *sd,int type); //self
-void clif_arrow_create_list(struct map_session_data *sd);	//self
-void clif_statusupack(struct map_session_data *sd,int type,int ok,int val);	// self
-void clif_equipitemack( struct map_session_data& sd, uint8 flag, int index, int pos = 0 ); // self
-void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok);	// self
+void clif_arrowequip(map_session_data *sd,int val); //self
+void clif_arrow_fail(map_session_data *sd,int type); //self
+void clif_arrow_create_list(map_session_data *sd);	//self
+void clif_statusupack(map_session_data *sd,int type,int ok,int val);	// self
+void clif_equipitemack( map_session_data& sd, uint8 flag, int index, int pos = 0 ); // self
+void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok);	// self
 void clif_misceffect(struct block_list* bl,int type);	// area
 void clif_changeoption_target(struct block_list* bl, struct block_list* target);
 #define clif_changeoption(bl) clif_changeoption_target(bl, NULL)	// area
 void clif_changeoption2(struct block_list* bl);	// area
-void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok);	// self
+void clif_useitemack(map_session_data *sd,int index,int amount,bool ok);	// self
 void clif_GlobalMessage(struct block_list* bl, const char* message,enum send_target target);
-void clif_createchat(struct map_session_data* sd, int flag);	// self
+void clif_createchat(map_session_data* sd, int flag);	// self
 void clif_dispchat(struct chat_data* cd, int fd);	// area or fd
-void clif_joinchatfail(struct map_session_data *sd,int flag);	// self
-void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd);	// self
-void clif_addchat(struct chat_data* cd,struct map_session_data *sd);	// chat
-void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd);	// chat
+void clif_joinchatfail(map_session_data *sd,int flag);	// self
+void clif_joinchatok(map_session_data *sd,struct chat_data* cd);	// self
+void clif_addchat(struct chat_data* cd,map_session_data *sd);	// chat
+void clif_changechatowner(struct chat_data* cd, map_session_data* sd);	// chat
 void clif_clearchat(struct chat_data *cd,int fd);	// area or fd
-void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag);	// chat
+void clif_leavechat(struct chat_data* cd, map_session_data* sd, bool flag);	// chat
 void clif_changechatstatus(struct chat_data* cd);	// chat
-void clif_refresh_storagewindow(struct map_session_data *sd);
-void clif_refresh(struct map_session_data *sd);	// self
+void clif_refresh_storagewindow(map_session_data *sd);
+void clif_refresh(map_session_data *sd);	// self
 
 void clif_emotion(struct block_list *bl,int type);
 void clif_talkiebox(struct block_list* bl, const char* talkie);
 void clif_wedding_effect(struct block_list *bl);
-void clif_divorced(struct map_session_data* sd, const char* name);
-void clif_callpartner(struct map_session_data& sd);
-void clif_playBGM( struct map_session_data& sd, const char* name );
+void clif_divorced(map_session_data* sd, const char* name);
+void clif_callpartner(map_session_data& sd);
+void clif_playBGM( map_session_data& sd, const char* name );
 void clif_soundeffect( struct block_list& bl, const char* name, int type, enum send_target target );
-void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, int target_id, t_tick tick);
-void clif_parse_LoadEndAck(int fd,struct map_session_data *sd);
-void clif_hotkeys_send(struct map_session_data *sd, int tab);
+void clif_parse_ActionRequest_sub(map_session_data *sd, int action_type, int target_id, t_tick tick);
+void clif_parse_LoadEndAck(int fd,map_session_data *sd);
+void clif_hotkeys_send(map_session_data *sd, int tab);
 
 // trade
-void clif_traderequest(struct map_session_data* sd, const char* name);
-void clif_tradestart(struct map_session_data* sd, uint8 type);
-void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd, int index, int amount);
-void clif_tradeitemok(struct map_session_data& sd, int index, e_exitem_add_result result);
-void clif_tradedeal_lock(struct map_session_data* sd, int fail);
-void clif_tradecancelled(struct map_session_data* sd);
-void clif_tradecompleted(struct map_session_data* sd, int fail);
-void clif_tradeundo(struct map_session_data* sd);
+void clif_traderequest(map_session_data* sd, const char* name);
+void clif_tradestart(map_session_data* sd, uint8 type);
+void clif_tradeadditem(map_session_data* sd, map_session_data* tsd, int index, int amount);
+void clif_tradeitemok(map_session_data& sd, int index, e_exitem_add_result result);
+void clif_tradedeal_lock(map_session_data* sd, int fail);
+void clif_tradecancelled(map_session_data* sd);
+void clif_tradecompleted(map_session_data* sd, int fail);
+void clif_tradeundo(map_session_data* sd);
 
 // storage
-void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length, const char *storename);
-void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_amount);
-void clif_storageitemadded(struct map_session_data* sd, struct item* i, int index, int amount);
-void clif_storageitemremoved(struct map_session_data* sd, int index, int amount);
-void clif_storageclose(struct map_session_data* sd);
+void clif_storagelist(map_session_data* sd, struct item* items, int items_length, const char *storename);
+void clif_updatestorageamount(map_session_data* sd, int amount, int max_amount);
+void clif_storageitemadded(map_session_data* sd, struct item* i, int index, int amount);
+void clif_storageitemremoved(map_session_data* sd, int index, int amount);
+void clif_storageclose(map_session_data* sd);
 
 int clif_insight(struct block_list *bl,va_list ap);	// map_forallinmovearea callback
 int clif_outsight(struct block_list *bl,va_list ap);	// map_forallinmovearea callback
 
-void clif_class_change_target(struct block_list *bl,int class_, int type, enum send_target target, struct map_session_data *sd);
+void clif_class_change_target(struct block_list *bl,int class_, int type, enum send_target target, map_session_data *sd);
 #define clif_class_change(bl, class_, type) clif_class_change_target(bl, class_, type, AREA, NULL)
 #define clif_mob_class_change(md, class_) clif_class_change(&md->bl, class_, 1)
 
-void clif_skillinfoblock(struct map_session_data *sd);
-void clif_skillup(struct map_session_data *sd, uint16 skill_id, int lv, int range, int upgradable);
-void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf);
-void clif_addskill(struct map_session_data *sd, int skill_id);
-void clif_deleteskill(struct map_session_data *sd, int skill_id);
+void clif_skillinfoblock(map_session_data *sd);
+void clif_skillup(map_session_data *sd, uint16 skill_id, int lv, int range, int upgradable);
+void clif_skillinfo(map_session_data *sd,int skill_id, int inf);
+void clif_addskill(map_session_data *sd, int skill_id);
+void clif_deleteskill(map_session_data *sd, int skill_id);
 
 void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int property, int casttime);
 void clif_skillcastcancel(struct block_list* bl);
-void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype, t_itemid itemId = 0);
-void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, t_tick tick);
+void clif_skill_fail(map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype, t_itemid itemId = 0);
+void clif_skill_cooldown(map_session_data *sd, uint16 skill_id, t_tick tick);
 int clif_skill_damage(struct block_list *src,struct block_list *dst,t_tick tick,int sdelay,int ddelay,int64 sdamage,int div,uint16 skill_id,uint16 skill_lv,enum e_damage_type type);
 //int clif_skill_damage2(struct block_list *src,struct block_list *dst,t_tick tick,int sdelay,int ddelay,int damage,int div,uint16 skill_id,uint16 skill_lv,enum e_damage_type type);
 bool clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,t_tick tick);
 void clif_skill_poseffect(struct block_list *src,uint16 skill_id,int val,int x,int y,t_tick tick);
-void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst);
-void clif_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 clif_skill_memomessage(struct map_session_data* sd, int type);
-void clif_skill_teleportmessage(struct map_session_data *sd, int type);
-void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, int trigger);
-void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
+void clif_skill_estimation(map_session_data *sd,struct block_list *dst);
+void clif_skill_warppoint(map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
+void clif_skill_memomessage(map_session_data* sd, int type);
+void clif_skill_teleportmessage(map_session_data *sd, int type);
+void clif_skill_produce_mix_list(map_session_data *sd, int skill_id, int trigger);
+void clif_cooking_list(map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
 
-void clif_produceeffect(struct map_session_data* sd,int flag, t_itemid nameid);
+void clif_produceeffect(map_session_data* sd,int flag, t_itemid nameid);
 
 void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *unit, enum send_target target, bool visible);
 void clif_skill_delunit(struct skill_unit *unit);
@@ -747,12 +747,12 @@ void clif_skillunit_update(struct block_list* bl);
 
 void clif_skill_unit_test(struct block_list *bl, short x, short y, int unit_id, short range, short skill_lv);
 
-void clif_autospell(struct map_session_data *sd,uint16 skill_lv);
-void clif_devotion(struct block_list *src, struct map_session_data *tsd);
+void clif_autospell(map_session_data *sd,uint16 skill_lv);
+void clif_devotion(struct block_list *src, map_session_data *tsd);
 void clif_spiritball( struct block_list *bl, struct block_list* target = nullptr, enum send_target send_target = AREA );
-void clif_soulball( struct map_session_data *sd, struct block_list* target = nullptr, enum send_target send_target = AREA );
-void clif_servantball( struct map_session_data& sd, struct block_list* target = nullptr, enum send_target send_target = AREA );
-void clif_abyssball( struct map_session_data& sd, struct block_list* target = nullptr, enum send_target send_target = AREA );
+void clif_soulball( map_session_data *sd, struct block_list* target = nullptr, enum send_target send_target = AREA );
+void clif_servantball( map_session_data& sd, struct block_list* target = nullptr, enum send_target send_target = AREA );
+void clif_abyssball( map_session_data& sd, struct block_list* target = nullptr, enum send_target send_target = AREA );
 void clif_combo_delay(struct block_list *bl,t_tick wait);
 void clif_bladestop(struct block_list *src, int dst_id, int active);
 void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target);
@@ -762,7 +762,7 @@ void clif_status_change(struct block_list *bl, int type, int flag, t_tick tick,
 void clif_efst_status_change(struct block_list *bl, int tid, enum send_target target, int type, t_tick tick, int val1, int val2, int val3);
 void clif_efst_status_change_sub(struct block_list *tbl, struct block_list *bl, enum send_target target);
 
-void clif_wis_message(struct map_session_data* sd, const char* nick, const char* mes, int mes_len, int gmlvl);
+void clif_wis_message(map_session_data* sd, const char* nick, const char* mes, int mes_len, int gmlvl);
 void clif_wis_end(int fd, int result);
 
 void clif_solved_charname(int fd, int charid, const char* name);
@@ -770,107 +770,107 @@ void clif_name( struct block_list* src, struct block_list *bl, send_target targe
 #define clif_name_self(bl) clif_name( (bl), (bl), SELF )
 #define clif_name_area(bl) clif_name( (bl), (bl), AREA )
 
-void clif_use_card(struct map_session_data *sd,int idx);
-void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);
+void clif_use_card(map_session_data *sd,int idx);
+void clif_insert_card(map_session_data *sd,int idx_equip,int idx_card,int flag);
 
-void clif_inventorylist(struct map_session_data *sd);
-void clif_equiplist(struct map_session_data *sd);
+void clif_inventorylist(map_session_data *sd);
+void clif_equiplist(map_session_data *sd);
 
-void clif_cart_additem(struct map_session_data *sd,int n,int amount);
-void clif_cart_additem_ack(struct map_session_data *sd, uint8 flag);
-void clif_cart_delitem(struct map_session_data *sd,int n,int amount);
-void clif_cartlist(struct map_session_data *sd);
+void clif_cart_additem(map_session_data *sd,int n,int amount);
+void clif_cart_additem_ack(map_session_data *sd, uint8 flag);
+void clif_cart_delitem(map_session_data *sd,int n,int amount);
+void clif_cartlist(map_session_data *sd);
 void clif_clearcart(int fd);
 
-void clif_item_identify_list(struct map_session_data *sd);
-void clif_item_identified(struct map_session_data *sd,int idx,int flag);
-void clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd, int lv);
-void clif_item_repaireffect(struct map_session_data *sd, int idx, int flag);
-void clif_item_damaged(struct map_session_data* sd, unsigned short position);
-void clif_item_refine_list(struct map_session_data *sd);
-void clif_hat_effects( struct map_session_data* sd, struct block_list* bl, enum send_target target );
-void clif_hat_effect_single( struct map_session_data* sd, uint16 effectId, bool enable );
-
-void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv);
-
-void clif_mvp_effect(struct map_session_data *sd);
-void clif_mvp_item(struct map_session_data *sd, t_itemid nameid);
-void clif_mvp_exp(struct map_session_data *sd, t_exp exp);
-void clif_mvp_noitem(struct map_session_data* sd);
+void clif_item_identify_list(map_session_data *sd);
+void clif_item_identified(map_session_data *sd,int idx,int flag);
+void clif_item_repair_list(map_session_data *sd, map_session_data *dstsd, int lv);
+void clif_item_repaireffect(map_session_data *sd, int idx, int flag);
+void clif_item_damaged(map_session_data* sd, unsigned short position);
+void clif_item_refine_list(map_session_data *sd);
+void clif_hat_effects( map_session_data* sd, struct block_list* bl, enum send_target target );
+void clif_hat_effect_single( map_session_data* sd, uint16 effectId, bool enable );
+
+void clif_item_skill(map_session_data *sd,uint16 skill_id,uint16 skill_lv);
+
+void clif_mvp_effect(map_session_data *sd);
+void clif_mvp_item(map_session_data *sd, t_itemid nameid);
+void clif_mvp_exp(map_session_data *sd, t_exp exp);
+void clif_mvp_noitem(map_session_data* sd);
 void clif_changed_dir(struct block_list *bl, enum send_target target);
 
 // vending
-void clif_openvendingreq(struct map_session_data* sd, int num);
-void clif_showvendingboard( struct map_session_data& sd, enum send_target target = AREA_WOS, struct block_list* tbl = nullptr );
+void clif_openvendingreq(map_session_data* sd, int num);
+void clif_showvendingboard( map_session_data& sd, enum send_target target = AREA_WOS, struct block_list* tbl = nullptr );
 void clif_closevendingboard(struct block_list* bl, int fd);
-void clif_vendinglist( struct map_session_data* sd, struct map_session_data* vsd );
-void clif_buyvending(struct map_session_data* sd, int index, int amount, int fail);
-void clif_openvending(struct map_session_data* sd, int id, struct s_vending* vending);
-void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
+void clif_vendinglist( map_session_data* sd, map_session_data* vsd );
+void clif_buyvending(map_session_data* sd, int index, int amount, int fail);
+void clif_openvending(map_session_data* sd, int id, struct s_vending* vending);
+void clif_vendingreport(map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
 
-void clif_movetoattack(struct map_session_data *sd,struct block_list *bl);
+void clif_movetoattack(map_session_data *sd,struct block_list *bl);
 
 // party
-void clif_party_created( struct map_session_data& sd, int result );
-void clif_party_member_info( struct party_data& party, struct map_session_data& sd );
-void clif_party_info( struct party_data& party, struct map_session_data *sd = nullptr );
-void clif_party_invite( struct map_session_data& sd, struct map_session_data& tsd );
-void clif_party_invite_reply( struct map_session_data& sd, const char* nick, enum e_party_invite_reply reply );
-void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag);
-void clif_party_withdraw( struct map_session_data& sd, uint32 account_id, const char* name, enum e_party_member_withdraw result, enum send_target target );
+void clif_party_created( map_session_data& sd, int result );
+void clif_party_member_info( struct party_data& party, map_session_data& sd );
+void clif_party_info( struct party_data& party, map_session_data *sd = nullptr );
+void clif_party_invite( map_session_data& sd, map_session_data& tsd );
+void clif_party_invite_reply( map_session_data& sd, const char* nick, enum e_party_invite_reply reply );
+void clif_party_option(struct party_data *p,map_session_data *sd,int flag);
+void clif_party_withdraw( map_session_data& sd, uint32 account_id, const char* name, enum e_party_member_withdraw result, enum send_target target );
 void clif_party_message( struct party_data& party, uint32 account_id, const char* mes, int len );
-void clif_party_xy( struct map_session_data& sd );
-void clif_party_xy_single( struct map_session_data& sd, struct map_session_data& tsd );
-void clif_party_hp( struct map_session_data& sd );
-void clif_hpmeter_single( struct map_session_data& sd, uint32 id, uint32 hp, uint32 maxhp );
-void clif_party_job_and_level( struct map_session_data& sd );
-void clif_party_dead( struct map_session_data& sd );
+void clif_party_xy( map_session_data& sd );
+void clif_party_xy_single( map_session_data& sd, map_session_data& tsd );
+void clif_party_hp( map_session_data& sd );
+void clif_hpmeter_single( map_session_data& sd, uint32 id, uint32 hp, uint32 maxhp );
+void clif_party_job_and_level( map_session_data& sd );
+void clif_party_dead( map_session_data& sd );
 
 // guild
-void clif_guild_created(struct map_session_data *sd,int flag);
-void clif_guild_belonginfo( struct map_session_data& sd );
-void clif_guild_masterormember(struct map_session_data *sd);
-void clif_guild_basicinfo( struct map_session_data& sd );
-void clif_guild_allianceinfo(struct map_session_data *sd);
-void clif_guild_memberlist( struct map_session_data& sd );
-void clif_guild_skillinfo(struct map_session_data* sd);
-void clif_guild_send_onlineinfo(struct map_session_data *sd); //[LuzZza]
+void clif_guild_created(map_session_data *sd,int flag);
+void clif_guild_belonginfo( map_session_data& sd );
+void clif_guild_masterormember(map_session_data *sd);
+void clif_guild_basicinfo( map_session_data& sd );
+void clif_guild_allianceinfo(map_session_data *sd);
+void clif_guild_memberlist( map_session_data& sd );
+void clif_guild_skillinfo(map_session_data* sd);
+void clif_guild_send_onlineinfo(map_session_data *sd); //[LuzZza]
 void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag);
-void clif_guild_invite(struct map_session_data *sd,struct guild *g);
-void clif_guild_inviteack(struct map_session_data *sd,int flag);
-void clif_guild_leave(struct map_session_data *sd,const char *name,const char *mes);
-void clif_guild_expulsion(struct map_session_data* sd, const char* name, const char* mes, uint32 account_id);
+void clif_guild_invite(map_session_data *sd,struct guild *g);
+void clif_guild_inviteack(map_session_data *sd,int flag);
+void clif_guild_leave(map_session_data *sd,const char *name,const char *mes);
+void clif_guild_expulsion(map_session_data* sd, const char* name, const char* mes, uint32 account_id);
 void clif_guild_positionchanged(struct guild *g,int idx);
 void clif_guild_memberpositionchanged(struct guild *g,int idx);
-void clif_guild_emblem(struct map_session_data *sd,struct guild *g);
+void clif_guild_emblem(map_session_data *sd,struct guild *g);
 void clif_guild_emblem_area(struct block_list* bl);
-void clif_guild_notice(struct map_session_data* sd);
+void clif_guild_notice(map_session_data* sd);
 void clif_guild_message(struct guild *g,uint32 account_id,const char *mes,int len);
-void clif_guild_reqalliance(struct map_session_data *sd,uint32 account_id,const char *name);
-void clif_guild_allianceack(struct map_session_data *sd,int flag);
-void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
-void clif_guild_oppositionack(struct map_session_data *sd,int flag);
-void clif_guild_broken(struct map_session_data *sd,int flag);
-void clif_guild_xy(struct map_session_data *sd);
-void clif_guild_xy_single(int fd, struct map_session_data *sd);
-void clif_guild_xy_remove(struct map_session_data *sd);
+void clif_guild_reqalliance(map_session_data *sd,uint32 account_id,const char *name);
+void clif_guild_allianceack(map_session_data *sd,int flag);
+void clif_guild_delalliance(map_session_data *sd,int guild_id,int flag);
+void clif_guild_oppositionack(map_session_data *sd,int flag);
+void clif_guild_broken(map_session_data *sd,int flag);
+void clif_guild_xy(map_session_data *sd);
+void clif_guild_xy_single(int fd, map_session_data *sd);
+void clif_guild_xy_remove(map_session_data *sd);
 
 // Battleground
-void clif_bg_hp(struct map_session_data *sd);
-void clif_bg_xy(struct map_session_data *sd);
-void clif_bg_xy_remove(struct map_session_data *sd);
+void clif_bg_hp(map_session_data *sd);
+void clif_bg_xy(map_session_data *sd);
+void clif_bg_xy_remove(map_session_data *sd);
 void clif_bg_message(struct s_battleground_data *bg, int src_id, const char *name, const char *mes, int len);
 void clif_bg_updatescore(int16 m);
-void clif_bg_updatescore_single(struct map_session_data *sd);
-void clif_sendbgemblem_area(struct map_session_data *sd);
-void clif_sendbgemblem_single(int fd, struct map_session_data *sd);
+void clif_bg_updatescore_single(map_session_data *sd);
+void clif_sendbgemblem_area(map_session_data *sd);
+void clif_sendbgemblem_single(int fd, map_session_data *sd);
 
 // Battleground Queue
-void clif_bg_queue_apply_result(e_bg_queue_apply_ack result, const char *name, struct map_session_data *sd);
-void clif_bg_queue_apply_notify(const char *name, struct map_session_data *sd);
-void clif_bg_queue_entry_init(struct map_session_data *sd);
-void clif_bg_queue_lobby_notify(const char *name, struct map_session_data *sd);
-void clif_bg_queue_ack_lobby(bool result, const char *name, const char *lobbyname, struct map_session_data *sd);
+void clif_bg_queue_apply_result(e_bg_queue_apply_ack result, const char *name, map_session_data *sd);
+void clif_bg_queue_apply_notify(const char *name, map_session_data *sd);
+void clif_bg_queue_entry_init(map_session_data *sd);
+void clif_bg_queue_lobby_notify(const char *name, map_session_data *sd);
+void clif_bg_queue_ack_lobby(bool result, const char *name, const char *lobbyname, map_session_data *sd);
 
 // Instancing
 void clif_instance_create(int instance_id, int num);
@@ -878,10 +878,10 @@ void clif_instance_changewait(int instance_id, int num);
 void clif_instance_status(int instance_id, unsigned int limit1, unsigned int limit2);
 void clif_instance_changestatus(int instance_id, e_instance_notify type, unsigned int limit);
 void clif_parse_MemorialDungeonCommand(int fd, map_session_data *sd);
-void clif_instance_info( struct map_session_data& sd );
+void clif_instance_info( map_session_data& sd );
 
 // Custom Fonts
-void clif_font(struct map_session_data *sd);
+void clif_font(map_session_data *sd);
 
 // atcommand
 void clif_displaymessage(const int fd, const char* mes);
@@ -891,82 +891,82 @@ void clif_broadcast2(struct block_list* bl, const char* mes, int len, unsigned l
 void clif_heal(int fd,int type,int val);
 void clif_resurrection(struct block_list *bl,int type);
 void clif_map_property(struct block_list *bl, enum map_property property, enum send_target t);
-void clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
+void clif_pvpset(map_session_data *sd, int pvprank, int pvpnum,int type);
 void clif_map_property_mapall(int map, enum map_property property);
 void clif_refine(int fd, int fail, int index, int val);
-void clif_upgrademessage( struct map_session_data* sd, int result, t_itemid item_id );
+void clif_upgrademessage( map_session_data* sd, int result, t_itemid item_id );
 
 //petsystem
-void clif_catch_process(struct map_session_data *sd);
-void clif_pet_roulette(struct map_session_data *sd,int data);
-void clif_sendegg(struct map_session_data *sd);
-void clif_send_petstatus(struct map_session_data *sd);
-void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int type, int param);
+void clif_catch_process(map_session_data *sd);
+void clif_pet_roulette(map_session_data *sd,int data);
+void clif_sendegg(map_session_data *sd);
+void clif_send_petstatus(map_session_data *sd);
+void clif_send_petdata(map_session_data* sd, struct pet_data* pd, int type, int param);
 #define clif_pet_equip(sd, pd) clif_send_petdata(sd, pd, 3, (pd)->vd.head_bottom)
 #define clif_pet_equip_area(pd) clif_send_petdata(NULL, pd, 3, (pd)->vd.head_bottom)
 #define clif_pet_performance(pd, param) clif_send_petdata(NULL, pd, 4, param)
 void clif_pet_emotion(struct pet_data *pd,int param);
-void clif_pet_food(struct map_session_data *sd,int foodid,int fail);
-void clif_pet_autofeed_status(struct map_session_data* sd, bool force);
+void clif_pet_food(map_session_data *sd,int foodid,int fail);
+void clif_pet_autofeed_status(map_session_data* sd, bool force);
 
 //friends list
-int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap);
-void clif_friendslist_send( struct map_session_data& sd );
-void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_data *f_sd, int type);
+int clif_friendslist_toggle_sub(map_session_data *sd,va_list ap);
+void clif_friendslist_send( map_session_data& sd );
+void clif_friendslist_reqack(map_session_data *sd, map_session_data *f_sd, int type);
 
 void clif_weather(int16 m); // [Valaris]
 void clif_specialeffect(struct block_list* bl, int type, enum send_target target); // special effects [Valaris]
 void clif_specialeffect_single(struct block_list* bl, int type, int fd);
 void clif_specialeffect_remove(struct block_list* bl_src, int effect, enum send_target e_target, struct block_list* bl_target);
-void clif_messagecolor_target(struct block_list *bl, unsigned long color, const char *msg, bool rgb2bgr, enum send_target type, struct map_session_data *sd);
+void clif_messagecolor_target(struct block_list *bl, unsigned long color, const char *msg, bool rgb2bgr, enum send_target type, map_session_data *sd);
 #define clif_messagecolor(bl, color, msg, rgb2bgr, type) clif_messagecolor_target(bl, color, msg, rgb2bgr, type, NULL) // Mob/Npc color talk [SnakeDrak]
 void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, send_target target);
 
-void clif_GM_kickack(struct map_session_data *sd, int id);
-void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd);
-void clif_manner_message(struct map_session_data* sd, uint32 type);
-void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
+void clif_GM_kickack(map_session_data *sd, int id);
+void clif_GM_kick(map_session_data *sd,map_session_data *tsd);
+void clif_manner_message(map_session_data* sd, uint32 type);
+void clif_GM_silence(map_session_data* sd, map_session_data* tsd, uint8 type);
 
 void clif_disp_overhead_(struct block_list *bl, const char* mes, enum send_target flag);
 #define clif_disp_overhead(bl, mes) clif_disp_overhead_(bl, mes, AREA)
 
-void clif_get_weapon_view(struct map_session_data* sd, t_itemid *rhand, t_itemid *lhand);
+void clif_get_weapon_view(map_session_data* sd, t_itemid *rhand, t_itemid *lhand);
 
-void clif_party_xy_remove(struct map_session_data *sd); //Fix for minimap [Kevin]
-void clif_gospel_info(struct map_session_data *sd, int type);
-void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv);
-void clif_starskill(struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
-void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsigned char type);
-void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
-void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress);
-void clif_feel_hate_reset(struct map_session_data *sd);
+void clif_party_xy_remove(map_session_data *sd); //Fix for minimap [Kevin]
+void clif_gospel_info(map_session_data *sd, int type);
+void clif_feel_req(int fd, map_session_data *sd, uint16 skill_lv);
+void clif_starskill(map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
+void clif_feel_info(map_session_data* sd, unsigned char feel_level, unsigned char type);
+void clif_hate_info(map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
+void clif_mission_info(map_session_data *sd, int mob_id, unsigned char progress);
+void clif_feel_hate_reset(map_session_data *sd);
 
 // [blackhole89]
-void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag);
-int clif_homskillinfoblock(struct map_session_data *sd);
-void clif_homskillup(struct map_session_data *sd, uint16 skill_id);	//[orn]
-void clif_hom_food(struct map_session_data *sd,int foodid,int fail);	//[orn]
-void clif_send_homdata(struct map_session_data *sd, int state, int param);	//[orn]
-
-void clif_configuration( struct map_session_data* sd, enum e_config_type type, bool enabled );
-void clif_partytickack(struct map_session_data* sd, bool flag);
-void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd);
-void clif_equipcheckbox(struct map_session_data* sd);
-
-void clif_msg(struct map_session_data* sd, unsigned short id);
-void clif_msg_value(struct map_session_data* sd, unsigned short id, int value);
-void clif_msg_skill(struct map_session_data* sd, uint16 skill_id, int msg_id);
-void clif_msg_color( struct map_session_data* sd, uint16 msg_id, uint32 color );
+void clif_hominfo(map_session_data *sd, struct homun_data *hd, int flag);
+int clif_homskillinfoblock(map_session_data *sd);
+void clif_homskillup(map_session_data *sd, uint16 skill_id);	//[orn]
+void clif_hom_food(map_session_data *sd,int foodid,int fail);	//[orn]
+void clif_send_homdata(map_session_data *sd, int state, int param);	//[orn]
+
+void clif_configuration( map_session_data* sd, enum e_config_type type, bool enabled );
+void clif_partytickack(map_session_data* sd, bool flag);
+void clif_viewequip_ack(map_session_data* sd, map_session_data* tsd);
+void clif_equipcheckbox(map_session_data* sd);
+
+void clif_msg(map_session_data* sd, unsigned short id);
+void clif_msg_value(map_session_data* sd, unsigned short id, int value);
+void clif_msg_skill(map_session_data* sd, uint16 skill_id, int msg_id);
+void clif_msg_color( map_session_data* sd, uint16 msg_id, uint32 color );
 
 //quest system [Kevin] [Inkfish]
-void clif_quest_send_list(struct map_session_data * sd);
-void clif_quest_send_mission(struct map_session_data * sd);
-void clif_quest_add(struct map_session_data * sd, struct quest * qd);
-void clif_quest_delete(struct map_session_data * sd, int quest_id);
-void clif_quest_update_status(struct map_session_data * sd, int quest_id, bool active);
-void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd);
-void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, e_questinfo_types effect, e_questinfo_markcolor color);
-void clif_displayexp(struct map_session_data *sd, t_exp exp, char type, bool quest, bool lost);
+void clif_quest_send_list(map_session_data * sd);
+void clif_quest_send_mission(map_session_data * sd);
+void clif_quest_add(map_session_data * sd, struct quest * qd);
+void clif_quest_delete(map_session_data * sd, int quest_id);
+void clif_quest_update_status(map_session_data * sd, int quest_id, bool active);
+void clif_quest_update_objective(map_session_data * sd, struct quest * qd);
+void clif_quest_show_event(map_session_data *sd, struct block_list *bl, e_questinfo_types effect, e_questinfo_markcolor color);
+void clif_displayexp(map_session_data *sd, t_exp exp, char type, bool quest, bool lost);
 
 int clif_send(const void* buf, int len, struct block_list* bl, enum send_target type);
 void do_init_clif(void);
@@ -983,132 +983,132 @@ enum mail_send_result : uint8_t {
 };
 
 void clif_Mail_window(int fd, int flag);
-void clif_Mail_read(struct map_session_data *sd, int mail_id);
-void clif_mail_delete(struct map_session_data* sd, struct mail_message *msg, bool success);
+void clif_Mail_read(map_session_data *sd, int mail_id);
+void clif_mail_delete(map_session_data* sd, struct mail_message *msg, bool success);
 void clif_Mail_return(int fd, int mail_id, short fail);
-void clif_Mail_send(struct map_session_data* sd, enum mail_send_result result);
-void clif_Mail_new(struct map_session_data* sd, int mail_id, const char *sender, const char *title);
-void clif_Mail_refreshinbox(struct map_session_data *sd,enum mail_inbox_type type,int64 mailID);
-void clif_mail_getattachment(struct map_session_data* sd, struct mail_message *msg, uint8 result, enum mail_attachment_type type);
-void clif_Mail_Receiver_Ack(struct map_session_data* sd, uint32 char_id, short class_, uint32 level, const char* name);
-void clif_mail_removeitem(struct map_session_data* sd, bool success, int index, int amount);
+void clif_Mail_send(map_session_data* sd, enum mail_send_result result);
+void clif_Mail_new(map_session_data* sd, int mail_id, const char *sender, const char *title);
+void clif_Mail_refreshinbox(map_session_data *sd,enum mail_inbox_type type,int64 mailID);
+void clif_mail_getattachment(map_session_data* sd, struct mail_message *msg, uint8 result, enum mail_attachment_type type);
+void clif_Mail_Receiver_Ack(map_session_data* sd, uint32 char_id, short class_, uint32 level, const char* name);
+void clif_mail_removeitem(map_session_data* sd, bool success, int index, int amount);
 // AUCTION SYSTEM
-void clif_Auction_openwindow(struct map_session_data *sd);
-void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf);
+void clif_Auction_openwindow(map_session_data *sd);
+void clif_Auction_results(map_session_data *sd, short count, short pages, uint8 *buf);
 void clif_Auction_message(int fd, unsigned char flag);
 void clif_Auction_close(int fd, unsigned char flag);
-void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd);
+void clif_parse_Auction_cancelreg(int fd, map_session_data *sd);
 
-void clif_bossmapinfo(struct map_session_data *sd, struct mob_data *md, enum e_bossmap_info flag);
-void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd);
+void clif_bossmapinfo(map_session_data *sd, struct mob_data *md, enum e_bossmap_info flag);
+void clif_cashshop_show(map_session_data *sd, struct npc_data *nd);
 
 // ADOPTION
-void clif_Adopt_reply(struct map_session_data *sd, int type);
-void clif_Adopt_request(struct map_session_data *sd, struct map_session_data *src, int p_id);
+void clif_Adopt_reply(map_session_data *sd, int type);
+void clif_Adopt_request(map_session_data *sd, map_session_data *src, int p_id);
 
 // MERCENARIES
-void clif_mercenary_info(struct map_session_data *sd);
-void clif_mercenary_skillblock(struct map_session_data *sd);
-void clif_mercenary_message(struct map_session_data* sd, int message);
-void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
+void clif_mercenary_info(map_session_data *sd);
+void clif_mercenary_skillblock(map_session_data *sd);
+void clif_mercenary_message(map_session_data* sd, int message);
+void clif_mercenary_updatestatus(map_session_data *sd, int type);
 
 // RENTAL SYSTEM
-void clif_rental_time( struct map_session_data* sd, t_itemid nameid, int seconds );
-void clif_rental_expired( struct map_session_data* sd, int index, t_itemid nameid );
+void clif_rental_time( map_session_data* sd, t_itemid nameid, int seconds );
+void clif_rental_expired( map_session_data* sd, int index, t_itemid nameid );
 
 // BOOK READING
 void clif_readbook(int fd, int book_id, int page);
 
 // Show Picker
-void clif_party_show_picker(struct map_session_data * sd, struct item * item_data);
+void clif_party_show_picker(map_session_data * sd, struct item * item_data);
 
 // Progress Bar [Inkfish]
-void clif_progressbar(struct map_session_data * sd, unsigned long color, unsigned int second);
-void clif_progressbar_abort(struct map_session_data * sd);
-void clif_progressbar_npc(struct npc_data *nd, struct map_session_data* sd);
+void clif_progressbar(map_session_data * sd, unsigned long color, unsigned int second);
+void clif_progressbar_abort(map_session_data * sd);
+void clif_progressbar_npc(struct npc_data *nd, map_session_data* sd);
 #define clif_progressbar_npc_area(nd) clif_progressbar_npc((nd),NULL)
 
-void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag);
-void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag);
+void clif_PartyBookingRegisterAck(map_session_data *sd, int flag);
+void clif_PartyBookingDeleteAck(map_session_data* sd, int flag);
 void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result);
-void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
-void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index);
-void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
+void clif_PartyBookingUpdateNotify(map_session_data* sd, struct party_booking_ad_info* pb_ad);
+void clif_PartyBookingDeleteNotify(map_session_data* sd, int index);
+void clif_PartyBookingInsertNotify(map_session_data* sd, struct party_booking_ad_info* pb_ad);
 
 /* Bank System [Yommy/Hercules] */
-void clif_parse_BankDeposit (int fd, struct map_session_data *sd);
-void clif_parse_BankWithdraw (int fd, struct map_session_data *sd);
-void clif_parse_BankCheck (int fd, struct map_session_data *sd);
-void clif_parse_BankOpen (int fd, struct map_session_data *sd);
-void clif_parse_BankClose (int fd, struct map_session_data *sd);
+void clif_parse_BankDeposit (int fd, map_session_data *sd);
+void clif_parse_BankWithdraw (int fd, map_session_data *sd);
+void clif_parse_BankCheck (int fd, map_session_data *sd);
+void clif_parse_BankOpen (int fd, map_session_data *sd);
+void clif_parse_BankClose (int fd, map_session_data *sd);
 
-void clif_showdigit(struct map_session_data* sd, unsigned char type, int value);
+void clif_showdigit(map_session_data* sd, unsigned char type, int value);
 
 /// Buying Store System
-void clif_buyingstore_open(struct map_session_data* sd);
-void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short result, unsigned int weight);
-void clif_buyingstore_myitemlist(struct map_session_data* sd);
-void clif_buyingstore_entry( struct map_session_data& sd, struct block_list* tbl = nullptr );
-void clif_buyingstore_disappear_entry( struct map_session_data& sd, struct block_list* tbl = nullptr );
-void clif_buyingstore_itemlist(struct map_session_data* sd, struct map_session_data* pl_sd);
-void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short result);
-void clif_buyingstore_update_item(struct map_session_data* sd, t_itemid nameid, unsigned short amount, uint32 char_id, int zeny);
-void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsigned short amount, int price);
-void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short result, t_itemid nameid);
+void clif_buyingstore_open(map_session_data* sd);
+void clif_buyingstore_open_failed(map_session_data* sd, unsigned short result, unsigned int weight);
+void clif_buyingstore_myitemlist(map_session_data* sd);
+void clif_buyingstore_entry( map_session_data& sd, struct block_list* tbl = nullptr );
+void clif_buyingstore_disappear_entry( map_session_data& sd, struct block_list* tbl = nullptr );
+void clif_buyingstore_itemlist(map_session_data* sd, map_session_data* pl_sd);
+void clif_buyingstore_trade_failed_buyer(map_session_data* sd, short result);
+void clif_buyingstore_update_item(map_session_data* sd, t_itemid nameid, unsigned short amount, uint32 char_id, int zeny);
+void clif_buyingstore_delete_item(map_session_data* sd, short index, unsigned short amount, int price);
+void clif_buyingstore_trade_failed_seller(map_session_data* sd, short result, t_itemid nameid);
 
 /// Search Store System
-void clif_search_store_info_ack(struct map_session_data* sd);
-void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason);
-void clif_open_search_store_info(struct map_session_data* sd);
-void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y);
+void clif_search_store_info_ack(map_session_data* sd);
+void clif_search_store_info_failed(map_session_data* sd, unsigned char reason);
+void clif_open_search_store_info(map_session_data* sd);
+void clif_search_store_info_click_ack(map_session_data* sd, short x, short y);
 
 /// Cash Shop
-void clif_cashshop_result( struct map_session_data* sd, t_itemid item_id, uint16 result );
-void clif_cashshop_open( struct map_session_data* sd, int tab );
+void clif_cashshop_result( map_session_data* sd, t_itemid item_id, uint16 result );
+void clif_cashshop_open( map_session_data* sd, int tab );
 
-void clif_display_pinfo( struct map_session_data& sd );
+void clif_display_pinfo( map_session_data& sd );
 
 /// Roulette
-void clif_roulette_open(struct map_session_data* sd);
-void clif_parse_roulette_open(int fd, struct map_session_data *sd);
-void clif_parse_roulette_info(int fd, struct map_session_data *sd);
-void clif_parse_roulette_close(int fd, struct map_session_data *sd);
-void clif_parse_roulette_generate(int fd, struct map_session_data *sd);
-void clif_parse_roulette_item(int fd, struct map_session_data *sd);
+void clif_roulette_open(map_session_data* sd);
+void clif_parse_roulette_open(int fd, map_session_data *sd);
+void clif_parse_roulette_info(int fd, map_session_data *sd);
+void clif_parse_roulette_close(int fd, map_session_data *sd);
+void clif_parse_roulette_generate(int fd, map_session_data *sd);
+void clif_parse_roulette_item(int fd, map_session_data *sd);
 
-void clif_elementalconverter_list(struct map_session_data *sd);
+void clif_elementalconverter_list(map_session_data *sd);
 
 void clif_millenniumshield(struct block_list *bl, short shields);
 
-void clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short x, short y);
+void clif_magicdecoy_list(map_session_data *sd, uint16 skill_lv, short x, short y);
 
-void clif_poison_list(struct map_session_data *sd, uint16 skill_lv);
+void clif_poison_list(map_session_data *sd, uint16 skill_lv);
 
-int clif_autoshadowspell_list(struct map_session_data *sd);
+int clif_autoshadowspell_list(map_session_data *sd);
 
-int clif_skill_itemlistwindow( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
-void clif_elemental_info(struct map_session_data *sd);
-void clif_elemental_updatestatus(struct map_session_data *sd, int type);
+int clif_skill_itemlistwindow( map_session_data *sd, uint16 skill_id, uint16 skill_lv );
+void clif_elemental_info(map_session_data *sd);
+void clif_elemental_updatestatus(map_session_data *sd, int type);
 
-void clif_spiritcharm(struct map_session_data *sd);
+void clif_spiritcharm(map_session_data *sd);
 
 void clif_snap( struct block_list *bl, short x, short y );
 void clif_monster_hp_bar( struct mob_data* md, int fd );
 
 // Clan System
-void clif_clan_basicinfo( struct map_session_data *sd );
+void clif_clan_basicinfo( map_session_data *sd );
 void clif_clan_message(struct clan *clan,const char *mes,int len);
 void clif_clan_onlinecount( struct clan* clan );
-void clif_clan_leave( struct map_session_data* sd );
+void clif_clan_leave( map_session_data* sd );
 
 // Bargain Tool
 void clif_sale_start(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target);
 void clif_sale_end(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target);
 void clif_sale_amount(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target);
-void clif_sale_open(struct map_session_data* sd);
+void clif_sale_open(map_session_data* sd);
 
 // Refine UI
-void clif_refineui_open( struct map_session_data* sd );
+void clif_refineui_open( map_session_data* sd );
 
 /**
  * Color Table
@@ -1129,28 +1129,28 @@ void clif_channel_msg(struct Channel *channel, const char *msg, unsigned long co
 
 #define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
 
-void clif_ranklist(struct map_session_data *sd, int16 rankingType);
+void clif_ranklist(map_session_data *sd, int16 rankingType);
 void clif_update_rankingpoint(map_session_data &sd, int rankingtype, int point);
 
-void clif_crimson_marker( struct map_session_data& sd, struct block_list& bl, bool remove );
+void clif_crimson_marker( map_session_data& sd, struct block_list& bl, bool remove );
 
 void clif_showscript(struct block_list* bl, const char* message, enum send_target flag);
-void clif_party_leaderchanged(struct map_session_data *sd, int prev_leader_aid, int new_leader_aid);
+void clif_party_leaderchanged(map_session_data *sd, int prev_leader_aid, int new_leader_aid);
 
 void clif_account_name(int fd, uint32 account_id, const char* accname);
-void clif_notify_bindOnEquip( struct map_session_data& sd, int16 index );
+void clif_notify_bindOnEquip( map_session_data& sd, int16 index );
 
-void clif_merge_item_open( struct map_session_data& sd );
+void clif_merge_item_open( map_session_data& sd );
 
 void clif_broadcast_obtain_special_item(const char *char_name, t_itemid nameid, t_itemid container, enum BROADCASTING_SPECIAL_ITEM_OBTAIN type);
 
-void clif_dressing_room(struct map_session_data *sd, int flag);
-void clif_navigateTo(struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id );
-void clif_SelectCart(struct map_session_data *sd);
+void clif_dressing_room(map_session_data *sd, int flag);
+void clif_navigateTo(map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id );
+void clif_SelectCart(map_session_data *sd);
 
 /// Achievement System
-void clif_achievement_list_all(struct map_session_data *sd);
-void clif_achievement_update(struct map_session_data *sd, struct achievement *ach, int count);
+void clif_achievement_list_all(map_session_data *sd);
+void clif_achievement_update(map_session_data *sd, struct achievement *ach, int count);
 void clif_achievement_reward_ack(int fd, unsigned char result, int ach_id);
 
 /// Attendance System
@@ -1171,53 +1171,53 @@ enum out_ui_type : int8 {
 	OUT_UI_ENCHANT = 10,
 };
 
-void clif_ui_open( struct map_session_data& sd, enum out_ui_type ui_type, int32 data );
-void clif_attendence_response( struct map_session_data *sd, int32 data );
+void clif_ui_open( map_session_data& sd, enum out_ui_type ui_type, int32 data );
+void clif_attendence_response( map_session_data *sd, int32 data );
 
-void clif_weight_limit( struct map_session_data* sd );
+void clif_weight_limit( map_session_data* sd );
 
-void clif_guild_storage_log( struct map_session_data* sd, std::vector<struct guild_log_entry>& log, enum e_guild_storage_log result );
+void clif_guild_storage_log( map_session_data* sd, std::vector<struct guild_log_entry>& log, enum e_guild_storage_log result );
 
-void clif_camerainfo( struct map_session_data* sd, bool show, float range = 0.0f, float rotation = 0.0f, float latitude = 0.0f );
+void clif_camerainfo( map_session_data* sd, bool show, float range = 0.0f, float rotation = 0.0f, float latitude = 0.0f );
 
 /// Equip Switch System
-void clif_equipswitch_list( struct map_session_data* sd );
-void clif_equipswitch_add( struct map_session_data* sd,uint16 index, uint32 pos, uint8 flag );
-void clif_equipswitch_remove( struct map_session_data* sd, uint16 index, uint32 pos, bool failed );
-void clif_equipswitch_reply( struct map_session_data* sd, bool failed );
+void clif_equipswitch_list( map_session_data* sd );
+void clif_equipswitch_add( map_session_data* sd,uint16 index, uint32 pos, uint8 flag );
+void clif_equipswitch_remove( map_session_data* sd, uint16 index, uint32 pos, bool failed );
+void clif_equipswitch_reply( map_session_data* sd, bool failed );
 
 /// Pet evolution
-void clif_pet_evolution_result( struct map_session_data* sd, e_pet_evolution_result result );
+void clif_pet_evolution_result( map_session_data* sd, e_pet_evolution_result result );
 
-void clif_parse_skill_toid( struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, int target_id );
+void clif_parse_skill_toid( map_session_data* sd, uint16 skill_id, uint16 skill_lv, int target_id );
 
-void clif_inventory_expansion_info( struct map_session_data* sd );
+void clif_inventory_expansion_info( map_session_data* sd );
 
 // Barter System
-void clif_barter_open( struct map_session_data& sd, struct npc_data& nd );
-void clif_barter_extended_open( struct map_session_data& sd, struct npc_data& nd );
+void clif_barter_open( map_session_data& sd, struct npc_data& nd );
+void clif_barter_extended_open( map_session_data& sd, struct npc_data& nd );
 
 void clif_summon_init(struct mob_data& md);
 void clif_summon_hp_bar(struct mob_data& md);
 
 // Laphine System
-void clif_laphine_synthesis_open( struct map_session_data *sd, std::shared_ptr<s_laphine_synthesis> synthesis );
-void clif_laphine_upgrade_open( struct map_session_data* sd, std::shared_ptr<s_laphine_upgrade> upgrade );
+void clif_laphine_synthesis_open( map_session_data *sd, std::shared_ptr<s_laphine_synthesis> synthesis );
+void clif_laphine_upgrade_open( map_session_data* sd, std::shared_ptr<s_laphine_upgrade> upgrade );
 
 // Reputation System
-void clif_reputation_type( struct map_session_data& sd, int64 type, int64 points );
-void clif_reputation_list( struct map_session_data& sd );
+void clif_reputation_type( map_session_data& sd, int64 type, int64 points );
+void clif_reputation_list( map_session_data& sd );
 
 // Item Reform UI
-void clif_item_reform_open( struct map_session_data& sd, t_itemid item );
+void clif_item_reform_open( map_session_data& sd, t_itemid item );
 
 // Item Enchant UI
-void clif_enchantwindow_open( struct map_session_data& sd, uint64 clientLuaIndex );
+void clif_enchantwindow_open( map_session_data& sd, uint64 clientLuaIndex );
 
 // Enchanting Shadow / Shadow Scar Spirit
 void clif_enchantingshadow_spirit(unit_data &ud);
 
-void clif_broadcast_refine_result(struct map_session_data& sd, t_itemid itemId, int8 level, bool success);
+void clif_broadcast_refine_result(map_session_data& sd, t_itemid itemId, int8 level, bool success);
 
 // Captcha Register
 void clif_captcha_upload_request(map_session_data &sd);

+ 13 - 13
src/map/duel.cpp

@@ -42,12 +42,12 @@ size_t duel_countactives()
 	return count; 
 } 
 
-static void duel_set(const size_t did, struct map_session_data* sd);
+static void duel_set(const size_t did, map_session_data* sd);
 
 /*
  * Save the current time of the duel in PC_LAST_DUEL_TIME
  */
-void duel_savetime(struct map_session_data* sd)
+void duel_savetime(map_session_data* sd)
 {
 	time_t timer;
 	struct tm *t;
@@ -61,7 +61,7 @@ void duel_savetime(struct map_session_data* sd)
 /*
  * Check if the time elapsed between last duel is enough to launch another.
  */
-bool duel_checktime(struct map_session_data* sd)
+bool duel_checktime(map_session_data* sd)
 {
 	int64 diff;
 	time_t timer;
@@ -90,9 +90,9 @@ bool duel_check_player_limit(struct duel& pDuel)
 /*
  * Display opponents name of sd
  */
-static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
+static int duel_showinfo_sub(map_session_data* sd, va_list va)
 {
-	struct map_session_data *ssd = va_arg(va, struct map_session_data*);
+	map_session_data *ssd = va_arg(va, map_session_data*);
 	int *p = va_arg(va, int*);
 
 	if (sd->duel_group != ssd->duel_group) 
@@ -108,7 +108,7 @@ static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
  * Display duel infos,
  * Number of duely...
  */
-void duel_showinfo(const size_t did, struct map_session_data* sd)
+void duel_showinfo(const size_t did, map_session_data* sd)
 {
 	//std::lock_guard<std::recursive_mutex> _(duel_list_mutex); //or shared_ptr	
 	if ( !duel_exist( did ) )
@@ -136,7 +136,7 @@ void duel_showinfo(const size_t did, struct map_session_data* sd)
 /*
 * Moves sd to duel
 */
-static void duel_set(const size_t did, struct map_session_data* sd) {
+static void duel_set(const size_t did, map_session_data* sd) {
 	sd->state.changemap = 1;
 	sd->state.warping = 1;
 
@@ -157,7 +157,7 @@ static void duel_set(const size_t did, struct map_session_data* sd) {
  * Create a new duel for sd
  * return new duel_id or 0 when fail
  */
-size_t duel_create(struct map_session_data* sd, const unsigned int maxpl)
+size_t duel_create(map_session_data* sd, const unsigned int maxpl)
 {
 	static size_t lastID=0;
 	lastID++;
@@ -184,7 +184,7 @@ size_t duel_create(struct map_session_data* sd, const unsigned int maxpl)
  * @sd = inviting player
  * @target_sd = invited player
  */
-bool duel_invite(const size_t did, struct map_session_data* sd, struct map_session_data* target_sd)
+bool duel_invite(const size_t did, map_session_data* sd, map_session_data* target_sd)
 {
 	//std::lock_guard<std::recursive_mutex> _(duel_list_mutex);
 	if ( !duel_exist( did ) )
@@ -208,7 +208,7 @@ bool duel_invite(const size_t did, struct map_session_data* sd, struct map_sessi
  * @sd = leaving player
  * @va = list(only contain duel_id atm)
  */
-static int duel_leave_sub(struct map_session_data* sd, va_list va)
+static int duel_leave_sub(map_session_data* sd, va_list va)
 {
 	size_t did = va_arg(va, size_t);
 	if (sd->duel_invite == did)
@@ -221,7 +221,7 @@ static int duel_leave_sub(struct map_session_data* sd, va_list va)
  * @did = duel id
  * @sd = leaving player
  */
-bool duel_leave(const size_t did, struct map_session_data* sd)
+bool duel_leave(const size_t did, map_session_data* sd)
 {
 	//std::lock_guard<std::recursive_mutex> _(duel_list_mutex);
 	if ( !duel_exist( did ) )
@@ -249,7 +249,7 @@ bool duel_leave(const size_t did, struct map_session_data* sd)
  * @did = duel id
  * @sd = player accepting duel
  */
-bool duel_accept(const size_t did, struct map_session_data* sd)
+bool duel_accept(const size_t did, map_session_data* sd)
 {
 	{ //mutex scope
 		//std::lock_guard<std::recursive_mutex> _(duel_list_mutex);
@@ -276,7 +276,7 @@ bool duel_accept(const size_t did, struct map_session_data* sd)
  * @did = duel id
  * @sd = player refusing duel
  */
-bool duel_reject(const size_t did, struct map_session_data* sd)
+bool duel_reject(const size_t did, map_session_data* sd)
 {
 	{
 		//std::lock_guard<std::recursive_mutex> _(duel_list_mutex);

+ 8 - 8
src/map/duel.hpp

@@ -5,7 +5,7 @@
 #define DUEL_HPP
 
 #include "../common/cbasetypes.hpp"
-
+class map_session_data;
 struct duel {
 	int members_count;
 	int invites_count;
@@ -18,13 +18,13 @@ size_t duel_counttotal();
 size_t duel_countactives();
 
 //Duel functions // [LuzZza]
-size_t duel_create(struct map_session_data* sd, const unsigned int maxpl);
-bool duel_invite(const size_t did, struct map_session_data* sd, struct map_session_data* target_sd);
-bool duel_accept(const size_t did, struct map_session_data* sd);
-bool duel_reject(const size_t did, struct map_session_data* sd);
-bool duel_leave(const size_t did, struct map_session_data* sd);
-void duel_showinfo(const size_t did, struct map_session_data* sd);
-bool duel_checktime(struct map_session_data* sd);
+size_t duel_create(map_session_data* sd, const unsigned int maxpl);
+bool duel_invite(const size_t did, map_session_data* sd, map_session_data* target_sd);
+bool duel_accept(const size_t did, map_session_data* sd);
+bool duel_reject(const size_t did, map_session_data* sd);
+bool duel_leave(const size_t did, map_session_data* sd);
+void duel_showinfo(const size_t did, map_session_data* sd);
+bool duel_checktime(map_session_data* sd);
 bool duel_check_player_limit( struct duel& pDuel );
 
 void do_init_duel(void);

+ 45 - 45
src/map/guild.cpp

@@ -369,7 +369,7 @@ std::shared_ptr<guild_castle> CastleDatabase::mapname2gc(const char* mapname) {
 	return castle_db.mapindex2gc(mapindex_name2id(mapname));
 }
 
-struct map_session_data* guild_getavailablesd(struct guild* g) {
+map_session_data* guild_getavailablesd(struct guild* g) {
 	int i;
 
 	nullpo_retr(NULL, g);
@@ -390,7 +390,7 @@ int guild_getindex(struct guild *g,uint32 account_id,uint32 char_id) {
 }
 
 /// lookup: player sd -> member position
-int guild_getposition(struct map_session_data* sd) {
+int guild_getposition(map_session_data* sd) {
 	int i;
 	struct guild *g;
 
@@ -401,7 +401,7 @@ int guild_getposition(struct map_session_data* sd) {
 }
 
 //Creation of member information
-void guild_makemember(struct guild_member *m,struct map_session_data *sd) {
+void guild_makemember(struct guild_member *m,map_session_data *sd) {
 	nullpo_retv(sd);
 
 	memset(m,0,sizeof(struct guild_member));
@@ -469,7 +469,7 @@ int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
 	}
 
 	for(i=0;i<g->max_member;i++){
-		struct map_session_data* sd = g->member[i].sd;
+		map_session_data* sd = g->member[i].sd;
 		if( sd != NULL && sd->fd && (sd->guild_x != sd->bl.x || sd->guild_y != sd->bl.y) && !sd->bg_id ) {
 			clif_guild_xy(sd);
 			sd->guild_x = sd->bl.x;
@@ -485,14 +485,14 @@ static TIMER_FUNC(guild_send_xy_timer){
 	return 0;
 }
 
-int guild_send_dot_remove(struct map_session_data *sd) {
+int guild_send_dot_remove(map_session_data *sd) {
 	if (sd->status.guild_id)
 		clif_guild_xy_remove(sd);
 	return 0;
 }
 //------------------------------------------------------------------------
 
-int guild_create(struct map_session_data *sd, const char *name) {
+int guild_create(map_session_data *sd, const char *name) {
 	char tname[NAME_LENGTH];
 	struct guild_member m;
 	nullpo_ret(sd);
@@ -522,7 +522,7 @@ int guild_create(struct map_session_data *sd, const char *name) {
 
 //Whether or not to create guild
 int guild_created(uint32 account_id,int guild_id) {
-	struct map_session_data *sd=map_id2sd(account_id);
+	map_session_data *sd=map_id2sd(account_id);
 
 	if(sd==NULL)
 		return 0;
@@ -573,7 +573,7 @@ int guild_npc_request_info(int guild_id,const char *event) {
  * Close trade window if party member is kicked when trade a party bound item
  * @param sd
  **/
-static void guild_trade_bound_cancel(struct map_session_data *sd) {
+static void guild_trade_bound_cancel(map_session_data *sd) {
 #ifdef BOUND_ITEMS
 	nullpo_retv(sd);
 	if (sd->state.isBoundTrading&(1<<BOUND_GUILD))
@@ -586,7 +586,7 @@ static void guild_trade_bound_cancel(struct map_session_data *sd) {
 //Confirmation of the character belongs to guild
 int guild_check_member(struct guild *g) {
 	int i;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct s_mapiterator* iter;
 
 	nullpo_ret(g);
@@ -611,7 +611,7 @@ int guild_check_member(struct guild *g) {
 
 //Delete association with guild_id for all characters
 int guild_recv_noinfo(int guild_id) {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct s_mapiterator* iter;
 
 	iter = mapit_getallusers();
@@ -629,7 +629,7 @@ int guild_recv_info(struct guild *sg) {
 	struct guild *g,before;
 	int i,bm,m;
 	DBData data;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	bool guild_new = false;
 
 	nullpo_ret(sg);
@@ -729,7 +729,7 @@ int guild_recv_info(struct guild *sg) {
 /*=============================================
  * Player sd send a guild invatation to player tsd to join his guild
  *--------------------------------------------*/
-int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
+int guild_invite(map_session_data *sd, map_session_data *tsd) {
 	struct guild *g;
 	int i;
 
@@ -779,8 +779,8 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
 
 /// Guild invitation reply.
 /// flag: 0:rejected, 1:accepted
-int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag) {
-	struct map_session_data* tsd;
+int guild_reply_invite(map_session_data* sd, int guild_id, int flag) {
+	map_session_data* tsd;
 
 	nullpo_ret(sd);
 
@@ -832,7 +832,7 @@ int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag) {
 //- If guild is not in memory, it is requested
 //- Otherwise sd pointer is set up.
 //- Player must be authed and must belong to a guild before invoking this method
-void guild_member_joined(struct map_session_data *sd) {
+void guild_member_joined(map_session_data *sd) {
 	struct guild* g;
 	int i;
 	g=guild_search(sd->status.guild_id);
@@ -865,7 +865,7 @@ void guild_member_joined(struct map_session_data *sd) {
  * Add a player to a given guild_id
  *----------------------------------------*/
 int guild_member_added(int guild_id,uint32 account_id,uint32 char_id,int flag) {
-	struct map_session_data *sd= map_id2sd(account_id),*sd2;
+	map_session_data *sd= map_id2sd(account_id),*sd2;
 	struct guild *g;
 
 	if( (g=guild_search(guild_id))==NULL )
@@ -914,7 +914,7 @@ int guild_member_added(int guild_id,uint32 account_id,uint32 char_id,int flag) {
 /*==========================================
  * Player request leaving a given guild_id
  *----------------------------------------*/
-int guild_leave(struct map_session_data* sd, int guild_id, uint32 account_id, uint32 char_id, const char* mes) {
+int guild_leave(map_session_data* sd, int guild_id, uint32 account_id, uint32 char_id, const char* mes) {
 	struct guild *g;
 
 	nullpo_ret(sd);
@@ -937,8 +937,8 @@ int guild_leave(struct map_session_data* sd, int guild_id, uint32 account_id, ui
 /*==========================================
  * Request remove a player to a given guild_id
  *----------------------------------------*/
-int guild_expulsion(struct map_session_data* sd, int guild_id, uint32 account_id, uint32 char_id, const char* mes) {
-	struct map_session_data *tsd;
+int guild_expulsion(map_session_data* sd, int guild_id, uint32 account_id, uint32 char_id, const char* mes) {
+	map_session_data *tsd;
 	struct guild *g;
 	int i,ps;
 
@@ -984,8 +984,8 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, uint32 account_id
 int guild_member_withdraw(int guild_id, uint32 account_id, uint32 char_id, int flag, const char* name, const char* mes) {
 	int i;
 	struct guild* g = guild_search(guild_id);
-	struct map_session_data* sd = map_charid2sd(char_id);
-	struct map_session_data* online_member_sd;
+	map_session_data* sd = map_charid2sd(char_id);
+	map_session_data* online_member_sd;
 
 	if(g == NULL)
 		return 0; // no such guild (error!)
@@ -1094,7 +1094,7 @@ void guild_retrieveitembound(uint32 char_id, uint32 account_id, int guild_id) {
 }
 #endif
 
-int guild_send_memberinfoshort(struct map_session_data *sd,int online) { // cleaned up [LuzZza]
+int guild_send_memberinfoshort(map_session_data *sd,int online) { // cleaned up [LuzZza]
 	struct guild *g;
 
 	nullpo_ret(sd);
@@ -1150,7 +1150,7 @@ int guild_recv_memberinfoshort(int guild_id,uint32 account_id,uint32 char_id,int
 
 	if(idx == -1 || c == 0) {
         //Treat char_id who doesn't match guild_id (not found as member)
-		struct map_session_data *sd = map_id2sd(account_id);
+		map_session_data *sd = map_id2sd(account_id);
 		if(sd && sd->status.char_id == char_id) {
 			sd->status.guild_id=0;
 			sd->guild_emblem_id=0;
@@ -1189,7 +1189,7 @@ int guild_recv_memberinfoshort(int guild_id,uint32 account_id,uint32 char_id,int
 /*====================================================
  * Send a message to whole guild
  *---------------------------------------------------*/
-int guild_send_message(struct map_session_data *sd,const char *mes,int len) {
+int guild_send_message(map_session_data *sd,const char *mes,int len) {
 	nullpo_ret(sd);
 
 	if(sd->status.guild_id==0)
@@ -1270,7 +1270,7 @@ int guild_position_changed(int guild_id,int idx,struct guild_position *p) {
 /*====================================================
  * Change guild notice
  *---------------------------------------------------*/
-int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2) {
+int guild_change_notice(map_session_data *sd,int guild_id,const char *mes1,const char *mes2) {
 	nullpo_ret(sd);
 
 	if(guild_id!=sd->status.guild_id)
@@ -1291,7 +1291,7 @@ int guild_notice_changed(int guild_id,const char *mes1,const char *mes2) {
 	memcpy(g->mes2,mes2,MAX_GUILDMES2);
 
 	for(i=0;i<g->max_member;i++){
-		struct map_session_data *sd = g->member[i].sd;
+		map_session_data *sd = g->member[i].sd;
 		if(sd != NULL)
 			clif_guild_notice(sd);
 	}
@@ -1317,7 +1317,7 @@ bool guild_check_emblem_change_condition(map_session_data *sd)
 /*====================================================
  * Change guild emblem
  *---------------------------------------------------*/
-int guild_change_emblem(struct map_session_data *sd,int len,const char *data) {
+int guild_change_emblem(map_session_data *sd,int len,const char *data) {
 	nullpo_ret(sd);
 
 	if (!guild_check_emblem_change_condition(sd)) {
@@ -1346,7 +1346,7 @@ int guild_change_emblem_version(map_session_data* sd, int version)
  *---------------------------------------------------*/
 int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data) {
 	int i;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct guild *g=guild_search(guild_id);
 	if(g==NULL)
 		return 0;
@@ -1403,7 +1403,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data) {
  */
 static DBData create_expcache(DBKey key, va_list args) {
 	struct guild_expcache *c;
-	struct map_session_data *sd = va_arg(args, struct map_session_data*);
+	map_session_data *sd = va_arg(args, map_session_data*);
 
 	c = ers_alloc(expcache_ers, struct guild_expcache);
 	c->guild_id = sd->status.guild_id;
@@ -1416,7 +1416,7 @@ static DBData create_expcache(DBKey key, va_list args) {
 /*====================================================
  * Return taxed experience from player sd to guild
  *---------------------------------------------------*/
-t_exp guild_payexp(struct map_session_data *sd,t_exp exp) {
+t_exp guild_payexp(map_session_data *sd,t_exp exp) {
 	struct guild *g;
 	struct guild_expcache *c;
 	int per;
@@ -1447,7 +1447,7 @@ t_exp guild_payexp(struct map_session_data *sd,t_exp exp) {
  * Add this experience to guild exp
  * [Celest]
  *---------------------------------------------------*/
-t_exp guild_getexp(struct map_session_data *sd,t_exp exp) {
+t_exp guild_getexp(map_session_data *sd,t_exp exp) {
 	struct guild_expcache *c;
 	nullpo_ret(sd);
 
@@ -1463,7 +1463,7 @@ t_exp guild_getexp(struct map_session_data *sd,t_exp exp) {
 /*====================================================
  * Ask to increase guildskill skill_id
  *---------------------------------------------------*/
-void guild_skillup(struct map_session_data* sd, uint16 skill_id) {
+void guild_skillup(map_session_data* sd, uint16 skill_id) {
 	struct guild* g;
 	short idx = guild_skill_get_index(skill_id);
 	short max = 0;
@@ -1489,7 +1489,7 @@ void guild_skillup(struct map_session_data* sd, uint16 skill_id) {
  * Notification of guildskill skill_id increase request
  *---------------------------------------------------*/
 int guild_skillupack(int guild_id,uint16 skill_id,uint32 account_id) {
-	struct map_session_data *sd = map_id2sd(account_id);
+	map_session_data *sd = map_id2sd(account_id);
 	struct guild *g = guild_search(guild_id);
 	int i;
 	short idx = guild_skill_get_index(skill_id);
@@ -1520,7 +1520,7 @@ int guild_skillupack(int guild_id,uint16 skill_id,uint32 account_id) {
 	return 0;
 }
 
-void guild_guildaura_refresh(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
+void guild_guildaura_refresh(map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
 	if( !(battle_config.guild_aura&(is_agit_start()?2:1)) &&
 			!(battle_config.guild_aura&(map_flag_gvg2(sd->bl.m)?8:4)) )
 		return;
@@ -1561,7 +1561,7 @@ int guild_get_alliance_count(struct guild *g,int flag) {
 }
 
 // Blocks all guild skills which have a common delay time.
-void guild_block_skill(struct map_session_data *sd, int time) {
+void guild_block_skill(map_session_data *sd, int time) {
 	uint16 skill_id[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL };
 	int i;
 	for (i = 0; i < 4; i++)
@@ -1590,7 +1590,7 @@ int guild_check_alliance(int guild_id1, int guild_id2, int flag) {
 /*====================================================
  * Player sd, asking player tsd an alliance between their 2 guilds
  *---------------------------------------------------*/
-int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd) {
+int guild_reqalliance(map_session_data *sd,map_session_data *tsd) {
 	struct guild *g[2];
 	int i;
 
@@ -1653,8 +1653,8 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
 /*====================================================
  * Player sd, answer to player tsd (account_id) for an alliance request
  *---------------------------------------------------*/
-int guild_reply_reqalliance(struct map_session_data *sd,uint32 account_id,int flag) {
-	struct map_session_data *tsd;
+int guild_reply_reqalliance(map_session_data *sd,uint32 account_id,int flag) {
+	map_session_data *tsd;
 
 	nullpo_ret(sd);
 	tsd= map_id2sd( account_id );
@@ -1713,7 +1713,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,uint32 account_id,int fl
 /*====================================================
  * Player sd asking to break alliance with guild guild_id
  *---------------------------------------------------*/
-int guild_delalliance(struct map_session_data *sd,int guild_id,int flag) {
+int guild_delalliance(map_session_data *sd,int guild_id,int flag) {
 	nullpo_ret(sd);
 
 	if(is_agit_start()) {	// Disable alliance breaking during woe [Valaris]
@@ -1728,7 +1728,7 @@ int guild_delalliance(struct map_session_data *sd,int guild_id,int flag) {
 /*====================================================
  * Player sd, asking player tsd a formal enemy relation between their 2 guilds
  *---------------------------------------------------*/
-int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd) {
+int guild_opposition(map_session_data *sd,map_session_data *tsd) {
 	struct guild *g;
 	int i;
 
@@ -1775,7 +1775,7 @@ int guild_allianceack(int guild_id1,int guild_id2,uint32 account_id1,uint32 acco
 	struct guild *g[2];
 	int guild_id[2];
 	const char *guild_name[2];
-	struct map_session_data *sd[2];
+	map_session_data *sd[2];
 	int j,i;
 
 	guild_id[0] = guild_id1;
@@ -1836,7 +1836,7 @@ int guild_allianceack(int guild_id1,int guild_id2,uint32 account_id1,uint32 acco
 	for (i = 0; i < 2 - (flag & 1); i++) { // Retransmission of the relationship list to all members
 		if(g[i]!=NULL)
 			for(j=0;j<g[i]->max_member;j++) {
-				struct map_session_data *sd_mem = g[i]->member[j].sd;
+				map_session_data *sd_mem = g[i]->member[j].sd;
 				if( sd_mem!=NULL){
 					clif_guild_allianceinfo(sd_mem);
 
@@ -1858,7 +1858,7 @@ int guild_broken_sub(DBKey key, DBData *data, va_list ap) {
 	struct guild *g = (struct guild *)db_data2ptr(data);
 	int guild_id=va_arg(ap,int);
 	int i,j;
-	struct map_session_data *sd=NULL;
+	map_session_data *sd=NULL;
 
 	nullpo_ret(g);
 
@@ -1903,7 +1903,7 @@ int guild_broken(int guild_id,int flag) {
 		return 0;
 
 	for (i = 0; i < g->max_member; i++){	// Destroy all relationships
-		struct map_session_data *sd = g->member[i].sd;
+		map_session_data *sd = g->member[i].sd;
 		if(sd != NULL){
 			if(sd->state.storage_flag == 2)
 				storage_guild_storage_quit(sd,1);
@@ -2026,7 +2026,7 @@ int guild_gm_changed(int guild_id, uint32 account_id, uint32 char_id, time_t tim
 * @param sd Player who breaks the guild
 * @param name Guild name
 */
-int guild_break(struct map_session_data *sd,char *name) {
+int guild_break(map_session_data *sd,char *name) {
 	struct guild *g;
 	struct unit_data *ud;
 	int i;

+ 24 - 24
src/map/guild.hpp

@@ -14,7 +14,7 @@ struct guild;
 struct guild_member;
 struct guild_position;
 struct guild_castle;
-struct map_session_data;
+class map_session_data;
 struct mob_data;
 
 //For quick linking to a guardian's info. [Skotlex]
@@ -38,54 +38,54 @@ void do_init_guild(void);
 struct guild *guild_search(int guild_id);
 struct guild *guild_searchname(char *str);
 
-struct map_session_data *guild_getavailablesd(struct guild *g);
+map_session_data *guild_getavailablesd(struct guild *g);
 int guild_getindex(struct guild *g,uint32 account_id,uint32 char_id);
-int guild_getposition(struct map_session_data *sd);
-t_exp guild_payexp(struct map_session_data *sd,t_exp exp);
-t_exp guild_getexp(struct map_session_data *sd,t_exp exp); // [Celest]
+int guild_getposition(map_session_data *sd);
+t_exp guild_payexp(map_session_data *sd,t_exp exp);
+t_exp guild_getexp(map_session_data *sd,t_exp exp); // [Celest]
 
-int guild_create(struct map_session_data *sd, const char *name);
+int guild_create(map_session_data *sd, const char *name);
 int guild_created(uint32 account_id,int guild_id);
 int guild_request_info(int guild_id);
 int guild_recv_noinfo(int guild_id);
 int guild_recv_info(struct guild *sg);
 int guild_npc_request_info(int guild_id,const char *ev);
-int guild_invite(struct map_session_data *sd,struct map_session_data *tsd);
-int guild_reply_invite(struct map_session_data *sd,int guild_id,int flag);
-void guild_member_joined(struct map_session_data *sd);
+int guild_invite(map_session_data *sd,map_session_data *tsd);
+int guild_reply_invite(map_session_data *sd,int guild_id,int flag);
+void guild_member_joined(map_session_data *sd);
 int guild_member_added(int guild_id,uint32 account_id,uint32 char_id,int flag);
-int guild_leave(struct map_session_data *sd,int guild_id,
+int guild_leave(map_session_data *sd,int guild_id,
 	uint32 account_id,uint32 char_id,const char *mes);
 int guild_member_withdraw(int guild_id,uint32 account_id,uint32 char_id,int flag,
 	const char *name,const char *mes);
-int guild_expulsion(struct map_session_data *sd,int guild_id,
+int guild_expulsion(map_session_data *sd,int guild_id,
 	uint32 account_id,uint32 char_id,const char *mes);
-void guild_skillup(struct map_session_data* sd, uint16 skill_id);
-void guild_block_skill(struct map_session_data *sd, int time);
-int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd);
-int guild_reply_reqalliance(struct map_session_data *sd,uint32 account_id,int flag);
+void guild_skillup(map_session_data* sd, uint16 skill_id);
+void guild_block_skill(map_session_data *sd, int time);
+int guild_reqalliance(map_session_data *sd,map_session_data *tsd);
+int guild_reply_reqalliance(map_session_data *sd,uint32 account_id,int flag);
 int guild_allianceack(int guild_id1,int guild_id2,uint32 account_id1,uint32 account_id2,
 	int flag,const char *name1,const char *name2);
-int guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
-int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd);
+int guild_delalliance(map_session_data *sd,int guild_id,int flag);
+int guild_opposition(map_session_data *sd,map_session_data *tsd);
 int guild_check_alliance(int guild_id1, int guild_id2, int flag);
 
-int guild_send_memberinfoshort(struct map_session_data *sd,int online);
+int guild_send_memberinfoshort(map_session_data *sd,int online);
 int guild_recv_memberinfoshort(int guild_id,uint32 account_id,uint32 char_id,int online,int lv,int class_);
 int guild_change_memberposition(int guild_id,uint32 account_id,uint32 char_id,short idx);
 int guild_memberposition_changed(struct guild *g,int idx,int pos);
 int guild_change_position(int guild_id,int idx,int mode,int exp_mode,const char *name);
 int guild_position_changed(int guild_id,int idx,struct guild_position *p);
-int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2);
+int guild_change_notice(map_session_data *sd,int guild_id,const char *mes1,const char *mes2);
 int guild_notice_changed(int guild_id,const char *mes1,const char *mes2);
-int guild_change_emblem(struct map_session_data *sd,int len,const char *data);
+int guild_change_emblem(map_session_data *sd,int len,const char *data);
 int guild_change_emblem_version(map_session_data* sd, int version);
 int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data);
-int guild_send_message(struct map_session_data *sd,const char *mes,int len);
+int guild_send_message(map_session_data *sd,const char *mes,int len);
 int guild_recv_message(int guild_id,uint32 account_id,const char *mes,int len);
-int guild_send_dot_remove(struct map_session_data *sd);
+int guild_send_dot_remove(map_session_data *sd);
 int guild_skillupack(int guild_id,uint16 skill_id,uint32 account_id);
-int guild_break(struct map_session_data *sd,char *name);
+int guild_break(map_session_data *sd,char *name);
 int guild_broken(int guild_id,int flag);
 int guild_gm_change(int guild_id, uint32 char_id);
 int guild_gm_changed(int guild_id, uint32 account_id, uint32 char_id, time_t time);
@@ -109,7 +109,7 @@ void guild_flag_add(struct npc_data *nd);
 void guild_flag_remove(struct npc_data *nd);
 void guild_flags_clear(void);
 
-void guild_guildaura_refresh(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+void guild_guildaura_refresh(map_session_data *sd, uint16 skill_id, uint16 skill_lv);
 #ifdef BOUND_ITEMS
 void guild_retrieveitembound(uint32 char_id,uint32 account_id,int guild_id);
 #endif

+ 17 - 17
src/map/homunculus.cpp

@@ -256,7 +256,7 @@ void hom_damage(struct homun_data *hd) {
 int hom_dead(struct homun_data *hd)
 {
 	//There's no intimacy penalties on death (from Tharis)
-	struct map_session_data *sd = hd->master;
+	map_session_data *sd = hd->master;
 
 	clif_emotion(&hd->bl, ET_KEK);
 
@@ -282,7 +282,7 @@ int hom_dead(struct homun_data *hd)
 * @param sd
 * @param flag 1: then HP needs to be 80% or above. 2: then set to morph state.
 */
-int hom_vaporize(struct map_session_data *sd, int flag)
+int hom_vaporize(map_session_data *sd, int flag)
 {
 	struct homun_data *hd;
 
@@ -324,7 +324,7 @@ int hom_vaporize(struct map_session_data *sd, int flag)
 */
 int hom_delete(struct homun_data *hd, int emote)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	nullpo_ret(hd);
 	sd = hd->master;
 
@@ -630,7 +630,7 @@ int hom_evolution(struct homun_data *hd)
 {
 	struct s_homunculus *hom;
 	struct h_stats *max, *min;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	nullpo_ret(hd);
 
 	if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class) {
@@ -688,7 +688,7 @@ int hom_evolution(struct homun_data *hd)
 int hom_mutate(struct homun_data *hd, int homun_id)
 {
 	struct s_homunculus *hom;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	int m_class, m_id, prev_class = 0;
 	nullpo_ret(hd);
 
@@ -852,7 +852,7 @@ void hom_save(struct homun_data *hd)
 * @param sd
 * @param type
 */
-void hom_menu(struct map_session_data *sd, int type)
+void hom_menu(map_session_data *sd, int type)
 {
 	nullpo_retv(sd);
 	if (sd->hd == NULL)
@@ -878,7 +878,7 @@ void hom_menu(struct map_session_data *sd, int type)
 * @param sd
 * @param hd
 */
-int hom_food(struct map_session_data *sd, struct homun_data *hd)
+int hom_food(map_session_data *sd, struct homun_data *hd)
 {
 	int i, foodID, emotion;
 
@@ -935,7 +935,7 @@ int hom_food(struct map_session_data *sd, struct homun_data *hd)
 * Timer to reduce hunger level
 */
 static TIMER_FUNC(hom_hungry){
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct homun_data *hd;
 
 	sd = map_id2sd(id);
@@ -998,7 +998,7 @@ int hom_hungry_timer_delete(struct homun_data *hd)
 /**
 * Change homunculus name
 */
-int hom_change_name(struct map_session_data *sd,char *name)
+int hom_change_name(map_session_data *sd,char *name)
 {
 	int i;
 	struct homun_data *hd;
@@ -1024,7 +1024,7 @@ int hom_change_name(struct map_session_data *sd,char *name)
 * @param name
 * @param flag
 */
-void hom_change_name_ack(struct map_session_data *sd, char* name, int flag)
+void hom_change_name_ack(map_session_data *sd, char* name, int flag)
 {
 	struct homun_data *hd = sd->hd;
 	if (!hom_is_active(hd))
@@ -1077,7 +1077,7 @@ int hom_search(int key, int type)
 * @param sd
 * @param hom
 */
-void hom_alloc(struct map_session_data *sd, struct s_homunculus *hom)
+void hom_alloc(map_session_data *sd, struct s_homunculus *hom)
 {
 	struct homun_data *hd;
 	int i = 0;
@@ -1147,7 +1147,7 @@ void hom_init_timers(struct homun_data * hd)
  * @param sd
  * @return False:failure, True:sucess
  */
-bool hom_call(struct map_session_data *sd)
+bool hom_call(map_session_data *sd)
 {
 	struct homun_data *hd;
 
@@ -1203,7 +1203,7 @@ bool hom_call(struct map_session_data *sd)
  */
 int hom_recv_data(uint32 account_id, struct s_homunculus *sh, int flag)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct homun_data *hd;
 	bool created = false;
 
@@ -1260,7 +1260,7 @@ int hom_recv_data(uint32 account_id, struct s_homunculus *sh, int flag)
 * @param class_
 * @return True:Success; False:Failed
 */
-bool hom_create_request(struct map_session_data *sd, int class_)
+bool hom_create_request(map_session_data *sd, int class_)
 {
 	struct s_homunculus homun;
 	struct h_stats *base;
@@ -1305,7 +1305,7 @@ bool hom_create_request(struct map_session_data *sd, int class_)
  * @param y : Y map coordinate
  * @return 0:failure, 1:success
  */
-int hom_ressurect(struct map_session_data* sd, unsigned char per, short x, short y)
+int hom_ressurect(map_session_data* sd, unsigned char per, short x, short y)
 {
 	struct homun_data* hd;
 	nullpo_ret(sd);
@@ -1353,7 +1353,7 @@ int hom_ressurect(struct map_session_data* sd, unsigned char per, short x, short
 */
 void hom_revive(struct homun_data *hd, unsigned int hp, unsigned int sp)
 {
-	struct map_session_data *sd = hd->master;
+	map_session_data *sd = hd->master;
 	hd->homunculus.hp = hd->battle_status.hp;
 	if (!sd)
 		return;
@@ -1399,7 +1399,7 @@ void hom_reset_stats(struct homun_data *hd)
 */
 int hom_shuffle(struct homun_data *hd)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	int lv, i, skillpts;
 	struct s_skill b_skill[MAX_HOMUNSKILL];
 

+ 10 - 10
src/map/homunculus.hpp

@@ -77,13 +77,13 @@ struct homun_data {
 	struct unit_data  ud;
 	struct view_data *vd;
 	struct status_data base_status, battle_status;
-	struct status_change sc;
+	status_change sc;
 	struct regen_data regen;
 	struct s_homunculus_db *homunculusDB;	//[orn]
 	struct s_homunculus homunculus;	//[orn]
 
 	int masterteleport_timer;
-	struct map_session_data *master; //pointer back to its master
+	map_session_data *master; //pointer back to its master
 	int hungry_timer;	//[orn]
 	t_exp exp_next;
 	std::vector<uint16> blockskill;	// [orn]
@@ -178,20 +178,20 @@ int hom_levelup(struct homun_data *hd);
 int hom_evolution(struct homun_data *hd);
 int hom_mutate(struct homun_data *hd,int homun_id);
 void hom_heal(struct homun_data *hd);
-int hom_vaporize(struct map_session_data *sd, int flag);
-int hom_ressurect(struct map_session_data *sd, unsigned char per, short x, short y);
+int hom_vaporize(map_session_data *sd, int flag);
+int hom_ressurect(map_session_data *sd, unsigned char per, short x, short y);
 void hom_revive(struct homun_data *hd, unsigned int hp, unsigned int sp);
 void hom_reset_stats(struct homun_data *hd);
 int hom_shuffle(struct homun_data *hd); // [Zephyrus]
 void hom_save(struct homun_data *hd);
-bool hom_call(struct map_session_data *sd);
-bool hom_create_request(struct map_session_data *sd, int class_);
+bool hom_call(map_session_data *sd);
+bool hom_create_request(map_session_data *sd, int class_);
 int hom_search(int key,int type);
-void hom_menu(struct map_session_data *sd,int type);
-int hom_food(struct map_session_data *sd, struct homun_data *hd);
+void hom_menu(map_session_data *sd,int type);
+int hom_food(map_session_data *sd, struct homun_data *hd);
 int hom_hungry_timer_delete(struct homun_data *hd);
-int hom_change_name(struct map_session_data *sd,char *name);
-void hom_change_name_ack(struct map_session_data *sd, char* name, int flag);
+int hom_change_name(map_session_data *sd,char *name);
+void hom_change_name_ack(map_session_data *sd, char* name, int flag);
 #define hom_stop_walking(hd, type) unit_stop_walking(&(hd)->bl, type)
 #define hom_stop_attack(hd) unit_stop_attack(&(hd)->bl)
 int hom_increase_intimacy(struct homun_data * hd, unsigned int value);

+ 7 - 7
src/map/instance.cpp

@@ -256,7 +256,7 @@ std::shared_ptr<s_instance_db> instance_search_db_name(const char *instance_name
  * @param sd: Pointer to player data
  * @param target: Target display type
  */
-void instance_getsd(int instance_id, struct map_session_data *&sd, enum send_target *target) {
+void instance_getsd(int instance_id, map_session_data *&sd, enum send_target *target) {
 	std::shared_ptr<s_instance_data> idata = util::umap_find(instances, instance_id);
 
 	if (!idata) {
@@ -311,7 +311,7 @@ static TIMER_FUNC(instance_subscription_timer){
 	if (!idata)
 		return 0;
 
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct party_data *pd;
 	struct guild *gd;
 	struct clan *cd;
@@ -568,7 +568,7 @@ int instance_create(int owner_id, const char *name, e_instance_mode mode) {
 		return -1;
 	}
 
-	struct map_session_data *sd = nullptr;
+	map_session_data *sd = nullptr;
 	struct party_data *pd;
 	struct guild *gd;
 	struct clan* cd;
@@ -891,7 +891,7 @@ bool instance_destroy(int instance_id)
 	if (!idata)
 		return false;
 
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct party_data *pd;
 	struct guild *gd;
 	struct clan *cd;
@@ -1001,7 +1001,7 @@ bool instance_destroy(int instance_id)
  * @param y: Y coordinate
  * @return e_instance_enter value
  */
-e_instance_enter instance_enter(struct map_session_data *sd, int instance_id, const char *name, short x, short y)
+e_instance_enter instance_enter(map_session_data *sd, int instance_id, const char *name, short x, short y)
 {
 	nullpo_retr(IE_OTHER, sd);
 	
@@ -1096,7 +1096,7 @@ e_instance_enter instance_enter(struct map_session_data *sd, int instance_id, co
  * @param instance_id: Instance to request
  * @return True on success or false on failure
  */
-bool instance_reqinfo(struct map_session_data *sd, int instance_id)
+bool instance_reqinfo(map_session_data *sd, int instance_id)
 {
 	nullpo_retr(false, sd);
 
@@ -1197,7 +1197,7 @@ void do_reload_instance(void)
 
 	// Reset player to instance beginning
 	struct s_mapiterator *iter = mapit_getallusers();
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	for (sd = (TBL_PC *)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC *)mapit_next(iter)) {
 		struct map_data *mapdata = map_getmapdata(sd->bl.m);

+ 3 - 3
src/map/instance.hpp

@@ -113,13 +113,13 @@ extern InstanceDatabase instance_db;
 extern std::unordered_map<int, std::shared_ptr<s_instance_data>> instances;
 
 std::shared_ptr<s_instance_db> instance_search_db_name(const char* name);
-void instance_getsd(int instance_id, struct map_session_data *&sd, enum send_target *target);
+void instance_getsd(int instance_id, map_session_data *&sd, enum send_target *target);
 
 int instance_create(int owner_id, const char *name, e_instance_mode mode);
 bool instance_destroy(int instance_id);
 void instance_destroy_command(map_session_data *sd);
-e_instance_enter instance_enter(struct map_session_data *sd, int instance_id, const char *name, short x, short y);
-bool instance_reqinfo(struct map_session_data *sd, int instance_id);
+e_instance_enter instance_enter(map_session_data *sd, int instance_id, const char *name, short x, short y);
+bool instance_reqinfo(map_session_data *sd, int instance_id);
 bool instance_addusers(int instance_id);
 bool instance_delusers(int instance_id);
 void instance_generate_mapname(int map_id, int instance_id, char outname[MAP_NAME_LENGTH]);

+ 46 - 46
src/map/intif.cpp

@@ -69,9 +69,9 @@ int CheckForCharServer(void)
  * @param char_id
  * @return sd Found sd or NULL if not found
  */
-struct map_session_data *inter_search_sd(uint32 account_id, uint32 char_id)
+map_session_data *inter_search_sd(uint32 account_id, uint32 char_id)
 {
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	struct auth_node *node = chrif_auth_check(account_id, char_id, ST_LOGIN);
 	if (node)
 		sd = node->sd;
@@ -182,7 +182,7 @@ int intif_delete_petdata(int pet_id)
  * @param name
  * @return 
  */
-int intif_rename(struct map_session_data *sd, int type, char *name)
+int intif_rename(map_session_data *sd, int type, char *name)
 {
 	if (CheckForCharServer())
 		return 0;
@@ -283,7 +283,7 @@ int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fo
  * @param message : the message to sent
  * @return 
  */
-int intif_main_message(struct map_session_data* sd, const char* message)
+int intif_main_message(map_session_data* sd, const char* message)
 {
 	char output[256];
 
@@ -310,7 +310,7 @@ int intif_main_message(struct map_session_data* sd, const char* message)
  * @param mes_len : Size of message
  * @return 0=Message not send, 1=Message send
  */
-int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len)
+int intif_wis_message(map_session_data *sd, char *nick, char *mes, int mes_len)
 {
 	int headersize = 8 + 2 * NAME_LENGTH;
 
@@ -393,7 +393,7 @@ int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes)
  * @param sd : Player to save registry
  * @return 1=msg sent, -1=error
  */
-int intif_saveregistry(struct map_session_data *sd)
+int intif_saveregistry(map_session_data *sd)
 {
 	DBIterator *iter;
 	DBKey key;
@@ -521,7 +521,7 @@ int intif_saveregistry(struct map_session_data *sd)
  * @param flag : Type of registry to load, &1=acc (login-serv), &2=acc (char-serv), &4=char
  * @return 
  */
-int intif_request_registry(struct map_session_data *sd, int flag)
+int intif_request_registry(map_session_data *sd, int flag)
 {
 	nullpo_ret(sd);
 
@@ -690,7 +690,7 @@ int intif_party_leave(int party_id, uint32 account_id, uint32 char_id, const cha
  * @param online : If the player will stay online or no
  * @return 0=error, 1=msg sent
  */
-int intif_party_changemap(struct map_session_data *sd,int online)
+int intif_party_changemap(map_session_data *sd,int online)
 {
 	int16 m, mapindex;
 
@@ -1280,7 +1280,7 @@ int intif_homunculus_requestdelete(int homun_id)
  */
 int intif_parse_WisMessage(int fd)
 {
-	struct map_session_data* sd;
+	map_session_data* sd;
 	char *wisp_source;
 	char name[NAME_LENGTH];
 	int id, i, gmlvl;
@@ -1323,11 +1323,11 @@ int intif_parse_WisMessage(int fd)
  */
 int intif_parse_WisEnd(int fd)
 {
-	struct map_session_data* sd;
+	map_session_data* sd;
 
 	if (battle_config.etc_log)
 		ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
-	sd = (struct map_session_data *)map_nick2sd(RFIFOCP(fd,2),false);
+	sd = (map_session_data *)map_nick2sd(RFIFOCP(fd,2),false);
 	if (sd != NULL)
 		clif_wis_end(sd->fd, RFIFOB(fd,26));
 
@@ -1340,7 +1340,7 @@ int intif_parse_WisEnd(int fd)
  * @param va : list of arguments ( wisp_name, message, len)
  * @return 0=error, 1=msg sent
  */
-static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va)
+static int mapif_parse_WisToGM_sub(map_session_data* sd,va_list va)
 {
 	e_pc_permission permission = static_cast<e_pc_permission>(va_arg(va, uint32));
 	char *wisp_name;
@@ -1390,7 +1390,7 @@ int mapif_parse_WisToGM(int fd)
 void intif_parse_Registers(int fd)
 {
 	int flag;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	uint32 account_id = RFIFOL(fd,4), char_id = RFIFOL(fd,8);
 	struct auth_node *node = chrif_auth_check(account_id, char_id, ST_LOGIN);
 	char type = RFIFOB(fd, 13);
@@ -1489,7 +1489,7 @@ void intif_parse_Registers(int fd)
 int intif_parse_LoadGuildStorage(int fd)
 {
 	struct s_storage *gstor;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	int guild_id, flag;
 
 	guild_id = RFIFOL(fd,8);
@@ -1942,7 +1942,7 @@ int intif_parse_DeletePetOk(int fd)
  */
 int intif_parse_ChangeNameOk(int fd)
 {
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	if((sd=map_id2sd(RFIFOL(fd,2)))==NULL ||
 		sd->status.char_id != RFIFOL(fd,6))
 		return 0;
@@ -2037,7 +2037,7 @@ QUESTLOG SYSTEM FUNCTIONS
  * Requests a character's quest log entries to the inter server.
  * @param sd Character's data
  */
-void intif_request_questlog(struct map_session_data *sd)
+void intif_request_questlog(map_session_data *sd)
 {
 	if (CheckForCharServer())
 		return;
@@ -2120,7 +2120,7 @@ void intif_parse_questsave(int fd)
  * @param sd Character's data
  * @return 0 in case of success, nonzero otherwise
  */
-int intif_quest_save(struct map_session_data *sd)
+int intif_quest_save(map_session_data *sd)
 {
 	int len = sizeof(struct quest) * sd->num_quests + 8;
 
@@ -2164,7 +2164,7 @@ void intif_request_achievements(uint32 char_id)
 void intif_parse_achievements(int fd)
 {
 	uint32 char_id = RFIFOL(fd, 4), num_received = (RFIFOW(fd, 2) - 8) / sizeof(struct achievement);
-	struct map_session_data *sd = map_charid2sd(char_id);
+	map_session_data *sd = map_charid2sd(char_id);
 
 	if (!sd) // User not online anymore
 		return;
@@ -2229,7 +2229,7 @@ void intif_parse_achievements(int fd)
 void intif_parse_achievementsave(int fd)
 {
 	int cid = RFIFOL(fd, 2);
-	struct map_session_data *sd = map_charid2sd(cid);
+	map_session_data *sd = map_charid2sd(cid);
 
 	if (!sd) // User not online anymore
 		return;
@@ -2243,7 +2243,7 @@ void intif_parse_achievementsave(int fd)
  * @param sd: Character's data
  * @return 0 in case of success, nonzero otherwise
  */
-int intif_achievement_save(struct map_session_data *sd)
+int intif_achievement_save(map_session_data *sd)
 {
 	int len = sizeof(struct achievement) * sd->achievement_data.count + 8;
 
@@ -2269,7 +2269,7 @@ int intif_achievement_save(struct map_session_data *sd)
  * @param fd : char-serv link
  */
 void intif_parse_achievementreward(int fd){
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 
 	// User not online anymore
 	if( !sd ){
@@ -2282,7 +2282,7 @@ void intif_parse_achievementreward(int fd){
 /**
  * Request the achievement rewards from the inter server.
  */
-int intif_achievement_reward(struct map_session_data *sd, struct s_achievement_db *adb){
+int intif_achievement_reward(map_session_data *sd, struct s_achievement_db *adb){
 	if( CheckForCharServer() ){
 		return 0;
 	}
@@ -2334,7 +2334,7 @@ int intif_Mail_requestinbox(uint32 char_id, unsigned char flag, enum mail_inbox_
  */
 int intif_parse_Mail_inboxreceived(int fd)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	unsigned char flag = RFIFOB(fd,8);
 
 	sd = map_charid2sd(RFIFOL(fd,4));
@@ -2396,7 +2396,7 @@ int intif_Mail_read(int mail_id)
  * @param mail_id : Mail identification
  * @return 0=error, 1=msg sent
  */
-bool intif_mail_getattach( struct map_session_data* sd, struct mail_message *msg, enum mail_attachment_type type){
+bool intif_mail_getattach( map_session_data* sd, struct mail_message *msg, enum mail_attachment_type type){
 	if (CheckForCharServer())
 		return false;
 
@@ -2417,7 +2417,7 @@ bool intif_mail_getattach( struct map_session_data* sd, struct mail_message *msg
  */
 int intif_parse_Mail_getattach(int fd)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct item item[MAIL_MAX_ITEM];
 	int i, mail_id, zeny;
 
@@ -2480,7 +2480,7 @@ int intif_parse_Mail_delete(int fd)
 	int mail_id = RFIFOL(fd,6);
 	bool failed = RFIFOB(fd,10) > 0;
 
-	struct map_session_data *sd = map_charid2sd(char_id);
+	map_session_data *sd = map_charid2sd(char_id);
 	if (sd == NULL)
 	{
 		ShowError("intif_parse_Mail_delete: char not found %d\n", char_id);
@@ -2537,7 +2537,7 @@ int intif_Mail_return(uint32 char_id, int mail_id)
  */
 int intif_parse_Mail_return(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 	int mail_id = RFIFOL(fd,6);
 	short fail = RFIFOB(fd,10);
 
@@ -2600,7 +2600,7 @@ int intif_Mail_send(uint32 account_id, struct mail_message *msg)
 static void intif_parse_Mail_send(int fd)
 {
 	struct mail_message msg;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	bool fail;
 
 	if( RFIFOW(fd,2) - 4 != sizeof(struct mail_message) )
@@ -2633,7 +2633,7 @@ static void intif_parse_Mail_send(int fd)
  */
 static void intif_parse_Mail_new(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 	int mail_id = RFIFOL(fd,6);
 	const char* sender_name = RFIFOCP(fd,10);
 	const char* title = RFIFOCP(fd,34);
@@ -2650,7 +2650,7 @@ static void intif_parse_Mail_new(int fd)
 }
 
 static void intif_parse_Mail_receiver( int fd ){
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	sd = map_charid2sd( RFIFOL( fd, 2 ) );
 
@@ -2660,8 +2660,8 @@ static void intif_parse_Mail_receiver( int fd ){
 	}
 }
 
-bool intif_mail_checkreceiver( struct map_session_data* sd, char* name ){
-	struct map_session_data *tsd;
+bool intif_mail_checkreceiver( map_session_data* sd, char* name ){
+	map_session_data *tsd;
 
 	tsd = map_nick2sd( name, false );
 
@@ -2723,7 +2723,7 @@ int intif_Auction_requestlist(uint32 char_id, short type, int price, const char*
  */
 static void intif_parse_Auction_results(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,4));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,4));
 	short count = RFIFOW(fd,8);
 	short pages = RFIFOW(fd,10);
 	uint8* data = RFIFOP(fd,12);
@@ -2761,7 +2761,7 @@ int intif_Auction_register(struct auction_data *auction)
  */
 static void intif_parse_Auction_register(int fd)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct auction_data auction;
 
 	if( RFIFOW(fd,2) - 4 != sizeof(struct auction_data) )
@@ -2817,7 +2817,7 @@ int intif_Auction_cancel(uint32 char_id, unsigned int auction_id)
  */
 static void intif_parse_Auction_cancel(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 	int result = RFIFOB(fd,6);
 
 	if( sd == NULL )
@@ -2858,7 +2858,7 @@ int intif_Auction_close(uint32 char_id, unsigned int auction_id)
  */
 static void intif_parse_Auction_close(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 	unsigned char result = RFIFOB(fd,6);
 
 	if( sd == NULL )
@@ -2907,7 +2907,7 @@ int intif_Auction_bid(uint32 char_id, const char* name, unsigned int auction_id,
  */
 static void intif_parse_Auction_bid(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 	int bid = RFIFOL(fd,6);
 	unsigned char result = RFIFOB(fd,10);
 
@@ -2932,7 +2932,7 @@ static void intif_parse_Auction_bid(int fd)
  */
 static void intif_parse_Auction_message(int fd)
 {
-	struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
+	map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
 	unsigned char result = RFIFOB(fd,6);
 
 	if( sd == NULL )
@@ -3239,7 +3239,7 @@ void intif_parse_MessageToFD(int fd) {
 
 	if( session[u_fd] && session[u_fd]->session_data ) { //check if the player still online
 		int aid = RFIFOL(fd,8);
-		struct map_session_data * sd = (struct map_session_data *)session[u_fd]->session_data;
+		map_session_data * sd = (map_session_data *)session[u_fd]->session_data;
 		/* matching e.g. previous fd owner didn't dc during request or is still the same */
 		if( sd->bl.id == aid ) {
 			char msg[512];
@@ -3263,7 +3263,7 @@ void intif_parse_MessageToFD(int fd) {
  * @param type Obtain type @see enum BROADCASTING_SPECIAL_ITEM_OBTAIN
  * @return
  **/
-int intif_broadcast_obtain_special_item(struct map_session_data *sd, t_itemid nameid, t_itemid sourceid, unsigned char type) {
+int intif_broadcast_obtain_special_item(map_session_data *sd, t_itemid nameid, t_itemid sourceid, unsigned char type) {
 	nullpo_retr(0, sd);
 
 	// Should not be here!
@@ -3302,7 +3302,7 @@ int intif_broadcast_obtain_special_item(struct map_session_data *sd, t_itemid na
  * @param srcname Source name
  * @return
  **/
-int intif_broadcast_obtain_special_item_npc(struct map_session_data *sd, t_itemid nameid) {
+int intif_broadcast_obtain_special_item_npc(map_session_data *sd, t_itemid nameid) {
 	nullpo_retr(0, sd);
 
 	// Send local
@@ -3424,7 +3424,7 @@ static bool intif_parse_StorageReceived(int fd)
 {
 	char type =  RFIFOB(fd,4);
 	uint32 account_id = RFIFOL(fd, 5);
-	struct map_session_data *sd = map_id2sd(account_id);
+	map_session_data *sd = map_id2sd(account_id);
 	struct s_storage *stor, *p; //storage
 	size_t sz_stor = sizeof(struct s_storage);
 
@@ -3547,7 +3547,7 @@ static void intif_parse_StorageSaved(int fd)
 				break;
 			case TABLE_STORAGE: //storage
 				{
-					struct map_session_data *sd = map_id2sd( RFIFOL( fd, 2 ) );
+					map_session_data *sd = map_id2sd( RFIFOL( fd, 2 ) );
 					struct s_storage* stor = nullptr;
 
 					if( RFIFOB( fd, 8 ) ){
@@ -3572,7 +3572,7 @@ static void intif_parse_StorageSaved(int fd)
 			case TABLE_CART: // cart
 				//ShowInfo("Cart has been saved (AID: %d).\n", RFIFOL(fd, 2));
 				{
-					struct map_session_data *sd = map_id2sd(RFIFOL(fd, 2));
+					map_session_data *sd = map_id2sd(RFIFOL(fd, 2));
 
 					if( sd && sd->state.prevend ){
 						intif_storage_request(sd,TABLE_CART,0,STOR_MODE_ALL);
@@ -3620,7 +3620,7 @@ void intif_parse_StorageInfo_recv(int fd) {
  * @param mode: Storage mode
  * @return false - error, true - message sent
  */
-bool intif_storage_request(struct map_session_data *sd, enum storage_type type, uint8 stor_id, uint8 mode)
+bool intif_storage_request(map_session_data *sd, enum storage_type type, uint8 stor_id, uint8 mode)
 {
 	if (CheckForCharServer())
 		return false;
@@ -3643,7 +3643,7 @@ bool intif_storage_request(struct map_session_data *sd, enum storage_type type,
  * @param stor: Storage data
  * @ return false - error, true - message sent
  */
-bool intif_storage_save(struct map_session_data *sd, struct s_storage *stor)
+bool intif_storage_save(map_session_data *sd, struct s_storage *stor)
 {
 	int stor_size = sizeof(struct s_storage);
 

+ 17 - 17
src/map/intif.hpp

@@ -19,21 +19,21 @@ struct s_elemental;
 struct mail_message;
 struct auction_data;
 struct s_achievement_db;
-struct map_session_data;
+class map_session_data;
 
 int intif_parse(int fd);
 
 int intif_broadcast(const char* mes, int len, int type);
 int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY);
-int intif_broadcast_obtain_special_item(struct map_session_data *sd, t_itemid nameid, unsigned int sourceid, unsigned char type);
-int intif_broadcast_obtain_special_item_npc(struct map_session_data *sd, t_itemid nameid);
-int intif_main_message(struct map_session_data* sd, const char* message);
+int intif_broadcast_obtain_special_item(map_session_data *sd, t_itemid nameid, unsigned int sourceid, unsigned char type);
+int intif_broadcast_obtain_special_item_npc(map_session_data *sd, t_itemid nameid);
+int intif_main_message(map_session_data* sd, const char* message);
 
-int intif_wis_message(struct map_session_data *sd,char *nick,char *mes,int mes_len);
+int intif_wis_message(map_session_data *sd,char *nick,char *mes,int mes_len);
 int intif_wis_message_to_gm(char *Wisp_name, int permission, char *mes);
 
-int intif_saveregistry(struct map_session_data *sd);
-int intif_request_registry(struct map_session_data *sd, int flag);
+int intif_saveregistry(map_session_data *sd);
+int intif_request_registry(map_session_data *sd, int flag);
 
 bool intif_request_guild_storage(uint32 account_id, int guild_id);
 bool intif_send_guild_storage(uint32 account_id, struct s_storage *gstor);
@@ -44,7 +44,7 @@ int intif_request_partyinfo(int party_id, uint32 char_id);
 int intif_party_addmember(int party_id,struct party_member *member);
 int intif_party_changeoption(int party_id, uint32 account_id, int exp, int item);
 int intif_party_leave(int party_id, uint32 account_id, uint32 char_id, const char *name, enum e_party_member_withdraw type);
-int intif_party_changemap(struct map_session_data *sd, int online);
+int intif_party_changemap(map_session_data *sd, int online);
 int intif_break_party(int party_id);
 int intif_party_message(int party_id, uint32 account_id, const char *mes,int len);
 int intif_party_leaderchange(int party_id,uint32 account_id,uint32 char_id);
@@ -76,7 +76,7 @@ int intif_create_pet(uint32 account_id, uint32 char_id, short pet_type, short pe
 int intif_request_petdata(uint32 account_id, uint32 char_id, int pet_id);
 int intif_save_petdata(uint32 account_id, struct s_pet *p);
 int intif_delete_petdata(int pet_id);
-int intif_rename(struct map_session_data *sd, int type, char *name);
+int intif_rename(map_session_data *sd, int type, char *name);
 #define intif_rename_pc(sd, name) intif_rename(sd, 0, name)
 #define intif_rename_pet(sd, name) intif_rename(sd, 1, name)
 #define intif_rename_hom(sd, name) intif_rename(sd, 2, name)
@@ -86,8 +86,8 @@ int intif_homunculus_requestsave(uint32 account_id, struct s_homunculus* sh);
 int intif_homunculus_requestdelete(int homun_id);
 
 /******QUEST SYTEM*******/
-void intif_request_questlog(struct map_session_data * sd);
-int intif_quest_save(struct map_session_data * sd);
+void intif_request_questlog(map_session_data * sd);
+int intif_quest_save(map_session_data * sd);
 
 // MERCENARY SYSTEM
 int intif_mercenary_create(struct s_mercenary *merc);
@@ -98,11 +98,11 @@ int intif_mercenary_save(struct s_mercenary *merc);
 // MAIL SYSTEM
 int intif_Mail_requestinbox(uint32 char_id, unsigned char flag, enum mail_inbox_type type);
 int intif_Mail_read(int mail_id);
-bool intif_mail_getattach( struct map_session_data* sd, struct mail_message *msg, enum mail_attachment_type type );
+bool intif_mail_getattach( map_session_data* sd, struct mail_message *msg, enum mail_attachment_type type );
 int intif_Mail_delete(uint32 char_id, int mail_id);
 int intif_Mail_return(uint32 char_id, int mail_id);
 int intif_Mail_send(uint32 account_id, struct mail_message *msg);
-bool intif_mail_checkreceiver(struct map_session_data* sd, char* name);
+bool intif_mail_checkreceiver(map_session_data* sd, char* name);
 // AUCTION SYSTEM
 int intif_Auction_requestlist(uint32 char_id, short type, int price, const char* searchtext, short page);
 int intif_Auction_register(struct auction_data *auction);
@@ -121,14 +121,14 @@ int intif_clan_member_joined( int clan_id );
 int intif_clan_member_left( int clan_id );
 // ACHIEVEMENT SYSTEM
 void intif_request_achievements(uint32 char_id);
-int intif_achievement_save(struct map_session_data *sd);
-int intif_achievement_reward(struct map_session_data *sd, struct s_achievement_db *adb);
+int intif_achievement_save(map_session_data *sd);
+int intif_achievement_reward(map_session_data *sd, struct s_achievement_db *adb);
 
 int intif_request_accinfo(int u_fd, int aid, int group_lv, char* query, char type);
 
 // STORAGE
-bool intif_storage_request(struct map_session_data *sd, enum storage_type type, uint8 stor_id, uint8 mode);
-bool intif_storage_save(struct map_session_data *sd, struct s_storage *stor);
+bool intif_storage_request(map_session_data *sd, enum storage_type type, uint8 stor_id, uint8 mode);
+bool intif_storage_save(map_session_data *sd, struct s_storage *stor);
 
 int CheckForCharServer(void);
 

+ 2 - 2
src/map/itemdb.cpp

@@ -4629,7 +4629,7 @@ void itemdb_gen_itemmoveinfo()
 */
 void itemdb_reload(void) {
 	struct s_mapiterator* iter;
-	struct map_session_data* sd;
+	map_session_data* sd;
 
 	do_final_itemdb();
 
@@ -4641,7 +4641,7 @@ void itemdb_reload(void) {
 
 	// readjust itemdb pointer cache for each player
 	iter = mapit_geteachpc();
-	for( sd = (struct map_session_data*)mapit_first(iter); mapit_exists(iter); sd = (struct map_session_data*)mapit_next(iter) ) {
+	for( sd = (map_session_data*)mapit_first(iter); mapit_exists(iter); sd = (map_session_data*)mapit_next(iter) ) {
 		memset(sd->item_delay, 0, sizeof(sd->item_delay));  // reset item delays
 		sd->combos.clear(); // clear combo bonuses
 		pc_setinventorydata(sd);

+ 8 - 8
src/map/log.cpp

@@ -170,7 +170,7 @@ static bool should_log_item(t_itemid nameid, int amount, int refine)
 
 
 /// logs items, that summon monsters
-void log_branch(struct map_session_data* sd)
+void log_branch(map_session_data* sd)
 {
 	nullpo_retv(sd);
 
@@ -263,7 +263,7 @@ void log_pick(int id, int16 m, e_log_pick_type type, int amount, struct item* it
 }
 
 /// logs item transactions (players)
-void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm)
+void log_pick_pc(map_session_data* sd, e_log_pick_type type, int amount, struct item* itm)
 {
 	nullpo_retv(sd);
 	log_pick(sd->status.char_id, sd->bl.m, type, amount, itm);
@@ -278,7 +278,7 @@ void log_pick_mob(struct mob_data* md, e_log_pick_type type, int amount, struct
 }
 
 /// logs zeny transactions
-void log_zeny(struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount)
+void log_zeny(map_session_data* sd, e_log_pick_type type, map_session_data* src_sd, int amount)
 {
 	nullpo_retv(sd);
 
@@ -311,7 +311,7 @@ void log_zeny(struct map_session_data* sd, e_log_pick_type type, struct map_sess
 
 
 /// logs MVP monster rewards
-void log_mvpdrop(struct map_session_data* sd, int monster_id, t_itemid nameid, t_exp exp )
+void log_mvpdrop(map_session_data* sd, int monster_id, t_itemid nameid, t_exp exp )
 {
 	nullpo_retv(sd);
 
@@ -344,7 +344,7 @@ void log_mvpdrop(struct map_session_data* sd, int monster_id, t_itemid nameid, t
 
 
 /// logs used atcommands
-void log_atcommand(struct map_session_data* sd, const char* message)
+void log_atcommand(map_session_data* sd, const char* message)
 {
 	nullpo_retv(sd);
 
@@ -421,7 +421,7 @@ void log_npc( struct npc_data* nd, const char* message ){
 }
 
 /// logs messages passed to script command 'logmes'
-void log_npc(struct map_session_data* sd, const char* message)
+void log_npc(map_session_data* sd, const char* message)
 {
 	nullpo_retv(sd);
 
@@ -507,7 +507,7 @@ void log_chat(e_log_chat_type type, int type_id, int src_charid, int src_accid,
 }
 
 /// logs cash transactions
-void log_cash( struct map_session_data* sd, e_log_pick_type type, e_log_cash_type cash_type, int amount ){
+void log_cash( map_session_data* sd, e_log_pick_type type, e_log_cash_type cash_type, int amount ){
 	nullpo_retv( sd );
 
 	if( !log_config.cash )
@@ -540,7 +540,7 @@ void log_cash( struct map_session_data* sd, e_log_pick_type type, e_log_cash_typ
  * @param type Log type, @see e_log_feeding_type
  * @param nameid Item used as food
  **/
-void log_feeding(struct map_session_data *sd, e_log_feeding_type type, t_itemid nameid) {
+void log_feeding(map_session_data *sd, e_log_feeding_type type, t_itemid nameid) {
 	unsigned int target_id = 0, intimacy = 0;
 	unsigned short target_class = 0;
 

+ 9 - 9
src/map/log.hpp

@@ -8,7 +8,7 @@
 #include "../common/mmo.hpp"
 
 struct block_list;
-struct map_session_data;
+class map_session_data;
 struct mob_data;
 struct item;
 
@@ -76,19 +76,19 @@ enum e_log_feeding_type : uint8
 };
 
 /// new logs
-void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm);
+void log_pick_pc(map_session_data* sd, e_log_pick_type type, int amount, struct item* itm);
 void log_pick_mob(struct mob_data* md, e_log_pick_type type, int amount, struct item* itm);
-void log_zeny(struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount);
-void log_cash( struct map_session_data* sd, e_log_pick_type type, e_log_cash_type cash_type, int amount );
+void log_zeny(map_session_data* sd, e_log_pick_type type, map_session_data* src_sd, int amount);
+void log_cash( map_session_data* sd, e_log_pick_type type, e_log_cash_type cash_type, int amount );
 void log_npc( struct npc_data* nd, const char* message );
-void log_npc(struct map_session_data* sd, const char *message);
+void log_npc(map_session_data* sd, const char *message);
 void log_chat(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message);
-void log_atcommand(struct map_session_data* sd, const char* message);
-void log_feeding(struct map_session_data *sd, e_log_feeding_type type, t_itemid nameid);
+void log_atcommand(map_session_data* sd, const char* message);
+void log_feeding(map_session_data *sd, e_log_feeding_type type, t_itemid nameid);
 
 /// old, but useful logs
-void log_branch(struct map_session_data* sd);
-void log_mvpdrop(struct map_session_data* sd, int monster_id, t_itemid nameid, t_exp exp);
+void log_branch(map_session_data* sd);
+void log_mvpdrop(map_session_data* sd, int monster_id, t_itemid nameid, t_exp exp);
 
 int log_config_read(const char* cfgName);
 

+ 11 - 11
src/map/mail.cpp

@@ -18,7 +18,7 @@
 #include "pc.hpp"
 #include "pet.hpp"
 
-void mail_clear(struct map_session_data *sd)
+void mail_clear(map_session_data *sd)
 {
 	int i;
 
@@ -32,7 +32,7 @@ void mail_clear(struct map_session_data *sd)
 	return;
 }
 
-int mail_removeitem(struct map_session_data *sd, short flag, int idx, int amount)
+int mail_removeitem(map_session_data *sd, short flag, int idx, int amount)
 {
 	int i;
 
@@ -99,7 +99,7 @@ int mail_removeitem(struct map_session_data *sd, short flag, int idx, int amount
 	return 1;
 }
 
-bool mail_removezeny( struct map_session_data *sd, bool flag ){
+bool mail_removezeny( map_session_data *sd, bool flag ){
 	nullpo_retr( false, sd );
 
 	if( sd->mail.zeny > 0 ){
@@ -126,7 +126,7 @@ bool mail_removezeny( struct map_session_data *sd, bool flag ){
 * @param amount : amout of zeny or number of item
 * @return see enum mail_attach_result in mail.hpp
 */
-enum mail_attach_result mail_setitem(struct map_session_data *sd, short idx, uint32 amount) {
+enum mail_attach_result mail_setitem(map_session_data *sd, short idx, uint32 amount) {
 	if( pc_istrading(sd) )
 		return MAIL_ATTACH_ERROR;
 
@@ -241,7 +241,7 @@ enum mail_attach_result mail_setitem(struct map_session_data *sd, short idx, uin
 	}
 }
 
-bool mail_setattachment(struct map_session_data *sd, struct mail_message *msg)
+bool mail_setattachment(map_session_data *sd, struct mail_message *msg)
 {
 	int i, amount;
 
@@ -290,7 +290,7 @@ bool mail_setattachment(struct map_session_data *sd, struct mail_message *msg)
 	return true;
 }
 
-void mail_getattachment(struct map_session_data* sd, struct mail_message* msg, int zeny, struct item* item){
+void mail_getattachment(map_session_data* sd, struct mail_message* msg, int zeny, struct item* item){
 	int i;
 	bool item_received = false;
 
@@ -360,7 +360,7 @@ void mail_getattachment(struct map_session_data* sd, struct mail_message* msg, i
 	}
 }
 
-int mail_openmail(struct map_session_data *sd)
+int mail_openmail(map_session_data *sd)
 {
 	nullpo_ret(sd);
 
@@ -372,7 +372,7 @@ int mail_openmail(struct map_session_data *sd)
 	return 1;
 }
 
-void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg){
+void mail_deliveryfail(map_session_data *sd, struct mail_message *msg){
 	int i, zeny = 0;
 
 	nullpo_retv(sd);
@@ -394,7 +394,7 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg){
 }
 
 // This function only check if the mail operations are valid
-bool mail_invalid_operation(struct map_session_data *sd)
+bool mail_invalid_operation(map_session_data *sd)
 {
 #if PACKETVER < 20150513
 	if( !map_getmapflag(sd->bl.m, MF_TOWN) && !pc_can_use_command(sd, "mail", COMMAND_ATCOMMAND) )
@@ -420,7 +420,7 @@ bool mail_invalid_operation(struct map_session_data *sd)
 * @param body_msg Mail message
 * @param body_len Message's length
 */
-void mail_send(struct map_session_data *sd, const char *dest_name, const char *title, const char *body_msg, int body_len) {
+void mail_send(map_session_data *sd, const char *dest_name, const char *title, const char *body_msg, int body_len) {
 	struct mail_message msg;
 
 	nullpo_retv(sd);
@@ -484,7 +484,7 @@ void mail_send(struct map_session_data *sd, const char *dest_name, const char *t
 	sd->cansendmail_tick = gettick() + battle_config.mail_delay; // Flood Protection
 }
 
-void mail_refresh_remaining_amount( struct map_session_data* sd ){
+void mail_refresh_remaining_amount( map_session_data* sd ){
 	int doy = date_get_dayofyear();
 
 	nullpo_retv(sd);

+ 11 - 11
src/map/mail.hpp

@@ -24,16 +24,16 @@ enum mail_attach_result {
 	MAIL_ATTACH_EQUIPSWITCH = 99,
 };
 
-void mail_clear(struct map_session_data *sd);
-int mail_removeitem(struct map_session_data *sd, short flag, int idx, int amount);
-bool mail_removezeny(struct map_session_data *sd, bool flag);
-enum mail_attach_result mail_setitem(struct map_session_data *sd, short idx, uint32 amount);
-bool mail_setattachment(struct map_session_data *sd, struct mail_message *msg);
-void mail_getattachment(struct map_session_data* sd, struct mail_message* msg, int zeny, struct item* item);
-int mail_openmail(struct map_session_data *sd);
-void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg);
-bool mail_invalid_operation(struct map_session_data *sd);
-void mail_send(struct map_session_data *sd, const char *dest_name, const char *title, const char *body_msg, int body_len);
-void mail_refresh_remaining_amount( struct map_session_data* sd );
+void mail_clear(map_session_data *sd);
+int mail_removeitem(map_session_data *sd, short flag, int idx, int amount);
+bool mail_removezeny(map_session_data *sd, bool flag);
+enum mail_attach_result mail_setitem(map_session_data *sd, short idx, uint32 amount);
+bool mail_setattachment(map_session_data *sd, struct mail_message *msg);
+void mail_getattachment(map_session_data* sd, struct mail_message* msg, int zeny, struct item* item);
+int mail_openmail(map_session_data *sd);
+void mail_deliveryfail(map_session_data *sd, struct mail_message *msg);
+bool mail_invalid_operation(map_session_data *sd);
+void mail_send(map_session_data *sd, const char *dest_name, const char *title, const char *body_msg, int body_len);
+void mail_refresh_remaining_amount( map_session_data* sd );
 
 #endif /* MAIL_HPP */

+ 32 - 32
src/map/map.cpp

@@ -106,12 +106,12 @@ struct inter_conf inter_config {};
 
 // DBMap declaration
 static DBMap* id_db=NULL; /// int id -> struct block_list*
-static DBMap* pc_db=NULL; /// int id -> struct map_session_data*
+static DBMap* pc_db=NULL; /// int id -> map_session_data*
 static DBMap* mobid_db=NULL; /// int id -> struct mob_data*
 static DBMap* bossid_db=NULL; /// int id -> struct mob_data* (MVP db)
 static DBMap* map_db=NULL; /// unsigned int mapindex -> struct map_data*
 static DBMap* nick_db=NULL; /// uint32 char_id -> struct charid2nick* (requested names of offline characters)
-static DBMap* charid_db=NULL; /// uint32 char_id -> struct map_session_data*
+static DBMap* charid_db=NULL; /// uint32 char_id -> map_session_data*
 static DBMap* regen_db=NULL; /// int id -> struct block_list* (status_natural_heal processing)
 static DBMap* map_msg_db=NULL;
 
@@ -437,7 +437,7 @@ int map_delblock(struct block_list* bl)
 int map_moveblock(struct block_list *bl, int x1, int y1, t_tick tick)
 {
 	int x0 = bl->x, y0 = bl->y;
-	struct status_change *sc = NULL;
+	status_change *sc = NULL;
 	int moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
 
 	if (!bl->prev) {
@@ -1931,7 +1931,7 @@ void map_addnickdb(int charid, const char* nick)
 	safestrncpy(p->nick, nick, sizeof(p->nick));
 
 	while( p->requests ) {
-		struct map_session_data* sd;
+		map_session_data* sd;
 		struct charid_request* req;
 		req = p->requests;
 		p->requests = req->next;
@@ -1954,7 +1954,7 @@ void map_delnickdb(int charid, const char* name)
 
 	while( p->requests ) {
 		struct charid_request* req;
-		struct map_session_data* sd;
+		map_session_data* sd;
 		req = p->requests;
 		p->requests = req->next;
 		sd = map_charid2sd(req->charid);
@@ -1968,11 +1968,11 @@ void map_delnickdb(int charid, const char* name)
 /// Notifies sd of the nick of charid.
 /// Uses the name in the character if online.
 /// Uses the name in nick_db if offline.
-void map_reqnickdb(struct map_session_data * sd, int charid)
+void map_reqnickdb(map_session_data * sd, int charid)
 {
 	struct charid2nick* p;
 	struct charid_request* req;
-	struct map_session_data* tsd;
+	map_session_data* tsd;
 
 	nullpo_retv(sd);
 
@@ -2052,7 +2052,7 @@ void map_deliddb(struct block_list *bl)
 /*==========================================
  * Standard call when a player connection is closed.
  *------------------------------------------*/
-int map_quit(struct map_session_data *sd) {
+int map_quit(map_session_data *sd) {
 	int i;
 
 	if (sd->state.keepshop == false) { // Close vending/buyingstore
@@ -2183,9 +2183,9 @@ int map_quit(struct map_session_data *sd) {
 /*==========================================
  * Lookup, id to session (player,mob,npc,homon,merc..)
  *------------------------------------------*/
-struct map_session_data * map_id2sd(int id){
+map_session_data * map_id2sd(int id){
 	if (id <= 0) return NULL;
-	return (struct map_session_data*)idb_get(pc_db,id);
+	return (map_session_data*)idb_get(pc_db,id);
 }
 
 struct mob_data * map_id2md(int id){
@@ -2227,7 +2227,7 @@ struct chat_data* map_id2cd(int id){
 const char* map_charid2nick(int charid)
 {
 	struct charid2nick *p;
-	struct map_session_data* sd;
+	map_session_data* sd;
 
 	sd = map_charid2sd(charid);
 	if( sd )
@@ -2241,10 +2241,10 @@ const char* map_charid2nick(int charid)
 	return NULL;
 }
 
-/// Returns the struct map_session_data of the charid or NULL if the char is not online.
-struct map_session_data* map_charid2sd(int charid)
+/// Returns the map_session_data of the charid or NULL if the char is not online.
+map_session_data* map_charid2sd(int charid)
 {
-	return (struct map_session_data*)uidb_get(charid_db, charid);
+	return (map_session_data*)uidb_get(charid_db, charid);
 }
 
 /*==========================================
@@ -2252,10 +2252,10 @@ struct map_session_data* map_charid2sd(int charid)
  * (without sensitive case if necessary)
  * return map_session_data pointer or NULL
  *------------------------------------------*/
-struct map_session_data * map_nick2sd(const char *nick, bool allow_partial)
+map_session_data * map_nick2sd(const char *nick, bool allow_partial)
 {
-	struct map_session_data* sd;
-	struct map_session_data* found_sd;
+	map_session_data* sd;
+	map_session_data* found_sd;
 	struct s_mapiterator* iter;
 	size_t nicklen;
 	int qty = 0;
@@ -2344,13 +2344,13 @@ struct mob_data * map_id2boss(int id)
 
 /// Applies func to all the players in the db.
 /// Stops iterating if func returns -1.
-void map_foreachpc(int (*func)(struct map_session_data* sd, va_list args), ...)
+void map_foreachpc(int (*func)(map_session_data* sd, va_list args), ...)
 {
 	DBIterator* iter;
-	struct map_session_data* sd;
+	map_session_data* sd;
 
 	iter = db_iterator(pc_db);
-	for( sd = (struct map_session_data*)dbi_first(iter); dbi_exists(iter); sd = (struct map_session_data*)dbi_next(iter) )
+	for( sd = (map_session_data*)dbi_first(iter); dbi_exists(iter); sd = (map_session_data*)dbi_next(iter) )
 	{
 		va_list args;
 		int ret;
@@ -2746,10 +2746,10 @@ int map_addinstancemap(int src_m, int instance_id, bool no_mapflag)
  *------------------------------------------*/
 static int map_instancemap_leave(struct block_list *bl, va_list ap)
 {
-	struct map_session_data* sd;
+	map_session_data* sd;
 
 	nullpo_retr(0, bl);
-	nullpo_retr(0, sd = (struct map_session_data *)bl);
+	nullpo_retr(0, sd = (map_session_data *)bl);
 
 	pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
 
@@ -2765,7 +2765,7 @@ static int map_instancemap_clean(struct block_list *bl, va_list ap)
 	switch(bl->type) {
 		/*case BL_PC:
 		// BL_PET, BL_HOM, BL_MER, and BL_ELEM are moved when BL_PC warped out in map_instancemap_leave
-			map_quit((struct map_session_data *) bl);
+			map_quit((map_session_data *) bl);
 			break;*/
 		case BL_NPC:
 			npc_unload((struct npc_data *)bl,true);
@@ -3366,7 +3366,7 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
 	return true;
 }
 
-void map_iwall_get(struct map_session_data *sd) {
+void map_iwall_get(map_session_data *sd) {
 	struct iwall_data *iwall;
 	DBIterator* iter;
 	int16 x1, y1;
@@ -3893,7 +3893,7 @@ int parse_console(const char* buf){
 	int16 x = 0;
 	int16 y = 0;
 	int n;
-	struct map_session_data sd;
+	map_session_data sd;
 
 	strcpy(sd.status.name, "console");
 
@@ -4372,7 +4372,7 @@ int cleanup_sub(struct block_list *bl, va_list ap)
 
 	switch(bl->type) {
 		case BL_PC:
-			map_quit((struct map_session_data *) bl);
+			map_quit((map_session_data *) bl);
 			break;
 		case BL_NPC:
 			npc_unload((struct npc_data *)bl,false);
@@ -4436,7 +4436,7 @@ void map_skill_duration_add(struct map_data *mapd, uint16 skill_id, uint16 per)
  */
 static int map_mapflag_pvp_start_sub(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd = map_id2sd(bl->id);
+	map_session_data *sd = map_id2sd(bl->id);
 
 	nullpo_retr(0, sd);
 
@@ -4461,7 +4461,7 @@ static int map_mapflag_pvp_start_sub(struct block_list *bl, va_list ap)
  */
 static int map_mapflag_pvp_stop_sub(struct block_list *bl, va_list ap)
 {
-	struct map_session_data* sd = map_id2sd(bl->id);
+	map_session_data* sd = map_id2sd(bl->id);
 
 	clif_pvpset(sd, 0, 0, 2);
 
@@ -4850,7 +4850,7 @@ void do_final(void){
 
 	//Ladies and babies first.
 	struct s_mapiterator* iter = mapit_getallusers();
-	for( struct map_session_data* sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
+	for( map_session_data* sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
 		map_quit(sd);
 	mapit_free(iter);
 
@@ -4944,7 +4944,7 @@ void do_final(void){
 	ShowStatus("Finished.\n");
 }
 
-static int map_abort_sub(struct map_session_data* sd, va_list ap)
+static int map_abort_sub(map_session_data* sd, va_list ap)
 {
 	chrif_save(sd, CSAVE_QUIT|CSAVE_INVENTORY|CSAVE_CART);
 	return 1;
@@ -5069,7 +5069,7 @@ int map_msg_config_read(const char *cfgName, int lang){
 	}
 	return 0;
 }
-const char* map_msg_txt(struct map_session_data *sd, int msg_number){
+const char* map_msg_txt(map_session_data *sd, int msg_number){
 	struct msg_data *mdb;
 	uint8 lang = 0; //default
 	if(sd && sd->langtype) lang = sd->langtype;
@@ -5135,7 +5135,7 @@ void do_shutdown(void)
 		runflag = MAPSERVER_ST_SHUTDOWN;
 		ShowStatus("Shutting down...\n");
 		{
-			struct map_session_data* sd;
+			map_session_data* sd;
 			struct s_mapiterator* iter = mapit_getallusers();
 			for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
 				clif_GM_kick(NULL, sd);

+ 9 - 9
src/map/map.hpp

@@ -38,7 +38,7 @@ struct map_data *map_getmapdata(int16 m);
 #define msg_txt(sd,msg_number) map_msg_txt(sd,msg_number)
 #define do_final_msg() map_do_final_msg()
 int map_msg_config_read(const char *cfgName,int lang);
-const char* map_msg_txt(struct map_session_data *sd,int msg_number);
+const char* map_msg_txt(map_session_data *sd,int msg_number);
 void map_do_final_msg(void);
 void map_msg_reload(void);
 
@@ -1094,7 +1094,7 @@ int map_get_new_object_id(void);
 int map_search_freecell(struct block_list *src, int16 m, int16 *x, int16 *y, int16 rx, int16 ry, int flag);
 bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag);
 //
-int map_quit(struct map_session_data *);
+int map_quit(map_session_data *);
 // npc
 bool map_addnpc(int16 m,struct npc_data *);
 
@@ -1113,11 +1113,11 @@ void map_data_copy(struct map_data *dst_map, struct map_data *src_map);
 // player to map session
 void map_addnickdb(int charid, const char* nick);
 void map_delnickdb(int charid, const char* nick);
-void map_reqnickdb(struct map_session_data* sd,int charid);
+void map_reqnickdb(map_session_data* sd,int charid);
 const char* map_charid2nick(int charid);
-struct map_session_data* map_charid2sd(int charid);
+map_session_data* map_charid2sd(int charid);
 
-struct map_session_data * map_id2sd(int id);
+map_session_data * map_id2sd(int id);
 struct mob_data * map_id2md(int id);
 struct npc_data * map_id2nd(int id);
 struct homun_data* map_id2hd(int id);
@@ -1138,12 +1138,12 @@ int map_eraseipport(unsigned short map, uint32 ip, uint16 port);
 int map_eraseallipport(void);
 void map_addiddb(struct block_list *);
 void map_deliddb(struct block_list *bl);
-void map_foreachpc(int (*func)(struct map_session_data* sd, va_list args), ...);
+void map_foreachpc(int (*func)(map_session_data* sd, va_list args), ...);
 void map_foreachmob(int (*func)(struct mob_data* md, va_list args), ...);
 void map_foreachnpc(int (*func)(struct npc_data* nd, va_list args), ...);
 void map_foreachregen(int (*func)(struct block_list* bl, va_list args), ...);
 void map_foreachiddb(int (*func)(struct block_list* bl, va_list args), ...);
-struct map_session_data * map_nick2sd(const char* nick, bool allow_partial);
+map_session_data * map_nick2sd(const char* nick, bool allow_partial);
 struct mob_data * map_getmob_boss(int16 m);
 struct mob_data * map_id2boss(int id);
 
@@ -1184,7 +1184,7 @@ void map_flags_init(void);
 
 bool map_iwall_exist(const char* wall_name);
 bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char* wall_name);
-void map_iwall_get(struct map_session_data *sd);
+void map_iwall_get(map_session_data *sd);
 bool map_iwall_remove(const char *wall_name);
 
 int map_addmobtolist(unsigned short m, struct spawn_data *spawn);	// [Wizputer]
@@ -1221,7 +1221,7 @@ extern const char*MSG_CONF_NAME_POR;
 extern const char*MSG_CONF_NAME_THA;
 
 //Useful typedefs from jA [Skotlex]
-typedef struct map_session_data TBL_PC;
+typedef map_session_data TBL_PC;
 typedef struct npc_data         TBL_NPC;
 typedef struct mob_data         TBL_MOB;
 typedef struct flooritem_data   TBL_ITEM;

+ 15 - 15
src/map/mob.cpp

@@ -537,7 +537,7 @@ int mob_get_random_id(int type, enum e_random_monster_flags flag, int lv)
 bool mob_ksprotected (struct block_list *src, struct block_list *target)
 {
 	struct block_list *s_bl, *t_bl;
-	struct map_session_data
+	map_session_data
 		*sd,    // Source
 		*t_sd;  // Mob Target
 	struct mob_data *md;
@@ -563,7 +563,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
 
 	do {
 		struct status_change_entry *sce;
-		struct map_session_data *pl_sd; // Owner
+		map_session_data *pl_sd; // Owner
 		struct map_data *mapdata = map_getmapdata(md->bl.m);
 		char output[128];
 		
@@ -662,7 +662,7 @@ struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int
 /*==========================================
  * Spawn a single mob on the specified coordinates.
  *------------------------------------------*/
-int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
+int mob_once_spawn(map_session_data* sd, int16 m, int16 x, int16 y, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
 {
 	struct mob_data* md = nullptr;
 	int count, lv;
@@ -714,7 +714,7 @@ int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const
 /*==========================================
  * Spawn mobs in the specified area.
  *------------------------------------------*/
-int mob_once_spawn_area(struct map_session_data* sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
+int mob_once_spawn_area(map_session_data* sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
 {
 	int i, max, id = 0;
 	int lx = -1, ly = -1;
@@ -1994,7 +1994,7 @@ static int mob_ai_sub_hard_timer(struct block_list *bl,va_list ap)
 /*==========================================
  * Serious processing for mob in PC field of view (foreachclient)
  *------------------------------------------*/
-static int mob_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
+static int mob_ai_sub_foreachclient(map_session_data *sd,va_list ap)
 {
 	t_tick tick=va_arg(ap,t_tick);
 	map_foreachinallrange(mob_ai_sub_hard_timer,&sd->bl, AREA_SIZE+ACTIVE_AI_RANGE, BL_MOB, sd->status.char_id, tick);
@@ -2296,7 +2296,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
 	{
 		case BL_PC:
 		{
-			struct map_session_data *sd = (TBL_PC*)src;
+			map_session_data *sd = (TBL_PC*)src;
 			char_id = sd->status.char_id;
 			if( damage )
 				md->attacked_id = src->id;
@@ -2338,7 +2338,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
 			struct mob_data* md2 = (TBL_MOB*)src;
 			if( md2->special_state.ai && md2->master_id )
 			{
-				struct map_session_data* msd = map_id2sd(md2->master_id);
+				map_session_data* msd = map_id2sd(md2->master_id);
 				if( msd )
 					char_id = msd->status.char_id;
 			}
@@ -2439,7 +2439,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
 			clif_summon_hp_bar(*md);
 		}
 		for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
-			struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
+			map_session_data *sd = map_charid2sd(md->dmglog[i].id);
 			if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
 				clif_monster_hp_bar(md, sd->fd);
 		}
@@ -2474,7 +2474,7 @@ int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int b
 			drop_rate += (int)(0.5 + drop_rate * status_get_luk(src) * battle_config.drops_by_luk2 / 10000.);
 
 		if (src->type == BL_PC) { // Player specific drop rate adjustments
-			struct map_session_data *sd = (struct map_session_data*)src;
+			map_session_data *sd = (map_session_data*)src;
 			int drop_rate_bonus = 100;
 
 			// In PK mode players get an additional drop chance bonus of 25% if there is a 20 level difference
@@ -2532,8 +2532,8 @@ int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int b
 int mob_dead(struct mob_data *md, struct block_list *src, int type)
 {
 	struct status_data *status;
-	struct map_session_data *sd = NULL, *tmpsd[DAMAGELOG_SIZE];
-	struct map_session_data *mvp_sd = NULL, *second_sd = NULL, *third_sd = NULL;
+	map_session_data *sd = NULL, *tmpsd[DAMAGELOG_SIZE];
+	map_session_data *mvp_sd = NULL, *second_sd = NULL, *third_sd = NULL;
 
 	struct {
 		struct party_data *p;
@@ -2550,7 +2550,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 	status = &md->status;
 
 	if( src && src->type == BL_PC ) {
-		sd = (struct map_session_data *)src;
+		sd = (map_session_data *)src;
 		mvp_sd = sd;
 	}
 
@@ -2574,7 +2574,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 	// filter out entries not eligible for exp distribution
 	memset(tmpsd,0,sizeof(tmpsd));
 	for(i = 0, count = 0, mvp_damage = 0; i < DAMAGELOG_SIZE && md->dmglog[i].id; i++) {
-		struct map_session_data* tsd = NULL;
+		map_session_data* tsd = NULL;
 		if (md->dmglog[i].flag == MDLF_SELF) {
 			//Self damage counts as exp tap
 			count++;
@@ -3405,7 +3405,7 @@ void mob_heal(struct mob_data *md,unsigned int heal)
 		}
 		for(i = 0; i < DAMAGELOG_SIZE; i++)// must show hp bar to all char who already hit the mob.
 			if( md->dmglog[i].id ) {
-				struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
+				map_session_data *sd = map_charid2sd(md->dmglog[i].id);
 				if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
 					clif_monster_hp_bar(md, sd->fd);
 			}
@@ -3994,7 +3994,7 @@ static bool mob_clone_disabled_skills(uint16 skill_id) {
 //If mode is not passed, a default aggressive mode is used.
 //If master_id is passed, clone is attached to him.
 //Returns: ID of newly crafted copy.
-int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration)
+int mob_clone_spawn(map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration)
 {
 	int mob_id;
 	int inf, fd;

+ 4 - 4
src/map/mob.hpp

@@ -319,7 +319,7 @@ struct mob_data {
 	struct view_data *vd;
 	bool vd_changed;
 	struct status_data status, *base_status; //Second one is in case of leveling up mobs, or tiny/large mobs.
-	struct status_change sc;
+	status_change sc;
 	std::shared_ptr<s_mob_db> db;	//For quick data access (saves doing mob_db(md->mob_id) all the time) [Skotlex]
 	char name[NAME_LENGTH];
 	struct s_specialState {
@@ -486,10 +486,10 @@ void mob_free_dynamic_viewdata( struct mob_data* md );
 
 struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int mob_id, const char *event, unsigned int size, enum mob_ai ai);
 
-int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y,
+int mob_once_spawn(map_session_data* sd, int16 m, int16 x, int16 y,
 	const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai);
 
-int mob_once_spawn_area(struct map_session_data* sd, int16 m,
+int mob_once_spawn_area(map_session_data* sd, int16 m,
 	int16 x0, int16 y0, int16 x1, int16 y1, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai);
 
 bool mob_ksprotected (struct block_list *src, struct block_list *target);
@@ -538,7 +538,7 @@ int mob_count_sub(struct block_list *bl, va_list ap);
 
 int mob_is_clone(int mob_id);
 
-int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration);
+int mob_clone_spawn(map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration);
 int mob_clone_delete(struct mob_data *md);
 
 void mob_reload_itemmob_data(void);

+ 43 - 43
src/map/npc.cpp

@@ -900,7 +900,7 @@ bool npc_isnear(struct block_list * bl) {
     return false;
 }
 
-int npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd)
+int npc_ontouch_event(map_session_data *sd, struct npc_data *nd)
 {
 	char name[EVENT_NAME_LENGTH];
 
@@ -922,7 +922,7 @@ int npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd)
 	return npc_event(sd,name,1);
 }
 
-int npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd)
+int npc_ontouch2_event(map_session_data *sd, struct npc_data *nd)
 {
 	char name[EVENT_NAME_LENGTH];
 
@@ -933,7 +933,7 @@ int npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd)
 	return npc_event(sd,name,2);
 }
 
-int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data *nd);
+int npc_touch_areanpc(map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data *nd);
 
 /*==========================================
  * Sub-function of npc_enable, runs OnTouch event when enabled
@@ -952,7 +952,7 @@ int npc_enable_sub(struct block_list *bl, va_list ap)
 	return 0;
 }
 
-bool npc_is_cloaked(struct npc_data* nd, struct map_session_data* sd) {
+bool npc_is_cloaked(struct npc_data* nd, map_session_data* sd) {
 	bool npc_cloaked = (nd->sc.option & OPTION_CLOAK) ? true : false;
 
 	if (std::find(sd->cloaked_npc.begin(), sd->cloaked_npc.end(), nd->bl.id) != sd->cloaked_npc.end())
@@ -960,17 +960,17 @@ bool npc_is_cloaked(struct npc_data* nd, struct map_session_data* sd) {
 	return npc_cloaked;
 }
 
-bool npc_is_hidden_dynamicnpc( struct npc_data& nd, struct map_session_data& tsd ){
+bool npc_is_hidden_dynamicnpc( struct npc_data& nd, map_session_data& tsd ){
 	// If the NPC is dynamic and the target character is not the owner of the dynamic NPC
 	return nd.dynamicnpc.owner_char_id != 0 && nd.dynamicnpc.owner_char_id != tsd.status.char_id;
 }
 
 static int npc_cloaked_sub(struct block_list *bl, va_list ap)
 {
-	struct map_session_data* sd;
+	map_session_data* sd;
 
 	nullpo_ret(bl);
-	nullpo_ret(sd = (struct map_session_data *)bl);
+	nullpo_ret(sd = (map_session_data *)bl);
 	int id = va_arg(ap, int);
 
 	auto it = std::find(sd->cloaked_npc.begin(), sd->cloaked_npc.end(), id);
@@ -1080,7 +1080,7 @@ struct npc_data* npc_name2id(const char* name)
  * Timer to check for idle time and timeout the dialog if necessary
  **/
 TIMER_FUNC(npc_secure_timeout_timer){
-	struct map_session_data* sd = NULL;
+	map_session_data* sd = NULL;
 	unsigned int timeout = NPC_SECURE_TIMEOUT_NEXT;
 	t_tick cur_tick = gettick(); //ensure we are on last tick
 
@@ -1120,7 +1120,7 @@ TIMER_FUNC(npc_secure_timeout_timer){
 /*==========================================
  * Dequeue event and add timer for execution (100ms)
  *------------------------------------------*/
-int npc_event_dequeue(struct map_session_data* sd,bool free_script_stack)
+int npc_event_dequeue(map_session_data* sd,bool free_script_stack)
 {
 	nullpo_ret(sd);
 
@@ -1192,7 +1192,7 @@ static int npc_event_export(struct npc_data *nd, int i)
 	return 0;
 }
 
-int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char* eventname); //[Lance]
+int npc_event_sub(map_session_data* sd, struct event_data* ev, const char* eventname); //[Lance]
 
 /**
  * Exec name (NPC events) on player or global
@@ -1421,7 +1421,7 @@ TIMER_FUNC(npc_timerevent){
 	struct npc_data* nd=(struct npc_data *)map_id2bl(id);
 	struct npc_timerevent_list *te;
 	struct timer_event_data *ted = (struct timer_event_data*)data;
-	struct map_session_data *sd=NULL;
+	map_session_data *sd=NULL;
 
 	if( nd == NULL )
 	{
@@ -1490,7 +1490,7 @@ int npc_timerevent_start(struct npc_data* nd, int rid)
 {
 	int j;
 	t_tick tick = gettick();
-	struct map_session_data *sd = NULL; //Player to whom script is attached.
+	map_session_data *sd = NULL; //Player to whom script is attached.
 
 	nullpo_ret(nd);
 
@@ -1545,7 +1545,7 @@ int npc_timerevent_start(struct npc_data* nd, int rid)
  *------------------------------------------*/
 int npc_timerevent_stop(struct npc_data* nd)
 {
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	int *tid;
 
 	nullpo_ret(nd);
@@ -1583,7 +1583,7 @@ int npc_timerevent_stop(struct npc_data* nd)
 /*==========================================
  * Aborts a running NPC timer that is attached to a player.
  *------------------------------------------*/
-void npc_timerevent_quit(struct map_session_data* sd)
+void npc_timerevent_quit(map_session_data* sd)
 {
 	const struct TimerData *td;
 	struct npc_data* nd;
@@ -1669,7 +1669,7 @@ int npc_settimerevent_tick(struct npc_data* nd, int newtimer)
 {
 	bool flag;
 	int old_rid;
-	//struct map_session_data *sd = NULL;
+	//map_session_data *sd = NULL;
 
 	nullpo_ret(nd);
 
@@ -1689,7 +1689,7 @@ int npc_settimerevent_tick(struct npc_data* nd, int newtimer)
 	return 0;
 }
 
-int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char* eventname)
+int npc_event_sub(map_session_data* sd, struct event_data* ev, const char* eventname)
 {
 	if ( sd->npc_id != 0 )
 	{
@@ -1738,7 +1738,7 @@ int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char
 /*==========================================
  * NPC processing event type
  *------------------------------------------*/
-int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
+int npc_event(map_session_data* sd, const char* eventname, int ontouch)
 {
 	struct event_data* ev = (struct event_data*)strdb_get(ev_db, eventname);
 	struct npc_data *nd;
@@ -1774,7 +1774,7 @@ int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
  *------------------------------------------*/
 int npc_touch_areanpc_sub(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	int pc_id;
 	char *name;
 
@@ -1802,7 +1802,7 @@ int npc_touch_areanpc_sub(struct block_list *bl, va_list ap)
  * Chk if sd is still touching his assigned npc.
  * If not, it unsets it and searches for another player in range.
  *------------------------------------------*/
-int npc_touchnext_areanpc(struct map_session_data* sd, bool leavemap)
+int npc_touchnext_areanpc(map_session_data* sd, bool leavemap)
 {
 	if (sd->npc_ontouch_.empty())
 		return 0;
@@ -1840,7 +1840,7 @@ int npc_touchnext_areanpc(struct map_session_data* sd, bool leavemap)
 	return found;
 }
 
-int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data *nd)
+int npc_touch_areanpc(map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data *nd)
 {
 	nullpo_retr(0, sd);
 	nullpo_retr(0, nd);
@@ -1902,7 +1902,7 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y, st
 /*==========================================
  * Exec OnTouch for player if in range of area event
  *------------------------------------------*/
-int npc_touch_area_allnpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
+int npc_touch_area_allnpc(map_session_data* sd, int16 m, int16 x, int16 y)
 {
 	nullpo_retr(1, sd);
 
@@ -2087,7 +2087,7 @@ int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range)
  * Chk if player not too far to access the npc.
  * Returns npc_data (success) or NULL (fail).
  *------------------------------------------*/
-struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* bl)
+struct npc_data* npc_checknear(map_session_data* sd, struct block_list* bl)
 {
 	struct npc_data *nd;
 
@@ -2128,7 +2128,7 @@ int npc_globalmessage(const char* name, const char* mes)
 }
 
 // MvP tomb [GreenBox]
-void run_tomb(struct map_session_data* sd, struct npc_data* nd)
+void run_tomb(map_session_data* sd, struct npc_data* nd)
 {
 	char buffer[200];
 	char time[10];
@@ -2156,7 +2156,7 @@ void run_tomb(struct map_session_data* sd, struct npc_data* nd)
  * NPC 1st call when clicking on npc
  * Do specific action for NPC type (openshop, run scripts...)
  *------------------------------------------*/
-int npc_click(struct map_session_data* sd, struct npc_data* nd)
+int npc_click(map_session_data* sd, struct npc_data* nd)
 {
 	nullpo_retr(1, sd);
 
@@ -2236,7 +2236,7 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
 /*==========================================
  *
  *------------------------------------------*/
-bool npc_scriptcont(struct map_session_data* sd, int id, bool closing){
+bool npc_scriptcont(map_session_data* sd, int id, bool closing){
 	struct block_list *target = map_id2bl(id);
 	struct npc_data* nd = BL_CAST( BL_NPC, target );
 
@@ -2331,7 +2331,7 @@ bool npc_scriptcont(struct map_session_data* sd, int id, bool closing){
  * @param type: 0 - Buy, 1 - Sell
  * @return 0 on success or 1 on failure
  */
-int npc_buysellsel(struct map_session_data* sd, int id, int type)
+int npc_buysellsel(map_session_data* sd, int id, int type)
 {
 	struct npc_data *nd;
 
@@ -2370,7 +2370,7 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type)
  * @param sd Player data
  * @return e_CASHSHOP_ACK
  **/
-static enum e_CASHSHOP_ACK npc_cashshop_process_payment(struct npc_data *nd, int price, int points, struct map_session_data *sd) {
+static enum e_CASHSHOP_ACK npc_cashshop_process_payment(struct npc_data *nd, int price, int points, map_session_data *sd) {
 	int cost[2] = { 0, 0 };
 
 	npc_shop_currency_type(sd, nd, cost, false);
@@ -2455,7 +2455,7 @@ static enum e_CASHSHOP_ACK npc_cashshop_process_payment(struct npc_data *nd, int
  * @param item_list: List of items to purchase
  * @return clif_cashshop_ack value to display
  */
-int npc_cashshop_buylist( struct map_session_data *sd, int points, std::vector<s_npc_buy_list>& item_list ){
+int npc_cashshop_buylist( map_session_data *sd, int points, std::vector<s_npc_buy_list>& item_list ){
 	int i, j, amount, new_, w, vt;
 	t_itemid nameid;
 	struct npc_data *nd = (struct npc_data *)map_id2bl(sd->npc_shopid);
@@ -2553,7 +2553,7 @@ int npc_cashshop_buylist( struct map_session_data *sd, int points, std::vector<s
  * @param cost: Reference to cost variable
  * @param display: Display cost type to player?
  */
-void npc_shop_currency_type(struct map_session_data *sd, struct npc_data *nd, int cost[2], bool display)
+void npc_shop_currency_type(map_session_data *sd, struct npc_data *nd, int cost[2], bool display)
 {
 	nullpo_retv(sd);
 
@@ -2615,7 +2615,7 @@ void npc_shop_currency_type(struct map_session_data *sd, struct npc_data *nd, in
  * @param points: Cost of total items
  * @return clif_cashshop_ack value to display
  */
-int npc_cashshop_buy(struct map_session_data *sd, t_itemid nameid, int amount, int points)
+int npc_cashshop_buy(map_session_data *sd, t_itemid nameid, int amount, int points)
 {
 	struct npc_data *nd = (struct npc_data *)map_id2bl(sd->npc_shopid);
 	int i, price, w;
@@ -2707,7 +2707,7 @@ int npc_cashshop_buy(struct map_session_data *sd, t_itemid nameid, int amount, i
  * @param item_list: List of items
  * @param nd: Attached NPC
  */
-static int npc_buylist_sub(struct map_session_data* sd, std::vector<s_npc_buy_list>& item_list, struct npc_data* nd) {
+static int npc_buylist_sub(map_session_data* sd, std::vector<s_npc_buy_list>& item_list, struct npc_data* nd) {
 	char npc_ev[EVENT_NAME_LENGTH];
 	int key_nameid = 0, key_amount = 0;
 
@@ -2735,7 +2735,7 @@ static int npc_buylist_sub(struct map_session_data* sd, std::vector<s_npc_buy_li
  * @param item_list: List of items
  * @return result code for clif_parse_NpcBuyListSend/clif_npc_market_purchase_ack
  */
-e_purchase_result npc_buylist( struct map_session_data* sd, std::vector<s_npc_buy_list>& item_list ){
+e_purchase_result npc_buylist( map_session_data* sd, std::vector<s_npc_buy_list>& item_list ){
 	struct npc_data* nd;
 	struct npc_item_list *shop = NULL;
 	double z;
@@ -2890,7 +2890,7 @@ e_purchase_result npc_buylist( struct map_session_data* sd, std::vector<s_npc_bu
 }
 
 /// npc_selllist for script-controlled shops
-static int npc_selllist_sub(struct map_session_data* sd, int list_length, PACKET_CZ_PC_SELL_ITEMLIST_sub* item_list, struct npc_data* nd)
+static int npc_selllist_sub(map_session_data* sd, int list_length, PACKET_CZ_PC_SELL_ITEMLIST_sub* item_list, struct npc_data* nd)
 {
 	char npc_ev[EVENT_NAME_LENGTH];
 	char card_slot[NAME_LENGTH];
@@ -2974,7 +2974,7 @@ static int npc_selllist_sub(struct map_session_data* sd, int list_length, PACKET
 ///
 /// @param item_list 'n' pairs <index,amount>
 /// @return result code for clif_parse_NpcSellListSend
-uint8 npc_selllist(struct map_session_data* sd, int list_length, PACKET_CZ_PC_SELL_ITEMLIST_sub* item_list)
+uint8 npc_selllist(map_session_data* sd, int list_length, PACKET_CZ_PC_SELL_ITEMLIST_sub* item_list)
 {
 	double z;
 	int i,skill;
@@ -3083,7 +3083,7 @@ uint8 npc_selllist(struct map_session_data* sd, int list_length, PACKET_CZ_PC_SE
 	return 0;
 }
 
-e_purchase_result npc_barter_purchase( struct map_session_data& sd, std::shared_ptr<s_npc_barter> barter, std::vector<s_barter_purchase>& purchases ){
+e_purchase_result npc_barter_purchase( map_session_data& sd, std::shared_ptr<s_npc_barter> barter, std::vector<s_barter_purchase>& purchases ){
 	uint64 requiredZeny = 0;
 	uint32 requiredWeight = 0;
 	uint32 reducedWeight = 0;
@@ -3467,7 +3467,7 @@ int npc_unload(struct npc_data* nd, bool single) {
 
 		iter = mapit_geteachpc();
 		for( bl = (struct block_list*)mapit_first(iter); mapit_exists(iter); bl = (struct block_list*)mapit_next(iter) ) {
-			struct map_session_data *sd = ((TBL_PC*)bl);
+			map_session_data *sd = ((TBL_PC*)bl);
 			if( sd && sd->npc_timer_id != INVALID_TIMER ) {
 				const struct TimerData *td = get_timer(sd->npc_timer_id);
 
@@ -3525,7 +3525,7 @@ int npc_unload(struct npc_data* nd, bool single) {
 	}
 
 	if( nd->dynamicnpc.owner_char_id != 0 ){
-		struct map_session_data* owner = map_charid2sd( nd->dynamicnpc.owner_char_id );
+		map_session_data* owner = map_charid2sd( nd->dynamicnpc.owner_char_id );
 
 		if( owner != nullptr ){
 			owner->npc_id_dynamic = 0;
@@ -4446,7 +4446,7 @@ static const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, cons
 /// shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<name of target>)%TAB%<NPC Name>%TAB%<sprite id>
 /// npc: -%TAB%duplicate(<name of target>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
 /// npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<name of target>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
-const char* npc_parse_duplicate( char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath, struct map_session_data* owner = nullptr ){
+const char* npc_parse_duplicate( char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath, map_session_data* owner = nullptr ){
 	short x, y, m, xs = -1, ys = -1;
 	int16 dir;
 	char srcname[128];
@@ -4995,7 +4995,7 @@ void npc_setclass(struct npc_data* nd, short class_)
 }
 
 // @commands (script based)
-int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const char* message, const char* eventname)
+int npc_do_atcmd_event(map_session_data* sd, const char* command, const char* message, const char* eventname)
 {
 	struct event_data* ev = (struct event_data*)strdb_get(ev_db, eventname);
 	struct npc_data *nd;
@@ -5698,7 +5698,7 @@ int npc_parsesrcfile(const char* filepath)
 	return 1;
 }
 
-int npc_script_event(struct map_session_data* sd, enum npce_event type){
+int npc_script_event(map_session_data* sd, enum npce_event type){
 	if (type == NPCE_MAX)
 		return 0;
 	if (!sd) {
@@ -5726,7 +5726,7 @@ int npc_script_event(struct map_session_data* sd, enum npce_event type){
  * dir: Facing direction of duplicate NPC
  * Returns duplicate NPC data on success
  */
-npc_data* npc_duplicate_npc( npc_data& nd, char name[NPC_NAME_LENGTH + 1], int16 mapid, int16 x, int16 y, int class_, uint8 dir, int16 xs, int16 ys, struct map_session_data* owner ){
+npc_data* npc_duplicate_npc( npc_data& nd, char name[NPC_NAME_LENGTH + 1], int16 mapid, int16 x, int16 y, int class_, uint8 dir, int16 xs, int16 ys, map_session_data* owner ){
 	static char w1[128], w2[128], w3[128], w4[128];
 	const char* stat_buf = "- call from duplicate subsystem -\n";
 	char exname[NPC_NAME_LENGTH + 1];
@@ -5778,7 +5778,7 @@ TIMER_FUNC(npc_dynamicnpc_removal_timer){
 
 	nd->dynamicnpc.removal_tid = INVALID_TIMER;
 
-	struct map_session_data* sd = map_charid2sd( nd->dynamicnpc.owner_char_id );
+	map_session_data* sd = map_charid2sd( nd->dynamicnpc.owner_char_id );
 
 	if( sd != nullptr ){
 		// Still talking to the NPC
@@ -5807,7 +5807,7 @@ TIMER_FUNC(npc_dynamicnpc_removal_timer){
 	return 0;
 }
 
-struct npc_data* npc_duplicate_npc_for_player( struct npc_data& nd, struct map_session_data& sd ){
+struct npc_data* npc_duplicate_npc_for_player( struct npc_data& nd, map_session_data& sd ){
 	if( sd.npc_id_dynamic != 0 ){
 		clif_msg_color( &sd, C_DYNAMICNPC_TWICE, color_table[COLOR_LIGHT_YELLOW] );
 		return nullptr;

+ 24 - 24
src/map/npc.hpp

@@ -141,7 +141,7 @@ struct npc_data {
 	struct block_list bl;
 	struct unit_data ud; //Because they need to be able to move....
 	struct view_data vd;
-	struct status_change sc; //They can't have status changes, but.. they want the visual opt values.
+	status_change sc; //They can't have status changes, but.. they want the visual opt values.
 	struct npc_data *master_nd;
 	short class_,speed;
 	char name[NPC_NAME_LENGTH+1];// display name
@@ -1481,33 +1481,33 @@ enum e_npcv_status : uint8 {
 };
 struct view_data* npc_get_viewdata(int class_);
 int npc_chat_sub(struct block_list* bl, va_list ap);
-int npc_event_dequeue(struct map_session_data* sd,bool free_script_stack=true);
-int npc_event(struct map_session_data* sd, const char* eventname, int ontouch);
-int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data* nd);
-int npc_touch_area_allnpc(struct map_session_data* sd, int16 m, int16 x, int16 y);
+int npc_event_dequeue(map_session_data* sd,bool free_script_stack=true);
+int npc_event(map_session_data* sd, const char* eventname, int ontouch);
+int npc_touch_areanpc(map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data* nd);
+int npc_touch_area_allnpc(map_session_data* sd, int16 m, int16 x, int16 y);
 int npc_touch_areanpc2(struct mob_data *md); // [Skotlex]
 int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range);
-int npc_touchnext_areanpc(struct map_session_data* sd,bool leavemap);
-int npc_click(struct map_session_data* sd, struct npc_data* nd);
-bool npc_scriptcont(struct map_session_data* sd, int id, bool closing);
-struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* bl);
-int npc_buysellsel(struct map_session_data* sd, int id, int type);
-e_purchase_result npc_buylist(struct map_session_data* sd, std::vector<s_npc_buy_list>& item_list);
-static int npc_buylist_sub(struct map_session_data* sd, std::vector<s_npc_buy_list>& item_list, struct npc_data* nd);
-uint8 npc_selllist(struct map_session_data* sd, int list_length, PACKET_CZ_PC_SELL_ITEMLIST_sub* item_list);
-e_purchase_result npc_barter_purchase( struct map_session_data& sd, std::shared_ptr<s_npc_barter> barter, std::vector<s_barter_purchase>& purchases );
+int npc_touchnext_areanpc(map_session_data* sd,bool leavemap);
+int npc_click(map_session_data* sd, struct npc_data* nd);
+bool npc_scriptcont(map_session_data* sd, int id, bool closing);
+struct npc_data* npc_checknear(map_session_data* sd, struct block_list* bl);
+int npc_buysellsel(map_session_data* sd, int id, int type);
+e_purchase_result npc_buylist(map_session_data* sd, std::vector<s_npc_buy_list>& item_list);
+static int npc_buylist_sub(map_session_data* sd, std::vector<s_npc_buy_list>& item_list, struct npc_data* nd);
+uint8 npc_selllist(map_session_data* sd, int list_length, PACKET_CZ_PC_SELL_ITEMLIST_sub* item_list);
+e_purchase_result npc_barter_purchase( map_session_data& sd, std::shared_ptr<s_npc_barter> barter, std::vector<s_barter_purchase>& purchases );
 void npc_parse_mob2(struct spawn_data* mob);
 struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y);
 int npc_globalmessage(const char* name,const char* mes);
 const char *npc_get_script_event_name(int npce_index);
-npc_data* npc_duplicate_npc( npc_data& nd, char name[NPC_NAME_LENGTH + 1], int16 mapid, int16 x, int16 y, int class_, uint8 dir, int16 xs, int16 ys, struct map_session_data* owner = nullptr );
-struct npc_data* npc_duplicate_npc_for_player( struct npc_data& nd, struct map_session_data& sd );
+npc_data* npc_duplicate_npc( npc_data& nd, char name[NPC_NAME_LENGTH + 1], int16 mapid, int16 x, int16 y, int class_, uint8 dir, int16 xs, int16 ys, map_session_data* owner = nullptr );
+struct npc_data* npc_duplicate_npc_for_player( struct npc_data& nd, map_session_data& sd );
 
 void npc_setcells(struct npc_data* nd);
 void npc_unsetcells(struct npc_data* nd);
 bool npc_movenpc(struct npc_data* nd, int16 x, int16 y);
-bool npc_is_cloaked(struct npc_data* nd, struct map_session_data* sd);
-bool npc_is_hidden_dynamicnpc( struct npc_data& nd, struct map_session_data& tsd );
+bool npc_is_cloaked(struct npc_data* nd, map_session_data* sd);
+bool npc_is_hidden_dynamicnpc( struct npc_data& nd, map_session_data& tsd );
 bool npc_enable_target(npc_data& nd, uint32 char_id, e_npcv_status flag);
 #define npc_enable(nd, flag) npc_enable_target(nd, 0, flag)
 void npc_setdisplayname(struct npc_data* nd, const char* newname);
@@ -1535,7 +1535,7 @@ int npc_event_doall_path(const char* event_name, const char* path);
 
 int npc_timerevent_start(struct npc_data* nd, int rid);
 int npc_timerevent_stop(struct npc_data* nd);
-void npc_timerevent_quit(struct map_session_data* sd);
+void npc_timerevent_quit(map_session_data* sd);
 t_tick npc_gettimerevent_tick(struct npc_data* nd);
 int npc_settimerevent_tick(struct npc_data* nd, int newtimer);
 int npc_remove_map(struct npc_data* nd);
@@ -1543,18 +1543,18 @@ void npc_unload_duplicates (struct npc_data* nd);
 int npc_unload(struct npc_data* nd, bool single);
 int npc_reload(void);
 void npc_read_event_script(void);
-int npc_script_event(struct map_session_data* sd, enum npce_event type);
+int npc_script_event(map_session_data* sd, enum npce_event type);
 
 int npc_duplicate4instance(struct npc_data *snd, int16 m);
 int npc_instanceinit(struct npc_data* nd);
 int npc_instancedestroy(struct npc_data* nd);
-int npc_cashshop_buy(struct map_session_data *sd, t_itemid nameid, int amount, int points);
+int npc_cashshop_buy(map_session_data *sd, t_itemid nameid, int amount, int points);
 
-void npc_shop_currency_type(struct map_session_data *sd, struct npc_data *nd, int cost[2], bool display);
+void npc_shop_currency_type(map_session_data *sd, struct npc_data *nd, int cost[2], bool display);
 
 extern struct npc_data* fake_nd;
 
-int npc_cashshop_buylist( struct map_session_data *sd, int points, std::vector<s_npc_buy_list>& item_list );
+int npc_cashshop_buylist( map_session_data *sd, int points, std::vector<s_npc_buy_list>& item_list );
 bool npc_shop_discount(struct npc_data* nd);
 
 #if PACKETVER >= 20131223
@@ -1567,7 +1567,7 @@ void npc_market_delfromsql_(const char *exname, t_itemid nameid, bool clear);
 #endif
 
 // @commands (script-based)
-int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const char* message, const char* eventname);
+int npc_do_atcmd_event(map_session_data* sd, const char* command, const char* message, const char* eventname);
 
 bool npc_unloadfile( const char* path );
 

+ 3 - 3
src/map/npc_chat.cpp

@@ -13,7 +13,7 @@
 #include "../common/timer.hpp"
 
 #include "mob.hpp" // struct mob_data
-#include "pc.hpp" // struct map_session_data
+#include "pc.hpp" // map_session_data
 
 /**
  *  Written by MouseJstr in a vision... (2/21/2005)
@@ -344,7 +344,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
 	struct npc_parse* npcParse = (struct npc_parse *) nd->chatdb;
 	char* msg;
 	int len, i;
-	struct map_session_data* sd;
+	map_session_data* sd;
 	struct npc_label_list* lst;
 	struct pcrematch_set* pcreset;
 	struct pcrematch_entry* e;
@@ -355,7 +355,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
 	
 	msg = va_arg(ap,char*);
 	len = va_arg(ap,int);
-	sd = va_arg(ap,struct map_session_data *);
+	sd = va_arg(ap,map_session_data *);
 	
 	// iterate across all active sets
 	for (pcreset = npcParse->active; pcreset != NULL; pcreset = pcreset->next)

+ 39 - 39
src/map/party.cpp

@@ -39,7 +39,7 @@ int party_create_byscript;
  * Fills the given party_member structure according to the sd provided.
  * Used when creating/adding people to a party. [Skotlex]
  *------------------------------------------*/
-static void party_fill_member(struct party_member* member, struct map_session_data* sd, unsigned int leader)
+static void party_fill_member(struct party_member* member, map_session_data* sd, unsigned int leader)
 {
   	member->account_id = sd->status.account_id;
 	member->char_id    = sd->status.char_id;
@@ -53,7 +53,7 @@ static void party_fill_member(struct party_member* member, struct map_session_da
 
 /// Get the member_id of a party member.
 /// Return -1 if not in party.
-int party_getmemberid(struct party_data* p, struct map_session_data* sd)
+int party_getmemberid(struct party_data* p, map_session_data* sd)
 {
 	int member_id;
 	nullpo_retr(-1, p);
@@ -70,7 +70,7 @@ int party_getmemberid(struct party_data* p, struct map_session_data* sd)
 /*==========================================
  * Request an available sd of this party
  *------------------------------------------*/
-struct map_session_data* party_getavailablesd(struct party_data *p)
+map_session_data* party_getavailablesd(struct party_data *p)
 {
 	int i;
 	nullpo_retr(NULL, p);
@@ -141,7 +141,7 @@ struct party_data* party_searchname(const char* str)
 	return p;
 }
 
-int party_create(struct map_session_data *sd,char *name,int item,int item2)
+int party_create(map_session_data *sd,char *name,int item,int item2)
 {
 	struct party_member leader;
 	char tname[NAME_LENGTH];
@@ -165,7 +165,7 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2)
 
 void party_created(uint32 account_id,uint32 char_id,int fail,int party_id,char *name)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	sd = map_id2sd(account_id);
 
@@ -201,7 +201,7 @@ int party_request_info(int party_id, uint32 char_id)
  * Close trade window if party member is kicked when trade a party bound item
  * @param sd
  **/
-static void party_trade_bound_cancel(struct map_session_data *sd) {
+static void party_trade_bound_cancel(map_session_data *sd) {
 #ifdef BOUND_ITEMS
 	nullpo_retv(sd);
 	if (sd->state.isBoundTrading&(1<<BOUND_PARTY))
@@ -216,7 +216,7 @@ int party_recv_noinfo(int party_id, uint32 char_id)
 {
 	party_broken(party_id);
 	if( char_id != 0 ) { // requester
-		struct map_session_data* sd;
+		map_session_data* sd;
 
 		sd = map_charid2sd(char_id);
 
@@ -271,7 +271,7 @@ int party_recv_info(struct party* sp, uint32 char_id)
 {
 	struct party_data* p;
 	struct party_member* member;
-	struct map_session_data* sd;
+	map_session_data* sd;
 	int removed[MAX_PARTY];// member_id in old data
 	int removed_count = 0;
 	int added[MAX_PARTY];// member_id in new data
@@ -382,7 +382,7 @@ int party_recv_info(struct party* sp, uint32 char_id)
 }
 
 ///! TODO: Party invitation cross map-server through inter-server, so does with the reply.
-int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
+int party_invite(map_session_data *sd,map_session_data *tsd)
 {
 	struct party_data *p;
 	int i;
@@ -452,9 +452,9 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
 	return 1;
 }
 
-int party_reply_invite(struct map_session_data *sd,int party_id,int flag)
+int party_reply_invite(map_session_data *sd,int party_id,int flag)
 {
-	struct map_session_data* tsd;
+	map_session_data* tsd;
 	struct party_member member;
 
 	if( sd->party_invite != party_id ) { // forged
@@ -493,7 +493,7 @@ int party_reply_invite(struct map_session_data *sd,int party_id,int flag)
 //- Loads up party data if not in server
 //- Sets up the pointer to him
 //- Player must be authed/active and belong to a party before calling this method
-void party_member_joined(struct map_session_data *sd)
+void party_member_joined(map_session_data *sd)
 {
 	struct party_data* p = party_search(sd->status.party_id);
 	int i;
@@ -515,7 +515,7 @@ void party_member_joined(struct map_session_data *sd)
 /// flag: 0-success, 1-failure
 int party_member_added(int party_id,uint32 account_id,uint32 char_id, int flag)
 {
-	struct map_session_data *sd = map_id2sd(account_id),*sd2;
+	map_session_data *sd = map_id2sd(account_id),*sd2;
 	struct party_data *p = party_search(party_id);
 	int i;
 
@@ -570,7 +570,7 @@ int party_member_added(int party_id,uint32 account_id,uint32 char_id, int flag)
 }
 
 /// Party member 'sd' requesting kick of member with <account_id, name>.
-int party_removemember(struct map_session_data* sd, uint32 account_id, char* name)
+int party_removemember(map_session_data* sd, uint32 account_id, char* name)
 {
 	struct party_data *p;
 	int i;
@@ -597,7 +597,7 @@ int party_removemember(struct map_session_data* sd, uint32 account_id, char* nam
 	return 1;
 }
 
-int party_removemember2(struct map_session_data *sd,uint32 char_id,int party_id)
+int party_removemember2(map_session_data *sd,uint32 char_id,int party_id)
 {
 	if( sd ) {
 		if( !sd->status.party_id )
@@ -622,7 +622,7 @@ int party_removemember2(struct map_session_data *sd,uint32 char_id,int party_id)
 }
 
 /// Party member 'sd' requesting exit from party.
-int party_leave(struct map_session_data *sd)
+int party_leave(map_session_data *sd)
 {
 	struct party_data *p;
 	int i;
@@ -644,11 +644,11 @@ int party_leave(struct map_session_data *sd)
 /// Invoked (from char-server) when a party member leaves the party.
 int party_member_withdraw(int party_id, uint32 account_id, uint32 char_id, char *name, enum e_party_member_withdraw type)
 {
-	struct map_session_data* sd = map_charid2sd(char_id);
+	map_session_data* sd = map_charid2sd(char_id);
 	struct party_data* p = party_search(party_id);
 
 	if( p ) {
-		struct map_session_data* party_sd = party_getavailablesd( p );
+		map_session_data* party_sd = party_getavailablesd( p );
 
 		if( party_sd != nullptr ){
 			clif_party_withdraw( *party_sd, account_id, name, type, PARTY );
@@ -721,7 +721,7 @@ int party_broken(int party_id)
 	return 1;
 }
 
-int party_changeoption(struct map_session_data *sd,int exp,int item)
+int party_changeoption(map_session_data *sd,int exp,int item)
 {
 	nullpo_ret(sd);
 
@@ -767,7 +767,7 @@ int party_setoption(struct party_data *party, int option, int flag)
 int party_optionchanged(int party_id,uint32 account_id,int exp,int item,int flag)
 {
 	struct party_data *p;
-	struct map_session_data *sd=map_id2sd(account_id);
+	map_session_data *sd=map_id2sd(account_id);
 
 	if( (p = party_search(party_id)) == NULL)
 		return 0;
@@ -784,7 +784,7 @@ int party_optionchanged(int party_id,uint32 account_id,int exp,int item,int flag
 	return 0;
 }
 
-int party_changeleader(struct map_session_data *sd, struct map_session_data *tsd, struct party_data *p)
+int party_changeleader(map_session_data *sd, map_session_data *tsd, struct party_data *p)
 {
 	int mi, tmi;
 
@@ -882,7 +882,7 @@ int party_recv_movemap(int party_id,uint32 account_id,uint32 char_id, unsigned s
 	return 0;
 }
 
-void party_send_movemap(struct map_session_data *sd)
+void party_send_movemap(map_session_data *sd)
 {
 	struct party_data *p;
 
@@ -916,12 +916,12 @@ void party_send_movemap(struct map_session_data *sd)
 	return;
 }
 
-void party_send_levelup(struct map_session_data *sd)
+void party_send_levelup(map_session_data *sd)
 {
 	intif_party_changemap(sd,1);
 }
 
-int party_send_logout(struct map_session_data *sd)
+int party_send_logout(map_session_data *sd)
 {
 	struct party_data *p;
 	int i;
@@ -942,7 +942,7 @@ int party_send_logout(struct map_session_data *sd)
 	return 1;
 }
 
-int party_send_message(struct map_session_data *sd,const char *mes,int len)
+int party_send_message(map_session_data *sd,const char *mes,int len)
 {
 	if(sd->status.party_id == 0)
 		return 0;
@@ -964,10 +964,10 @@ int party_recv_message(int party_id,uint32 account_id,const char *mes,int len)
 	return 0;
 }
 
-int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv)
+int party_skill_check(map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv)
 {
 	struct party_data *p;
-	struct map_session_data *p_sd;
+	map_session_data *p_sd;
 	int i;
 
 	if(!party_id || (p = party_search(party_id)) == NULL)
@@ -1033,7 +1033,7 @@ TIMER_FUNC(party_send_xy_timer){
 
 		// for each member of this party
 		for( i = 0; i < MAX_PARTY; i++ ) {
-			struct map_session_data* sd = p->data[i].sd;
+			map_session_data* sd = p->data[i].sd;
 
 			if( !sd )
 				continue;
@@ -1082,7 +1082,7 @@ int party_send_xy_clear(struct party_data *p)
  **/
 void party_exp_share(struct party_data* p, struct block_list* src, t_exp base_exp, t_exp job_exp, int zeny)
 {
-	struct map_session_data* sd[MAX_PARTY];
+	map_session_data* sd[MAX_PARTY];
 	unsigned int i, c;
 #ifdef RENEWAL_EXP
 	TBL_MOB *md = BL_CAST(BL_MOB, src);
@@ -1140,7 +1140,7 @@ void party_exp_share(struct party_data* p, struct block_list* src, t_exp base_ex
 }
 
 //Does party loot. first_charid holds the charid of the player who has time priority to take the item.
-int party_share_loot(struct party_data* p, struct map_session_data* sd, struct item* item, int first_charid)
+int party_share_loot(struct party_data* p, map_session_data* sd, struct item* item, int first_charid)
 {
 	TBL_PC* target = NULL;
 	int i;
@@ -1207,7 +1207,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
 	return 0;
 }
 
-int party_send_dot_remove(struct map_session_data *sd)
+int party_send_dot_remove(map_session_data *sd)
 {
 	if (sd->status.party_id)
 		clif_party_xy_remove(sd);
@@ -1223,7 +1223,7 @@ int party_send_dot_remove(struct map_session_data *sd)
  */
 int party_sub_count(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd = (TBL_PC *)bl;
+	map_session_data *sd = (TBL_PC *)bl;
 
 	if (sd->state.autotrade)
 		return 0;
@@ -1242,7 +1242,7 @@ int party_sub_count(struct block_list *bl, va_list ap)
  */
 int party_sub_count_class(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd = (TBL_PC *)bl;
+	map_session_data *sd = (TBL_PC *)bl;
 	unsigned int mask = va_arg(ap, unsigned int);
 	unsigned int mapid_class = va_arg(ap, unsigned int);
 
@@ -1256,7 +1256,7 @@ int party_sub_count_class(struct block_list *bl, va_list ap)
 }
 
 /// Executes 'func' for each party member on the same map and in range (0:whole map)
-int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_session_data *sd,int range,...)
+int party_foreachsamemap(int (*func)(struct block_list*,va_list),map_session_data *sd,int range,...)
 {
 	struct party_data *p;
 	int i;
@@ -1276,7 +1276,7 @@ int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_sess
 	y1 = sd->bl.y+range;
 
 	for(i = 0; i < MAX_PARTY; i++) {
-		struct map_session_data *psd = p->data[i].sd;
+		map_session_data *psd = p->data[i].sd;
 
 		if(!psd)
 			continue;
@@ -1319,7 +1319,7 @@ static struct party_booking_ad_info* create_party_booking_data(void)
 	return pb_ad;
 }
 
-void party_booking_register(struct map_session_data *sd, short level, short mapid, short* job)
+void party_booking_register(map_session_data *sd, short level, short mapid, short* job)
 {
 	struct party_booking_ad_info *pb_ad;
 	int i;
@@ -1348,7 +1348,7 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi
 	clif_PartyBookingInsertNotify(sd, pb_ad); // Notice
 }
 
-void party_booking_update(struct map_session_data *sd, short* job)
+void party_booking_update(map_session_data *sd, short* job)
 {
 	int i;
 	struct party_booking_ad_info *pb_ad;
@@ -1369,7 +1369,7 @@ void party_booking_update(struct map_session_data *sd, short* job)
 	clif_PartyBookingUpdateNotify(sd, pb_ad);
 }
 
-void party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount)
+void party_booking_search(map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount)
 {
 	struct party_booking_ad_info *pb_ad;
 	int i, count=0;
@@ -1407,7 +1407,7 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
 	clif_PartyBookingSearchAck(sd->fd, result_list, count, more_result);
 }
 
-bool party_booking_delete(struct map_session_data *sd)
+bool party_booking_delete(map_session_data *sd)
 {
 	struct party_booking_ad_info* pb_ad;
 

+ 25 - 25
src/map/party.hpp

@@ -9,7 +9,7 @@
 #include "../common/mmo.hpp" // struct party
 
 struct block_list;
-struct map_session_data;
+class map_session_data;
 struct party;
 struct item;
 
@@ -17,7 +17,7 @@ struct item;
 #define MAX_PARTY_BOOKING_RESULTS 10
 
 struct party_member_data {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	unsigned int hp; //For HP,x,y refreshing.
 	unsigned short x, y;
 };
@@ -54,49 +54,49 @@ void do_init_party(void);
 void do_final_party(void);
 struct party_data* party_search(int party_id);
 struct party_data* party_searchname(const char* str);
-int party_getmemberid(struct party_data* p, struct map_session_data* sd);
-struct map_session_data* party_getavailablesd(struct party_data *p);
+int party_getmemberid(struct party_data* p, map_session_data* sd);
+map_session_data* party_getavailablesd(struct party_data *p);
 
-int party_create(struct map_session_data *sd,char *name, int item, int item2);
+int party_create(map_session_data *sd,char *name, int item, int item2);
 void party_created(uint32 account_id,uint32 char_id,int fail,int party_id,char *name);
 int party_request_info(int party_id, uint32 char_id);
-int party_invite(struct map_session_data *sd,struct map_session_data *tsd);
-void party_member_joined(struct map_session_data *sd);
+int party_invite(map_session_data *sd,map_session_data *tsd);
+void party_member_joined(map_session_data *sd);
 int party_member_added(int party_id,uint32 account_id,uint32 char_id,int flag);
-int party_leave(struct map_session_data *sd);
-int party_removemember(struct map_session_data *sd,uint32 account_id,char *name);
-int party_removemember2(struct map_session_data *sd,uint32 char_id,int party_id);
+int party_leave(map_session_data *sd);
+int party_removemember(map_session_data *sd,uint32 account_id,char *name);
+int party_removemember2(map_session_data *sd,uint32 char_id,int party_id);
 int party_member_withdraw(int party_id, uint32 account_id, uint32 char_id, char *name, enum e_party_member_withdraw type);
-int party_reply_invite(struct map_session_data *sd,int party_id,int flag);
+int party_reply_invite(map_session_data *sd,int party_id,int flag);
 #define party_add_member(party_id,sd) party_reply_invite(sd,party_id,1)
 int party_recv_noinfo(int party_id, uint32 char_id);
 int party_recv_info(struct party* sp, uint32 char_id);
 int party_recv_movemap(int party_id,uint32 account_id,uint32 char_id, unsigned short map,int online,int lv);
 int party_broken(int party_id);
 int party_optionchanged(int party_id,uint32 account_id,int exp,int item,int flag);
-int party_changeoption(struct map_session_data *sd,int exp,int item);
+int party_changeoption(map_session_data *sd,int exp,int item);
 int party_setoption(struct party_data *party, int option, int flag);
-int party_changeleader(struct map_session_data *sd, struct map_session_data *t_sd, struct party_data *p);
-void party_send_movemap(struct map_session_data *sd);
-void party_send_levelup(struct map_session_data *sd);
-int party_send_logout(struct map_session_data *sd);
-int party_send_message(struct map_session_data *sd,const char *mes,int len);
+int party_changeleader(map_session_data *sd, map_session_data *t_sd, struct party_data *p);
+void party_send_movemap(map_session_data *sd);
+void party_send_levelup(map_session_data *sd);
+int party_send_logout(map_session_data *sd);
+int party_send_message(map_session_data *sd,const char *mes,int len);
 int party_recv_message(int party_id,uint32 account_id,const char *mes,int len);
-int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv);
+int party_skill_check(map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv);
 int party_send_xy_clear(struct party_data *p);
 void party_exp_share(struct party_data *p,struct block_list *src,t_exp base_exp,t_exp job_exp,int zeny);
-int party_share_loot(struct party_data* p, struct map_session_data* sd, struct item* item, int first_charid);
-int party_send_dot_remove(struct map_session_data *sd);
+int party_share_loot(struct party_data* p, map_session_data* sd, struct item* item, int first_charid);
+int party_send_dot_remove(map_session_data *sd);
 int party_sub_count(struct block_list *bl, va_list ap);
 int party_sub_count_class(struct block_list *bl, va_list ap);
-int party_foreachsamemap(int (*func)(struct block_list *,va_list),struct map_session_data *sd,int range,...);
+int party_foreachsamemap(int (*func)(struct block_list *,va_list),map_session_data *sd,int range,...);
 
 /*==========================================
  * Party Booking in KRO [Spiria]
  *------------------------------------------*/
-void party_booking_register(struct map_session_data *sd, short level, short mapid, short* job);
-void party_booking_update(struct map_session_data *sd, short* job);
-void party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount);
-bool party_booking_delete(struct map_session_data *sd);
+void party_booking_register(map_session_data *sd, short level, short mapid, short* job);
+void party_booking_update(map_session_data *sd, short* job);
+void party_booking_search(map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount);
+bool party_booking_delete(map_session_data *sd);
 
 #endif /* PARTY_HPP */

文件差異過大導致無法顯示
+ 114 - 114
src/map/pc.cpp


+ 209 - 209
src/map/pc.hpp

@@ -378,7 +378,7 @@ public:
 	struct unit_data ud;
 	struct view_data vd;
 	struct status_data base_status, battle_status;
-	struct status_change sc;
+	status_change sc;
 	struct regen_data regen;
 	struct regen_data_sub sregen, ssregen;
 	//NOTE: When deciding to add a flag to state or special_state, take into consideration that state is preserved in
@@ -1127,7 +1127,7 @@ extern JobDatabase job_db;
 #define pc_isidle_hom(sd)     ( (sd)->hd && ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(last_tick, (sd)->idletime_hom) >= battle_config.hom_idle_no_share ) )
 #define pc_isidle_mer(sd)     ( (sd)->md && ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(last_tick, (sd)->idletime_mer) >= battle_config.mer_idle_no_share ) )
 #define pc_istrading(sd)      ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading )
-static bool pc_cant_act2( struct map_session_data* sd ){
+static bool pc_cant_act2( map_session_data* sd ){
 	return sd->state.vending || sd->state.buyingstore || (sd->sc.opt1 && sd->sc.opt1 != OPT1_BURNING)
 		|| sd->state.trading || sd->state.storage_flag || sd->state.prevend || sd->state.refineui_open
 		|| sd->state.stylist_open || sd->state.inventory_expansion_confirmation || sd->npc_shopid
@@ -1137,7 +1137,7 @@ static bool pc_cant_act2( struct map_session_data* sd ){
 		|| sd->state.item_reform || sd->state.item_enchant_index;
 }
 // equals pc_cant_act2 and additionally checks for chat rooms and npcs
-static bool pc_cant_act( struct map_session_data* sd ){
+static bool pc_cant_act( map_session_data* sd ){
 	return sd->npc_id || sd->chatID || pc_cant_act2( sd );
 }
 
@@ -1164,12 +1164,12 @@ static bool pc_cant_act( struct map_session_data* sd ){
 #define pc_is70overweight(sd) ( (sd)->weight * 100 >= (sd)->max_weight * battle_config.natural_heal_weight_rate_renewal )
 #define pc_is90overweight(sd) ( (sd)->weight * 10 >= (sd)->max_weight * 9 )
 
-static inline bool pc_hasprogress(struct map_session_data *sd, enum e_wip_block progress) {
+static inline bool pc_hasprogress(map_session_data *sd, enum e_wip_block progress) {
 	return sd == NULL || (sd->state.workinprogress&progress) == progress;
 }
 
-uint16 pc_maxparameter(struct map_session_data *sd, e_params param);
-short pc_maxaspd(struct map_session_data *sd);
+uint16 pc_maxparameter(map_session_data *sd, e_params param);
+short pc_maxaspd(map_session_data *sd);
 
 /**
  * Ranger
@@ -1348,50 +1348,50 @@ enum e_summoner_power_type {
 
 void pc_set_reg_load(bool val);
 int pc_class2idx(int class_);
-int pc_get_group_level(struct map_session_data *sd);
-int pc_get_group_id(struct map_session_data *sd);
-bool pc_can_sell_item(struct map_session_data* sd, struct item * item, enum npc_subtype shoptype);
-bool pc_can_give_items(struct map_session_data *sd);
-bool pc_can_give_bounded_items(struct map_session_data *sd);
+int pc_get_group_level(map_session_data *sd);
+int pc_get_group_id(map_session_data *sd);
+bool pc_can_sell_item(map_session_data* sd, struct item * item, enum npc_subtype shoptype);
+bool pc_can_give_items(map_session_data *sd);
+bool pc_can_give_bounded_items(map_session_data *sd);
 bool pc_can_trade_item(map_session_data *sd, int index);
 
-bool pc_can_use_command(struct map_session_data *sd, const char *command, AtCommandType type);
-bool pc_has_permission( struct map_session_data* sd, e_pc_permission permission );
-bool pc_should_log_commands(struct map_session_data *sd);
-
-void pc_setrestartvalue(struct map_session_data *sd, char type);
-void pc_makesavestatus(struct map_session_data *sd);
-void pc_respawn(struct map_session_data* sd, clr_type clrtype);
-void pc_setnewpc(struct map_session_data *sd, uint32 account_id, uint32 char_id, int login_id1, t_tick client_tick, int sex, int fd);
-bool pc_authok(struct map_session_data *sd, uint32 login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers);
-void pc_authfail(struct map_session_data *sd);
-void pc_reg_received(struct map_session_data *sd);
-void pc_close_npc(struct map_session_data *sd,int flag);
+bool pc_can_use_command(map_session_data *sd, const char *command, AtCommandType type);
+bool pc_has_permission( map_session_data* sd, e_pc_permission permission );
+bool pc_should_log_commands(map_session_data *sd);
+
+void pc_setrestartvalue(map_session_data *sd, char type);
+void pc_makesavestatus(map_session_data *sd);
+void pc_respawn(map_session_data* sd, clr_type clrtype);
+void pc_setnewpc(map_session_data *sd, uint32 account_id, uint32 char_id, int login_id1, t_tick client_tick, int sex, int fd);
+bool pc_authok(map_session_data *sd, uint32 login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers);
+void pc_authfail(map_session_data *sd);
+void pc_reg_received(map_session_data *sd);
+void pc_close_npc(map_session_data *sd,int flag);
 TIMER_FUNC(pc_close_npc_timer);
 
-void pc_setequipindex(struct map_session_data *sd);
-uint8 pc_isequip(struct map_session_data *sd,int n);
-int pc_equippoint(struct map_session_data *sd,int n);
-int pc_equippoint_sub(struct map_session_data *sd, struct item_data* id);
-void pc_setinventorydata(struct map_session_data *sd);
+void pc_setequipindex(map_session_data *sd);
+uint8 pc_isequip(map_session_data *sd,int n);
+int pc_equippoint(map_session_data *sd,int n);
+int pc_equippoint_sub(map_session_data *sd, struct item_data* id);
+void pc_setinventorydata(map_session_data *sd);
 
-int pc_get_skillcooldown(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
-uint8 pc_checkskill(struct map_session_data *sd,uint16 skill_id);
+int pc_get_skillcooldown(map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+uint8 pc_checkskill(map_session_data *sd,uint16 skill_id);
 e_skill_flag pc_checkskill_flag(map_session_data &sd, uint16 skill_id);
 uint8 pc_checkskill_summoner(map_session_data *sd, e_summoner_power_type type);
-uint8 pc_checkskill_imperial_guard(struct map_session_data *sd, short flag);
-short pc_checkequip(struct map_session_data *sd,int pos,bool checkall=false);
-bool pc_checkequip2(struct map_session_data *sd, t_itemid nameid, int min, int max);
+uint8 pc_checkskill_imperial_guard(map_session_data *sd, short flag);
+short pc_checkequip(map_session_data *sd,int pos,bool checkall=false);
+bool pc_checkequip2(map_session_data *sd, t_itemid nameid, int min, int max);
 
-void pc_scdata_received(struct map_session_data *sd);
-void pc_check_expiration(struct map_session_data *sd);
+void pc_scdata_received(map_session_data *sd);
+void pc_check_expiration(map_session_data *sd);
 TIMER_FUNC(pc_expiration_timer);
 TIMER_FUNC(pc_global_expiration_timer);
-void pc_expire_check(struct map_session_data *sd);
+void pc_expire_check(map_session_data *sd);
 
-void pc_calc_skilltree(struct map_session_data *sd);
-uint64 pc_calc_skilltree_normalize_job(struct map_session_data *sd);
-void pc_clean_skilltree(struct map_session_data *sd);
+void pc_calc_skilltree(map_session_data *sd);
+uint64 pc_calc_skilltree_normalize_job(map_session_data *sd);
+void pc_clean_skilltree(map_session_data *sd);
 
 #define pc_checkoverhp(sd) ((sd)->battle_status.hp == (sd)->battle_status.max_hp)
 #define pc_checkoversp(sd) ((sd)->battle_status.sp == (sd)->battle_status.max_sp)
@@ -1403,53 +1403,53 @@ enum e_setpos{
 	SETPOS_AUTOTRADE = 3
 };
 
-enum e_setpos pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype);
-void pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y);
-char pc_randomwarp(struct map_session_data *sd,clr_type type,bool ignore_mapflag = false);
-bool pc_memo(struct map_session_data* sd, int pos);
+enum e_setpos pc_setpos(map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype);
+void pc_setsavepoint(map_session_data *sd, short mapindex,int x,int y);
+char pc_randomwarp(map_session_data *sd,clr_type type,bool ignore_mapflag = false);
+bool pc_memo(map_session_data* sd, int pos);
 
-char pc_checkadditem(struct map_session_data *sd, t_itemid nameid, int amount);
-uint8 pc_inventoryblank(struct map_session_data *sd);
-short pc_search_inventory(struct map_session_data *sd, t_itemid nameid);
-char pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd);
-enum e_additem_result pc_additem(struct map_session_data *sd, struct item *item, int amount, e_log_pick_type log_type);
-char pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd);
-char pc_delitem(struct map_session_data *sd, int n, int amount, int type, short reason, e_log_pick_type log_type);
+char pc_checkadditem(map_session_data *sd, t_itemid nameid, int amount);
+uint8 pc_inventoryblank(map_session_data *sd);
+short pc_search_inventory(map_session_data *sd, t_itemid nameid);
+char pc_payzeny(map_session_data *sd, int zeny, enum e_log_pick_type type, map_session_data *tsd);
+enum e_additem_result pc_additem(map_session_data *sd, struct item *item, int amount, e_log_pick_type log_type);
+char pc_getzeny(map_session_data *sd, int zeny, enum e_log_pick_type type, map_session_data *tsd);
+char pc_delitem(map_session_data *sd, int n, int amount, int type, short reason, e_log_pick_type log_type);
 
-uint64 pc_generate_unique_id(struct map_session_data *sd);
+uint64 pc_generate_unique_id(map_session_data *sd);
 
 //Bound items
 int pc_bound_chk(TBL_PC *sd,enum bound_type type,int *idxlist);
 
 // Special Shop System
-int pc_paycash( struct map_session_data *sd, int price, int points, e_log_pick_type type );
-int pc_getcash( struct map_session_data *sd, int cash, int points, e_log_pick_type type );
+int pc_paycash( map_session_data *sd, int price, int points, e_log_pick_type type );
+int pc_getcash( map_session_data *sd, int cash, int points, e_log_pick_type type );
 
-enum e_additem_result pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type);
-void pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type);
-void pc_putitemtocart(struct map_session_data *sd,int idx,int amount);
-void pc_getitemfromcart(struct map_session_data *sd,int idx,int amount);
-int pc_cartitem_amount(struct map_session_data *sd,int idx,int amount);
+enum e_additem_result pc_cart_additem(map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type);
+void pc_cart_delitem(map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type);
+void pc_putitemtocart(map_session_data *sd,int idx,int amount);
+void pc_getitemfromcart(map_session_data *sd,int idx,int amount);
+int pc_cartitem_amount(map_session_data *sd,int idx,int amount);
 
-bool pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem);
-bool pc_dropitem(struct map_session_data *sd,int n,int amount);
+bool pc_takeitem(map_session_data *sd,struct flooritem_data *fitem);
+bool pc_dropitem(map_session_data *sd,int n,int amount);
 
-bool pc_isequipped(struct map_session_data *sd, t_itemid nameid);
-enum adopt_responses pc_try_adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
-bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
+bool pc_isequipped(map_session_data *sd, t_itemid nameid);
+enum adopt_responses pc_try_adopt(map_session_data *p1_sd, map_session_data *p2_sd, map_session_data *b_sd);
+bool pc_adoption(map_session_data *p1_sd, map_session_data *p2_sd, map_session_data *b_sd);
 
-void pc_updateweightstatus(struct map_session_data *sd);
+void pc_updateweightstatus(map_session_data *sd);
 
 bool pc_addautobonus(std::vector<std::shared_ptr<s_autobonus>> &bonus, const char *script, short rate, unsigned int dur, uint16 atk_type, const char *o_script, unsigned int pos, bool onskill);
-void pc_exeautobonus(struct map_session_data &sd, std::vector<std::shared_ptr<s_autobonus>> *bonus, std::shared_ptr<s_autobonus> autobonus);
+void pc_exeautobonus(map_session_data &sd, std::vector<std::shared_ptr<s_autobonus>> *bonus, std::shared_ptr<s_autobonus> autobonus);
 TIMER_FUNC(pc_endautobonus);
-void pc_delautobonus(struct map_session_data &sd, std::vector<std::shared_ptr<s_autobonus>> &bonus, bool restore);
+void pc_delautobonus(map_session_data &sd, std::vector<std::shared_ptr<s_autobonus>> &bonus, bool restore);
 
-void pc_bonus(struct map_session_data *sd, int type, int val);
-void pc_bonus2(struct map_session_data *sd, int type, int type2, int val);
-void pc_bonus3(struct map_session_data *sd, int type, int type2, int type3, int val);
-void pc_bonus4(struct map_session_data *sd, int type, int type2, int type3, int type4, int val);
-void pc_bonus5(struct map_session_data *sd, int type, int type2, int type3, int type4, int type5, int val);
+void pc_bonus(map_session_data *sd, int type, int val);
+void pc_bonus2(map_session_data *sd, int type, int type2, int val);
+void pc_bonus3(map_session_data *sd, int type, int type2, int type3, int val);
+void pc_bonus4(map_session_data *sd, int type, int type2, int type3, int type4, int val);
+void pc_bonus5(map_session_data *sd, int type, int type2, int type3, int type4, int type5, int val);
 
 enum e_addskill_type {
 	ADDSKILL_PERMANENT			= 0,	///< Permanent skill. Remove the skill if level is 0
@@ -1458,91 +1458,91 @@ enum e_addskill_type {
 	ADDSKILL_PERMANENT_GRANTED	= 3,	///< Grant permanent skill, ignore skill tree and learned level
 };
 
-bool pc_skill(struct map_session_data *sd, uint16 skill_id, int level, enum e_addskill_type type);
+bool pc_skill(map_session_data *sd, uint16 skill_id, int level, enum e_addskill_type type);
 bool pc_skill_plagiarism(map_session_data &sd, uint16 skill_id, uint16 skill_lv);
 bool pc_skill_plagiarism_reset(map_session_data &sd, uint8 type);
 
-int pc_insert_card(struct map_session_data *sd,int idx_card,int idx_equip);
-
-int pc_identifyall(struct map_session_data *sd, bool identify_item);
-
-bool pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skill_lv);
-int pc_steal_coin(struct map_session_data *sd,struct block_list *bl);
-
-int pc_modifybuyvalue(struct map_session_data*,int);
-int pc_modifysellvalue(struct map_session_data*,int);
-
-int pc_follow(struct map_session_data*, int); // [MouseJstr]
-int pc_stop_following(struct map_session_data*);
-
-unsigned int pc_maxbaselv(struct map_session_data *sd);
-unsigned int pc_maxjoblv(struct map_session_data *sd);
-bool pc_is_maxbaselv(struct map_session_data *sd);
-bool pc_is_maxjoblv(struct map_session_data *sd);
-int pc_checkbaselevelup(struct map_session_data *sd);
-int pc_checkjoblevelup(struct map_session_data *sd);
-void pc_gainexp(struct map_session_data *sd, struct block_list *src, t_exp base_exp, t_exp job_exp, uint8 exp_flag);
-void pc_gainexp_disp(struct map_session_data *sd, t_exp base_exp, t_exp next_base_exp, t_exp job_exp, t_exp next_job_exp, bool lost);
-void pc_lostexp(struct map_session_data *sd, t_exp base_exp, t_exp job_exp);
-t_exp pc_nextbaseexp(struct map_session_data *sd);
-t_exp pc_nextjobexp(struct map_session_data *sd);
-int pc_need_status_point(struct map_session_data *,int,int);
-int pc_maxparameterincrease(struct map_session_data*,int);
-bool pc_statusup(struct map_session_data*,int,int);
-int pc_statusup2(struct map_session_data*,int,int);
+int pc_insert_card(map_session_data *sd,int idx_card,int idx_equip);
+
+int pc_identifyall(map_session_data *sd, bool identify_item);
+
+bool pc_steal_item(map_session_data *sd,struct block_list *bl, uint16 skill_lv);
+int pc_steal_coin(map_session_data *sd,struct block_list *bl);
+
+int pc_modifybuyvalue(map_session_data*,int);
+int pc_modifysellvalue(map_session_data*,int);
+
+int pc_follow(map_session_data*, int); // [MouseJstr]
+int pc_stop_following(map_session_data*);
+
+unsigned int pc_maxbaselv(map_session_data *sd);
+unsigned int pc_maxjoblv(map_session_data *sd);
+bool pc_is_maxbaselv(map_session_data *sd);
+bool pc_is_maxjoblv(map_session_data *sd);
+int pc_checkbaselevelup(map_session_data *sd);
+int pc_checkjoblevelup(map_session_data *sd);
+void pc_gainexp(map_session_data *sd, struct block_list *src, t_exp base_exp, t_exp job_exp, uint8 exp_flag);
+void pc_gainexp_disp(map_session_data *sd, t_exp base_exp, t_exp next_base_exp, t_exp job_exp, t_exp next_job_exp, bool lost);
+void pc_lostexp(map_session_data *sd, t_exp base_exp, t_exp job_exp);
+t_exp pc_nextbaseexp(map_session_data *sd);
+t_exp pc_nextjobexp(map_session_data *sd);
+int pc_need_status_point(map_session_data *,int,int);
+int pc_maxparameterincrease(map_session_data*,int);
+bool pc_statusup(map_session_data*,int,int);
+int pc_statusup2(map_session_data*,int,int);
 int pc_getstat(map_session_data *sd, int type);
-int pc_setstat(struct map_session_data* sd, int type, int val);
-int pc_need_trait_point(struct map_session_data *, int, int);
-int pc_maxtraitparameterincrease(struct map_session_data*, int);
-bool pc_traitstatusup(struct map_session_data*, int, int);
-int pc_traitstatusup2(struct map_session_data*, int, int);
-void pc_skillup(struct map_session_data*,uint16 skill_id);
-int pc_allskillup(struct map_session_data*);
-int pc_resetlvl(struct map_session_data*,int type);
-int pc_resetstate(struct map_session_data*);
-int pc_resetskill(struct map_session_data*, int);
-int pc_resetfeel(struct map_session_data*);
-int pc_resethate(struct map_session_data*);
-bool pc_equipitem(struct map_session_data *sd, short n, int req_pos, bool equipswitch=false);
-bool pc_unequipitem(struct map_session_data*,int,int);
-int pc_equipswitch( struct map_session_data* sd, int index );
-void pc_equipswitch_remove( struct map_session_data* sd, int index );
-void pc_checkitem(struct map_session_data*);
-void pc_check_available_item(struct map_session_data *sd, uint8 type);
-int pc_useitem(struct map_session_data*,int);
-
-int pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id);
-int pc_sub_skillatk_bonus(struct map_session_data *sd, uint16 skill_id);
-int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id);
-int pc_skillheal2_bonus(struct map_session_data *sd, uint16 skill_id);
-
-void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp, unsigned int ap);
-int pc_dead(struct map_session_data *sd,struct block_list *src);
-void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp, unsigned int ap = 0);
-bool pc_revive_item(struct map_session_data *sd);
-void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, unsigned int ap, int type);
-int pc_itemheal(struct map_session_data *sd, t_itemid itemid, int hp,int sp);
-int pc_percentheal(struct map_session_data *sd,int,int);
-bool pc_jobchange(struct map_session_data *sd, int job, char upper);
-void pc_setoption(struct map_session_data *,int type, int subtype = 0);
-bool pc_setcart(struct map_session_data* sd, int type);
-void pc_setfalcon(struct map_session_data* sd, int flag);
-void pc_setriding(struct map_session_data* sd, int flag);
-void pc_setmadogear(struct map_session_data* sd, bool flag, e_mado_type type = MADO_ROBOT);
-void pc_changelook(struct map_session_data *,int,int);
-void pc_equiplookall(struct map_session_data *sd);
-void pc_set_costume_view(struct map_session_data *sd);
-
-int64 pc_readparam(struct map_session_data *sd, int64 type);
-bool pc_setparam(struct map_session_data *sd, int64 type, int64 val);
-int64 pc_readreg(struct map_session_data *sd, int64 reg);
-bool pc_setreg(struct map_session_data *sd, int64 reg, int64 val);
-char *pc_readregstr(struct map_session_data *sd, int64 reg);
-bool pc_setregstr(struct map_session_data *sd, int64 reg, const char *str);
-int64 pc_readregistry(struct map_session_data *sd, int64 reg);
-bool pc_setregistry(struct map_session_data *sd, int64 reg, int64 val);
-char *pc_readregistry_str(struct map_session_data *sd, int64 reg);
-bool pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val);
+int pc_setstat(map_session_data* sd, int type, int val);
+int pc_need_trait_point(map_session_data *, int, int);
+int pc_maxtraitparameterincrease(map_session_data*, int);
+bool pc_traitstatusup(map_session_data*, int, int);
+int pc_traitstatusup2(map_session_data*, int, int);
+void pc_skillup(map_session_data*,uint16 skill_id);
+int pc_allskillup(map_session_data*);
+int pc_resetlvl(map_session_data*,int type);
+int pc_resetstate(map_session_data*);
+int pc_resetskill(map_session_data*, int);
+int pc_resetfeel(map_session_data*);
+int pc_resethate(map_session_data*);
+bool pc_equipitem(map_session_data *sd, short n, int req_pos, bool equipswitch=false);
+bool pc_unequipitem(map_session_data*,int,int);
+int pc_equipswitch( map_session_data* sd, int index );
+void pc_equipswitch_remove( map_session_data* sd, int index );
+void pc_checkitem(map_session_data*);
+void pc_check_available_item(map_session_data *sd, uint8 type);
+int pc_useitem(map_session_data*,int);
+
+int pc_skillatk_bonus(map_session_data *sd, uint16 skill_id);
+int pc_sub_skillatk_bonus(map_session_data *sd, uint16 skill_id);
+int pc_skillheal_bonus(map_session_data *sd, uint16 skill_id);
+int pc_skillheal2_bonus(map_session_data *sd, uint16 skill_id);
+
+void pc_damage(map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp, unsigned int ap);
+int pc_dead(map_session_data *sd,struct block_list *src);
+void pc_revive(map_session_data *sd,unsigned int hp, unsigned int sp, unsigned int ap = 0);
+bool pc_revive_item(map_session_data *sd);
+void pc_heal(map_session_data *sd,unsigned int hp,unsigned int sp, unsigned int ap, int type);
+int pc_itemheal(map_session_data *sd, t_itemid itemid, int hp,int sp);
+int pc_percentheal(map_session_data *sd,int,int);
+bool pc_jobchange(map_session_data *sd, int job, char upper);
+void pc_setoption(map_session_data *,int type, int subtype = 0);
+bool pc_setcart(map_session_data* sd, int type);
+void pc_setfalcon(map_session_data* sd, int flag);
+void pc_setriding(map_session_data* sd, int flag);
+void pc_setmadogear(map_session_data* sd, bool flag, e_mado_type type = MADO_ROBOT);
+void pc_changelook(map_session_data *,int,int);
+void pc_equiplookall(map_session_data *sd);
+void pc_set_costume_view(map_session_data *sd);
+
+int64 pc_readparam(map_session_data *sd, int64 type);
+bool pc_setparam(map_session_data *sd, int64 type, int64 val);
+int64 pc_readreg(map_session_data *sd, int64 reg);
+bool pc_setreg(map_session_data *sd, int64 reg, int64 val);
+char *pc_readregstr(map_session_data *sd, int64 reg);
+bool pc_setregstr(map_session_data *sd, int64 reg, const char *str);
+int64 pc_readregistry(map_session_data *sd, int64 reg);
+bool pc_setregistry(map_session_data *sd, int64 reg, int64 val);
+char *pc_readregistry_str(map_session_data *sd, int64 reg);
+bool pc_setregistry_str(map_session_data *sd, int64 reg, const char *val);
 
 #define pc_readglobalreg(sd,reg) pc_readregistry(sd,reg)
 #define pc_setglobalreg(sd,reg,val) pc_setregistry(sd,reg,val)
@@ -1557,30 +1557,30 @@ bool pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
 #define pc_readaccountreg2str(sd,reg) pc_readregistry_str(sd,reg)
 #define pc_setaccountreg2str(sd,reg,val) pc_setregistry_str(sd,reg,val)
 
-bool pc_setreg2(struct map_session_data *sd, const char *reg, int64 val);
-int64 pc_readreg2(struct map_session_data *sd, const char *reg);
+bool pc_setreg2(map_session_data *sd, const char *reg, int64 val);
+int64 pc_readreg2(map_session_data *sd, const char *reg);
 
-bool pc_addeventtimer(struct map_session_data *sd,int tick,const char *name);
-bool pc_deleventtimer(struct map_session_data *sd,const char *name);
-void pc_cleareventtimer(struct map_session_data *sd);
-void pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick);
+bool pc_addeventtimer(map_session_data *sd,int tick,const char *name);
+bool pc_deleventtimer(map_session_data *sd,const char *name);
+void pc_cleareventtimer(map_session_data *sd);
+void pc_addeventtimercount(map_session_data *sd,const char *name,int tick);
 
-int pc_calc_pvprank(struct map_session_data *sd);
+int pc_calc_pvprank(map_session_data *sd);
 TIMER_FUNC(pc_calc_pvprank_timer);
 
-int pc_ismarried(struct map_session_data *sd);
-bool pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd);
-bool pc_divorce(struct map_session_data *sd);
-struct map_session_data *pc_get_partner(struct map_session_data *sd);
-struct map_session_data *pc_get_father(struct map_session_data *sd);
-struct map_session_data *pc_get_mother(struct map_session_data *sd);
-struct map_session_data *pc_get_child(struct map_session_data *sd);
+int pc_ismarried(map_session_data *sd);
+bool pc_marriage(map_session_data *sd,map_session_data *dstsd);
+bool pc_divorce(map_session_data *sd);
+map_session_data *pc_get_partner(map_session_data *sd);
+map_session_data *pc_get_father(map_session_data *sd);
+map_session_data *pc_get_mother(map_session_data *sd);
+map_session_data *pc_get_child(map_session_data *sd);
 
-void pc_bleeding (struct map_session_data *sd, t_tick diff_tick);
-void pc_regen (struct map_session_data *sd, t_tick diff_tick);
+void pc_bleeding (map_session_data *sd, t_tick diff_tick);
+void pc_regen (map_session_data *sd, t_tick diff_tick);
 
-bool pc_setstand(struct map_session_data *sd, bool force);
-bool pc_candrop(struct map_session_data *sd,struct item *item);
+bool pc_setstand(map_session_data *sd, bool force);
+bool pc_candrop(map_session_data *sd,struct item *item);
 
 uint64 pc_jobid2mapid(unsigned short b_class);	// Skotlex
 int pc_mapid2jobid(uint64 class_, int sex);	// Skotlex
@@ -1628,21 +1628,21 @@ extern const struct sg_data sg_info[MAX_PC_FEELHATE];
 void pc_set_bg_queue_timer(map_session_data *sd);
 void pc_delete_bg_queue_timer(map_session_data *sd);
 
-void pc_setinvincibletimer(struct map_session_data* sd, int val);
-void pc_delinvincibletimer(struct map_session_data* sd);
+void pc_setinvincibletimer(map_session_data* sd, int val);
+void pc_delinvincibletimer(map_session_data* sd);
 
-void pc_addspiritball(struct map_session_data *sd,int interval,int max);
-void pc_delspiritball(struct map_session_data *sd,int count,int type);
+void pc_addspiritball(map_session_data *sd,int interval,int max);
+void pc_delspiritball(map_session_data *sd,int count,int type);
 int pc_addsoulball(map_session_data *sd, int max);
 int pc_delsoulball(map_session_data *sd, int count, bool type);
-void pc_addservantball( struct map_session_data& sd, int count = 1 );
-void pc_delservantball( struct map_session_data& sd, int count = 1 );
-void pc_addabyssball( struct map_session_data& sd, int count = 1 );
-void pc_delabyssball( struct map_session_data& sd, int count = 1 );
+void pc_addservantball( map_session_data& sd, int count = 1 );
+void pc_delservantball( map_session_data& sd, int count = 1 );
+void pc_addabyssball( map_session_data& sd, int count = 1 );
+void pc_delabyssball( map_session_data& sd, int count = 1 );
 
 bool pc_addfame(map_session_data &sd, int count);
 unsigned char pc_famerank(uint32 char_id, int job);
-bool pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl);
+bool pc_set_hate_mob(map_session_data *sd, int pos, struct block_list *bl);
 
 extern struct fame_list smith_fame_list[MAX_FAME_LIST];
 extern struct fame_list chemist_fame_list[MAX_FAME_LIST];
@@ -1659,48 +1659,48 @@ TIMER_FUNC(map_day_timer); // by [yor]
 TIMER_FUNC(map_night_timer); // by [yor]
 
 // Rental System
-void pc_inventory_rentals(struct map_session_data *sd);
-void pc_inventory_rental_clear(struct map_session_data *sd);
-void pc_inventory_rental_add(struct map_session_data *sd, unsigned int seconds);
+void pc_inventory_rentals(map_session_data *sd);
+void pc_inventory_rental_clear(map_session_data *sd);
+void pc_inventory_rental_add(map_session_data *sd, unsigned int seconds);
 
 int pc_read_motd(void); // [Valaris]
-int pc_disguise(struct map_session_data *sd, int class_);
-bool pc_isautolooting(struct map_session_data *sd, t_itemid nameid);
+int pc_disguise(map_session_data *sd, int class_);
+bool pc_isautolooting(map_session_data *sd, t_itemid nameid);
 
 void pc_overheat(map_session_data &sd, int16 heat);
 
-void pc_itemcd_do(struct map_session_data *sd, bool load);
-uint8 pc_itemcd_add(struct map_session_data *sd, struct item_data *id, t_tick tick, unsigned short n);
-uint8 pc_itemcd_check(struct map_session_data *sd, struct item_data *id, t_tick tick, unsigned short n);
+void pc_itemcd_do(map_session_data *sd, bool load);
+uint8 pc_itemcd_add(map_session_data *sd, struct item_data *id, t_tick tick, unsigned short n);
+uint8 pc_itemcd_check(map_session_data *sd, struct item_data *id, t_tick tick, unsigned short n);
 
-int pc_load_combo(struct map_session_data *sd);
+int pc_load_combo(map_session_data *sd);
 
-void pc_addspiritcharm(struct map_session_data *sd, int interval, int max, int type);
-void pc_delspiritcharm(struct map_session_data *sd, int count, int type);
+void pc_addspiritcharm(map_session_data *sd, int interval, int max, int type);
+void pc_delspiritcharm(map_session_data *sd, int count, int type);
 
-void pc_baselevelchanged(struct map_session_data *sd);
+void pc_baselevelchanged(map_session_data *sd);
 
-void pc_damage_log_add(struct map_session_data *sd, int id);
-void pc_damage_log_clear(struct map_session_data *sd, int id);
+void pc_damage_log_add(map_session_data *sd, int id);
+void pc_damage_log_clear(map_session_data *sd, int id);
 
 enum e_BANKING_DEPOSIT_ACK : uint8;
 enum e_BANKING_WITHDRAW_ACK : uint8;
-enum e_BANKING_DEPOSIT_ACK pc_bank_deposit(struct map_session_data *sd, int money);
-enum e_BANKING_WITHDRAW_ACK pc_bank_withdraw(struct map_session_data *sd, int money);
+enum e_BANKING_DEPOSIT_ACK pc_bank_deposit(map_session_data *sd, int money);
+enum e_BANKING_WITHDRAW_ACK pc_bank_withdraw(map_session_data *sd, int money);
 
-void pc_crimson_marker_clear(struct map_session_data *sd);
+void pc_crimson_marker_clear(map_session_data *sd);
 
-void pc_show_version(struct map_session_data *sd);
+void pc_show_version(map_session_data *sd);
 
 TIMER_FUNC(pc_bonus_script_timer);
-void pc_bonus_script(struct map_session_data *sd);
-struct s_bonus_script_entry *pc_bonus_script_add(struct map_session_data *sd, const char *script_str, t_tick dur, enum efst_type icon, uint16 flag, uint8 type);
-void pc_bonus_script_clear(struct map_session_data *sd, uint32 flag);
+void pc_bonus_script(map_session_data *sd);
+struct s_bonus_script_entry *pc_bonus_script_add(map_session_data *sd, const char *script_str, t_tick dur, enum efst_type icon, uint16 flag, uint8 type);
+void pc_bonus_script_clear(map_session_data *sd, uint32 flag);
 
-void pc_cell_basilica(struct map_session_data *sd);
+void pc_cell_basilica(map_session_data *sd);
 
-short pc_get_itemgroup_bonus(struct map_session_data* sd, t_itemid nameid, std::vector<s_item_bonus>& bonuses);
-short pc_get_itemgroup_bonus_group(struct map_session_data* sd, uint16 group_id, std::vector<s_item_bonus>& bonuses);
+short pc_get_itemgroup_bonus(map_session_data* sd, t_itemid nameid, std::vector<s_item_bonus>& bonuses);
+short pc_get_itemgroup_bonus_group(map_session_data* sd, uint16 group_id, std::vector<s_item_bonus>& bonuses);
 
 bool pc_is_same_equip_index(enum equip_index eqi, short *equip_index, short index);
 /// Check if player is Taekwon Ranker and the level is >= 90 (battle_config.taekwon_ranker_min_lv)
@@ -1708,20 +1708,20 @@ bool pc_is_same_equip_index(enum equip_index eqi, short *equip_index, short inde
 
 TIMER_FUNC(pc_autotrade_timer);
 
-void pc_validate_skill(struct map_session_data *sd);
+void pc_validate_skill(map_session_data *sd);
 
-void pc_show_questinfo(struct map_session_data *sd);
-void pc_show_questinfo_reinit(struct map_session_data *sd);
+void pc_show_questinfo(map_session_data *sd);
+void pc_show_questinfo_reinit(map_session_data *sd);
 
 bool pc_job_can_entermap(enum e_job jobid, int m, int group_lv);
 
 #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
-uint16 pc_level_penalty_mod( struct map_session_data* sd, e_penalty_type type, std::shared_ptr<s_mob_db> mob, mob_data* md = nullptr );
+uint16 pc_level_penalty_mod( map_session_data* sd, e_penalty_type type, std::shared_ptr<s_mob_db> mob, mob_data* md = nullptr );
 #endif
 
 bool pc_attendance_enabled();
-int32 pc_attendance_counter( struct map_session_data* sd );
-void pc_attendance_claim_reward( struct map_session_data* sd );
+int32 pc_attendance_counter( map_session_data* sd );
+void pc_attendance_claim_reward( map_session_data* sd );
 
 void pc_jail(map_session_data &sd, int32 duration = INT_MAX);
 

+ 3 - 3
src/map/pc_groups.cpp

@@ -9,7 +9,7 @@
 #include "../common/utilities.hpp"
 
 #include "atcommand.hpp" // AtCommandType
-#include "pc.hpp" // struct map_session_data
+#include "pc.hpp" // map_session_data
 
 using namespace rathena;
 
@@ -338,7 +338,7 @@ bool s_player_group::can_use_command( const std::string& command, AtCommandType
  * Load permission for player based on group id
  * @param sd Player
  */
-void pc_group_pc_load(struct map_session_data * sd) {
+void pc_group_pc_load(map_session_data * sd) {
 	std::shared_ptr<s_player_group> group = player_group_db.find( sd->group_id );
 
 	if( group == nullptr ){
@@ -392,7 +392,7 @@ void pc_groups_reload( void ){
 	
 	/* refresh online users permissions */
 	struct s_mapiterator* iter = mapit_getallusers();
-	for( struct map_session_data* sd = (struct map_session_data*)mapit_first(iter); mapit_exists(iter); sd = (struct map_session_data*)mapit_next(iter) ){
+	for( map_session_data* sd = (map_session_data*)mapit_first(iter); mapit_exists(iter); sd = (map_session_data*)mapit_next(iter) ){
 		pc_group_pc_load(sd);
 	}
 	mapit_free(iter);

+ 1 - 1
src/map/pc_groups.hpp

@@ -14,7 +14,7 @@
 // Forward declaration from atcommands.hpp
 enum AtCommandType : uint8;
 
-void pc_group_pc_load(struct map_session_data *sd);
+void pc_group_pc_load(class map_session_data *sd);
 void do_init_pc_groups(void);
 void do_final_pc_groups(void);
 void pc_groups_reload(void);

+ 33 - 33
src/map/pet.cpp

@@ -480,7 +480,7 @@ uint64 PetDatabase::parseBodyNode( const ryml::NodeRef& node ){
  * Clear pet support bonuses from memory
  * @param sd: Pet owner
  */
-void pet_clear_support_bonuses(struct map_session_data *sd) {
+void pet_clear_support_bonuses(map_session_data *sd) {
 	nullpo_retv(sd);
 
 	if (!sd->pd)
@@ -538,7 +538,7 @@ void pet_clear_support_bonuses(struct map_session_data *sd) {
  * @param args: va_list of arguments
  * @return 0
  */
-static int pet_reload_sub( struct map_session_data *sd, va_list args ){
+static int pet_reload_sub( map_session_data *sd, va_list args ){
 	if( sd->pd == nullptr ){
 		return 0;
 	}
@@ -637,7 +637,7 @@ void pet_set_intimate(struct pet_data *pd, int value)
 
 	pd->pet.intimate = min(value, PET_INTIMATE_MAX);
 
-	struct map_session_data *sd = pd->master;
+	map_session_data *sd = pd->master;
 
 	int index = pet_egg_search( sd, pd->pet.pet_id );
 
@@ -660,7 +660,7 @@ void pet_set_intimate(struct pet_data *pd, int value)
  * @param item_id : item ID of tamer
  * @return true:success, false:failure
  */
-bool pet_create_egg(struct map_session_data *sd, t_itemid item_id)
+bool pet_create_egg(map_session_data *sd, t_itemid item_id)
 {
 	std::shared_ptr<s_pet_db> pet = pet_db_search(item_id, PET_EGG);
 
@@ -796,7 +796,7 @@ int pet_target_check(struct pet_data *pd,struct block_list *bl,int type)
  * @param type : recovery type
  * @author [Skotlex]
  */
-int pet_sc_check(struct map_session_data *sd, int type)
+int pet_sc_check(map_session_data *sd, int type)
 {
 	struct pet_data *pd;
 
@@ -824,7 +824,7 @@ int pet_sc_check(struct map_session_data *sd, int type)
  * @return 0
  */
 static TIMER_FUNC(pet_hungry){
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct pet_data *pd;
 	int interval;
 
@@ -931,7 +931,7 @@ int pet_hungry_timer_delete(struct pet_data *pd)
  * @param pd : pet requesting
  * @return 1
  */
-static int pet_performance(struct map_session_data *sd, struct pet_data *pd)
+static int pet_performance(map_session_data *sd, struct pet_data *pd)
 {
 	int val;
 
@@ -955,7 +955,7 @@ static int pet_performance(struct map_session_data *sd, struct pet_data *pd)
  * @param pd : pet requesting
  * @return true if everything went well, false if the egg is not found in the inventory.
  */
-bool pet_return_egg( struct map_session_data *sd, struct pet_data *pd ){
+bool pet_return_egg( map_session_data *sd, struct pet_data *pd ){
 	pet_lootitem_drop(pd,sd);
 
 	int i = pet_egg_search( sd, pd->pet.pet_id );
@@ -985,7 +985,7 @@ bool pet_return_egg( struct map_session_data *sd, struct pet_data *pd ){
  * @param pet : pet requesting
  * @return True on success or false otherwise
  */
-bool pet_data_init(struct map_session_data *sd, struct s_pet *pet)
+bool pet_data_init(map_session_data *sd, struct s_pet *pet)
 {
 	struct pet_data *pd;
 	int interval = 0;
@@ -1078,7 +1078,7 @@ bool pet_data_init(struct map_session_data *sd, struct s_pet *pet)
  * @param sd : player requesting
  * @param pet : pet requesting
  */
-int pet_birth_process(struct map_session_data *sd, struct s_pet *pet)
+int pet_birth_process(map_session_data *sd, struct s_pet *pet)
 {
 	nullpo_retr(1, sd);
 
@@ -1133,7 +1133,7 @@ int pet_birth_process(struct map_session_data *sd, struct s_pet *pet)
  */
 int pet_recv_petdata(uint32 account_id,struct s_pet *p,int flag)
 {
-	struct map_session_data *sd;
+	map_session_data *sd;
 
 	sd = map_id2sd(account_id);
 
@@ -1186,7 +1186,7 @@ int pet_recv_petdata(uint32 account_id,struct s_pet *p,int flag)
  * @param egg_index : egg index value in inventory
  * @return 0
  */
-int pet_select_egg(struct map_session_data *sd,short egg_index)
+int pet_select_egg(map_session_data *sd,short egg_index)
 {
 	nullpo_ret(sd);
 
@@ -1216,7 +1216,7 @@ int pet_select_egg(struct map_session_data *sd,short egg_index)
  * @param target_class : monster ID of pet to catch
  * @return 0
  */
-int pet_catch_process1(struct map_session_data *sd,int target_class)
+int pet_catch_process1(map_session_data *sd,int target_class)
 {
 	nullpo_ret(sd);
 
@@ -1237,7 +1237,7 @@ int pet_catch_process1(struct map_session_data *sd,int target_class)
  * @param target_id : monster ID of pet to catch
  * @return 0:success, 1:failure
  */
-int pet_catch_process2(struct map_session_data* sd, int target_id)
+int pet_catch_process2(map_session_data* sd, int target_id)
 {
 	struct mob_data* md;
 	int pet_catch_rate = 0;
@@ -1293,7 +1293,7 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
 		return 1;
 	}
 
-	struct status_change* tsc = status_get_sc( &md->bl );
+	status_change* tsc = status_get_sc( &md->bl );
 
 	if( battle_config.pet_hide_check && tsc && ( tsc->getSCE(SC_HIDING) || tsc->getSCE(SC_CLOAKING) || tsc->getSCE(SC_CAMOUFLAGE) || tsc->getSCE(SC_NEWMOON) || tsc->getSCE(SC_CLOAKINGEXCEED) ) ){
 		clif_pet_roulette( sd, 0 );
@@ -1341,7 +1341,7 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
  * @return true : success, false : failure
  **/
 bool pet_get_egg(uint32 account_id, short pet_class, int pet_id ) {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct item tmp_item;
 	int ret = 0;
 
@@ -1384,7 +1384,7 @@ bool pet_get_egg(uint32 account_id, short pet_class, int pet_id ) {
 	return true;
 }
 
-static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd);
+static int pet_unequipitem(map_session_data *sd, struct pet_data *pd);
 static int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap);
 
 /**
@@ -1393,7 +1393,7 @@ static int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap);
  * @param menunum : menu option chosen
  * @return 0:success, 1:failure
  */
-int pet_menu(struct map_session_data *sd,int menunum)
+int pet_menu(map_session_data *sd,int menunum)
 {
 	nullpo_ret(sd);
 
@@ -1431,7 +1431,7 @@ int pet_menu(struct map_session_data *sd,int menunum)
  * @param name : new pet name
  * @return 0:success, 1:failure
  */
-int pet_change_name(struct map_session_data *sd,char *name)
+int pet_change_name(map_session_data *sd,char *name)
 {
 	int i;
 	struct pet_data *pd;
@@ -1458,7 +1458,7 @@ int pet_change_name(struct map_session_data *sd,char *name)
  * @param flag : 1:cannot use this name
  * @return 1:success, 0:failure
  */
-int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
+int pet_change_name_ack(map_session_data *sd, char* name, int flag)
 {
 	struct pet_data *pd = sd->pd;
 
@@ -1494,7 +1494,7 @@ int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
  * @param index : index value of item
  * @return 0:success, 1:failure
  */
-int pet_equipitem(struct map_session_data *sd,int index)
+int pet_equipitem(map_session_data *sd,int index)
 {
 	struct pet_data *pd;
 
@@ -1546,7 +1546,7 @@ int pet_equipitem(struct map_session_data *sd,int index)
  * @param pd : pet requesting
  * @return 0:success, 1:failure
  */
-static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd)
+static int pet_unequipitem(map_session_data *sd, struct pet_data *pd)
 {
 	struct item tmp_item;
 	unsigned char flag = 0;
@@ -1596,7 +1596,7 @@ static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd)
  * @param pd : pet requesting
  * @return 0:success, 1:failure
  */
-int pet_food(struct map_session_data *sd, struct pet_data *pd)
+int pet_food(map_session_data *sd, struct pet_data *pd)
 {
 	nullpo_retr(1, sd);
 	nullpo_retr(1, pd);
@@ -1717,7 +1717,7 @@ static int pet_randomwalk(struct pet_data *pd,t_tick tick)
  * @param tick : last support time
  * @return 0
  */
-static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, t_tick tick)
+static int pet_ai_sub_hard(struct pet_data *pd, map_session_data *sd, t_tick tick)
 {
 	struct block_list *target = NULL;
 
@@ -1847,7 +1847,7 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, t_t
  *   tick : last search time
  * @return 0
  */
-static int pet_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
+static int pet_ai_sub_foreachclient(map_session_data *sd,va_list ap)
 {
 	t_tick tick = va_arg(ap,t_tick);
 
@@ -1942,7 +1942,7 @@ static TIMER_FUNC(pet_delay_item_drop){
  * @param sd : player requesting
  * @return 1:success, 0:failure
  */
-int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd)
+int pet_lootitem_drop(struct pet_data *pd,map_session_data *sd)
 {
 	int i;
 	struct item_drop_list *dlist;
@@ -2005,7 +2005,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd)
  * @author [Valaris], rewritten by [Skotlex]
  */
 TIMER_FUNC(pet_skill_bonus_timer){
-	struct map_session_data *sd = map_id2sd(id);
+	map_session_data *sd = map_id2sd(id);
 	struct pet_data *pd;
 	int bonus;
 	int timer = 0;
@@ -2053,7 +2053,7 @@ TIMER_FUNC(pet_skill_bonus_timer){
  * @author [Valaris], rewritten by [Skotlex]
  */
 TIMER_FUNC(pet_recovery_timer){
-	struct map_session_data *sd = map_id2sd(id);
+	map_session_data *sd = map_id2sd(id);
 	struct pet_data *pd;
 
 	if(sd == NULL || sd->pd == NULL || sd->pd->recovery == NULL)
@@ -2085,7 +2085,7 @@ TIMER_FUNC(pet_recovery_timer){
  * @param id : ID of pet owner
  */
 TIMER_FUNC(pet_heal_timer){
-	struct map_session_data *sd = map_id2sd(id);
+	map_session_data *sd = map_id2sd(id);
 	struct status_data *status;
 	struct pet_data *pd;
 	unsigned int rate = 100;
@@ -2128,7 +2128,7 @@ TIMER_FUNC(pet_heal_timer){
  * @author [Skotlex]
  */
 TIMER_FUNC(pet_skill_support_timer){
-	struct map_session_data *sd = map_id2sd(id);
+	map_session_data *sd = map_id2sd(id);
 	struct pet_data *pd;
 	struct status_data *status;
 	short rate = 100;
@@ -2177,7 +2177,7 @@ TIMER_FUNC(pet_skill_support_timer){
  * @param pet_id : pet ID of the pet
  * @return index of egg in player's inventory or -1 if the egg is not found.
  */
-int pet_egg_search(struct map_session_data* sd, int pet_id) {
+int pet_egg_search(map_session_data* sd, int pet_id) {
 	for (int i = 0; i < MAX_INVENTORY; i++) {
 		if (sd->inventory.u.items_inventory[i].card[0] == CARD0_PET &&
 			pet_id == MakeDWord(sd->inventory.u.items_inventory[i].card[1], sd->inventory.u.items_inventory[i].card[2]))
@@ -2192,7 +2192,7 @@ int pet_egg_search(struct map_session_data* sd, int pet_id) {
  * @param pet_id: Pet's database ID
  * @return True on success or false otherwise
  */
-bool pet_evolution_requirements_check(struct map_session_data *sd, short pet_id) {
+bool pet_evolution_requirements_check(map_session_data *sd, short pet_id) {
 	nullpo_retr(false, sd);
 
 	if (sd->pd == nullptr)
@@ -2224,7 +2224,7 @@ bool pet_evolution_requirements_check(struct map_session_data *sd, short pet_id)
  * @param sd: Player requesting the evolution
  * @param pet_id: Pet's database ID
  */
-void pet_evolution(struct map_session_data *sd, int16 pet_id) {
+void pet_evolution(map_session_data *sd, int16 pet_id) {
 	nullpo_retv(sd);
 
 	if (sd->pd == nullptr) {

+ 18 - 18
src/map/pet.hpp

@@ -204,7 +204,7 @@ struct pet_data {
 	std::vector<std::shared_ptr<s_petautobonus>> autobonus, autobonus2, autobonus3;
 
 	int masterteleport_timer;
-	struct map_session_data *master;
+	map_session_data *master;
 
 	std::shared_ptr<s_pet_db> get_pet_db() {
 		return pet_db.find(this->pet.class_);
@@ -223,36 +223,36 @@ struct pet_data {
 	}
 };
 
-bool pet_create_egg(struct map_session_data *sd, t_itemid item_id);
+bool pet_create_egg(map_session_data *sd, t_itemid item_id);
 int pet_hungry_val(struct pet_data *pd);
 void pet_set_intimate(struct pet_data *pd, int value);
 int pet_target_check(struct pet_data *pd,struct block_list *bl,int type);
 void pet_unlocktarget(struct pet_data *pd);
-int pet_sc_check(struct map_session_data *sd, int type); //Skotlex
+int pet_sc_check(map_session_data *sd, int type); //Skotlex
 std::shared_ptr<s_pet_db> pet_db_search(int key, enum e_pet_itemtype type);
 int pet_hungry_timer_delete(struct pet_data *pd);
-bool pet_data_init(struct map_session_data *sd, struct s_pet *pet);
-bool pet_return_egg( struct map_session_data *sd, struct pet_data *pd );
-int pet_birth_process(struct map_session_data *sd, struct s_pet *pet);
+bool pet_data_init(map_session_data *sd, struct s_pet *pet);
+bool pet_return_egg( map_session_data *sd, struct pet_data *pd );
+int pet_birth_process(map_session_data *sd, struct s_pet *pet);
 int pet_recv_petdata(uint32 account_id,struct s_pet *p,int flag);
-int pet_select_egg(struct map_session_data *sd,short egg_index);
-int pet_catch_process1(struct map_session_data *sd,int target_class);
-int pet_catch_process2(struct map_session_data *sd,int target_id);
+int pet_select_egg(map_session_data *sd,short egg_index);
+int pet_catch_process1(map_session_data *sd,int target_class);
+int pet_catch_process2(map_session_data *sd,int target_id);
 bool pet_get_egg(uint32 account_id, short pet_class, int pet_id);
-int pet_menu(struct map_session_data *sd,int menunum);
-int pet_change_name(struct map_session_data *sd,char *name);
-int pet_change_name_ack(struct map_session_data *sd, char* name, int flag);
-int pet_equipitem(struct map_session_data *sd,int index);
-int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd);
+int pet_menu(map_session_data *sd,int menunum);
+int pet_change_name(map_session_data *sd,char *name);
+int pet_change_name_ack(map_session_data *sd, char* name, int flag);
+int pet_equipitem(map_session_data *sd,int index);
+int pet_lootitem_drop(struct pet_data *pd,map_session_data *sd);
 int pet_attackskill(struct pet_data *pd, int target_id);
 TIMER_FUNC(pet_skill_support_timer); // [Skotlex]
 TIMER_FUNC(pet_skill_bonus_timer); // [Valaris]
 TIMER_FUNC(pet_recovery_timer); // [Valaris]
 TIMER_FUNC(pet_heal_timer); // [Valaris]
-int pet_egg_search(struct map_session_data *sd, int pet_id);
-void pet_evolution(struct map_session_data *sd, int16 pet_id);
-int pet_food(struct map_session_data *sd, struct pet_data *pd);
-void pet_clear_support_bonuses(struct map_session_data *sd);
+int pet_egg_search(map_session_data *sd, int pet_id);
+void pet_evolution(map_session_data *sd, int16 pet_id);
+int pet_food(map_session_data *sd, struct pet_data *pd);
+void pet_clear_support_bonuses(map_session_data *sd);
 
 #define pet_stop_walking(pd, type) unit_stop_walking(&(pd)->bl, type)
 #define pet_stop_attack(pd) unit_stop_attack(&(pd)->bl)

+ 9 - 9
src/map/quest.cpp

@@ -501,7 +501,7 @@ std::shared_ptr<s_quest_db> quest_search(int quest_id)
  * @param sd : Player's data
  * @return 0 in case of success, nonzero otherwise (i.e. the player has no quests)
  */
-int quest_pc_login(struct map_session_data *sd)
+int quest_pc_login(map_session_data *sd)
 {
 	if (!sd->avail_quests)
 		return 1;
@@ -552,7 +552,7 @@ static time_t quest_time(std::shared_ptr<s_quest_db> qi)
  * @param quest_id : ID of the quest to add.
  * @return 0 in case of success, nonzero otherwise
  */
-int quest_add(struct map_session_data *sd, int quest_id)
+int quest_add(map_session_data *sd, int quest_id)
 {
 	std::shared_ptr<s_quest_db> qi = quest_search(quest_id);
 
@@ -598,7 +598,7 @@ int quest_add(struct map_session_data *sd, int quest_id)
  * @param qid2 : New quest to add
  * @return 0 in case of success, nonzero otherwise
  */
-int quest_change(struct map_session_data *sd, int qid1, int qid2)
+int quest_change(map_session_data *sd, int qid1, int qid2)
 {
 	std::shared_ptr<s_quest_db> qi = quest_search(qid2);
 
@@ -647,7 +647,7 @@ int quest_change(struct map_session_data *sd, int qid1, int qid2)
  * @param quest_id : ID of the quest to remove
  * @return 0 in case of success, nonzero otherwise
  */
-int quest_delete(struct map_session_data *sd, int quest_id)
+int quest_delete(map_session_data *sd, int quest_id)
 {
 	int i;
 
@@ -695,7 +695,7 @@ int quest_update_objective_sub(struct block_list *bl, va_list ap)
 {
 	nullpo_ret(bl);
 
-	struct map_session_data *sd = BL_CAST(BL_PC, bl);
+	map_session_data *sd = BL_CAST(BL_PC, bl);
 
 	nullpo_ret(sd);
 
@@ -719,7 +719,7 @@ int quest_update_objective_sub(struct block_list *bl, va_list ap)
  * @param mob_size: Monster Size
  * @param mob_element: Monster Element
  */
-void quest_update_objective(struct map_session_data *sd, struct mob_data* md)
+void quest_update_objective(map_session_data *sd, struct mob_data* md)
 {
 	nullpo_retv(sd);
 
@@ -811,7 +811,7 @@ void quest_update_objective(struct map_session_data *sd, struct mob_data* md)
  * @return 0 in case of success, nonzero otherwise
  * @author [Inkfish]
  */
-int quest_update_status(struct map_session_data *sd, int quest_id, e_quest_state status)
+int quest_update_status(map_session_data *sd, int quest_id, e_quest_state status)
 {
 	int i;
 
@@ -860,7 +860,7 @@ int quest_update_status(struct map_session_data *sd, int quest_id, e_quest_state
  *              1 if the quest's timeout has expired
  *              0 otherwise
  */
-int quest_check(struct map_session_data *sd, int quest_id, e_quest_check_type type)
+int quest_check(map_session_data *sd, int quest_id, e_quest_check_type type)
 {
 	int i;
 
@@ -902,7 +902,7 @@ int quest_check(struct map_session_data *sd, int quest_id, e_quest_check_type ty
  * @param sd : Character's data
  * @param ap : Ignored
  */
-static int quest_reload_check_sub(struct map_session_data *sd, va_list ap)
+static int quest_reload_check_sub(map_session_data *sd, va_list ap)
 {
 	nullpo_ret(sd);
 

+ 8 - 8
src/map/quest.hpp

@@ -12,7 +12,7 @@
 
 #include "map.hpp"
 
-struct map_session_data;
+class map_session_data;
 enum e_size : uint8;
 
 struct s_quest_dropitem {
@@ -69,15 +69,15 @@ public:
 
 extern QuestDatabase quest_db;
 
-int quest_pc_login(struct map_session_data *sd);
+int quest_pc_login(map_session_data *sd);
 
-int quest_add(struct map_session_data *sd, int quest_id);
-int quest_delete(struct map_session_data *sd, int quest_id);
-int quest_change(struct map_session_data *sd, int qid1, int qid2);
+int quest_add(map_session_data *sd, int quest_id);
+int quest_delete(map_session_data *sd, int quest_id);
+int quest_change(map_session_data *sd, int qid1, int qid2);
 int quest_update_objective_sub(struct block_list *bl, va_list ap);
-void quest_update_objective(struct map_session_data *sd, struct mob_data* md);
-int quest_update_status(struct map_session_data *sd, int quest_id, e_quest_state status);
-int quest_check(struct map_session_data *sd, int quest_id, e_quest_check_type type);
+void quest_update_objective(map_session_data *sd, struct mob_data* md);
+int quest_update_status(map_session_data *sd, int quest_id, e_quest_state status);
+int quest_check(map_session_data *sd, int quest_id, e_quest_check_type type);
 
 std::shared_ptr<s_quest_db> quest_search(int quest_id);
 

文件差異過大導致無法顯示
+ 113 - 113
src/map/script.cpp


+ 15 - 15
src/map/script.hpp

@@ -140,7 +140,7 @@ enum script_cmd_result {
 #define SCRIPT_BLOCK_SIZE 512
 enum e_labelType { LABEL_NEXTLINE = 1, LABEL_START };
 
-struct map_session_data;
+class map_session_data;
 struct eri;
 
 extern int potion_flag; //For use on Alchemist improved potions/Potion Pitcher. [Skotlex]
@@ -2147,10 +2147,10 @@ bool is_number(const char *p);
 struct script_code* parse_script(const char* src,const char* file,int line,int options);
 void run_script(struct script_code *rootscript,int pos,int rid,int oid);
 
-bool set_reg_num(struct script_state* st, struct map_session_data* sd, int64 num, const char* name, const int64 value, struct reg_db *ref);
-bool set_reg_str(struct script_state* st, struct map_session_data* sd, int64 num, const char* name, const char* value, struct reg_db* ref);
-bool set_var_str(struct map_session_data *sd, const char* name, const char* val);
-bool clear_reg( struct script_state* st, struct map_session_data* sd, int64 num, const char* name, struct reg_db *ref );
+bool set_reg_num(struct script_state* st, map_session_data* sd, int64 num, const char* name, const int64 value, struct reg_db *ref);
+bool set_reg_str(struct script_state* st, map_session_data* sd, int64 num, const char* name, const char* value, struct reg_db* ref);
+bool set_var_str(map_session_data *sd, const char* name, const char* val);
+bool clear_reg( struct script_state* st, map_session_data* sd, int64 num, const char* name, struct reg_db *ref );
 int64 conv_num64(struct script_state *st, struct script_data *data);
 int conv_num(struct script_state *st, struct script_data *data);
 const char* conv_str(struct script_state *st,struct script_data *data);
@@ -2170,7 +2170,7 @@ void script_free_state(struct script_state* st);
 
 struct DBMap* script_get_label_db(void);
 struct DBMap* script_get_userfunc_db(void);
-void script_run_autobonus(const char *autobonus, struct map_session_data *sd, unsigned int pos);
+void script_run_autobonus(const char *autobonus, map_session_data *sd, unsigned int pos);
 void script_run_petautobonus(const std::string &autobonus, map_session_data &sd);
 
 const char* script_get_constant_str(const char* prefix, int64 value);
@@ -2180,8 +2180,8 @@ void script_set_constant_(const char* name, int64 value, const char* constant_na
 #define script_set_constant(name, value, isparameter, deprecated) script_set_constant_(name, value, NULL, isparameter, deprecated)
 void script_hardcoded_constants(void);
 
-void script_cleararray_pc(struct map_session_data* sd, const char* varname);
-void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32 idx, int64 value, int* refcache);
+void script_cleararray_pc(map_session_data* sd, const char* varname);
+void script_setarray_pc(map_session_data* sd, const char* varname, uint32 idx, int64 value, int* refcache);
 
 int script_config_read(const char *cfgName);
 void do_init_script(void);
@@ -2190,23 +2190,23 @@ int add_str(const char* p);
 const char* get_str(int id);
 void script_reload(void);
 
-void setd_sub_num( struct script_state* st, struct map_session_data* sd, const char* varname, int elem, int64 value, struct reg_db* ref );
-void setd_sub_str( struct script_state* st, struct map_session_data* sd, const char* varname, int elem, const char* value, struct reg_db* ref );
+void setd_sub_num( struct script_state* st, map_session_data* sd, const char* varname, int elem, int64 value, struct reg_db* ref );
+void setd_sub_str( struct script_state* st, map_session_data* sd, const char* varname, int elem, const char* value, struct reg_db* ref );
 
 /**
  * Array Handling
  **/
-struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+struct reg_db *script_array_src(struct script_state *st, map_session_data *sd, const char *name, struct reg_db *ref);
 void script_array_update(struct reg_db *src, int64 num, bool empty);
 void script_array_delete(struct reg_db *src, struct script_array *sa);
 void script_array_remove_member(struct reg_db *src, struct script_array *sa, unsigned int idx);
 void script_array_add_member(struct script_array *sa, unsigned int idx);
-unsigned int script_array_size(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
-unsigned int script_array_highest_key(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
-void script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref);
+unsigned int script_array_size(struct script_state *st, map_session_data *sd, const char *name, struct reg_db *ref);
+unsigned int script_array_highest_key(struct script_state *st, map_session_data *sd, const char *name, struct reg_db *ref);
+void script_array_ensure_zero(struct script_state *st, map_session_data *sd, int64 uid, struct reg_db *ref);
 int script_free_array_db(DBKey key, DBData *data, va_list ap);
 /* */
-void script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct script_reg_state *data);
+void script_reg_destroy_single(map_session_data *sd, int64 reg, struct script_reg_state *data);
 int script_reg_destroy(DBKey key, DBData *data, va_list ap);
 /* */
 void script_generic_ui_array_expand(unsigned int plus);

+ 17 - 17
src/map/searchstore.cpp

@@ -10,7 +10,7 @@
 
 #include "battle.hpp"  // battle_config.*
 #include "clif.hpp"  // clif_open_search_store_info, clif_search_store_info_*
-#include "pc.hpp"  // struct map_session_data
+#include "pc.hpp"  // map_session_data
 
 /// Failure constants for clif functions
 enum e_searchstore_failure
@@ -38,8 +38,8 @@ enum e_searchstore_effecttype
 };
 
 /// Type for shop search function
-typedef bool (*searchstore_search_t)(struct map_session_data* sd, t_itemid nameid);
-typedef bool (*searchstore_searchall_t)(struct map_session_data* sd, const struct s_search_store_search* s);
+typedef bool (*searchstore_search_t)(map_session_data* sd, t_itemid nameid);
+typedef bool (*searchstore_searchall_t)(map_session_data* sd, const struct s_search_store_search* s);
 
 /**
  * Retrieves search function by type.
@@ -77,7 +77,7 @@ static searchstore_searchall_t searchstore_getsearchallfunc(unsigned char type)
  * @param type : type of search to conduct
  * @return : store type
  */
-static bool searchstore_hasstore(struct map_session_data* sd, unsigned char type)
+static bool searchstore_hasstore(map_session_data* sd, unsigned char type)
 {
 	switch( type ) {
 		case SEARCHTYPE_VENDING:      return sd->state.vending;
@@ -93,7 +93,7 @@ static bool searchstore_hasstore(struct map_session_data* sd, unsigned char type
  * @param type : type of search to conduct
  * @return : store ID
  */
-static int searchstore_getstoreid(struct map_session_data* sd, unsigned char type)
+static int searchstore_getstoreid(map_session_data* sd, unsigned char type)
 {
 	switch( type ) {
 		case SEARCHTYPE_VENDING:      return sd->vender_id;
@@ -110,7 +110,7 @@ static int searchstore_getstoreid(struct map_session_data* sd, unsigned char typ
  * @param effect : shop type
  * @return : true : opened, false : failed to open
  */
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect)
+bool searchstore_open(map_session_data* sd, unsigned int uses, unsigned short effect)
 {
 	if( !battle_config.feature_search_stores || sd->searchstore.open )
 		return false;
@@ -138,10 +138,10 @@ bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned s
  * @param cardlist : list with stored cards (cards attached to items)
  * @param card_count : amount of items in cardlist
  */
-void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const struct PACKET_CZ_SEARCH_STORE_INFO_item* itemlist, unsigned int item_count, const struct PACKET_CZ_SEARCH_STORE_INFO_item* cardlist, unsigned int card_count)
+void searchstore_query(map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const struct PACKET_CZ_SEARCH_STORE_INFO_item* itemlist, unsigned int item_count, const struct PACKET_CZ_SEARCH_STORE_INFO_item* cardlist, unsigned int card_count)
 {
 	unsigned int i;
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	struct DBIterator *iter;
 	struct s_search_store_search s;
 	searchstore_searchall_t store_searchall;
@@ -206,7 +206,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
 	s.max_price  = max_price;
 	iter         = db_iterator((type == SEARCHTYPE_VENDING) ? vending_getdb() : buyingstore_getdb());
 
-	for( pl_sd = (struct map_session_data*)dbi_first(iter); dbi_exists(iter);  pl_sd = (struct map_session_data*)dbi_next(iter) ) {
+	for( pl_sd = (map_session_data*)dbi_first(iter); dbi_exists(iter);  pl_sd = (map_session_data*)dbi_next(iter) ) {
 		if( sd == pl_sd ) // skip own shop, if any
 			continue;
 
@@ -241,7 +241,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
  * @param sd : player requesting
  * @return : true : more items to search, false : no more items
  */
-bool searchstore_querynext(struct map_session_data* sd)
+bool searchstore_querynext(map_session_data* sd)
 {
 	if( !sd->searchstore.items.empty() && ( sd->searchstore.items.size()-1 )/SEARCHSTORE_RESULTS_PER_PAGE > sd->searchstore.pages )
 		return true;
@@ -253,7 +253,7 @@ bool searchstore_querynext(struct map_session_data* sd)
  * Get and display the results for the next page.
  * @param sd : player requesting
  */
-void searchstore_next(struct map_session_data* sd)
+void searchstore_next(map_session_data* sd)
 {
 	if( !battle_config.feature_search_stores || !sd->searchstore.open || sd->searchstore.items.size() <= sd->searchstore.pages*SEARCHSTORE_RESULTS_PER_PAGE ) // nothing (more) to display
 		return;
@@ -269,7 +269,7 @@ void searchstore_next(struct map_session_data* sd)
  * Prepare to clear information for closing of window.
  * @param sd : player requesting
  */
-void searchstore_clear(struct map_session_data* sd)
+void searchstore_clear(map_session_data* sd)
 {
 	searchstore_clearremote(sd);
 
@@ -281,7 +281,7 @@ void searchstore_clear(struct map_session_data* sd)
  * Close the Search Store window.
  * @param sd : player requesting
  */
-void searchstore_close(struct map_session_data* sd)
+void searchstore_close(map_session_data* sd)
 {
 	if( sd->searchstore.open ) {
 		searchstore_clear(sd);
@@ -298,10 +298,10 @@ void searchstore_close(struct map_session_data* sd)
  * @param store_id : store ID created by client
  * @param nameid : item being searched
  */
-void searchstore_click(struct map_session_data* sd, uint32 account_id, int store_id, t_itemid nameid)
+void searchstore_click(map_session_data* sd, uint32 account_id, int store_id, t_itemid nameid)
 {
 	unsigned int i;
-	struct map_session_data* pl_sd;
+	map_session_data* pl_sd;
 	searchstore_search_t store_search;
 
 	if( !battle_config.feature_search_stores || !sd->searchstore.open || sd->searchstore.items.empty() )
@@ -363,7 +363,7 @@ void searchstore_click(struct map_session_data* sd, uint32 account_id, int store
  * @param account_id : account ID of owner's shop
  * @return : true : shop opened, false : shop not opened
  */
-bool searchstore_queryremote(struct map_session_data* sd, uint32 account_id)
+bool searchstore_queryremote(map_session_data* sd, uint32 account_id)
 {
 	return (bool)( sd->searchstore.open && !sd->searchstore.items.empty() && sd->searchstore.remote_id == account_id );
 }
@@ -372,7 +372,7 @@ bool searchstore_queryremote(struct map_session_data* sd, uint32 account_id)
  * Removes range-check bypassing for remotely opened stores.
  * @param sd : player requesting
  */
-void searchstore_clearremote(struct map_session_data* sd)
+void searchstore_clearremote(map_session_data* sd)
 {
 	sd->searchstore.remote_id = 0;
 }

+ 10 - 10
src/map/searchstore.hpp

@@ -17,7 +17,7 @@
 
 /// information about the search being performed
 struct s_search_store_search {
-	struct map_session_data* search_sd;  // sd of the searching player
+	map_session_data* search_sd;  // sd of the searching player
 	const struct PACKET_CZ_SEARCH_STORE_INFO_item* itemlist;
 	const struct PACKET_CZ_SEARCH_STORE_INFO_item* cardlist;
 	unsigned int item_count;
@@ -49,14 +49,14 @@ struct s_search_store_info {
 	bool open;
 };
 
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect);
-void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const struct PACKET_CZ_SEARCH_STORE_INFO_item* itemlist, unsigned int item_count, const struct PACKET_CZ_SEARCH_STORE_INFO_item* cardlist, unsigned int card_count);
-bool searchstore_querynext(struct map_session_data* sd);
-void searchstore_next(struct map_session_data* sd);
-void searchstore_clear(struct map_session_data* sd);
-void searchstore_close(struct map_session_data* sd);
-void searchstore_click(struct map_session_data* sd, uint32 account_id, int store_id, t_itemid nameid);
-bool searchstore_queryremote(struct map_session_data* sd, uint32 account_id);
-void searchstore_clearremote(struct map_session_data* sd);
+bool searchstore_open(map_session_data* sd, unsigned int uses, unsigned short effect);
+void searchstore_query(map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const struct PACKET_CZ_SEARCH_STORE_INFO_item* itemlist, unsigned int item_count, const struct PACKET_CZ_SEARCH_STORE_INFO_item* cardlist, unsigned int card_count);
+bool searchstore_querynext(map_session_data* sd);
+void searchstore_next(map_session_data* sd);
+void searchstore_clear(map_session_data* sd);
+void searchstore_close(map_session_data* sd);
+void searchstore_click(map_session_data* sd, uint32 account_id, int store_id, t_itemid nameid);
+bool searchstore_queryremote(map_session_data* sd, uint32 account_id);
+void searchstore_clearremote(map_session_data* sd);
 
 #endif /* SEARCHSTORE_HPP */

+ 125 - 125
src/map/skill.cpp

@@ -102,7 +102,7 @@ static int skill_check_unit_range (struct block_list *bl, int x, int y, uint16 s
 static int skill_check_unit_range2 (struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv, bool isNearNPC);
 static int skill_destroy_trap( struct block_list *bl, va_list ap );
 static int skill_check_condition_mob_master_sub (struct block_list *bl, va_list ap);
-static bool skill_check_condition_sc_required(struct map_session_data *sd, unsigned short skill_id, struct s_skill_condition *require);
+static bool skill_check_condition_sc_required(map_session_data *sd, unsigned short skill_id, struct s_skill_condition *require);
 static bool skill_check_unit_movepos(uint8 check_flag, struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
 
 // Use this function for splash skills that can't hit icewall when cast by players
@@ -481,7 +481,7 @@ bool skill_pos_maxcount_check(struct block_list *src, int16 x, int16 y, uint16 s
 		return false;
 
 	struct unit_data *ud = unit_bl2ud(src);
-	struct map_session_data *sd = map_id2sd(src->id);
+	map_session_data *sd = map_id2sd(src->id);
 	int maxcount = 0;
 	std::shared_ptr<s_skill_db> skill = skill_db.find(skill_id);
 
@@ -523,9 +523,9 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
 	int hp_bonus = 0;
 	double global_bonus = 1;
 #endif
-	struct map_session_data *sd = BL_CAST(BL_PC, src);
-	struct map_session_data *tsd = BL_CAST(BL_PC, target);
-	struct status_change *sc, *tsc;
+	map_session_data *sd = BL_CAST(BL_PC, src);
+	map_session_data *tsd = BL_CAST(BL_PC, target);
+	status_change *sc, *tsc;
 
 	sc = status_get_sc(src);
 	tsc = status_get_sc(target);
@@ -799,7 +799,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
  * @return 0 - Cannot be copied; 1 - Can be copied by Plagiarism 2 - Can be copied by Reproduce
  * @author Aru - for previous check; Jobbie for class restriction idea; Cydh expands the copyable skill
  */
-int8 skill_isCopyable(struct map_session_data *sd, uint16 skill_id) {
+int8 skill_isCopyable(map_session_data *sd, uint16 skill_id) {
 	uint16 skill_idx = skill_get_index(skill_id);
 
 	if (!skill_idx)
@@ -830,7 +830,7 @@ int8 skill_isCopyable(struct map_session_data *sd, uint16 skill_id) {
  * @return true: Skill cannot be used, false: otherwise
  * @author [MouseJstr]
  */
-bool skill_isNotOk(uint16 skill_id, struct map_session_data *sd)
+bool skill_isNotOk(uint16 skill_id, map_session_data *sd)
 {
 	nullpo_retr(1,sd);
 
@@ -1002,8 +1002,8 @@ bool skill_isNotOk(uint16 skill_id, struct map_session_data *sd)
  */
 bool skill_isNotOk_hom(struct homun_data *hd, uint16 skill_id, uint16 skill_lv)
 {
-	struct map_session_data *sd = NULL;
-	struct status_change *sc;
+	map_session_data *sd = NULL;
+	status_change *sc;
 	int8 spiritball = 0;
 
 	nullpo_retr(true, hd);
@@ -1210,10 +1210,10 @@ static int skill_area_temp[8];
  *------------------------------------------*/
 int skill_additional_effect(struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, enum damage_lv dmg_lv, t_tick tick)
 {
-	struct map_session_data *sd, *dstsd;
+	map_session_data *sd, *dstsd;
 	struct mob_data *md, *dstmd;
 	struct status_data *sstatus, *tstatus;
-	struct status_change *sc, *tsc;
+	status_change *sc, *tsc;
 	int skill;
 	int rate;
 
@@ -2415,7 +2415,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
 	return 0;
 }
 
-int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint16 skill_id, t_tick tick) {
+int skill_onskillusage(map_session_data *sd, struct block_list *bl, uint16 skill_id, t_tick tick) {
 	if( sd == nullptr || !skill_id )
 		return 0;
 
@@ -2524,8 +2524,8 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1
 int skill_counter_additional_effect (struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, t_tick tick)
 {
 	int rate;
-	struct map_session_data *sd=NULL;
-	struct map_session_data *dstsd=NULL;
+	map_session_data *sd=NULL;
+	map_session_data *dstsd=NULL;
 
 	nullpo_ret(src);
 	nullpo_ret(bl);
@@ -2636,7 +2636,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 			sp += sd->bonus.magic_sp_gain_value;
 			hp += sd->bonus.magic_hp_gain_value;
 			if( skill_id == WZ_WATERBALL ) {//(bugreport:5303)
-				struct status_change *sc = NULL;
+				status_change *sc = NULL;
 				if( ( sc = status_get_sc(src) ) ) {
 					if(sc->getSCE(SC_SPIRIT) &&
 								sc->getSCE(SC_SPIRIT)->val2 == SL_WIZARD &&
@@ -2651,7 +2651,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 	}
 
 	if (dstsd && !status_isdead(bl) && !(skill_id && skill_get_nk(skill_id, NK_NODAMAGE))) {
-		struct status_change *sc = status_get_sc(bl);
+		status_change *sc = status_get_sc(bl);
 
 		if (sc && sc->getSCE(SC_DORAM_SVSP) && attack_type&(BF_MAGIC|BF_LONG))
 			skill_castend_damage_id(bl, src, SU_SV_STEMSPEAR, (pc_checkskill(dstsd, SU_SV_STEMSPEAR) ? pc_checkskill(dstsd, SU_SV_STEMSPEAR) : 1), tick, 0);
@@ -2783,7 +2783,7 @@ int skill_break_equip(struct block_list *src, struct block_list *bl, unsigned sh
 	const int where_list[6]     = { EQP_WEAPON, EQP_ARMOR, EQP_SHIELD, EQP_HELM, EQP_ACC, EQP_SHADOW_GEAR };
 	const enum sc_type scatk[6] = { SC_STRIPWEAPON, SC_STRIPARMOR, SC_STRIPSHIELD, SC_STRIPHELM, SC__STRIPACCESSORY, SC_SHADOW_STRIP };
 	const enum sc_type scdef[6] = { SC_CP_WEAPON, SC_CP_ARMOR, SC_CP_SHIELD, SC_CP_HELM, SC_NONE, SC_PROTECTSHADOWEQUIP };
-	struct status_change *sc = status_get_sc(bl);
+	status_change *sc = status_get_sc(bl);
 	int i;
 	TBL_PC *sd;
 	sd = BL_CAST(BL_PC, bl);
@@ -2909,7 +2909,7 @@ bool skill_strip_equip(struct block_list *src, struct block_list *target, uint16
 	nullpo_retr(false, src);
 	nullpo_retr(false, target);
 
-	struct status_change *tsc = status_get_sc(target);
+	status_change *tsc = status_get_sc(target);
 
 	if (!tsc || tsc->option&OPTION_MADOGEAR) // Mado Gear cannot be divested [Ind]
 		return false;
@@ -3050,7 +3050,7 @@ short skill_blown(struct block_list* src, struct block_list* target, char count,
 {
 	int dx = 0, dy = 0;
 	uint8 checkflag = 0;
-	struct status_change *tsc = status_get_sc(target);
+	status_change *tsc = status_get_sc(target);
 	enum e_unit_blown reason = UB_KNOCKABLE;
 
 	nullpo_ret(src);
@@ -3106,8 +3106,8 @@ short skill_blown(struct block_list* src, struct block_list* target, char count,
 //		2 - SL_KAITE reflection
 static int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type)
 {
-	struct status_change *sc = status_get_sc(bl);
-	struct map_session_data* sd = BL_CAST(BL_PC, bl);
+	status_change *sc = status_get_sc(bl);
+	map_session_data* sd = BL_CAST(BL_PC, bl);
 
 	// Deadly Projection null's all magic reflection.
 	if (sc && sc->getSCE(SC_DEADLY_DEFEASANCE))
@@ -3226,7 +3226,7 @@ void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_li
 	struct status_change_entry *sce;
 	TBL_PC *sd = BL_CAST(BL_PC,src);
 	TBL_HOM *hd = BL_CAST(BL_HOM,src);
-	struct status_change *sc = status_get_sc(src);
+	status_change *sc = status_get_sc(src);
 
 	if(sc == NULL) return;
 
@@ -3377,7 +3377,7 @@ static void skill_do_copy(struct block_list* src,struct block_list *bl, uint16 s
 				break;
 			case 2: //Copied by Reproduce
 				{
-					struct status_change *tsc = status_get_sc(bl);
+					status_change *tsc = status_get_sc(bl);
 					//Already did SC check
 					//Skill level copied depends on Reproduce skill that used
 					lv = (tsc) ? tsc->getSCE(SC__REPRODUCE)->val1 : 1;
@@ -3505,8 +3505,8 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
 {
 	struct Damage dmg;
 	struct status_data *sstatus, *tstatus;
-	struct status_change *sc, *tsc;
-	struct map_session_data *sd, *tsd;
+	status_change *sc, *tsc;
+	map_session_data *sd, *tsd;
 	int64 damage;
 	bool rmdamage = false;//magic reflected
 	int type;
@@ -3733,7 +3733,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
 		case SL_STIN:
 		case SL_STUN:
 			if (skill_lv >= 7) {
-				struct status_change *sc_cur = status_get_sc(src);
+				status_change *sc_cur = status_get_sc(src);
 				if (sc_cur && !sc_cur->getSCE(SC_SMA))
 					sc_start(src,src,SC_SMA,100,skill_lv,skill_get_time(SL_SMA, skill_lv));
 			}
@@ -3999,7 +3999,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
 				int64 devotion_damage = damage;
 
 				// Needed to check the devotion master for Rebound Shield status.
-				struct status_change *d_sc = status_get_sc(d_bl);
+				status_change *d_sc = status_get_sc(d_bl);
 
 				if (d_sc && d_sc->getSCE(SC_REBOUND_S))
 					devotion_damage -= devotion_damage * d_sc->getSCE(SC_REBOUND_S)->val2 / 100;
@@ -4072,7 +4072,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
 	if( damage > 0 ) { // Post-damage effects
 		switch( skill_id ) {
 			case GC_VENOMPRESSURE: {
-					struct status_change *ssc = status_get_sc(src);
+					status_change *ssc = status_get_sc(src);
 					if( ssc && ssc->getSCE(SC_POISONINGWEAPON) && rnd()%100 < 70 + 5*skill_lv ) {
 						sc_start4(src, bl, (sc_type)ssc->getSCE(SC_POISONINGWEAPON)->val2, 100, ssc->getSCE(SC_POISONINGWEAPON)->val1, 0, 1, 0, skill_get_time2(GC_POISONINGWEAPON, 1));
 						status_change_end(src,SC_POISONINGWEAPON);
@@ -4341,7 +4341,7 @@ static int skill_check_unit_range2 (struct block_list *bl, int x, int y, uint16
 static int skill_check_condition_mercenary(struct block_list *bl, uint16 skill_id, uint16 skill_lv, int type)
 {
 	struct status_data *status;
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	int i, hp, sp, hp_rate, sp_rate, state, mhp;
 	t_itemid itemid[MAX_SKILL_ITEM_REQUIRE];
 	int amount[ARRAYLENGTH(itemid)], index[ARRAYLENGTH(itemid)];
@@ -4581,7 +4581,7 @@ static TIMER_FUNC(skill_timerskill){
 						unit_set_walkdelay(src, tick, TIMERSKILL_INTERVAL, 1);
 						skill_addtimerskill(src,tick+TIMERSKILL_INTERVAL,target->id,skl->x,skl->y,skl->skill_id,skl->skill_lv,skl->type+1,skl->flag);
 					} else {
-						struct status_change *sc = status_get_sc(src);
+						status_change *sc = status_get_sc(src);
 						if(sc) {
 							if(sc->getSCE(SC_SPIRIT) &&
 								sc->getSCE(SC_SPIRIT)->val2 == SL_WIZARD &&
@@ -4650,7 +4650,7 @@ static TIMER_FUNC(skill_timerskill){
 					break;
 				case SR_WINDMILL:
 					if( target->type == BL_PC ) {
-						struct map_session_data *tsd = NULL;
+						map_session_data *tsd = NULL;
 						if( (tsd = ((TBL_PC*)target)) && !pc_issit(tsd) ) {
 							pc_setsit(tsd);
 							skill_sit(tsd, true);
@@ -4663,8 +4663,8 @@ static TIMER_FUNC(skill_timerskill){
 					break;
 				case CH_PALMSTRIKE:
 					{
-						struct status_change* tsc = status_get_sc(target);
-						struct status_change* sc = status_get_sc(src);
+						status_change* tsc = status_get_sc(target);
+						status_change* sc = status_get_sc(src);
 						if( ( tsc && tsc->option&OPTION_HIDE ) ||
 							( sc && sc->option&OPTION_HIDE ) ){
 							skill_blown(src,target,skill_get_blewcount(skl->skill_id, skl->skill_lv), -1, BLOWN_NONE);
@@ -4685,7 +4685,7 @@ static TIMER_FUNC(skill_timerskill){
 					break;
 
 				case SU_SV_ROOTTWIST_ATK: {
-						struct status_change *tsc = status_get_sc(target);
+						status_change *tsc = status_get_sc(target);
 
 						if (tsc && tsc->getSCE(SC_SV_ROOTTWIST)) {
 							if (check_distance_bl(src, target, 32)) // Only damage if caster is within 32x32 area
@@ -5003,9 +5003,9 @@ static int skill_tarotcard(struct block_list* src, struct block_list *target, ui
  *------------------------------------------*/
 int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, t_tick tick, int flag)
 {
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	struct status_data *tstatus;
-	struct status_change *sc, *tsc;
+	status_change *sc, *tsc;
 
 	if (skill_id > 0 && !skill_lv) return 0;
 
@@ -6699,7 +6699,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
 	case EL_TIDAL_WEAPON:
 		if( src->type == BL_ELEM ) {
 			s_elemental_data *ele = BL_CAST(BL_ELEM,src);
-			struct status_change *tsc_ele = status_get_sc(&ele->bl);
+			status_change *tsc_ele = status_get_sc(&ele->bl);
 			sc_type type = SC_TIDAL_WEAPON_OPTION, type2 = SC_TIDAL_WEAPON;
 
 			clif_skill_nodamage(src,battle_get_master(src),skill_id,skill_lv,1);
@@ -6860,7 +6860,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
 		}
 		break;
 	case SJ_FLASHKICK: {
-			struct map_session_data *tsd = BL_CAST(BL_PC, bl);
+			map_session_data *tsd = BL_CAST(BL_PC, bl);
 			struct mob_data *md = BL_CAST(BL_MOB, src), *tmd = BL_CAST(BL_MOB, bl);
 
 			// Only players and monsters can be tagged....I think??? [Rytech]
@@ -7006,7 +7006,7 @@ static int skill_castend_song(struct block_list* src, uint16 skill_id, uint16 sk
 		return 0;
 	}
 
-	struct map_session_data* sd = BL_CAST(BL_PC, src);
+	map_session_data* sd = BL_CAST(BL_PC, src);
 	int flag = BCT_PARTY;
 
 	switch (skill_id) {
@@ -7046,12 +7046,12 @@ static int skill_castend_song(struct block_list* src, uint16 skill_id, uint16 sk
  **/
 int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, t_tick tick, int flag)
 {
-	struct map_session_data *sd, *dstsd;
+	map_session_data *sd, *dstsd;
 	struct mob_data *md, *dstmd;
 	struct homun_data *hd;
 	s_mercenary_data *mer;
 	struct status_data *sstatus, *tstatus;
-	struct status_change *tsc;
+	status_change *tsc;
 	struct status_change_entry *tsce;
 
 	int i = 0;
@@ -8340,7 +8340,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 	case MT_AXE_STOMP:
 	case ABC_ABYSS_DAGGER:
 	{
-		struct status_change *sc = status_get_sc(src);
+		status_change *sc = status_get_sc(src);
 		int starget = BL_CHAR|BL_SKILL;
 
 		if (skill_id == SR_HOWLINGOFLION)
@@ -9718,8 +9718,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 	// parent-baby skills
 	case WE_BABY:
 		if(sd){
-			struct map_session_data *f_sd = pc_get_father(sd);
-			struct map_session_data *m_sd = pc_get_mother(sd);
+			map_session_data *f_sd = pc_get_father(sd);
+			map_session_data *m_sd = pc_get_mother(sd);
 
 			if( (!f_sd && !m_sd) // if neither was found
 				|| (sd->status.party_id != 0 && //not in same party
@@ -9741,8 +9741,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 
 	case WE_CALLALLFAMILY:
 		if (sd) {
-			struct map_session_data *p_sd = pc_get_partner(sd);
-			struct map_session_data *c_sd = pc_get_child(sd);
+			map_session_data *p_sd = pc_get_partner(sd);
+			map_session_data *c_sd = pc_get_child(sd);
 
 			if (!p_sd && !c_sd) { // Fail if no family members are found
 				clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
@@ -9761,8 +9761,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 
 	case WE_ONEFOREVER:
 		if (sd) {
-			struct map_session_data *p_sd = pc_get_partner(sd);
-			struct map_session_data *c_sd = pc_get_child(sd);
+			map_session_data *p_sd = pc_get_partner(sd);
+			map_session_data *c_sd = pc_get_child(sd);
 
 			if (!p_sd && !c_sd && !dstsd) { // Fail if no family members are found
 				clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
@@ -9792,8 +9792,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 
 	case WE_CHEERUP:
 		if (sd) {
-			struct map_session_data *f_sd = pc_get_father(sd);
-			struct map_session_data *m_sd = pc_get_mother(sd);
+			map_session_data *f_sd = pc_get_father(sd);
+			map_session_data *m_sd = pc_get_mother(sd);
 
 			if (!f_sd && !m_sd && !dstsd) { // Fail if no family members are found
 				clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
@@ -11424,7 +11424,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 	case WM_LERADS_DEW:
 	case WM_UNLIMITED_HUMMING_VOICE:
 		if( flag&1 ) {	// These affect to to all party members near the caster.
-			struct status_change *sc = status_get_sc(src);
+			status_change *sc = status_get_sc(src);
 			if( sc && sc->getSCE(type) ) {
 				sc_start2(src,bl,type,100,skill_lv,pc_checkskill(sd, WM_LESSON),skill_get_time(skill_id,skill_lv));
 			}
@@ -11813,7 +11813,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 			s_elemental_data *ele = BL_CAST(BL_ELEM, src);
 			if( ele ) {
 				sc_type type2 = (sc_type)(type-1);
-				struct status_change *sc = status_get_sc(&ele->bl);
+				status_change *sc = status_get_sc(&ele->bl);
 
 				if( (sc && sc->getSCE(type2)) || (tsc && tsc->getSCE(type)) ) {
 					status_change_end(src,type);
@@ -11840,7 +11840,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 	case EL_WATER_SCREEN: {
 			s_elemental_data *ele = BL_CAST(BL_ELEM, src);
 			if( ele ) {
-				struct status_change *sc = status_get_sc(&ele->bl);
+				status_change *sc = status_get_sc(&ele->bl);
 				sc_type type2 = (sc_type)(type-1);
 
 				clif_skill_nodamage(src,src,skill_id,skill_lv,1);
@@ -12552,7 +12552,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 	}
 
 	if (skill_id != SR_CURSEDCIRCLE && skill_id != NPC_SR_CURSEDCIRCLE) {
-		struct status_change *sc = status_get_sc(src);
+		status_change *sc = status_get_sc(src);
 
 		if (sc && sc->getSCE(SC_CURSEDCIRCLE_ATKER)) // Should only remove after the skill had been casted.
 			status_change_end(src,SC_CURSEDCIRCLE_ATKER);
@@ -12591,7 +12591,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 static int8 skill_castend_id_check(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv) {
 	std::shared_ptr<s_skill_db> skill = skill_db.find(skill_id);
 	int inf = skill->inf;
-	struct status_change *tsc = status_get_sc(target);
+	status_change *tsc = status_get_sc(target);
 
 	if (src != target && (status_bl_has_mode(target,MD_SKILLIMMUNE) || (status_get_class(target) == MOBID_EMPERIUM && !skill->inf2[INF2_TARGETEMPERIUM])) && skill_get_casttype(skill_id) == CAST_NODAMAGE)
 		return USESKILL_FAIL_MAX; // Don't show a skill fail message (NoDamage type doesn't consume requirements)
@@ -12720,7 +12720,7 @@ static int8 skill_castend_id_check(struct block_list *src, struct block_list *ta
 }
 
 TIMER_FUNC( skill_keep_using ){
-	struct map_session_data* sd = map_id2sd( id );
+	map_session_data* sd = map_id2sd( id );
 
 	if( sd && sd->skill_keep_using.skill_id ){
 		clif_parse_skill_toid( sd, sd->skill_keep_using.skill_id, sd->skill_keep_using.level, sd->skill_keep_using.target );
@@ -12738,10 +12738,10 @@ TIMER_FUNC( skill_keep_using ){
  **/
 TIMER_FUNC(skill_castend_id){
 	struct block_list *target, *src;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct mob_data *md;
 	struct unit_data *ud;
-	struct status_change *sc = NULL;
+	status_change *sc = NULL;
 	int flag = 0;
 
 	src = map_id2bl(id);
@@ -13094,7 +13094,7 @@ TIMER_FUNC(skill_castend_id){
  *------------------------------------------*/
 TIMER_FUNC(skill_castend_pos){
 	struct block_list* src = map_id2bl(id);
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct unit_data *ud = unit_bl2ud(src);
 	struct mob_data *md;
 
@@ -13244,8 +13244,8 @@ static int skill_count_wos(struct block_list *bl,va_list ap) {
  *------------------------------------------*/
 int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, uint16 skill_lv, t_tick tick, int flag)
 {
-	struct map_session_data* sd;
-	struct status_change* sc;
+	map_session_data* sd;
+	status_change* sc;
 	struct status_change_entry *sce;
 	std::shared_ptr<s_skill_unit_group> sg;
 	enum sc_type type;
@@ -14178,7 +14178,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
 /*==========================================
  *
  *------------------------------------------*/
-int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char *mapname)
+int skill_castend_map (map_session_data *sd, uint16 skill_id, const char *mapname)
 {
 	nullpo_ret(sd);
 
@@ -14421,9 +14421,9 @@ std::shared_ptr<s_skill_unit_group> skill_unitsetting(struct block_list *src, ui
 	int target, interval, range;
 	t_itemid req_item = 0;
 	struct s_skill_unit_layout *layout;
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct status_data *status;
-	struct status_change *sc;
+	status_change *sc;
 	int active_flag = 1;
 	int subunt = 0;
 	bool hidden = false;
@@ -15006,7 +15006,7 @@ static int skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, t_
 {
 	
 	struct block_list *ss; // Actual source that cast the skill unit
-	struct status_change *sc;
+	status_change *sc;
 	struct status_change_entry *sce;
 	struct status_data *tstatus;
 	enum sc_type type;
@@ -15126,7 +15126,7 @@ static int skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, t_
 			int working = sg->val1&0xffff;
 
 			if(bl->type==BL_PC && !working){
-				struct map_session_data *sd = (struct map_session_data *)bl;
+				map_session_data *sd = (map_session_data *)bl;
 				if((!sd->chatID || battle_config.chat_warpportal)
 					&& sd->ud.to_x == unit->bl.x && sd->ud.to_y == unit->bl.y)
 				{
@@ -15353,7 +15353,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
 	struct block_list *ss;
 	TBL_PC* tsd;
 	struct status_data *tstatus;
-	struct status_change *sc, *tsc;
+	status_change *sc, *tsc;
 	struct skill_unit_group_tickset *ts;
 	enum sc_type type;
 	uint16 skill_id;
@@ -16137,7 +16137,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
  */
 int skill_unit_onout(struct skill_unit *src, struct block_list *bl, t_tick tick)
 {
-	struct status_change *sc;
+	status_change *sc;
 	struct status_change_entry *sce;
 	enum sc_type type;
 
@@ -16210,7 +16210,7 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, t_tick tick)
  */
 int skill_unit_onleft(uint16 skill_id, struct block_list *bl, t_tick tick)
 {
-	struct status_change *sc;
+	status_change *sc;
 	struct status_change_entry *sce;
 	enum sc_type type;
 
@@ -16444,14 +16444,14 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
 {
 	int *c, skill_id;
 	struct block_list *src;
-	struct map_session_data *sd;
-	struct map_session_data *tsd;
+	map_session_data *sd;
+	map_session_data *tsd;
 	int *p_sd;	//Contains the list of characters found.
 
 	nullpo_ret(bl);
-	nullpo_ret(tsd=(struct map_session_data*)bl);
+	nullpo_ret(tsd=(map_session_data*)bl);
 	nullpo_ret(src=va_arg(ap,struct block_list *));
-	nullpo_ret(sd=(struct map_session_data*)src);
+	nullpo_ret(sd=(map_session_data*)src);
 
 	c=va_arg(ap,int *);
 	p_sd = va_arg(ap, int *);
@@ -16545,7 +16545,7 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
  * @param range Area range to check
  * @param cast_flag Special handle
  */
-int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag)
+int skill_check_pc_partner(map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag)
 {
 	static int c=0;
 	static int p_sd[MAX_PARTY];
@@ -16559,7 +16559,7 @@ int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16
 		return is_chorus ? MAX_PARTY : 99; //As if there were infinite partners.
 
 	if (cast_flag) {	//Execute the skill on the partners.
-		struct map_session_data* tsd;
+		map_session_data* tsd;
 		switch (skill_id) {
 			case PR_BENEDICTIO:
 			case WM_GREAT_ECHO:
@@ -16675,7 +16675,7 @@ static int skill_check_condition_mob_master_sub(struct block_list *bl, va_list a
  * @param skill_id Skill ID
  * @return True if skill is need ammo; False otherwise.
  */
-int skill_isammotype(struct map_session_data *sd, unsigned short skill_id)
+int skill_isammotype(map_session_data *sd, unsigned short skill_id)
 {
 	std::shared_ptr<s_skill_db> skill = skill_db.find(skill_id);
 
@@ -16695,7 +16695,7 @@ int skill_isammotype(struct map_session_data *sd, unsigned short skill_id)
 * @param skill_id
 * @return True if condition is met, False otherwise
 **/
-static bool skill_check_condition_sc_required(struct map_session_data *sd, unsigned short skill_id, struct s_skill_condition *require) {
+static bool skill_check_condition_sc_required(map_session_data *sd, unsigned short skill_id, struct s_skill_condition *require) {
 	if (require == nullptr || require->status.empty())
 		return true;
 
@@ -16749,10 +16749,10 @@ static bool skill_check_condition_sc_required(struct map_session_data *sd, unsig
  * @param skill_lv Level of used skill
  * @return true: All condition passed, false: Failed
  */
-bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv)
+bool skill_check_condition_castbegin(map_session_data* sd, uint16 skill_id, uint16 skill_lv)
 {
 	struct status_data *status;
-	struct status_change *sc;
+	status_change *sc;
 	struct s_skill_condition require;
 	int i;
 
@@ -17791,7 +17791,7 @@ bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_i
  * @param skill_lv Level of used skill
  * @return true: All condition passed, false: Failed
  */
-bool skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv)
+bool skill_check_condition_castend(map_session_data* sd, uint16 skill_id, uint16 skill_lv)
 {
 	struct s_skill_condition require;
 	struct status_data *status;
@@ -18031,7 +18031,7 @@ bool skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
  *  type&1: consume the others (before skill was used);
  *  type&2: consume items (after skill was used)
  */
-void skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type)
+void skill_consume_requirement(map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type)
 {
 	struct s_skill_condition require;
 
@@ -18106,7 +18106,7 @@ void skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uin
 	}
 
 	if( type&2 ) {
-		struct status_change *sc = &sd->sc;
+		status_change *sc = &sd->sc;
 		int n,i;
 
 		if( !sc->count )
@@ -18155,11 +18155,11 @@ void skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uin
  * @param skill_lv Skill level of used skill
  * @return s_skill_condition Struct 's_skill_condition' that store the modified skill requirements
  */
-struct s_skill_condition skill_get_requirement(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv)
+struct s_skill_condition skill_get_requirement(map_session_data* sd, uint16 skill_id, uint16 skill_lv)
 {
 	struct s_skill_condition req;
 	struct status_data *status;
-	struct status_change *sc;
+	status_change *sc;
 	int i,hp_rate,sp_rate, ap_rate, sp_skill_rate_bonus = 100;
 
 	memset(&req,0,sizeof(req));
@@ -18544,8 +18544,8 @@ int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
 
 #ifndef RENEWAL_CAST
 	{
-		struct map_session_data *sd = BL_CAST(BL_PC, bl);
-		struct status_change *sc = status_get_sc(bl);
+		map_session_data *sd = BL_CAST(BL_PC, bl);
+		status_change *sc = status_get_sc(bl);
 		int reduce_cast_rate = 0;
 		uint8 flag = skill_get_castnodex(skill_id);
 
@@ -18921,7 +18921,7 @@ int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
 /*==========================================
  * Weapon Repair [Celest/DracoRPG]
  *------------------------------------------*/
-void skill_repairweapon(struct map_session_data *sd, int idx) {
+void skill_repairweapon(map_session_data *sd, int idx) {
 	static const t_itemid weapon_materials[MAX_WEAPON_LEVEL] = {
 		ITEMID_IRON_ORE,
 		ITEMID_IRON,
@@ -18939,7 +18939,7 @@ void skill_repairweapon(struct map_session_data *sd, int idx) {
 	};
 	t_itemid material = 0;
 	struct item *item;
-	struct map_session_data *target_sd;
+	map_session_data *target_sd;
 
 	nullpo_retv(sd);
 
@@ -18991,7 +18991,7 @@ void skill_repairweapon(struct map_session_data *sd, int idx) {
 /*==========================================
  * Item Appraisal
  *------------------------------------------*/
-void skill_identify(struct map_session_data *sd, int idx)
+void skill_identify(map_session_data *sd, int idx)
 {
 	int flag=1;
 
@@ -19011,7 +19011,7 @@ void skill_identify(struct map_session_data *sd, int idx)
 /*==========================================
  * Weapon Refine [Celest]
  *------------------------------------------*/
-void skill_weaponrefine(struct map_session_data *sd, int idx)
+void skill_weaponrefine(map_session_data *sd, int idx)
 {
 	static const t_itemid material[MAX_WEAPON_LEVEL] = {
 		ITEMID_PHRACON,
@@ -19128,7 +19128,7 @@ void skill_weaponrefine(struct map_session_data *sd, int idx)
 /*==========================================
  *
  *------------------------------------------*/
-int skill_autospell(struct map_session_data *sd, uint16 skill_id)
+int skill_autospell(map_session_data *sd, uint16 skill_id)
 {
 	nullpo_ret(sd);
 
@@ -19183,7 +19183,7 @@ int skill_autospell(struct map_session_data *sd, uint16 skill_id)
  */
 static int skill_sit_count(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd = (struct map_session_data*)bl;
+	map_session_data *sd = (map_session_data*)bl;
 	int flag = va_arg(ap, int);
 
 	if (!pc_issit(sd))
@@ -19206,7 +19206,7 @@ static int skill_sit_count(struct block_list *bl, va_list ap)
  */
 static int skill_sit_in(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd = (struct map_session_data*)bl;
+	map_session_data *sd = (map_session_data*)bl;
 	int flag = va_arg(ap, int);
 
 	if (!pc_issit(sd))
@@ -19232,7 +19232,7 @@ static int skill_sit_in(struct block_list *bl, va_list ap)
  */
 static int skill_sit_out(struct block_list *bl, va_list ap)
 {
-	struct map_session_data *sd = (struct map_session_data*)bl;
+	map_session_data *sd = (map_session_data*)bl;
 	int flag = va_arg(ap, int), range = va_arg(ap, int);
 
 	if (map_foreachinallrange(skill_sit_count, &sd->bl, range, BL_PC, flag) > 1)
@@ -19255,7 +19255,7 @@ static int skill_sit_out(struct block_list *bl, va_list ap)
  * @param sitting: True when sitting or false when standing
  * @return 0
  */
-int skill_sit(struct map_session_data *sd, bool sitting)
+int skill_sit(map_session_data *sd, bool sitting)
 {
 	int flag = 0, range = 0, lv;
 
@@ -19311,7 +19311,7 @@ int skill_frostjoke_scream(struct block_list *bl, va_list ap)
 	if (src == bl || status_isdead(bl))
 		return 0;
 	if (bl->type == BL_PC) {
-		struct map_session_data *sd = (struct map_session_data *)bl;
+		map_session_data *sd = (map_session_data *)bl;
 		if ( sd && sd->sc.option&(OPTION_INVISIBLE|OPTION_MADOGEAR) )
 			return 0;//Frost Joke / Scream cannot target invisible or MADO Gear characters [Ind]
 	}
@@ -19515,13 +19515,13 @@ int skill_graffitiremover(struct block_list *bl, va_list ap)
 int skill_greed(struct block_list *bl, va_list ap)
 {
 	struct block_list *src;
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	struct flooritem_data *fitem = NULL;
 
 	nullpo_ret(bl);
 	nullpo_ret(src = va_arg(ap, struct block_list *));
 
-	if(src->type == BL_PC && (sd = (struct map_session_data *)src) && bl->type == BL_ITEM && (fitem = (struct flooritem_data *)bl))
+	if(src->type == BL_PC && (sd = (map_session_data *)src) && bl->type == BL_ITEM && (fitem = (struct flooritem_data *)bl))
 		pc_takeitem(sd, fitem);
 
 	return 0;
@@ -19587,7 +19587,7 @@ int skill_detonator(struct block_list *bl, va_list ap)
  * @param sd: Player data
  * @return Number of Royal Guard
  */
-int skill_banding_count(struct map_session_data *sd)
+int skill_banding_count(map_session_data *sd)
 {
  	nullpo_ret(sd);
 
@@ -19965,7 +19965,7 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce
  */
 bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit)
 {
-	struct status_change *sc;
+	status_change *sc;
 
 	nullpo_retr(false,bl);
 
@@ -20232,7 +20232,7 @@ int skill_delunit(struct skill_unit* unit)
 			break;
 		case SC_MANHOLE: // Note : Removing the unit don't remove the status (official info)
 			if( group->val2 ) { // Someone Traped
-				struct status_change *tsc = status_get_sc( map_id2bl(group->val2));
+				status_change *tsc = status_get_sc( map_id2bl(group->val2));
 				if( tsc && tsc->getSCE(SC__MANHOLE) )
 					tsc->getSCE(SC__MANHOLE)->val4 = 0; // Remove the Unit ID
 			}
@@ -20383,7 +20383,7 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
 	}
 
 	if (skill_get_unit_flag_(group->skill_id, { UF_DANCE, UF_SONG, UF_ENSEMBLE })) {
-		struct status_change* sc = status_get_sc(src);
+		status_change* sc = status_get_sc(src);
 		if (sc && sc->getSCE(SC_DANCING)) {
 			sc->getSCE(SC_DANCING)->val2 = 0 ; //This prevents status_change_end attempting to redelete the group. [Skotlex]
 			status_change_end(src, SC_DANCING);
@@ -20399,7 +20399,7 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
 #endif
 	}
 	if (i != SC_NONE) {
-		struct status_change *sc = status_get_sc(src);
+		status_change *sc = status_get_sc(src);
 		if (sc && sc->getSCE(i)) {
 			sc->getSCE(i)->val3 = 0; //Remove reference to this group. [Skotlex]
 			status_change_end(src, (sc_type)i);
@@ -20410,7 +20410,7 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
 		case PF_SPIDERWEB:
 		{
 			struct block_list* target = map_id2bl(group->val2);
-			struct status_change *sc;
+			status_change *sc;
 			bool removed = true;
 			//Clear group id from status change
 			if (target && (sc = status_get_sc(target)) != NULL && sc->getSCE(SC_SPIDERWEB)) {
@@ -20451,7 +20451,7 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
 			break;
 		case NC_NEUTRALBARRIER:
 			{
-				struct status_change *sc = NULL;
+				status_change *sc = NULL;
 				if( (sc = status_get_sc(src)) != NULL ) {
 					if ( sc->getSCE(SC_NEUTRALBARRIER_MASTER) )
 					{
@@ -20464,7 +20464,7 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
 			break;
 		case NC_STEALTHFIELD:
 			{
-				struct status_change *sc = NULL;
+				status_change *sc = NULL;
 				if( (sc = status_get_sc(src)) != NULL && sc->getSCE(SC_STEALTHFIELD_MASTER) ) {
 					sc->getSCE(SC_STEALTHFIELD_MASTER)->val2 = 0;
 					status_change_end(src,SC_STEALTHFIELD_MASTER);
@@ -20698,7 +20698,7 @@ static int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap)
 
 			case UNT_CALLFAMILY:
 			{
-				struct map_session_data *sd = NULL;
+				map_session_data *sd = NULL;
 				if(group->val1) {
 					sd = map_charid2sd(group->val1);
 					group->val1 = 0;
@@ -20741,7 +20741,7 @@ static int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap)
 			case UNT_BANDING:
 			{
 				struct block_list *src = map_id2bl(group->src_id);
-				struct status_change *sc;
+				status_change *sc;
 				if( !src || (sc = status_get_sc(src)) == NULL || !sc->getSCE(SC_BANDING) ) {
 					skill_delunit(unit);
 					break;
@@ -21168,7 +21168,7 @@ void skill_unit_move_unit_group(std::shared_ptr<s_skill_unit_group> group, int16
  * @param qty Amount of item will be created
  * @return 0 If failed or Index+1 of item found on skill_produce_db[]
  */
-short skill_can_produce_mix(struct map_session_data *sd, t_itemid nameid, int trigger, int qty)
+short skill_can_produce_mix(map_session_data *sd, t_itemid nameid, int trigger, int qty)
 {
 	nullpo_ret(sd);
 
@@ -21248,7 +21248,7 @@ short skill_can_produce_mix(struct map_session_data *sd, t_itemid nameid, int tr
  * @param produce_idx Index of produce entry in skill_produce_db[]. (Optional. Assumed the requirements are complete, checked somewhere)
  * @return True is success, False if failed
  */
-bool skill_produce_mix(struct map_session_data *sd, uint16 skill_id, t_itemid nameid, int slot1, int slot2, int slot3, int qty, short produce_idx)
+bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, int slot1, int slot2, int slot3, int qty, short produce_idx)
 {
 	int slot[3];
 	int i, sc, ele, idx, equip, wlv, make_per = 0, flag = 0, skill_lv = 0;
@@ -21914,7 +21914,7 @@ bool skill_produce_mix(struct map_session_data *sd, uint16 skill_id, t_itemid na
  * @param nameid Item ID of material
  * @return True if created, False is failed
  */
-bool skill_arrow_create(struct map_session_data *sd, t_itemid nameid)
+bool skill_arrow_create(map_session_data *sd, t_itemid nameid)
 {
 	nullpo_ret(sd);
 
@@ -21965,7 +21965,7 @@ bool skill_arrow_create(struct map_session_data *sd, t_itemid nameid)
  * @param sd Player
  * @nameid Item ID of poison type
  */
-int skill_poisoningweapon(struct map_session_data *sd, t_itemid nameid)
+int skill_poisoningweapon(map_session_data *sd, t_itemid nameid)
 {
 	nullpo_ret(sd);
 
@@ -22016,7 +22016,7 @@ int skill_poisoningweapon(struct map_session_data *sd, t_itemid nameid)
  */
 void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id)
 {
-	struct status_change *sc = status_get_sc(bl);
+	status_change *sc = status_get_sc(bl);
 
 	// non-offensive and non-magic skills do not affect the status
 	if (skill_get_nk(skill_id, NK_NODAMAGE) || !(skill_get_type(skill_id)&BF_MAGIC))
@@ -22036,7 +22036,7 @@ void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id)
 	}
 }
 
-int skill_magicdecoy(struct map_session_data *sd, t_itemid nameid) {
+int skill_magicdecoy(map_session_data *sd, t_itemid nameid) {
 	int x, y, i, class_, skill;
 	struct mob_data *md;
 	nullpo_ret(sd);
@@ -22141,7 +22141,7 @@ void skill_spellbook(map_session_data &sd, t_itemid nameid) {
 	status_zap(&sd.bl, 0, skill_get_sp(skill_id, skill_lv));
 }
 
-int skill_select_menu(struct map_session_data *sd,uint16 skill_id) {
+int skill_select_menu(map_session_data *sd,uint16 skill_id) {
 	int lv, prob, aslvl = 0;
 	uint16 id, sk_idx = 0;
 	nullpo_ret(sd);
@@ -22166,7 +22166,7 @@ int skill_select_menu(struct map_session_data *sd,uint16 skill_id) {
 	return 0;
 }
 
-int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv, unsigned short* item_list) {
+int skill_elementalanalysis(map_session_data* sd, int n, uint16 skill_lv, unsigned short* item_list) {
 	int i;
 
 	nullpo_ret(sd);
@@ -22241,7 +22241,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
 	return 0;
 }
 
-int skill_changematerial(struct map_session_data *sd, int n, unsigned short *item_list) {
+int skill_changematerial(map_session_data *sd, int n, unsigned short *item_list) {
 	int i, j, k, c, p = 0, amount;
 	t_itemid nameid;
 
@@ -22336,7 +22336,7 @@ static int skill_destroy_trap(struct block_list *bl, va_list ap)
 /*==========================================
  *
  *------------------------------------------*/
-int skill_blockpc_get(struct map_session_data *sd, int skillid) {
+int skill_blockpc_get(map_session_data *sd, int skillid) {
 	int i;
 
 	nullpo_retr(-1, sd);
@@ -22346,7 +22346,7 @@ int skill_blockpc_get(struct map_session_data *sd, int skillid) {
 }
 
 TIMER_FUNC(skill_blockpc_end){
-	struct map_session_data *sd = map_id2sd(id);
+	map_session_data *sd = map_id2sd(id);
 	int i = (int)data;
 
 	if (!sd || data < 0 || data >= MAX_SKILLCOOLDOWN)
@@ -22370,7 +22370,7 @@ TIMER_FUNC(skill_blockpc_end){
  * @param   load      whether this assignment is being loaded upon player login
  * @return  0 if successful, -1 otherwise
  */
-int skill_blockpc_start(struct map_session_data *sd, int skill_id, t_tick tick) {
+int skill_blockpc_start(map_session_data *sd, int skill_id, t_tick tick) {
 	int i;
 
 	nullpo_retr(-1, sd);
@@ -22401,7 +22401,7 @@ int skill_blockpc_start(struct map_session_data *sd, int skill_id, t_tick tick)
 	}
 }
 
-int skill_blockpc_clear(struct map_session_data *sd) {
+int skill_blockpc_clear(map_session_data *sd) {
 	int i;
 
 	nullpo_ret(sd);
@@ -22485,7 +22485,7 @@ int skill_blockmerc_start(s_mercenary_data *md, uint16 skill_id, int tick)
  * @param skill_id: Skill ID to save
  * @param skill_lv: Skill level to save
  */
-void skill_usave_add(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv)
+void skill_usave_add(map_session_data *sd, uint16 skill_id, uint16 skill_lv)
 {
 	struct skill_usave *sus = NULL;
 
@@ -22503,7 +22503,7 @@ void skill_usave_add(struct map_session_data *sd, uint16 skill_id, uint16 skill_
  * Loads saved skill unit entries for this player after map load
  * @param sd: Player
  */
-void skill_usave_trigger(struct map_session_data *sd)
+void skill_usave_trigger(map_session_data *sd)
 {
 	skill_usave *sus;
 	std::shared_ptr<s_skill_unit_group> group;
@@ -23014,7 +23014,7 @@ void skill_init_nounit_layout (void) {
 }
 
 int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) {
-	struct status_change *sc = status_get_sc(bl);
+	status_change *sc = status_get_sc(bl);
 
 	if( !sc || !bl || !skill_id )
 		return 0; // Can do it
@@ -23086,7 +23086,7 @@ int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) {
  * @return True:If unit can be moved, False:If check on flags are met or unit cannot be moved.
  **/
 static bool skill_check_unit_movepos(uint8 check_flag, struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath) {
-	struct status_change *sc;
+	status_change *sc;
 
 	nullpo_retr(false, bl);
 

+ 30 - 30
src/map/skill.hpp

@@ -21,12 +21,12 @@ enum send_target : uint8;
 enum e_damage_type : uint8;
 enum e_battle_flag : uint16;
 enum e_battle_check_target : uint32;
-struct map_session_data;
+class map_session_data;
 struct homun_data;
 struct skill_unit;
 struct s_skill_unit_group;
 struct status_change_entry;
-struct status_change;
+class status_change;
 
 #define MAX_SKILL_PRODUCE_DB	300 /// Max Produce DB
 #define MAX_PRODUCE_RESOURCE	12 /// Max Produce requirements
@@ -548,11 +548,11 @@ unsigned short skill_dummy2skill_id(unsigned short skill_id);
 
 uint16 skill_name2id(const char* name);
 
-int skill_isammotype(struct map_session_data *sd, unsigned short skill_id);
+int skill_isammotype(map_session_data *sd, unsigned short skill_id);
 TIMER_FUNC(skill_castend_id);
 TIMER_FUNC(skill_castend_pos);
 TIMER_FUNC( skill_keep_using );
-int skill_castend_map( struct map_session_data *sd,uint16 skill_id, const char *map);
+int skill_castend_map( map_session_data *sd,uint16 skill_id, const char *map);
 
 int skill_cleartimerskill(struct block_list *src);
 int skill_addtimerskill(struct block_list *src,t_tick tick,int target,int x,int y,uint16 skill_id,uint16 skill_lv,int type,int flag);
@@ -589,51 +589,51 @@ int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv);
 void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id);
 
 // Skill conditions check and remove [Inkfish]
-bool skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
-bool skill_check_condition_castend(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+bool skill_check_condition_castbegin(map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+bool skill_check_condition_castend(map_session_data *sd, uint16 skill_id, uint16 skill_lv);
 int skill_check_condition_char_sub (struct block_list *bl, va_list ap);
-void skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type);
-struct s_skill_condition skill_get_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+void skill_consume_requirement(map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type);
+struct s_skill_condition skill_get_requirement(map_session_data *sd, uint16 skill_id, uint16 skill_lv);
 bool skill_disable_check(status_change &sc, uint16 skill_id);
 bool skill_pos_maxcount_check(struct block_list *src, int16 x, int16 y, uint16 skill_id, uint16 skill_lv, enum bl_type type, bool display_failure);
 
-int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag);
+int skill_check_pc_partner(map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag);
 int skill_unit_move(struct block_list *bl,t_tick tick,int flag);
 void skill_unit_move_unit_group( std::shared_ptr<s_skill_unit_group> group, int16 m,int16 dx,int16 dy);
 void skill_unit_move_unit(struct block_list *bl, int dx, int dy);
 
-int skill_sit(struct map_session_data *sd, bool sitting);
-void skill_repairweapon(struct map_session_data *sd, int idx);
-void skill_identify(struct map_session_data *sd,int idx);
-void skill_weaponrefine(struct map_session_data *sd,int idx); // [Celest]
-int skill_autospell(struct map_session_data *md,uint16 skill_id);
+int skill_sit(map_session_data *sd, bool sitting);
+void skill_repairweapon(map_session_data *sd, int idx);
+void skill_identify(map_session_data *sd,int idx);
+void skill_weaponrefine(map_session_data *sd,int idx); // [Celest]
+int skill_autospell(map_session_data *md,uint16 skill_id);
 
 int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal);
 
 bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce);
-int8 skill_isCopyable(struct map_session_data *sd, uint16 skill_id);
+int8 skill_isCopyable(map_session_data *sd, uint16 skill_id);
 
 // Abnormal status
-bool skill_isNotOk(uint16 skill_id, struct map_session_data *sd);
+bool skill_isNotOk(uint16 skill_id, map_session_data *sd);
 bool skill_isNotOk_hom(struct homun_data *hd, uint16 skill_id, uint16 skill_lv);
 bool skill_isNotOk_mercenary(uint16 skill_id, s_mercenary_data *md);
 
 bool skill_isNotOk_npcRange(struct block_list *src, uint16 skill_id, uint16 skill_lv, int pos_x, int pos_y);
 
 // Item creation
-short skill_can_produce_mix( struct map_session_data *sd, t_itemid nameid, int trigger, int qty);
-bool skill_produce_mix( struct map_session_data *sd, uint16 skill_id, t_itemid nameid, int slot1, int slot2, int slot3, int qty, short produce_idx );
+short skill_can_produce_mix( map_session_data *sd, t_itemid nameid, int trigger, int qty);
+bool skill_produce_mix( map_session_data *sd, uint16 skill_id, t_itemid nameid, int slot1, int slot2, int slot3, int qty, short produce_idx );
 
-bool skill_arrow_create( struct map_session_data *sd, t_itemid nameid);
+bool skill_arrow_create( map_session_data *sd, t_itemid nameid);
 
 // skills for the mob
 int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,uint16 skill_id,uint16 skill_lv,t_tick tick,int flag );
 int skill_castend_damage_id( struct block_list* src, struct block_list *bl,uint16 skill_id,uint16 skill_lv,t_tick tick,int flag );
 int skill_castend_pos2( struct block_list *src, int x,int y,uint16 skill_id,uint16 skill_lv,t_tick tick,int flag);
 
-int skill_blockpc_start(struct map_session_data*, int, t_tick);
-int skill_blockpc_get(struct map_session_data *sd, int skillid);
-int skill_blockpc_clear(struct map_session_data *sd);
+int skill_blockpc_start(map_session_data*, int, t_tick);
+int skill_blockpc_get(map_session_data *sd, int skillid);
+int skill_blockpc_clear(map_session_data *sd);
 TIMER_FUNC(skill_blockpc_end);
 int skill_blockhomun_start (struct homun_data*,uint16 skill_id,int);
 int skill_blockmerc_start (s_mercenary_data*,uint16 skill_id,int);
@@ -2649,8 +2649,8 @@ enum e_skill_unit_id : uint16 {
 /**
  * Skill Unit Save
  **/
-void skill_usave_add(struct map_session_data * sd, uint16 skill_id, uint16 skill_lv);
-void skill_usave_trigger(struct map_session_data *sd);
+void skill_usave_add(map_session_data * sd, uint16 skill_id, uint16 skill_lv);
+void skill_usave_trigger(map_session_data *sd);
 
 /**
  * Warlock
@@ -2714,23 +2714,23 @@ bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *s
 /**
  * Mechanic
  **/
-int skill_magicdecoy(struct map_session_data *sd, t_itemid nameid);
+int skill_magicdecoy(map_session_data *sd, t_itemid nameid);
 
 /**
  * Guiltoine Cross
  **/
-int skill_poisoningweapon( struct map_session_data *sd, t_itemid nameid);
+int skill_poisoningweapon( map_session_data *sd, t_itemid nameid);
 
 /**
  * Auto Shadow Spell (Shadow Chaser)
  **/
-int skill_select_menu(struct map_session_data *sd,uint16 skill_id);
+int skill_select_menu(map_session_data *sd,uint16 skill_id);
 
-int skill_elementalanalysis(struct map_session_data *sd, int n, uint16 skill_lv, unsigned short *item_list); // Sorcerer Four Elemental Analisys.
-int skill_changematerial(struct map_session_data *sd, int n, unsigned short *item_list);	// Genetic Change Material.
+int skill_elementalanalysis(map_session_data *sd, int n, uint16 skill_lv, unsigned short *item_list); // Sorcerer Four Elemental Analisys.
+int skill_changematerial(map_session_data *sd, int n, unsigned short *item_list);	// Genetic Change Material.
 int skill_get_elemental_type(uint16 skill_id, uint16 skill_lv);
 
-int skill_banding_count(struct map_session_data *sd);
+int skill_banding_count(map_session_data *sd);
 
 int skill_is_combo(uint16 skill_id);
 void skill_combo_toggle_inf(struct block_list* bl, uint16 skill_id, int inf);

文件差異過大導致無法顯示
+ 149 - 149
src/map/status.cpp


+ 10 - 10
src/map/status.hpp

@@ -25,7 +25,7 @@ struct homun_data;
 struct s_mercenary_data;
 struct s_elemental_data;
 struct npc_data;
-struct status_change;
+class status_change;
 
 /**
  * Max Refine available to your server
@@ -3280,7 +3280,7 @@ unsigned short status_get_speed(struct block_list *bl);
 #define status_get_crate(bl) status_get_status_data(bl)->crate
 #define status_get_element(bl) status_get_status_data(bl)->def_ele
 #define status_get_element_level(bl) status_get_status_data(bl)->ele_lv
-unsigned char status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element);
+unsigned char status_calc_attack_element(struct block_list *bl, status_change *sc, int element);
 #define status_get_attack_sc_element(bl, sc) status_calc_attack_element(bl, sc, 0)
 #define status_get_attack_element(bl) status_get_status_data(bl)->rhw.ele
 #define status_get_attack_lelement(bl) status_get_status_data(bl)->lhw.ele
@@ -3306,7 +3306,7 @@ std::vector<e_race2> status_get_race2(struct block_list *bl);
 struct view_data *status_get_viewdata(struct block_list *bl);
 void status_set_viewdata(struct block_list *bl, int class_);
 void status_change_init(struct block_list *bl);
-struct status_change *status_get_sc(struct block_list *bl);
+status_change *status_get_sc(struct block_list *bl);
 
 int status_isdead(struct block_list *bl);
 int status_isimmune(struct block_list *bl);
@@ -3328,7 +3328,7 @@ TIMER_FUNC(status_change_timer);
 int status_change_timer_sub(struct block_list* bl, va_list ap);
 int status_change_clear(struct block_list* bl, int type);
 void status_change_clear_buffs(struct block_list* bl, uint8 type);
-void status_change_clear_onChangeMap(struct block_list *bl, struct status_change *sc);
+void status_change_clear_onChangeMap(struct block_list *bl, status_change *sc);
 TIMER_FUNC(status_clear_lastEffect_timer);
 
 #define status_calc_mob(md, opt) status_calc_bl_(&(md)->bl, status_db.getSCB_ALL(), opt)
@@ -3339,12 +3339,12 @@ TIMER_FUNC(status_clear_lastEffect_timer);
 #define status_calc_elemental(ed, opt) status_calc_bl_(&(ed)->bl, status_db.getSCB_ALL(), opt)
 #define status_calc_npc(nd, opt) status_calc_bl_(&(nd)->bl, status_db.getSCB_ALL(), opt)
 
-bool status_calc_weight(struct map_session_data *sd, enum e_status_calc_weight_opt flag);
-bool status_calc_cart_weight(struct map_session_data *sd, enum e_status_calc_weight_opt flag);
+bool status_calc_weight(map_session_data *sd, enum e_status_calc_weight_opt flag);
+bool status_calc_cart_weight(map_session_data *sd, enum e_status_calc_weight_opt flag);
 void status_calc_bl_(struct block_list *bl, std::bitset<SCB_MAX> flag, uint8 opt = SCO_NONE);
 int status_calc_mob_(struct mob_data* md, uint8 opt);
 void status_calc_pet_(struct pet_data* pd, uint8 opt);
-int status_calc_pc_(struct map_session_data* sd, uint8 opt);
+int status_calc_pc_(map_session_data* sd, uint8 opt);
 int status_calc_homunculus_(struct homun_data *hd, uint8 opt);
 int status_calc_mercenary_(s_mercenary_data *md, uint8 opt);
 int status_calc_elemental_(s_elemental_data *ed, uint8 opt);
@@ -3363,8 +3363,8 @@ static void status_calc_bl(block_list *bl, std::vector<e_scb_flag> flags) {
 
 void status_calc_misc(struct block_list *bl, struct status_data *status, int level);
 void status_calc_regen(struct block_list *bl, struct status_data *status, struct regen_data *regen);
-void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, struct status_change *sc);
-void status_calc_state(struct block_list *bl, struct status_change *sc, std::bitset<SCS_MAX> flag, bool start);
+void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, status_change *sc);
+void status_calc_state(struct block_list *bl, status_change *sc, std::bitset<SCS_MAX> flag, bool start);
 
 void status_calc_slave_mode(struct mob_data *md, struct mob_data *mmd);
 
@@ -3377,7 +3377,7 @@ int status_change_spread(block_list *src, block_list *bl);
 unsigned short status_base_matk_min(const struct status_data* status);
 unsigned short status_base_matk_max(const struct status_data* status);
 #else
-unsigned int status_weapon_atk(struct weapon_atk wa, struct map_session_data *sd);
+unsigned int status_weapon_atk(struct weapon_atk wa, map_session_data *sd);
 unsigned short status_base_atk_min(struct block_list *bl, const struct status_data* status, int level);
 unsigned short status_base_atk_max(struct block_list *bl, const struct status_data* status, int level);
 unsigned short status_base_matk_min(struct block_list *bl, const struct status_data* status, int level);

+ 28 - 28
src/map/storage.cpp

@@ -20,7 +20,7 @@
 #include "intif.hpp"
 #include "itemdb.hpp"
 #include "log.hpp"
-#include "map.hpp" // struct map_session_data
+#include "map.hpp" // map_session_data
 #include "packets.hpp"
 #include "pc.hpp"
 #include "pc_groups.hpp"
@@ -131,7 +131,7 @@ void do_reconnect_storage(void){
  * @param sd : player
  * @return  0:success, 1:fail
  */
-int storage_storageopen(struct map_session_data *sd)
+int storage_storageopen(map_session_data *sd)
 {
 	nullpo_ret(sd);
 
@@ -239,7 +239,7 @@ static enum e_storage_add storage_canGetItem(struct s_storage *stor, int idx, in
  * @param amount : quantity of items
  * @return 0:success, 1:failed, 2:failed because of room or stack checks
  */
-static int storage_additem(struct map_session_data* sd, struct s_storage *stor, struct item *it, int amount)
+static int storage_additem(map_session_data* sd, struct s_storage *stor, struct item *it, int amount)
 {
 	struct item_data *data;
 	int i;
@@ -303,7 +303,7 @@ static int storage_additem(struct map_session_data* sd, struct s_storage *stor,
  * @param amount :number of item to remove
  * @return 0:sucess, 1:fail
  */
-int storage_delitem(struct map_session_data* sd, struct s_storage *stor, int index, int amount)
+int storage_delitem(map_session_data* sd, struct s_storage *stor, int index, int amount)
 {
 	if( stor->u.items_storage[index].nameid == 0 || stor->u.items_storage[index].amount < amount )
 		return 1;
@@ -332,7 +332,7 @@ int storage_delitem(struct map_session_data* sd, struct s_storage *stor, int ind
  * @param amount : number of item to take
  * @return 0:fail, 1:success
  */
-void storage_storageadd(struct map_session_data* sd, struct s_storage *stor, int index, int amount)
+void storage_storageadd(map_session_data* sd, struct s_storage *stor, int index, int amount)
 {
 	enum e_storage_add result;
 
@@ -365,7 +365,7 @@ void storage_storageadd(struct map_session_data* sd, struct s_storage *stor, int
  * @param amount : number of item to take
  * @return 0:fail, 1:success
  */
-void storage_storageget(struct map_session_data *sd, struct s_storage *stor, int index, int amount)
+void storage_storageget(map_session_data *sd, struct s_storage *stor, int index, int amount)
 {
 	unsigned char flag = 0;
 	enum e_storage_add result;
@@ -392,7 +392,7 @@ void storage_storageget(struct map_session_data *sd, struct s_storage *stor, int
  * @param amount : number of item to take
  * @return 0:fail, 1:success
  */
-void storage_storageaddfromcart(struct map_session_data *sd, struct s_storage *stor, int index, int amount)
+void storage_storageaddfromcart(map_session_data *sd, struct s_storage *stor, int index, int amount)
 {
 	enum e_storage_add result;
 	nullpo_retv(sd);
@@ -429,7 +429,7 @@ void storage_storageaddfromcart(struct map_session_data *sd, struct s_storage *s
  * @param amount : number of item to take
  * @return 0:fail, 1:success
  */
-void storage_storagegettocart(struct map_session_data* sd, struct s_storage *stor, int index, int amount)
+void storage_storagegettocart(map_session_data* sd, struct s_storage *stor, int index, int amount)
 {
 	unsigned char flag = 0;
 	enum e_storage_add result;
@@ -456,7 +456,7 @@ void storage_storagegettocart(struct map_session_data* sd, struct s_storage *sto
  * Request to save storage
  * @param sd: Player who has the storage
  */
-void storage_storagesave(struct map_session_data *sd)
+void storage_storagesave(map_session_data *sd)
 {
 	nullpo_retv(sd);
 
@@ -468,7 +468,7 @@ void storage_storagesave(struct map_session_data *sd)
  * @param sd: Player who has the storage
  * @author [massdriller] / modified by [Valaris]
  */
-void storage_storageclose(struct map_session_data *sd)
+void storage_storageclose(map_session_data *sd)
 {
 	nullpo_retv(sd);
 
@@ -493,7 +493,7 @@ void storage_storageclose(struct map_session_data *sd)
  *  1: Character is quitting
  *	2(x): Character is changing map-servers 
  */
-void storage_storage_quit(struct map_session_data* sd, int flag)
+void storage_storage_quit(map_session_data* sd, int flag)
 {
 	nullpo_retv(sd);
 
@@ -551,7 +551,7 @@ void storage_guild_delete(int guild_id)
  * @param sd : player
  * @return 0 : success, 1 : fail, 2 : no guild found
  */
-char storage_guild_storageopen(struct map_session_data* sd)
+char storage_guild_storageopen(map_session_data* sd)
 {
 	struct s_storage *gstor;
 
@@ -606,7 +606,7 @@ char storage_guild_storageopen(struct map_session_data* sd)
 	return GSTORAGE_OPEN;
 }
 
-void storage_guild_log( struct map_session_data* sd, struct item* item, int16 amount ){
+void storage_guild_log( map_session_data* sd, struct item* item, int16 amount ){
 	int i;
 	SqlStmt* stmt = SqlStmt_Malloc(mmysql_handle);
 	StringBuf buf;
@@ -636,7 +636,7 @@ void storage_guild_log( struct map_session_data* sd, struct item* item, int16 am
 	StringBuf_Destroy(&buf);
 }
 
-enum e_guild_storage_log storage_guild_log_read_sub( struct map_session_data* sd, std::vector<struct guild_log_entry>& log, uint32 max ){
+enum e_guild_storage_log storage_guild_log_read_sub( map_session_data* sd, std::vector<struct guild_log_entry>& log, uint32 max ){
 	StringBuf buf;
 	int j;
 
@@ -707,7 +707,7 @@ enum e_guild_storage_log storage_guild_log_read_sub( struct map_session_data* sd
 	return GUILDSTORAGE_LOG_FINAL_SUCCESS;
 }
 
-enum e_guild_storage_log storage_guild_log_read( struct map_session_data* sd ){
+enum e_guild_storage_log storage_guild_log_read( map_session_data* sd ){
 	std::vector<struct guild_log_entry> log;
 
 	enum e_guild_storage_log ret = storage_guild_log_read_sub( sd, log, MAX_GUILD_STORAGE_LOG_PACKET );
@@ -725,7 +725,7 @@ enum e_guild_storage_log storage_guild_log_read( struct map_session_data* sd ){
  * @param amount : number of item to add
  * @return True : success, False : fail
  */
-bool storage_guild_additem(struct map_session_data* sd, struct s_storage* stor, struct item* item_data, int amount)
+bool storage_guild_additem(map_session_data* sd, struct s_storage* stor, struct item* item_data, int amount)
 {
 	struct item_data *id;
 	int i;
@@ -841,7 +841,7 @@ bool storage_guild_additem2(struct s_storage* stor, struct item* item, int amoun
  * @param amount : number of item to delete
  * @return True : success, False : fail
  */
-bool storage_guild_delitem(struct map_session_data* sd, struct s_storage* stor, int n, int amount)
+bool storage_guild_delitem(map_session_data* sd, struct s_storage* stor, int n, int amount)
 {
 	nullpo_retr(1, sd);
 	nullpo_retr(1, stor);
@@ -870,7 +870,7 @@ bool storage_guild_delitem(struct map_session_data* sd, struct s_storage* stor,
  * @param sd : player
  * @param amount : number of item to delete
  */
-void storage_guild_storageadd(struct map_session_data* sd, int index, int amount)
+void storage_guild_storageadd(map_session_data* sd, int index, int amount)
 {
 	struct s_storage *stor;
 
@@ -912,7 +912,7 @@ void storage_guild_storageadd(struct map_session_data* sd, int index, int amount
  * @param amount : number of item to get
  * @return 1:success, 0:fail
  */
-void storage_guild_storageget(struct map_session_data* sd, int index, int amount)
+void storage_guild_storageget(map_session_data* sd, int index, int amount)
 {
 	struct s_storage *stor;
 	unsigned char flag = 0;
@@ -951,7 +951,7 @@ void storage_guild_storageget(struct map_session_data* sd, int index, int amount
  * @param index : index of item in cart
  * @param amount : number of item to transfer
  */
-void storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int amount)
+void storage_guild_storageaddfromcart(map_session_data* sd, int index, int amount)
 {
 	struct s_storage *stor;
 
@@ -985,7 +985,7 @@ void storage_guild_storageaddfromcart(struct map_session_data* sd, int index, in
  * @param amount : number of item to transfer
  * @return 1:fail, 0:success
  */
-void storage_guild_storagegettocart(struct map_session_data* sd, int index, int amount)
+void storage_guild_storagegettocart(map_session_data* sd, int index, int amount)
 {
 	short flag;
 	struct s_storage *stor;
@@ -1055,7 +1055,7 @@ void storage_guild_storagesaved(int guild_id)
  * Close storage for player then save it
  * @param sd : player
  */
-void storage_guild_storageclose(struct map_session_data* sd)
+void storage_guild_storageclose(map_session_data* sd)
 {
 	struct s_storage *stor;
 
@@ -1080,7 +1080,7 @@ void storage_guild_storageclose(struct map_session_data* sd)
  * @param sd
  * @param flag
  */
-void storage_guild_storage_quit(struct map_session_data* sd, int flag)
+void storage_guild_storage_quit(map_session_data* sd, int flag)
 {
 	struct s_storage *stor;
 
@@ -1113,7 +1113,7 @@ void storage_guild_storage_quit(struct map_session_data* sd, int flag)
  * Open premium storage
  * @param sd Player
  **/
-void storage_premiumStorage_open(struct map_session_data *sd) {
+void storage_premiumStorage_open(map_session_data *sd) {
 	nullpo_retv(sd);
 
 	sd->state.storage_flag = 3;
@@ -1130,7 +1130,7 @@ void storage_premiumStorage_open(struct map_session_data *sd) {
  * @return 1:Success to request, 0:Failed
  * @author [Cydh]
  **/
-bool storage_premiumStorage_load(struct map_session_data *sd, uint8 num, uint8 mode) {
+bool storage_premiumStorage_load(map_session_data *sd, uint8 num, uint8 mode) {
 	nullpo_ret(sd);
 
 	if (sd->state.storage_flag)
@@ -1162,7 +1162,7 @@ bool storage_premiumStorage_load(struct map_session_data *sd, uint8 num, uint8 m
  * @param sd Player who has the storage
  * @author [Cydh]
  **/
-void storage_premiumStorage_save(struct map_session_data *sd) {
+void storage_premiumStorage_save(map_session_data *sd) {
 	nullpo_retv(sd);
 
 	intif_storage_save(sd, &sd->premiumStorage);
@@ -1173,7 +1173,7 @@ void storage_premiumStorage_save(struct map_session_data *sd) {
  * @param sd Player who has the storage
  * @author [Cydh]
  **/
-void storage_premiumStorage_close(struct map_session_data *sd) {
+void storage_premiumStorage_close(map_session_data *sd) {
 	nullpo_retv(sd);
 
 	if (sd->premiumStorage.dirty) {
@@ -1194,7 +1194,7 @@ void storage_premiumStorage_close(struct map_session_data *sd) {
  * @param sd Player who has the storage
  * @author [Cydh]
  **/
-void storage_premiumStorage_quit(struct map_session_data *sd) {
+void storage_premiumStorage_quit(map_session_data *sd) {
 	nullpo_retv(sd);
 
 	if (save_settings&CHARSAVE_STORAGE)

+ 25 - 25
src/map/storage.hpp

@@ -13,7 +13,7 @@
 
 struct s_storage;
 struct item;
-struct map_session_data;
+class map_session_data;
 
 extern std::unordered_map<uint16, std::shared_ptr<struct s_storage_table>> storage_db;
 
@@ -52,43 +52,43 @@ struct guild_log_entry{
 const char *storage_getName(uint8 id);
 bool storage_exists(uint8 id);
 
-int storage_delitem(struct map_session_data* sd, struct s_storage *stor, int index, int amount);
-int storage_storageopen(struct map_session_data *sd);
-void storage_storageadd(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
-void storage_storageget(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
-void storage_storageaddfromcart(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
-void storage_storagegettocart(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
-void storage_storagesave(struct map_session_data *sd);
-void storage_storageclose(struct map_session_data *sd);
+int storage_delitem(map_session_data* sd, struct s_storage *stor, int index, int amount);
+int storage_storageopen(map_session_data *sd);
+void storage_storageadd(map_session_data *sd, struct s_storage *stor, int index, int amount);
+void storage_storageget(map_session_data *sd, struct s_storage *stor, int index, int amount);
+void storage_storageaddfromcart(map_session_data *sd, struct s_storage *stor, int index, int amount);
+void storage_storagegettocart(map_session_data *sd, struct s_storage *stor, int index, int amount);
+void storage_storagesave(map_session_data *sd);
+void storage_storageclose(map_session_data *sd);
 void storage_sortitem(struct item* items, unsigned int size);
 void do_init_storage(void);
 void do_final_storage(void);
 void do_reconnect_storage(void);
-void storage_storage_quit(struct map_session_data *sd, int flag);
+void storage_storage_quit(map_session_data *sd, int flag);
 
 struct s_storage* guild2storage(int guild_id);
 struct s_storage* guild2storage2(int guild_id);
 void storage_guild_delete(int guild_id);
-char storage_guild_storageopen(struct map_session_data *sd);
-enum e_guild_storage_log storage_guild_log_read( struct map_session_data* sd );
-bool storage_guild_additem(struct map_session_data *sd,struct s_storage *stor,struct item *item_data,int amount);
+char storage_guild_storageopen(map_session_data *sd);
+enum e_guild_storage_log storage_guild_log_read( map_session_data* sd );
+bool storage_guild_additem(map_session_data *sd,struct s_storage *stor,struct item *item_data,int amount);
 bool storage_guild_additem2(struct s_storage* stor, struct item* item, int amount);
-bool storage_guild_delitem(struct map_session_data *sd,struct s_storage *stor,int n,int amount);
-void storage_guild_storageadd(struct map_session_data *sd,int index,int amount);
-void storage_guild_storageget(struct map_session_data *sd,int index,int amount);
-void storage_guild_storageaddfromcart(struct map_session_data *sd,int index,int amount);
-void storage_guild_storagegettocart(struct map_session_data *sd,int index,int amount);
-void storage_guild_storageclose(struct map_session_data *sd);
-void storage_guild_storage_quit(struct map_session_data *sd,int flag);
+bool storage_guild_delitem(map_session_data *sd,struct s_storage *stor,int n,int amount);
+void storage_guild_storageadd(map_session_data *sd,int index,int amount);
+void storage_guild_storageget(map_session_data *sd,int index,int amount);
+void storage_guild_storageaddfromcart(map_session_data *sd,int index,int amount);
+void storage_guild_storagegettocart(map_session_data *sd,int index,int amount);
+void storage_guild_storageclose(map_session_data *sd);
+void storage_guild_storage_quit(map_session_data *sd,int flag);
 bool storage_guild_storagesave(uint32 account_id, int guild_id, int flag);
 void storage_guild_storagesaved(int guild_id); //Ack from char server that guild store was saved.
 
 // Premium Storage [Cydh]
-void storage_premiumStorage_open(struct map_session_data *sd);
-bool storage_premiumStorage_load(struct map_session_data *sd, uint8 num, uint8 mode);
-void storage_premiumStorage_save(struct map_session_data *sd);
-void storage_premiumStorage_close(struct map_session_data *sd);
-void storage_premiumStorage_quit(struct map_session_data *sd);
+void storage_premiumStorage_open(map_session_data *sd);
+bool storage_premiumStorage_load(map_session_data *sd, uint8 num, uint8 mode);
+void storage_premiumStorage_save(map_session_data *sd);
+void storage_premiumStorage_close(map_session_data *sd);
+void storage_premiumStorage_quit(map_session_data *sd);
 
 int compare_item(struct item *a, struct item *b);
 

+ 16 - 16
src/map/trade.cpp

@@ -28,7 +28,7 @@
  * @param sd : player requesting the trade
  * @param target_sd : player requested
  */
-void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd)
+void trade_traderequest(map_session_data *sd, map_session_data *target_sd)
 {
 	nullpo_retv(sd);
 
@@ -55,7 +55,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
 	}
 
 	if ( sd->trade_partner != 0 ) { // If a character tries to trade to another one then cancel the previous one
-		struct map_session_data *previous_sd = map_id2sd(sd->trade_partner);
+		map_session_data *previous_sd = map_id2sd(sd->trade_partner);
 
 		if( previous_sd ){
 			previous_sd->trade_partner = 0;
@@ -101,9 +101,9 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
  * Weird enough, the client should only send 3/4
  * and the server is the one that can reply 0~2
  */
-void trade_tradeack(struct map_session_data *sd, int type)
+void trade_tradeack(map_session_data *sd, int type)
 {
-	struct map_session_data *tsd;
+	map_session_data *tsd;
 
 	nullpo_retv(sd);
 
@@ -174,7 +174,7 @@ void trade_tradeack(struct map_session_data *sd, int type)
  * @param sd : player to check
  * @return -1:zeny hack, 0:all fine, 1:item hack
  */
-int impossible_trade_check(struct map_session_data *sd)
+int impossible_trade_check(map_session_data *sd)
 {
 	struct item inventory[MAX_INVENTORY];
 	char message_to_gm[200];
@@ -240,7 +240,7 @@ int impossible_trade_check(struct map_session_data *sd)
  * @param tsd : player 2 trading
  * @return 0:error, 1:success
  */
-int trade_check(struct map_session_data *sd, struct map_session_data *tsd)
+int trade_check(map_session_data *sd, map_session_data *tsd)
 {
 	struct item inventory[MAX_INVENTORY];
 	struct item inventory2[MAX_INVENTORY];
@@ -344,9 +344,9 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd)
  * @param index : index of item in inventory
  * @param amount : amount of item to add from index
  */
-void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
+void trade_tradeadditem(map_session_data *sd, short index, short amount)
 {
-	struct map_session_data *target_sd;
+	map_session_data *target_sd;
 	struct item *item;
 	int trade_i, trade_weight;
 	int src_lv, dst_lv;
@@ -444,9 +444,9 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
  * @param sd : Player who's adding zeny
  * @param amount : zeny amount
  */
-void trade_tradeaddzeny(struct map_session_data* sd, int amount)
+void trade_tradeaddzeny(map_session_data* sd, int amount)
 {
-	struct map_session_data* target_sd;
+	map_session_data* target_sd;
 
 	nullpo_retv(sd);
 
@@ -471,9 +471,9 @@ void trade_tradeaddzeny(struct map_session_data* sd, int amount)
  * 'Ok' button on the trade window is pressed.
  * @param sd : Player that pressed the button
  */
-void trade_tradeok(struct map_session_data *sd)
+void trade_tradeok(map_session_data *sd)
 {
-	struct map_session_data *target_sd;
+	map_session_data *target_sd;
 
 	if(sd->state.deal_locked || !sd->state.trading)
 		return;
@@ -493,9 +493,9 @@ void trade_tradeok(struct map_session_data *sd)
  * 'Cancel' is pressed. (or trade was force-cancelled by the code)
  * @param sd : Player that pressed the button
  */
-void trade_tradecancel(struct map_session_data *sd)
+void trade_tradecancel(map_session_data *sd)
 {
-	struct map_session_data *target_sd;
+	map_session_data *target_sd;
 	int trade_i;
 
 	nullpo_retv(sd);
@@ -559,9 +559,9 @@ void trade_tradecancel(struct map_session_data *sd)
  * lock sd and tsd trade data, execute the trade, clear, then save players
  * @param sd : Player that has click on trade button
  */
-void trade_tradecommit(struct map_session_data *sd)
+void trade_tradecommit(map_session_data *sd)
 {
-	struct map_session_data *tsd;
+	map_session_data *tsd;
 	int trade_i;
 
 	nullpo_retv(sd);

+ 8 - 8
src/map/trade.hpp

@@ -4,14 +4,14 @@
 #ifndef TRADE_HPP
 #define TRADE_HPP
 
-struct map_session_data;
+class map_session_data;
 
-void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd);
-void trade_tradeack(struct map_session_data *sd,int type);
-void trade_tradeadditem(struct map_session_data *sd,short index,short amount);
-void trade_tradeaddzeny(struct map_session_data *sd,int amount);
-void trade_tradeok(struct map_session_data *sd);
-void trade_tradecancel(struct map_session_data *sd);
-void trade_tradecommit(struct map_session_data *sd);
+void trade_traderequest(map_session_data *sd, map_session_data *target_sd);
+void trade_tradeack(map_session_data *sd,int type);
+void trade_tradeadditem(map_session_data *sd,short index,short amount);
+void trade_tradeaddzeny(map_session_data *sd,int amount);
+void trade_tradeok(map_session_data *sd);
+void trade_tradecancel(map_session_data *sd);
+void trade_tradecommit(map_session_data *sd);
 
 #endif /* TRADE_HPP */

+ 25 - 25
src/map/unit.cpp

@@ -67,7 +67,7 @@ struct unit_data* unit_bl2ud(struct block_list *bl)
 {
 	if( bl == NULL) return NULL;
 	switch(bl->type){
-	case BL_PC: return &((struct map_session_data*)bl)->ud;
+	case BL_PC: return &((map_session_data*)bl)->ud;
 	case BL_MOB: return &((struct mob_data*)bl)->ud;
 	case BL_PET: return &((struct pet_data*)bl)->ud;
 	case BL_NPC: return &((struct npc_data*)bl)->ud;
@@ -910,7 +910,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, unsi
  * Called by unit_run when an object is hit.
  * @param sd Required only when using SC_WUGDASH
  */
-void unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type)
+void unit_run_hit(struct block_list *bl, status_change *sc, map_session_data *sd, enum sc_type type)
 {
 	int lv = sc->getSCE(type)->val1;
 
@@ -938,9 +938,9 @@ void unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_se
  * @param sd: Required only when using SC_WUGDASH
  * @return true: Success (Finished running) false: Fail (Hit an object/Couldn't run)
  */
-bool unit_run(struct block_list *bl, struct map_session_data *sd, enum sc_type type)
+bool unit_run(struct block_list *bl, map_session_data *sd, enum sc_type type)
 {
-	struct status_change *sc;
+	status_change *sc;
 	short to_x, to_y, dir_x, dir_y;
 	int i;
 
@@ -1033,7 +1033,7 @@ bool unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, boo
 {
 	short dx,dy;
 	struct unit_data        *ud = NULL;
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 
 	nullpo_retr(false,bl);
 
@@ -1160,7 +1160,7 @@ uint8 unit_getdir(struct block_list *bl)
 int unit_blown(struct block_list* bl, int dx, int dy, int count, enum e_skill_blown flag)
 {
 	if(count) {
-		struct map_session_data* sd;
+		map_session_data* sd;
 		struct skill_unit* su = NULL;
 		int nx, ny, result;
 
@@ -1248,7 +1248,7 @@ enum e_unit_blown unit_blown_immune(struct block_list* bl, uint8 flag)
 				return UB_MD_KNOCKBACK_IMMUNE;
 			break;
 		case BL_PC: {
-				struct map_session_data *sd = BL_CAST(BL_PC, bl);
+				map_session_data *sd = BL_CAST(BL_PC, bl);
 
 #ifndef RENEWAL
 				// Basilica caster can't be knocked-back by normal monsters.
@@ -1469,9 +1469,9 @@ int unit_is_walking(struct block_list *bl)
  * @return True - can move; False - can't move
  */
 bool unit_can_move(struct block_list *bl) {
-	struct map_session_data *sd;
+	map_session_data *sd;
 	struct unit_data *ud;
-	struct status_change *sc;
+	status_change *sc;
 
 	nullpo_ret(bl);
 
@@ -1606,8 +1606,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
 {
 	struct unit_data *ud;
 	struct status_data *tstatus;
-	struct status_change *sc;
-	struct map_session_data *sd = NULL;
+	status_change *sc;
+	map_session_data *sd = NULL;
 	struct block_list * target = NULL;
 	t_tick tick = gettick();
 	int combo = 0, range;
@@ -2119,9 +2119,9 @@ int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, uint
  */
 int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel)
 {
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	struct unit_data        *ud = NULL;
-	struct status_change *sc;
+	status_change *sc;
 	struct block_list    bl;
 	t_tick tick = gettick();
 	int range;
@@ -2676,7 +2676,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, t_tick tick)
 	struct block_list *target;
 	struct unit_data *ud;
 	struct status_data *sstatus;
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	struct mob_data *md = NULL;
 	int range;
 
@@ -2866,7 +2866,7 @@ bool unit_can_attack(struct block_list *bl, int target_id) {
 			return false;
 	}
 
-	struct status_change *sc;
+	status_change *sc;
 
 	if (!(sc = status_get_sc(bl)))
 		return true;
@@ -2887,7 +2887,7 @@ bool unit_can_attack(struct block_list *bl, int target_id) {
  */
 int unit_skillcastcancel(struct block_list *bl, char type)
 {
-	struct map_session_data *sd = NULL;
+	map_session_data *sd = NULL;
 	struct unit_data *ud = unit_bl2ud( bl);
 	t_tick tick = gettick();
 	int ret = 0, skill_id;
@@ -3039,7 +3039,7 @@ int unit_changetarget(struct block_list *bl, va_list ap) {
 int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func)
 {
 	struct unit_data *ud = unit_bl2ud(bl);
-	struct status_change *sc = status_get_sc(bl);
+	status_change *sc = status_get_sc(bl);
 
 	nullpo_ret(ud);
 
@@ -3084,7 +3084,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
 
 	switch( bl->type ) {
 		case BL_PC: {
-			struct map_session_data *sd = (struct map_session_data*)bl;
+			map_session_data *sd = (map_session_data*)bl;
 
 			if(sd->shadowform_id) { // If shadow target has leave the map
 			    struct block_list *d_bl = map_id2bl(sd->shadowform_id);
@@ -3323,7 +3323,7 @@ void unit_refresh(struct block_list *bl, bool walking) {
  *	0: Assume bl is being warped
  *	1: Death, appropriate cleanup performed
  */
-void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype)
+void unit_remove_map_pc(map_session_data *sd, clr_type clrtype)
 {
 	unit_remove_map(&sd->bl,clrtype);
 
@@ -3349,7 +3349,7 @@ void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype)
  * Also free his pets/homon/mercenary/elemental/etc if he have any
  * @param sd: Player
  */
-void unit_free_pc(struct map_session_data *sd)
+void unit_free_pc(map_session_data *sd)
 {
 	if (sd->pd)
 		unit_free(&sd->pd->bl,CLR_OUTSIGHT);
@@ -3387,7 +3387,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
 
 	switch( bl->type ) {
 		case BL_PC: {
-			struct map_session_data *sd = (struct map_session_data*)bl;
+			map_session_data *sd = (map_session_data*)bl;
 			int i;
 
 			if( status_isdead(bl) )
@@ -3472,7 +3472,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
 		}
 		case BL_PET: {
 			struct pet_data *pd = (struct pet_data*)bl;
-			struct map_session_data *sd = pd->master;
+			map_session_data *sd = pd->master;
 
 			pet_delautobonus(*sd, pd->autobonus, false);
 			pet_delautobonus(*sd, pd->autobonus2, false);
@@ -3564,7 +3564,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
 		case BL_HOM:
 		{
 			struct homun_data *hd = (TBL_HOM*)bl;
-			struct map_session_data *sd = hd->master;
+			map_session_data *sd = hd->master;
 
 			hom_hungry_timer_delete(hd);
 
@@ -3591,7 +3591,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
 		}
 		case BL_MER: {
 			s_mercenary_data *md = (TBL_MER*)bl;
-			struct map_session_data *sd = md->master;
+			map_session_data *sd = md->master;
 
 			if( mercenary_get_lifetime(md) > 0 )
 				mercenary_save(md);
@@ -3614,7 +3614,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
 		}
 		case BL_ELEM: {
 			s_elemental_data *ed = (TBL_ELEM*)bl;
-			struct map_session_data *sd = ed->master;
+			map_session_data *sd = ed->master;
 
 			if( elemental_get_lifetime(ed) > 0 )
 				elemental_save(ed);

+ 5 - 5
src/map/unit.hpp

@@ -13,7 +13,7 @@
 enum sc_type : int16;
 struct block_list;
 struct unit_data;
-struct map_session_data;
+class map_session_data;
 enum clr_type : uint8;
 
 extern const short dirx[DIR_MAX]; ///lookup to know where will move to x according dir
@@ -110,8 +110,8 @@ enum e_unit_stop_walking {
 // Does walk action for unit
 int unit_walktoxy(struct block_list *bl, short x, short y, unsigned char flag);
 int unit_walktobl(struct block_list *bl, struct block_list *target, int range, unsigned char flag);
-void unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type);
-bool unit_run(struct block_list *bl, struct map_session_data *sd, enum sc_type type);
+void unit_run_hit(struct block_list *bl, status_change *sc, map_session_data *sd, enum sc_type type);
+bool unit_run(struct block_list *bl, map_session_data *sd, enum sc_type type);
 int unit_calc_pos(struct block_list *bl, int tx, int ty, uint8 dir);
 TIMER_FUNC(unit_delay_walktoxy_timer);
 TIMER_FUNC(unit_delay_walktobl_timer);
@@ -165,9 +165,9 @@ void unit_skillunit_maxcount(unit_data& ud, uint16 skill_id, int& maxcount);
 
 // Remove unit
 struct unit_data* unit_bl2ud(struct block_list *bl);
-void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype);
+void unit_remove_map_pc(map_session_data *sd, clr_type clrtype);
 void unit_refresh(struct block_list *bl, bool walking = false);
-void unit_free_pc(struct map_session_data *sd);
+void unit_free_pc(map_session_data *sd);
 #define unit_remove_map(bl,clrtype) unit_remove_map_(bl,clrtype,__FILE__,__LINE__,__func__)
 int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func);
 int unit_free(struct block_list *bl, clr_type clrtype);

+ 11 - 11
src/map/vending.cpp

@@ -55,7 +55,7 @@ static int vending_getuid(void)
  * Make a player close his shop
  * @param sd : player session
  */
-void vending_closevending(struct map_session_data* sd)
+void vending_closevending(map_session_data* sd)
 {
 	nullpo_retv(sd);
 
@@ -77,9 +77,9 @@ void vending_closevending(struct map_session_data* sd)
  * @param sd : player requestion the list
  * @param id : vender account id (gid)
  */
-void vending_vendinglistreq(struct map_session_data* sd, int id)
+void vending_vendinglistreq(map_session_data* sd, int id)
 {
-	struct map_session_data* vsd;
+	map_session_data* vsd;
 	nullpo_retv(sd);
 
 	if( (vsd = map_id2sd(id)) == NULL )
@@ -103,7 +103,7 @@ void vending_vendinglistreq(struct map_session_data* sd, int id)
  * @param zeny: Total amount to tax
  * @return Total amount after taxes
  */
-static double vending_calc_tax(struct map_session_data *sd, double zeny)
+static double vending_calc_tax(map_session_data *sd, double zeny)
 {
 	if (battle_config.vending_tax && zeny >= battle_config.vending_tax_min)
 		zeny -= zeny * (battle_config.vending_tax / 10000.);
@@ -120,12 +120,12 @@ static double vending_calc_tax(struct map_session_data *sd, double zeny)
  *	data := {<index>.w <amount>.w }[count]
  * @param count : number of different items he's trying to buy
  */
-void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const uint8* data, int count)
+void vending_purchasereq(map_session_data* sd, int aid, int uid, const uint8* data, int count)
 {
 	int i, j, cursor, w, new_ = 0, blank, vend_list[MAX_VENDING];
 	double z;
 	struct s_vending vending[MAX_VENDING]; // against duplicate packets
-	struct map_session_data* vsd = map_id2sd(aid);
+	map_session_data* vsd = map_id2sd(aid);
 
 	nullpo_retv(sd);
 	if( vsd == NULL || !vsd->state.vending || vsd->bl.id == sd->bl.id )
@@ -295,7 +295,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
  * @param at Autotrader info, or NULL if requetsed not from autotrade persistance
  * @return 0 If success, 1 - Cannot open (die, not state.prevend, trading), 2 - No cart, 3 - Count issue, 4 - Cart data isn't saved yet, 5 - No valid item found
  */
-int8 vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count, struct s_autotrader *at)
+int8 vending_openvending(map_session_data* sd, const char* message, const uint8* data, int count, struct s_autotrader *at)
 {
 	int i, j;
 	int vending_skill_lvl;
@@ -401,7 +401,7 @@ int8 vending_openvending(struct map_session_data* sd, const char* message, const
  * @param nameid : item id
  * @return 0:not selling it, 1: yes
  */
-bool vending_search(struct map_session_data* sd, t_itemid nameid)
+bool vending_search(map_session_data* sd, t_itemid nameid)
 {
 	int i;
 
@@ -423,7 +423,7 @@ bool vending_search(struct map_session_data* sd, t_itemid nameid)
  * @param s : parameter of the search (see s_search_store_search)
  * @return Whether or not the search should be continued.
  */
-bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s)
+bool vending_searchall(map_session_data* sd, const struct s_search_store_search* s)
 {
 	int i, c, slot;
 	unsigned int idx, cidx;
@@ -494,7 +494,7 @@ bool vending_searchall(struct map_session_data* sd, const struct s_search_store_
 * Open vending for Autotrader
 * @param sd Player as autotrader
 */
-void vending_reopen( struct map_session_data* sd )
+void vending_reopen( map_session_data* sd )
 {
 	struct s_autotrader *at = NULL;
 	int8 fail = -1;
@@ -616,7 +616,7 @@ void do_init_vending_autotrade(void)
 					at->sit = battle_config.feature_autotrade_sit;
 
 				// initialize player
-				CREATE(at->sd, struct map_session_data, 1);
+				CREATE(at->sd, map_session_data, 1); // TODO: Dont use Memory Manager allocation anymore and rely on the C++ container
 				pc_setnewpc(at->sd, at->account_id, at->char_id, 0, gettick(), at->sex, 0);
 				at->sd->state.autotrade = 1|2;
 				if (battle_config.autotrade_monsterignore)

+ 8 - 8
src/map/vending.hpp

@@ -8,7 +8,7 @@
 #include "../common/db.hpp"
 #include "../common/mmo.hpp"
 
-struct map_session_data;
+class map_session_data;
 struct s_search_store_search;
 struct s_autotrader;
 
@@ -23,13 +23,13 @@ void do_final_vending(void);
 void do_init_vending(void);
 void do_init_vending_autotrade( void );
  
-void vending_reopen( struct map_session_data* sd );
-void vending_closevending(struct map_session_data* sd);
-int8 vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count, struct s_autotrader *at);
-void vending_vendinglistreq(struct map_session_data* sd, int id);
-void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const uint8* data, int count);
-bool vending_search(struct map_session_data* sd, t_itemid nameid);
-bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s);
+void vending_reopen( map_session_data* sd );
+void vending_closevending(map_session_data* sd);
+int8 vending_openvending(map_session_data* sd, const char* message, const uint8* data, int count, struct s_autotrader *at);
+void vending_vendinglistreq(map_session_data* sd, int id);
+void vending_purchasereq(map_session_data* sd, int aid, int uid, const uint8* data, int count);
+bool vending_search(map_session_data* sd, t_itemid nameid);
+bool vending_searchall(map_session_data* sd, const struct s_search_store_search* s);
 void vending_update(map_session_data &sd);
 
 #endif /* _VENDING_HPP_ */

部分文件因文件數量過多而無法顯示