summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/Makefile.in32
-rw-r--r--src/map/clif.c78
-rw-r--r--src/map/clif.h6
-rw-r--r--src/map/pc.c12
4 files changed, 82 insertions, 46 deletions
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 31c0fc3f1..355086127 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -1,9 +1,9 @@
-COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \
- ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \
- ../common/obj/nullpo.o ../common/obj/malloc.o ../common/obj/showmsg.o \
- ../common/obj/utils.o ../common/obj/strlib.o ../common/obj/grfio.o \
- ../common/obj/mapindex.o ../common/obj/ers.o
+COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \
+ ../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \
+ ../common/obj_all/nullpo.o ../common/obj_all/malloc.o ../common/obj_all/showmsg.o \
+ ../common/obj_all/utils.o ../common/obj_all/strlib.o ../common/obj_all/grfio.o \
+ ../common/obj_all/mapindex.o ../common/obj_all/ers.o
COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \
../common/db.h ../common/plugins.h ../common/lock.h \
../common/nullpo.h ../common/malloc.h ../common/showmsg.h \
@@ -13,11 +13,13 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \
COMMON_SQL_OBJ = ../common/obj_sql/sql.o
COMMON_SQL_H = ../common/sql.h
-MAP_OBJ = obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/status.o obj/npc.o \
- obj/npc_chat.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o \
- obj/storage.o obj/skill.o obj/atcommand.o obj/charcommand.o obj/battle.o \
- obj/intif.o obj/trade.o obj/party.o obj/vending.o obj/guild.o obj/pet.o \
- obj/log.o obj/mail.o obj/date.o obj/irc.o obj/unit.o obj/mercenary.o
+MAP_OBJ = map.o chrif.o clif.o pc.o status.o npc.o \
+ npc_chat.o chat.o path.o itemdb.o mob.o script.o \
+ storage.o skill.o atcommand.o charcommand.o battle.o \
+ intif.o trade.o party.o vending.o guild.o pet.o \
+ log.o mail.o date.o irc.o unit.o mercenary.o
+MAP_TXT_OBJ = $(MAP_OBJ:%=obj_txt/%)
+MAP_SQL_OBJ = $(MAP_OBJ:%=obj_sql/%)
MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \
chat.h itemdb.h mob.h script.h \
storage.h skill.h atcommand.h charcommand.h battle.h \
@@ -80,11 +82,11 @@ obj_sql:
-mkdir obj_sql
# executables
-map-server: obj_txt $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ)
- @CC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ) @LIBS@ @PCRE_LIBS@
+map-server: obj_txt $(MAP_TXT_OBJ) $(COMMON_OBJ)
+ @CC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_TXT_OBJ) $(COMMON_OBJ) @LIBS@ @PCRE_LIBS@
-map-server_sql: obj_sql $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_OBJ) $(COMMON_SQL_OBJ)
- @CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
+map-server_sql: obj_sql $(MAP_SQL_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ)
+ @CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_SQL_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
# map object files
obj_txt/%.o: %.c $(MAP_H) $(COMMON_H)
@@ -94,7 +96,7 @@ obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(COMMON_SQL_H)
@CC@ @CFLAGS@ $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing common object files
-../common/obj/%.o:
+../common/obj_all/%.o:
@$(MAKE) -C ../common txt
../common/obj_sql/%.o:
diff --git a/src/map/clif.c b/src/map/clif.c
index 5f59bda74..2a45b1b79 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4396,35 +4396,44 @@ void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short sk
else
sd->menuskill_val = skill_lv;
}
-/*==========================================
- * メモ応答
- *------------------------------------------*/
-int clif_skill_memo(struct map_session_data *sd,int flag)
+
+/// Memo message.
+/// type=0 : "Saved location as a Memo Point for Warp skill." in color 0xFFFF00 (cyan)
+/// type=1 : "Skill Level is not high enough." in color 0x0000FF (red)
+/// type=2 : "You haven't learned Warp." in color 0x0000FF (red)
+///
+/// @param sd Who receives the message
+/// @param type What message
+void clif_skill_memomessage(struct map_session_data* sd, int type)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_retv(sd);
fd=sd->fd;
-
WFIFOHEAD(fd,packet_len(0x11e));
WFIFOW(fd,0)=0x11e;
- WFIFOB(fd,2)=flag;
+ WFIFOB(fd,2)=type;
WFIFOSET(fd,packet_len(0x11e));
- return 0;
}
-int clif_skill_teleportmessage(struct map_session_data *sd,int flag)
+
+/// Teleport message.
+/// type=0 : "Unable to Teleport in this area" in color 0xFFFF00 (cyan)
+/// type=1 : "Saved point cannot be memorized." in color 0x0000FF (red)
+///
+/// @param sd Who receives the message
+/// @param type What message
+void clif_skill_teleportmessage(struct map_session_data *sd, int type)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_retv(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x189));
WFIFOW(fd,0)=0x189;
- WFIFOW(fd,2)=flag;
+ WFIFOW(fd,2)=type;
WFIFOSET(fd,packet_len(0x189));
- return 0;
}
/*==========================================
@@ -4700,18 +4709,43 @@ int clif_resurrection(struct block_list *bl,int type)
return 0;
}
-/*==========================================
- * PVP実装?(仮)
- *------------------------------------------*/
-int clif_set0199(int fd,int type)
+/// Sets the map mode.
+///
+/// mode=1 : pvp mode
+/// mode=2 : unknown mode (pk?)
+/// mode=3 : gvg mode
+/// mode=4 : message "You are in a PK area. Please beware of sudden attacks." in color 0x9B9BFF (light red)
+/// mode=5 : pvp mode
+/// mode=other : ?
+void clif_set0199(struct map_session_data* sd, int mode)
{
+ int fd;
+
+ nullpo_retv(sd);
+
+ fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x199));
WFIFOW(fd,0)=0x199;
- WFIFOW(fd,2)=type;
+ WFIFOW(fd,2)=mode;
WFIFOSET(fd,packet_len(0x199));
+}
- return 0;
+#if 0
+/// Set the map mode?
+/// Differs from the behaviour of clif_set0199 with unknown consequences.
+void clif_set01D6(struct map_session_data* sd, int mode)
+{
+ int fd;
+
+ nullpo_retv(sd);
+
+ fd=sd->fd;
+ WFIFOHEAD(fd,packet_len(0x1D6));
+ WFIFOW(fd,0)=0x1D6;
+ WFIFOW(fd,2)=mode;
+ WFIFOSET(fd,packet_len(0x1D6));
}
+#endif
/*==========================================
* PVP実装?(仮)
@@ -7762,15 +7796,15 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
sd->pvp_won = 0;
sd->pvp_lost = 0;
}
- clif_set0199(fd,1);
+ clif_set0199(sd,1);
} else
// set flag, if it's a duel [LuzZza]
if(sd->duel_group)
- clif_set0199(fd,1);
+ clif_set0199(sd,1);
if (map[sd->bl.m].flag.gvg_dungeon)
{
- clif_set0199(fd,1); //TODO: Figure out the real packet to send here.
+ clif_set0199(sd,1); //TODO: Figure out the real packet to send here.
if (!sd->pvp_point)
{
sd->pvp_point = 5; //Need to die twice to be warped out.
@@ -7780,7 +7814,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
}
if(map_flag_gvg(sd->bl.m))
- clif_set0199(fd,3);
+ clif_set0199(sd,3);
// info about nearby objects
// must use foreachinarea (CIRCULAR_AREA interferes with foreachinrange)
diff --git a/src/map/clif.h b/src/map/clif.h
index a1246f97a..b68645da9 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -213,8 +213,8 @@ int clif_skill_nodamage(struct block_list *src,struct block_list *dst,int skill_
int clif_skill_poseffect(struct block_list *src,int skill_id,int val,int x,int y,int tick);
int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst);
void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
-int clif_skill_memo(struct map_session_data *sd,int flag);
-int clif_skill_teleportmessage(struct map_session_data *sd,int flag);
+void clif_skill_memomessage(struct map_session_data* sd, int type);
+void clif_skill_teleportmessage(struct map_session_data* sd, int type);
int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger);
int clif_produceeffect(struct map_session_data* sd,int flag,int nameid);
@@ -331,7 +331,7 @@ void clif_MainChatMessage(const char* message); //luzza
int clif_announce(struct block_list *bl, const char* mes, int len, unsigned long color, int flag);
int clif_heal(int fd,int type,int val);
int clif_resurrection(struct block_list *bl,int type);
-int clif_set0199(int fd,int type);
+void clif_set0199(struct map_session_data* sd, int mode);
int clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
int clif_send0199(int map,int type);
void clif_refine(int fd, int fail, int index, int val);
diff --git a/src/map/pc.c b/src/map/pc.c
index fc39ea88d..852d06e5e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3603,11 +3603,11 @@ int pc_memo(struct map_session_data* sd, int pos)
// check required skill level
skill = pc_checkskill(sd, AL_WARP);
if( skill < 1 ) {
- clif_skill_memo(sd,2); // "You haven't learned Warp."
+ clif_skill_memomessage(sd,2); // "You haven't learned Warp."
return 0;
}
if( skill < 2 || skill - 2 < pos ) {
- clif_skill_memo(sd,1); // "Skill Level is not high enough."
+ clif_skill_memomessage(sd,1); // "Skill Level is not high enough."
return 0;
}
@@ -3624,7 +3624,7 @@ int pc_memo(struct map_session_data* sd, int pos)
sd->status.memo_point[pos].x = sd->bl.x;
sd->status.memo_point[pos].y = sd->bl.y;
- clif_skill_memo(sd, 0);
+ clif_skill_memomessage(sd, 0);
return 1;
}
@@ -7173,7 +7173,7 @@ int duel_create(struct map_session_data* sd, const unsigned int maxpl)
strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
clif_disp_onlyself(sd, output, strlen(output));
- clif_set0199(sd->fd, 1);
+ clif_set0199(sd, 1);
//clif_misceffect2(&sd->bl, 159);
return i;
}
@@ -7220,7 +7220,7 @@ int duel_leave(const unsigned int did, struct map_session_data* sd)
sd->duel_group = 0;
duel_savetime(sd);
- clif_set0199(sd->fd, 0);
+ clif_set0199(sd, 0);
return 0;
}
@@ -7237,7 +7237,7 @@ int duel_accept(const unsigned int did, struct map_session_data* sd)
sprintf(output, msg_txt(376), sd->status.name);
clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
- clif_set0199(sd->fd, 1);
+ clif_set0199(sd, 1);
//clif_misceffect2(&sd->bl, 159);
return 0;
}