summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c8
-rw-r--r--src/map/clif.c95
-rw-r--r--src/map/clif.h42
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/script.c8
5 files changed, 77 insertions, 82 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index cebd881ce..3035487da 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1956,7 +1956,7 @@ ACMD_FUNC(pvpoff)
map[sd->bl.m].flag.pvp = 0;
if (!battle_config.pk_mode)
- clif_send0199(sd->bl.m, 0);
+ clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
clif_displaymessage(fd, msg_txt(31)); // PvP: Off.
@@ -1993,7 +1993,7 @@ ACMD_FUNC(pvpon)
if (!battle_config.pk_mode)
{// display pvp circle and rank
- clif_send0199(sd->bl.m, 1);
+ clif_map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE);
map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC);
}
@@ -2015,7 +2015,7 @@ ACMD_FUNC(gvgoff)
}
map[sd->bl.m].flag.gvg = 0;
- clif_send0199(sd->bl.m, 0);
+ clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
clif_displaymessage(fd, msg_txt(33)); // GvG: Off.
@@ -2035,7 +2035,7 @@ ACMD_FUNC(gvgon)
}
map[sd->bl.m].flag.gvg = 1;
- clif_send0199(sd->bl.m, 3);
+ clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
clif_displaymessage(fd, msg_txt(34)); // GvG: On.
return 0;
diff --git a/src/map/clif.c b/src/map/clif.c
index b724ddbab..98bb0821a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1216,7 +1216,7 @@ int clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
WBUFL(buf,59)=hd->homunculus.exp;
WBUFL(buf,63)=hd->exp_next;
WBUFW(buf,67)=hd->homunculus.skillpts;
- WBUFW(buf,69)=2; // FIXME: undocumented flag, seems to be '2' all the time [ultramage]
+ WBUFW(buf,69)=status_get_range(&hd->bl);
clif_send(buf,packet_len(0x22e),&sd->bl,SELF);
return 0;
}
@@ -1227,7 +1227,7 @@ void clif_send_homdata(struct map_session_data *sd, int type, int param)
WFIFOHEAD(fd, packet_len(0x230));
nullpo_retv(sd->hd);
WFIFOW(fd,0)=0x230;
- WFIFOW(fd,2)=type;
+ WFIFOW(fd,2)=type; // FIXME: This is actually <type>.B <state>.B
WFIFOL(fd,4)=sd->hd->bl.id;
WFIFOL(fd,8)=param;
WFIFOSET(fd,packet_len(0x230));
@@ -2815,8 +2815,8 @@ int clif_initialstatus(struct map_session_data *sd)
WBUFW(buf,34) = sd->battle_status.flee;
WBUFW(buf,36) = sd->battle_status.flee2/10;
WBUFW(buf,38) = sd->battle_status.cri/10;
- WBUFW(buf,40) = sd->status.karma;
- WBUFW(buf,42) = sd->status.manner;
+ WBUFW(buf,40) = sd->battle_status.amotion; // aspd
+ WBUFW(buf,42) = sd->status.manner; // FIXME: This is 'plusASPD', but what is it supposed to be?
WFIFOSET(fd,packet_len(0xbd));
@@ -4129,42 +4129,6 @@ int clif_insight(struct block_list *bl,va_list ap)
}
/*==========================================
- *
- *------------------------------------------
-int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range)
-{
- int fd,id;
-
- nullpo_ret(sd);
-
- fd=sd->fd;
- if( (id=sd->status.skill[skillid].id) <= 0 )
- return 0;
- WFIFOHEAD(fd,packet_len(0x147));
- WFIFOW(fd,0)=0x147;
- WFIFOW(fd,2) = id;
- if(type < 0)
- WFIFOW(fd,4) = skill_get_inf(id);
- else
- WFIFOW(fd,4) = type;
- WFIFOW(fd,6) = 0;
- WFIFOW(fd,8) = sd->status.skill[skillid].lv;
- WFIFOW(fd,10) = skill_get_sp(id,sd->status.skill[skillid].lv);
- if(range < 0)
- range = skill_get_range2(&sd->bl, id,sd->status.skill[skillid].lv);
-
- WFIFOW(fd,12)= range;
- safestrncpy((char*)WFIFOP(fd,14), skill_get_name(id), NAME_LENGTH);
- if(sd->status.skill[skillid].flag ==0)
- WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_tree_get_max(id, sd->status.class_))? 1:0;
- else
- WFIFOB(fd,38) = 0;
- WFIFOSET(fd,packet_len(0x147));
-
- return 0;
-}*/
-
-/*==========================================
* スキルリストを送信する
*------------------------------------------*/
int clif_skillinfoblock(struct map_session_data *sd)
@@ -4390,7 +4354,7 @@ int clif_skill_fail(struct map_session_data *sd,int skill_id,int type,int btype)
WFIFOW(fd,0) = 0x110;
WFIFOW(fd,2) = skill_id;
WFIFOL(fd,4) = btype;
- WFIFOB(fd,8) = 0;// success?
+ WFIFOB(fd,8) = 0;// success
WFIFOB(fd,9) = type;
WFIFOSET(fd,packet_len(0x110));
@@ -5057,15 +5021,8 @@ int clif_resurrection(struct block_list *bl,int type)
return 0;
}
-/// 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)
+/// Sets the map property (ZC_NOTIFY_MAPPROPERTY).
+void clif_map_property(struct map_session_data* sd, enum map_property property)
{
int fd;
@@ -5074,13 +5031,12 @@ void clif_set0199(struct map_session_data* sd, int mode)
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x199));
WFIFOW(fd,0)=0x199;
- WFIFOW(fd,2)=mode;
+ WFIFOW(fd,2)=property;
WFIFOSET(fd,packet_len(0x199));
}
-/// Set the map mode (special)
-/// 19 = battleground
-void clif_set01D6(struct map_session_data* sd, int mode)
+/// Set the map type (ZC_NOTIFY_MAPPROPERTY2)
+void clif_map_type(struct map_session_data* sd, enum map_type type)
{
int fd;
@@ -5089,7 +5045,7 @@ void clif_set01D6(struct map_session_data* sd, int mode)
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x1D6));
WFIFOW(fd,0)=0x1D6;
- WFIFOW(fd,2)=mode;
+ WFIFOW(fd,2)=type;
WFIFOSET(fd,packet_len(0x1D6));
}
@@ -5129,7 +5085,7 @@ int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
/*==========================================
*
*------------------------------------------*/
-int clif_send0199(int map,int type)
+void clif_map_property_mapall(int map, enum map_property property)
{
struct block_list bl;
unsigned char buf[16];
@@ -5138,10 +5094,8 @@ int clif_send0199(int map,int type)
bl.type = BL_NUL;
bl.m = map;
WBUFW(buf,0)=0x199;
- WBUFW(buf,2)=type;
+ WBUFW(buf,2)=property;
clif_send(buf,packet_len(0x199),&bl,ALL_SAMEMAP);
-
- return 0;
}
/*==========================================
@@ -5189,7 +5143,7 @@ int clif_wis_message(int fd, const char* nick, const char* mes, int mes_len)
WFIFOW(fd,0) = 0x97;
WFIFOW(fd,2) = mes_len + NAME_LENGTH + 8;
safestrncpy((char*)WFIFOP(fd,4), nick, NAME_LENGTH);
- WFIFOL(fd,28) = 0; // unknown; if nonzero, also displays text above char
+ WFIFOL(fd,28) = 0; // isAdmin; if nonzero, also displays text above char
safestrncpy((char*)WFIFOP(fd,32), mes, mes_len);
WFIFOSET(fd,WFIFOW(fd,2));
#endif
@@ -5849,7 +5803,7 @@ int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd)
WFIFOHEAD(fd,packet_len(0xfe));
WFIFOW(fd,0)=0xfe;
- WFIFOL(fd,2)=sd->status.account_id;
+ WFIFOL(fd,2)=sd->status.account_id; // FIXME: This is party_id
memcpy(WFIFOP(fd,6),p->party.name,NAME_LENGTH);
WFIFOSET(fd,packet_len(0xfe));
return 0;
@@ -8447,7 +8401,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if( sd->state.bg_id ) clif_bg_hp(sd); // BattleGround System
if( sd->state.changemap && map[sd->bl.m].flag.battleground )
{
- clif_set01D6(sd,19); // Battleground Mode
+ clif_map_type(sd, MAPTYPE_BATTLEFIELD); // Battleground Mode
if( map[sd->bl.m].flag.battleground == 2 )
clif_bg_updatescore_single(sd);
}
@@ -8462,17 +8416,17 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
sd->pvp_won = 0;
sd->pvp_lost = 0;
}
- clif_set0199(sd,1);
+ clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
} else
// set flag, if it's a duel [LuzZza]
if(sd->duel_group)
- clif_set0199(sd,1);
+ clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
if (map[sd->bl.m].flag.gvg_dungeon)
- clif_set0199(sd,1); //TODO: Figure out the real packet to send here.
+ clif_map_property(sd, MAPPROPERTY_FREEPVPZONE); //TODO: Figure out the real packet to send here.
if( map_flag_gvg(sd->bl.m) )
- clif_set0199(sd,3);
+ clif_map_property(sd, MAPPROPERTY_AGITZONE);
// info about nearby objects
// must use foreachinarea (CIRCULAR_AREA interferes with foreachinrange)
@@ -13244,8 +13198,13 @@ void clif_parse_Adopt_reply(int fd, struct map_session_data *sd)
}
/*==========================================
- * Convex Mirror
- * S 0293 <flag>.b <x>.l <y>.l <Hours>.w <Minutes>.w <unknown>.l <monster name>.40B <unknown>.11B
+ * Convex Mirror (ZC_BOSS_INFO)
+ * S 0293 <infoType>.B <x>.L <y>.L <minHours>.W <minMinutes>.W <maxHours>.W <maxMinutes>.W <monster name>.51B
+ * infoType:
+ * 0 = No boss on this map (BOSS_INFO_NOT).
+ * 1 = Boss is alive (position update) (BOSS_INFO_ALIVE).
+ * 2 = Boss is alive (initial announce) (BOSS_INFO_ALIVE_WITHMSG).
+ * 3 = Boss is dead (BOSS_INFO_DEAD).
*==========================================*/
void clif_bossmapinfo(int fd, struct mob_data *md, short flag)
{
diff --git a/src/map/clif.h b/src/map/clif.h
index 8e9f2be7a..50dc76c72 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -173,6 +173,43 @@ typedef enum clr_type
CLR_TELEPORT,
} clr_type;
+enum map_property
+{// clif_map_property
+ MAPPROPERTY_NOTHING = 0,
+ MAPPROPERTY_FREEPVPZONE = 1,
+ MAPPROPERTY_EVENTPVPZONE = 2,
+ MAPPROPERTY_AGITZONE = 3,
+ MAPPROPERTY_PKSERVERZONE = 4, // message "You are in a PK area. Please beware of sudden attacks." in color 0x9B9BFF (light red)
+ MAPPROPERTY_PVPSERVERZONE = 5,
+ MAPPROPERTY_DENYSKILLZONE = 6,
+};
+
+enum map_type
+{// clif_map_type
+ MAPTYPE_VILLAGE = 0,
+ MAPTYPE_VILLAGE_IN = 1,
+ MAPTYPE_FIELD = 2,
+ MAPTYPE_DUNGEON = 3,
+ MAPTYPE_ARENA = 4,
+ MAPTYPE_PENALTY_FREEPKZONE = 5,
+ MAPTYPE_NOPENALTY_FREEPKZONE = 6,
+ MAPTYPE_EVENT_GUILDWAR = 7,
+ MAPTYPE_AGIT = 8,
+ MAPTYPE_DUNGEON2 = 9,
+ MAPTYPE_DUNGEON3 = 10,
+ MAPTYPE_PKSERVER = 11,
+ MAPTYPE_PVPSERVER = 12,
+ MAPTYPE_DENYSKILL = 13,
+ MAPTYPE_TURBOTRACK = 14,
+ MAPTYPE_JAIL = 15,
+ MAPTYPE_MONSTERTRACK = 16,
+ MAPTYPE_PORINGBATTLE = 17,
+ MAPTYPE_AGIT_SIEGEV15 = 18,
+ MAPTYPE_BATTLEFIELD = 19,
+ MAPTYPE_PVP_TOURNAMENT = 20,
+ MAPTYPE_UNUSED = 29,
+};
+
int clif_setip(const char* ip);
void clif_setbindip(const char* ip);
void clif_setport(uint16 port);
@@ -284,7 +321,6 @@ int clif_class_change(struct block_list *bl,int class_,int type);
#define clif_mob_class_change(md, class_) clif_class_change(&md->bl, class_, 1)
int clif_mob_equip(struct mob_data *md,int nameid); // [Valaris]
-int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range);
int clif_skillinfoblock(struct map_session_data *sd);
int clif_skillup(struct map_session_data *sd,int skill_num);
int clif_addskill(struct map_session_data *sd, int skill);
@@ -438,9 +474,9 @@ void clif_MainChatMessage(const char* message); //luzza
int clif_broadcast2(struct block_list *bl, const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
int clif_heal(int fd,int type,int val);
int clif_resurrection(struct block_list *bl,int type);
-void clif_set0199(struct map_session_data* sd, int mode);
+void clif_map_property(struct map_session_data* sd, enum map_property property);
int clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
-int clif_send0199(int map,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(int fd, int result, int item_id);
diff --git a/src/map/pc.c b/src/map/pc.c
index 8cf591f1b..396eb0ae5 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7794,7 +7794,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, 1);
+ clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
//clif_misceffect2(&sd->bl, 159);
return i;
}
@@ -7841,7 +7841,7 @@ int duel_leave(const unsigned int did, struct map_session_data* sd)
sd->duel_group = 0;
duel_savetime(sd);
- clif_set0199(sd, 0);
+ clif_map_property(sd, MAPPROPERTY_NOTHING);
return 0;
}
@@ -7858,7 +7858,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, 1);
+ clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
//clif_misceffect2(&sd->bl, 159);
return 0;
}
diff --git a/src/map/script.c b/src/map/script.c
index 82f39d258..b26ae33e1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9753,7 +9753,7 @@ BUILDIN_FUNC(pvpon)
return 0; // nothing to do
map[m].flag.pvp = 1;
- clif_send0199(m,1);
+ clif_map_property_mapall(m, MAPPROPERTY_FREEPVPZONE);
if(battle_config.pk_mode) // disable ranking functions if pk_mode is on [Valaris]
return 0;
@@ -9798,7 +9798,7 @@ BUILDIN_FUNC(pvpoff)
return 0; //fixed Lupus
map[m].flag.pvp = 0;
- clif_send0199(m,0);
+ clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
if(battle_config.pk_mode) // disable ranking options if pk_mode is on [Valaris]
return 0;
@@ -9816,7 +9816,7 @@ BUILDIN_FUNC(gvgon)
m = map_mapname2mapid(str);
if(m >= 0 && !map[m].flag.gvg) {
map[m].flag.gvg = 1;
- clif_send0199(m,3);
+ clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
}
return 0;
@@ -9830,7 +9830,7 @@ BUILDIN_FUNC(gvgoff)
m = map_mapname2mapid(str);
if(m >= 0 && map[m].flag.gvg) {
map[m].flag.gvg = 0;
- clif_send0199(m,0);
+ clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
}
return 0;