Index: db/packet_db.txt
===================================================================
--- db/packet_db.txt (revision 17292)
+++ db/packet_db.txt (working copy)
@@ -1832,6 +1832,8 @@
0x094E,-1,searchstoreinfo,2:4:5:9:13:14:15
//0x0835,2,searchstoreinfonextpage,0
//0x0838,12,searchstoreinfolistitemclick,2:6:10
+0x0447,2
+0x99b,8
// New cashshop
0x0844,2,cashshopopen,0
Index: src/common/mmo.h
===================================================================
--- src/common/mmo.h (revision 17292)
+++ src/common/mmo.h (working copy)
@@ -47,7 +47,7 @@
// 20120307 - 2012-03-07aRagexeRE+ - 0x970
#ifndef PACKETVER
- #define PACKETVER 20120410
+ #define PACKETVER 20130320
//#define PACKETVER 20111116
#endif
Index: src/login/Makefile.in
===================================================================
--- src/login/Makefile.in (revision 17292)
+++ src/login/Makefile.in (working copy)
@@ -36,7 +36,7 @@
clean:
@echo " CLEAN login"
- @rm -rf *.o obj_sql ../../login-server@EXEEXT@ ../../login-server_sql@EXEEXT@
+ @rm -rf *.o obj_sql ../../login-server_sql@EXEEXT@
help:
@echo "possible targets are 'sql' 'all' 'clean' 'help'"
Index: src/map/clif.c
===================================================================
--- src/map/clif.c (revision 17292)
+++ src/map/clif.c (working copy)
@@ -66,14 +66,12 @@
struct s_packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
//Converts item type in case of pet eggs.
-static inline int itemtype(int type)
-{
+static inline int itemtype(int type) {
return ( type == IT_PETEGG ) ? IT_WEAPON : type;
}
-static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsigned char dir)
-{
+static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsigned char dir) {
p += pos;
p[0] = (uint8)(x>>2);
p[1] = (uint8)((x<<6) | ((y>>4)&0x3f));
@@ -82,8 +80,7 @@
// client-side: x0+=sx0*0.0625-0.5 and y0+=sy0*0.0625-0.5
-static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0)
-{
+static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) {
p += pos;
p[0] = (uint8)(x0>>2);
p[1] = (uint8)((x0<<6) | ((y0>>4)&0x3f));
@@ -94,20 +91,17 @@
}
-static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir)
-{
+static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir) {
WBUFPOS(WFIFOP(fd,pos), 0, x, y, dir);
}
-static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0)
-{
+static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) {
WBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0);
}
-static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* y, unsigned char* dir)
-{
+static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* y, unsigned char* dir) {
p += pos;
if( x ) {
@@ -124,8 +118,7 @@
}
-static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0)
-{
+static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) {
p += pos;
if( x0 ) {
@@ -154,28 +147,24 @@
}
-static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir)
-{
+static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir) {
RBUFPOS(RFIFOP(fd,pos), 0, x, y, dir);
}
-static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0)
-{
+static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) {
RBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0);
}
//To idenfity disguised characters.
-static inline bool disguised(struct block_list* bl)
-{
+static inline bool disguised(struct block_list* bl) {
return (bool)( bl->type == BL_PC && ((TBL_PC*)bl)->disguise );
}
//Guarantees that the given string does not exceeds the allowed size, as well as making sure it's null terminated. [Skotlex]
-static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned int max)
-{
+static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned int max) {
if( len > max )
len = max;
@@ -196,8 +185,7 @@
/*==========================================
* Ip setting of map-server
*------------------------------------------*/
-int clif_setip(const char* ip)
-{
+int clif_setip(const char* ip) {
char ip_str[16];
map_ip = host2ip(ip);
if (!map_ip) {
@@ -307,8 +295,7 @@
nullpo_ret(src_bl = va_arg(ap,struct block_list*));
type = va_arg(ap,int);
- switch(type)
- {
+ switch(type) {
case AREA_WOS:
if (bl == src_bl)
return 0;
@@ -317,8 +304,7 @@
if (sd->chatID || bl == src_bl)
return 0;
break;
- case AREA_WOSC:
- {
+ case AREA_WOSC: {
if(src_bl->type == BL_PC){
struct map_session_data *ssd = (struct map_session_data *)src_bl;
if (ssd && sd->chatID && (sd->chatID == ssd->chatID))
@@ -542,8 +528,7 @@
if (g) {
for(i = 0; i < g->max_member; i++) {
- if( (sd = g->member[i].sd) != NULL )
- {
+ if( (sd = g->member[i].sd) != NULL ) {
if( !(fd=sd->fd) )
continue;
@@ -594,10 +579,8 @@
case BG_SAMEMAP_WOS:
case BG:
case BG_WOS:
- if( sd && sd->bg_id && (bg = bg_team_search(sd->bg_id)) != NULL )
- {
- for( i = 0; i < MAX_BG_MEMBERS; i++ )
- {
+ if( sd && sd->bg_id && (bg = bg_team_search(sd->bg_id)) != NULL ) {
+ for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
if( (sd = bg->members[i].sd) == NULL || !(fd = sd->fd) )
continue;
if( sd->bl.id == bl->id && (type == BG_WOS || type == BG_SAMEMAP_WOS || type == BG_AREA_WOS) )
@@ -880,8 +863,7 @@
}
//To make the assignation of the level based on limits clearer/easier. [Skotlex]
-static int clif_setlevel_sub(int lv)
-{
+static int clif_setlevel_sub(int lv) {
if( lv < battle_config.max_lv ) {
;
} else if( lv < battle_config.aura_lv ) {
@@ -893,8 +875,7 @@
return lv;
}
-static int clif_setlevel(struct block_list* bl)
-{
+static int clif_setlevel(struct block_list* bl) {
int lv = status_get_lv(bl);
if( battle_config.client_limit_unit_lv&bl->type )
return clif_setlevel_sub(lv);
@@ -1647,13 +1628,12 @@
/*==========================================
*
*------------------------------------------*/
-void clif_quitsave(int fd,struct map_session_data *sd)
-{
+void clif_quitsave(int fd,struct map_session_data *sd) {
if (!battle_config.prevent_logout ||
DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout)
map_quit(sd);
- else if (sd->fd)
- { //Disassociate session from player (session is deleted after this function was called)
+ else if (sd->fd) {
+ //Disassociate session from player (session is deleted after this function was called)
//And set a timer to make him quit later.
session[sd->fd]->session_data = NULL;
sd->fd = 0;
@@ -5570,7 +5550,33 @@
WFIFOSET(fd,packet_len(0x199));
}
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
+#if PACKETVER >= 20130000 /* not entirely sure when this started */
+ uint8 buf[8];
+ WBUFW(buf,0)=0x99b; //2
+ WBUFW(buf,2)=0x28; //2
+
+ WBUFB(buf,4) = RBUFB(buf,4)|0x01; //party
+ WBUFB(buf,4) = RBUFB(buf,4)|0x02; //guild
+ WBUFB(buf,4) = RBUFB(buf,4)|((map_flag_gvg2(bl->m))?0x04:0); //siege
+ WBUFB(buf,4) = RBUFB(buf,4)|0x08; //mineffect
+ WBUFB(buf,4) = RBUFB(buf,4)|0x10; //nolockon
+ WBUFB(buf,4) = RBUFB(buf,4)|((map[bl->m].flag.pvp)?0x20:0); //countpk
+ WBUFB(buf,4) = RBUFB(buf,4)|0; //nopartyformation
+ WBUFB(buf,4) = RBUFB(buf,4)|((map[bl->m].flag.battleground)?0x80:0); //battleground
+
+ WBUFB(buf,5) = RBUFB(buf,5)|0x01; //noitemconsumption
+ WBUFB(buf,5) = RBUFB(buf,5)|0x02; //cart
+ WBUFB(buf,5) = RBUFB(buf,5)|0x04; //summonstarmiracle
+// WBUFB(buf,5) = RBUFB(buf,5)&0xf8; //sparebit[0-4]
+
+ WBUFW(buf,6) = 0; //sparebit [5-15], + extra[4]
+
+ clif_send(buf,packet_len(0x99b),bl,t);
+#endif
+}
+
/// Set the map type (ZC_NOTIFY_MAPPROPERTY2).
/// 01d6 <type>.W
void clif_map_type(struct map_session_data* sd, enum map_type type)
@@ -8248,6 +8254,7 @@
mail_clear(sd);
+
if( disguised(&sd->bl) ) {/* refresh-da */
short disguise = sd->disguise;
pc_disguise(sd, 0);
@@ -9312,6 +9319,8 @@
mail_clear(sd);
+ clif_maptypeproperty2(&sd->bl,SELF);
+
/* Guild Aura Init */
if( sd->state.gmaster_flag ) {
guild_guildaura_refresh(sd,GD_LEADERSHIP,guild_checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
@@ -16704,8 +16713,8 @@
0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
//#0x0980
0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
};
Index: src/map/clif.h
===================================================================
--- src/map/clif.h (revision 17292)
+++ src/map/clif.h (working copy)
@@ -585,6 +585,7 @@
void clif_heal(int fd,int type,int val);
void clif_resurrection(struct block_list *bl,int type);
void clif_map_property(struct map_session_data* sd, enum map_property property);
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t);
void clif_pvpset(struct 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);
Index: src/map/script.c
===================================================================
--- src/map/script.c (revision 17292)
+++ src/map/script.c (working copy)
@@ -10854,6 +10854,7 @@
sd->pvp_lost = 0;
}
clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif_maptypeproperty2(&sd->bl,SELF);
return 0;
}
BUILDIN_FUNC(setmapflag)
@@ -10884,9 +10885,14 @@
break;
case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 1; break;
case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 1; break;
- case MF_GVG:
+ case MF_GVG: {
+ struct block_list bl;
map[m].flag.gvg = 1;
clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+ }
break;
case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 1; break;
case MF_NOTRADE: map[m].flag.notrade = 1; break;
@@ -10958,15 +10964,25 @@
case MF_NOBRANCH: map[m].flag.nobranch = 0; break;
case MF_NOPENALTY: map[m].flag.noexppenalty = 0; map[m].flag.nozenypenalty = 0; break;
case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 0; break;
- case MF_PVP:
+ case MF_PVP: {
+ struct block_list bl;
+ bl.type = BL_NUL;
+ bl.m = m;
map[m].flag.pvp = 0;
clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+ }
break;
case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 0; break;
case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 0; break;
- case MF_GVG:
+ case MF_GVG: {
+ struct block_list bl;
+ bl.type = BL_NUL;
+ bl.m = m;
map[m].flag.gvg = 0;
clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+ }
break;
case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 0; break;
case MF_NOTRADE: map[m].flag.notrade = 0; break;
@@ -11026,6 +11042,7 @@
const char *str;
TBL_PC* sd = NULL;
struct s_mapiterator* iter;
+ struct block_list bl;
str = script_getstr(st,2);
m = map_mapname2mapid(str);
@@ -11034,6 +11051,9 @@
map[m].flag.pvp = 1;
clif_map_property_mapall(m, MAPPROPERTY_FREEPVPZONE);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
if(battle_config.pk_mode) // disable ranking functions if pk_mode is on [Valaris]
return 0;
@@ -11071,6 +11091,7 @@
{
int16 m;
const char *str;
+ struct block_list bl;
str=script_getstr(st,2);
m = map_mapname2mapid(str);
@@ -11079,6 +11100,9 @@
map[m].flag.pvp = 0;
clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
if(battle_config.pk_mode) // disable ranking options if pk_mode is on [Valaris]
return 0;
@@ -11091,12 +11115,16 @@
{
int16 m;
const char *str;
+ struct block_list bl;
str=script_getstr(st,2);
m = map_mapname2mapid(str);
if(m >= 0 && !map[m].flag.gvg) {
map[m].flag.gvg = 1;
clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
}
return 0;
@@ -11109,8 +11137,12 @@
str=script_getstr(st,2);
m = map_mapname2mapid(str);
if(m >= 0 && map[m].flag.gvg) {
+ struct block_list bl;
map[m].flag.gvg = 0;
clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif_maptypeproperty2(&bl,ALL_SAMEMAP);
}
return 0;
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 17292)
+++ src/map/battle.c (working copy)
@@ -3630,8 +3630,8 @@
short s_ele = 0;
unsigned int skillratio = 100; //Skill dmg modifiers.
- TBL_PC *sd;
-// TBL_PC *tsd;
+ TBL_PC *sd;
+// TBL_PC *tsd;
struct status_change *sc, *tsc;
struct Damage ad;
struct status_data *sstatus = status_get_status_data(src);
@@ -3661,7 +3661,7 @@
flag.imdef = nk&NK_IGNORE_DEF?1:0;
sd = BL_CAST(BL_PC, src);
-// tsd = BL_CAST(BL_PC, target);
+// tsd = BL_CAST(BL_PC, target);
sc = status_get_sc(src);
tsc = status_get_sc(target);
Index: src/map/duel.c
===================================================================
--- src/map/duel.c (revision 17292)
+++ src/map/duel.c (working copy)
@@ -95,6 +95,7 @@
clif_disp_onlyself(sd, output, strlen(output));
clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif_maptypeproperty2(&sd->bl,SELF);
//clif_misceffect2(&sd->bl, 159);
return i;
}
@@ -141,6 +142,7 @@
sd->duel_group = 0;
duel_savetime(sd);
clif_map_property(sd, MAPPROPERTY_NOTHING);
+ clif_maptypeproperty2(&sd->bl,SELF);
}
void duel_accept(const unsigned int did, struct map_session_data* sd)
@@ -157,6 +159,7 @@
clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif_maptypeproperty2(&sd->bl,SELF);
//clif_misceffect2(&sd->bl, 159);
}
Index: src/config/const.h
===================================================================
--- src/config/const.h (revision 17292)
+++ src/config/const.h (working copy)
@@ -13,7 +13,7 @@
*/
/**
- * "Sane Checks" to save you from compiling with cool bugs
+ * "Sane Checks" to save you from compiling with cool bugs
**/
#if SECURE_NPCTIMEOUT_INTERVAL <= 0
#error SECURE_NPCTIMEOUT_INTERVAL should be at least 1 (1s)
@@ -79,7 +79,7 @@
if( status_get_lv(src) > 100 ) \
md.damage = md.damage * 150 / 100 + md.damage * status_get_lv(src) / 100;
#else
- #define RE_LVL_DMOD(val)
+ #define RE_LVL_DMOD(val)
#define RE_LVL_MDMOD(val)
#define RE_LVL_TMDMOD()
#endif