|
@@ -488,11 +488,11 @@ ACMD_FUNC(mapmove)
|
|
|
if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
|
|
|
x = y = 0; //Invalid cell, use random spot.
|
|
|
}
|
|
|
- if ((map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) || !pc_job_can_entermap((enum e_job)sd->status.class_, m, sd->group_level)) {
|
|
|
+ if ((map_getmapflag(m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) || !pc_job_can_entermap((enum e_job)sd->status.class_, m, sd->group_level)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,247)); // You are not authorized to warp to this map.
|
|
|
return -1;
|
|
|
}
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -557,13 +557,13 @@ ACMD_FUNC(jumpto)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
+ if (pl_sd->bl.m >= 0 && map_getmapflag(pl_sd->bl.m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
{
|
|
|
clif_displaymessage(fd, msg_txt(sd,247)); // You are not authorized to warp to this map.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
{
|
|
|
clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map.
|
|
|
return -1;
|
|
@@ -595,7 +595,7 @@ ACMD_FUNC(jump)
|
|
|
|
|
|
sscanf(message, "%6hd %6hd", &x, &y);
|
|
|
|
|
|
- if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_NOTELEPORT) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -840,11 +840,11 @@ ACMD_FUNC(load)
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
m = map_mapindex2mapid(sd->status.save_point.map);
|
|
|
- if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (m >= 0 && map_getmapflag(m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,249)); // You are not authorized to warp to your save map.
|
|
|
return -1;
|
|
|
}
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -997,7 +997,7 @@ ACMD_FUNC(hide)
|
|
|
// increment the number of pvp players on the map
|
|
|
map[sd->bl.m].users_pvp++;
|
|
|
|
|
|
- if( !battle_config.pk_mode && map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank )
|
|
|
+ if( !battle_config.pk_mode && map_getmapflag(sd->bl.m, MF_PVP) && !map_getmapflag(sd->bl.m, MF_PVP_NOCALCRANK) )
|
|
|
{// register the player for ranking calculations
|
|
|
sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 );
|
|
|
}
|
|
@@ -1011,7 +1011,7 @@ ACMD_FUNC(hide)
|
|
|
// decrement the number of pvp players on the map
|
|
|
map[sd->bl.m].users_pvp--;
|
|
|
|
|
|
- if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER )
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_PVP) && !map_getmapflag(sd->bl.m, MF_PVP_NOCALCRANK) && sd->pvp_timer != INVALID_TIMER )
|
|
|
{// unregister the player for ranking
|
|
|
delete_timer( sd->pvp_timer, pc_calc_pvprank_timer );
|
|
|
sd->pvp_timer = INVALID_TIMER;
|
|
@@ -1632,12 +1632,12 @@ ACMD_FUNC(pvpoff)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if (!map[sd->bl.m].flag.pvp) {
|
|
|
+ if (!map_getmapflag(sd->bl.m, MF_PVP)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,160)); // PvP is already Off.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- map[sd->bl.m].flag.pvp = 0;
|
|
|
+ map_setmapflag(sd->bl.m, MF_PVP, false);
|
|
|
|
|
|
if (!battle_config.pk_mode){
|
|
|
clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
|
|
@@ -1669,12 +1669,12 @@ ACMD_FUNC(pvpon)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if (map[sd->bl.m].flag.pvp) {
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_PVP)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,161)); // PvP is already On.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- map[sd->bl.m].flag.pvp = 1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_PVP, true);
|
|
|
|
|
|
if (!battle_config.pk_mode) {// display pvp circle and rank
|
|
|
clif_map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE);
|
|
@@ -1693,12 +1693,12 @@ ACMD_FUNC(gvgoff)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if (!map[sd->bl.m].flag.gvg) {
|
|
|
+ if (!map_getmapflag(sd->bl.m, MF_GVG)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,162)); // GvG is already Off.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- map[sd->bl.m].flag.gvg = 0;
|
|
|
+ map_setmapflag(sd->bl.m, MF_GVG, false);
|
|
|
clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
|
|
|
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
|
|
|
clif_displaymessage(fd, msg_txt(sd,33)); // GvG: Off.
|
|
@@ -1713,12 +1713,12 @@ ACMD_FUNC(gvgon)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if (map[sd->bl.m].flag.gvg) {
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_GVG)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,163)); // GvG is already On.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- map[sd->bl.m].flag.gvg = 1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_GVG, true);
|
|
|
clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
|
|
|
clif_displaymessage(fd, msg_txt(sd,34)); // GvG: On.
|
|
|
|
|
@@ -1932,7 +1932,7 @@ ACMD_FUNC(go)
|
|
|
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) {
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_NOGO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) {
|
|
|
clif_displaymessage(sd->fd,msg_txt(sd,995)); // You cannot use @go on this map.
|
|
|
return 0;
|
|
|
}
|
|
@@ -2054,11 +2054,11 @@ ACMD_FUNC(go)
|
|
|
if (town >= 0 && town < ARRAYLENGTH(data))
|
|
|
{
|
|
|
int16 m = map_mapname2mapid(data[town].map);
|
|
|
- if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (m >= 0 && map_getmapflag(m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,247)); // You are not authorized to warp to this map.
|
|
|
return -1;
|
|
|
}
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -2921,11 +2921,11 @@ ACMD_FUNC(recall) {
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1019)); // You are not authorized to warp someone to this map.
|
|
|
return -1;
|
|
|
}
|
|
|
- if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (pl_sd->bl.m >= 0 && map_getmapflag(pl_sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1020)); // You are not authorized to warp this player from their map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -3651,7 +3651,7 @@ ACMD_FUNC(recallall)
|
|
|
|
|
|
memset(atcmd_output, '\0', sizeof(atcmd_output));
|
|
|
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -3664,7 +3664,7 @@ ACMD_FUNC(recallall)
|
|
|
{
|
|
|
if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)
|
|
|
continue; // Don't waste time warping the character to the same place.
|
|
|
- if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
+ if (pl_sd->bl.m >= 0 && map_getmapflag(pl_sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
count++;
|
|
|
else {
|
|
|
if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){
|
|
@@ -3704,7 +3704,7 @@ ACMD_FUNC(guildrecall)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -3725,7 +3725,7 @@ ACMD_FUNC(guildrecall)
|
|
|
{
|
|
|
if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y))
|
|
|
continue; // Skip GMs greater than you... or chars already on the cell
|
|
|
- if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
+ if (pl_sd->bl.m >= 0 && map_getmapflag(pl_sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
count++;
|
|
|
else{
|
|
|
if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){
|
|
@@ -3766,7 +3766,7 @@ ACMD_FUNC(partyrecall)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
+ if (sd->bl.m >= 0 && map_getmapflag(sd->bl.m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -3787,7 +3787,7 @@ ACMD_FUNC(partyrecall)
|
|
|
{
|
|
|
if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y))
|
|
|
continue; // Skip GMs greater than you... or chars already on the cell
|
|
|
- if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
+ if (pl_sd->bl.m >= 0 && map_getmapflag(pl_sd->bl.m, MF_NOWARP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
|
|
|
count++;
|
|
|
else{
|
|
|
if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){
|
|
@@ -4036,46 +4036,45 @@ ACMD_FUNC(mapinfo) {
|
|
|
sprintf(atcmd_output, msg_txt(sd,1040), mapname, map[m_id].users, map[m_id].npc_num, chat_num, vend_num); // Map: %s | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1041)); // ------ Map Flags ------
|
|
|
- if (map[m_id].flag.town)
|
|
|
+ if (map_getmapflag(m_id, MF_TOWN))
|
|
|
clif_displaymessage(fd, msg_txt(sd,1042)); // Town Map
|
|
|
- if (map[m_id].flag.restricted){
|
|
|
+ if (map_getmapflag(m_id, MF_RESTRICTED)){
|
|
|
sprintf(atcmd_output, " Restricted (zone %d)",map[m_id].zone);
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
}
|
|
|
|
|
|
- if (battle_config.autotrade_mapflag == map[m_id].flag.autotrade)
|
|
|
+ if (battle_config.autotrade_mapflag == map_getmapflag(m_id, MF_AUTOTRADE))
|
|
|
clif_displaymessage(fd, msg_txt(sd,1043)); // Autotrade Enabled
|
|
|
else
|
|
|
clif_displaymessage(fd, msg_txt(sd,1044)); // Autotrade Disabled
|
|
|
|
|
|
- if (map[m_id].flag.battleground){
|
|
|
- sprintf(atcmd_output, msg_txt(sd,1045),map[m_id].flag.battleground); // Battlegrounds ON (type %d)
|
|
|
+ if (map_getmapflag(m_id, MF_BATTLEGROUND)){
|
|
|
+ sprintf(atcmd_output, msg_txt(sd,1045),map_getmapflag(m_id, MF_BATTLEGROUND)); // Battlegrounds ON (type %d)
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
}
|
|
|
|
|
|
/* Skill damage adjustment info [Cydh] */
|
|
|
#ifdef ADJUST_SKILL_DAMAGE
|
|
|
- if (map[m_id].flag.skill_damage) {
|
|
|
+ if (map_getmapflag(m_id, MF_SKILL_DAMAGE)) {
|
|
|
clif_displaymessage(fd,msg_txt(sd,1052)); // Skill Damage Adjustments:
|
|
|
sprintf(atcmd_output," > [Map] %d%%, %d%%, %d%%, %d%% | Caster:%d"
|
|
|
- ,map[m_id].adjust.damage.pc
|
|
|
- ,map[m_id].adjust.damage.mob
|
|
|
- ,map[m_id].adjust.damage.boss
|
|
|
- ,map[m_id].adjust.damage.other
|
|
|
- ,map[m_id].adjust.damage.caster);
|
|
|
+ ,map[m_id].damage_adjust.rate[SKILLDMG_PC]
|
|
|
+ ,map[m_id].damage_adjust.rate[SKILLDMG_MOB]
|
|
|
+ ,map[m_id].damage_adjust.rate[SKILLDMG_BOSS]
|
|
|
+ ,map[m_id].damage_adjust.rate[SKILLDMG_OTHER]
|
|
|
+ ,map[m_id].damage_adjust.caster);
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
- if (map[m_id].skill_damage.count) {
|
|
|
- uint8 j;
|
|
|
+ if (map[m_id].skill_damage.size()) {
|
|
|
clif_displaymessage(fd," > [Map Skill] Name : Player, Monster, Boss Monster, Other | Caster");
|
|
|
- for (j = 0; j < map[m_id].skill_damage.count; j++) {
|
|
|
+ for (int j = 0; j < map[m_id].skill_damage.size(); j++) {
|
|
|
sprintf(atcmd_output," %d. %s : %d%%, %d%%, %d%%, %d%% | %d"
|
|
|
,j+1
|
|
|
- ,skill_get_name(map[m_id].skill_damage.entries[j]->skill_id)
|
|
|
- ,map[m_id].skill_damage.entries[j]->pc
|
|
|
- ,map[m_id].skill_damage.entries[j]->mob
|
|
|
- ,map[m_id].skill_damage.entries[j]->boss
|
|
|
- ,map[m_id].skill_damage.entries[j]->other
|
|
|
- ,map[m_id].skill_damage.entries[j]->caster);
|
|
|
+ ,skill_get_name(map[m_id].skill_damage[j].skill_id)
|
|
|
+ ,map[m_id].skill_damage[j].rate[SKILLDMG_PC]
|
|
|
+ ,map[m_id].skill_damage[j].rate[SKILLDMG_MOB]
|
|
|
+ ,map[m_id].skill_damage[j].rate[SKILLDMG_BOSS]
|
|
|
+ ,map[m_id].skill_damage[j].rate[SKILLDMG_OTHER]
|
|
|
+ ,map[m_id].skill_damage[j].caster);
|
|
|
clif_displaymessage(fd,atcmd_output);
|
|
|
}
|
|
|
}
|
|
@@ -4083,55 +4082,55 @@ ACMD_FUNC(mapinfo) {
|
|
|
#endif
|
|
|
|
|
|
strcpy(atcmd_output,msg_txt(sd,1046)); // PvP Flags:
|
|
|
- if (map[m_id].flag.pvp)
|
|
|
+ if (map_getmapflag(m_id, MF_PVP))
|
|
|
strcat(atcmd_output, " Pvp ON |");
|
|
|
- if (map[m_id].flag.pvp_noguild)
|
|
|
+ if (map_getmapflag(m_id, MF_PVP_NOGUILD))
|
|
|
strcat(atcmd_output, " NoGuild |");
|
|
|
- if (map[m_id].flag.pvp_noparty)
|
|
|
+ if (map_getmapflag(m_id, MF_PVP_NOPARTY))
|
|
|
strcat(atcmd_output, " NoParty |");
|
|
|
- if (map[m_id].flag.pvp_nightmaredrop)
|
|
|
+ if (map_getmapflag(m_id, MF_PVP_NIGHTMAREDROP))
|
|
|
strcat(atcmd_output, " NightmareDrop |");
|
|
|
- if (map[m_id].flag.pvp_nocalcrank)
|
|
|
+ if (map_getmapflag(m_id, MF_PVP_NOCALCRANK))
|
|
|
strcat(atcmd_output, " NoCalcRank |");
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
strcpy(atcmd_output,msg_txt(sd,1047)); // GvG Flags:
|
|
|
- if (map[m_id].flag.gvg)
|
|
|
+ if (map_getmapflag(m_id, MF_GVG))
|
|
|
strcat(atcmd_output, " GvG ON |");
|
|
|
- if (map[m_id].flag.gvg_dungeon)
|
|
|
+ if (map_getmapflag(m_id, MF_GVG_DUNGEON))
|
|
|
strcat(atcmd_output, " GvG Dungeon |");
|
|
|
- if (map[m_id].flag.gvg_castle)
|
|
|
+ if (map_getmapflag(m_id, MF_GVG_CASTLE))
|
|
|
strcat(atcmd_output, " GvG Castle |");
|
|
|
- if (map[m_id].flag.gvg_te)
|
|
|
+ if (map_getmapflag(m_id, MF_GVG_TE))
|
|
|
strcat(atcmd_output, " GvG TE |");
|
|
|
- if (map[m_id].flag.gvg_te_castle)
|
|
|
+ if (map_getmapflag(m_id, MF_GVG_TE_CASTLE))
|
|
|
strcat(atcmd_output, " GvG TE Castle |");
|
|
|
- if (map[m_id].flag.gvg_noparty)
|
|
|
+ if (map_getmapflag(m_id, MF_GVG_NOPARTY))
|
|
|
strcat(atcmd_output, " NoParty |");
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
strcpy(atcmd_output,msg_txt(sd,1048)); // Teleport Flags:
|
|
|
- if (map[m_id].flag.noteleport)
|
|
|
+ if (map_getmapflag(m_id, MF_NOTELEPORT))
|
|
|
strcat(atcmd_output, " NoTeleport |");
|
|
|
- if (map[m_id].flag.monster_noteleport)
|
|
|
+ if (map_getmapflag(m_id, MF_MONSTER_NOTELEPORT))
|
|
|
strcat(atcmd_output, " Monster NoTeleport |");
|
|
|
- if (map[m_id].flag.nowarp)
|
|
|
+ if (map_getmapflag(m_id, MF_NOWARP))
|
|
|
strcat(atcmd_output, " NoWarp |");
|
|
|
- if (map[m_id].flag.nowarpto)
|
|
|
+ if (map_getmapflag(m_id, MF_NOWARPTO))
|
|
|
strcat(atcmd_output, " NoWarpTo |");
|
|
|
- if (map[m_id].flag.noreturn)
|
|
|
+ if (map_getmapflag(m_id, MF_NORETURN))
|
|
|
strcat(atcmd_output, " NoReturn |");
|
|
|
- if (map[m_id].flag.nogo)
|
|
|
+ if (map_getmapflag(m_id, MF_NOGO))
|
|
|
strcat(atcmd_output, " NoGo |"); //
|
|
|
- if (map[m_id].flag.nomemo)
|
|
|
+ if (map_getmapflag(m_id, MF_NOMEMO))
|
|
|
strcat(atcmd_output, " NoMemo |");
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
sprintf(atcmd_output, msg_txt(sd,1065), // No Exp Penalty: %s | No Zeny Penalty: %s
|
|
|
- (map[m_id].flag.noexppenalty) ? msg_txt(sd,1066) : msg_txt(sd,1067), (map[m_id].flag.nozenypenalty) ? msg_txt(sd,1066) : msg_txt(sd,1067)); // On / Off
|
|
|
+ (map_getmapflag(m_id, MF_NOEXPPENALTY)) ? msg_txt(sd,1066) : msg_txt(sd,1067), (map_getmapflag(m_id, MF_NOZENYPENALTY)) ? msg_txt(sd,1066) : msg_txt(sd,1067)); // On / Off
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
- if (map[m_id].flag.nosave) {
|
|
|
+ if (map_getmapflag(m_id, MF_NOSAVE)) {
|
|
|
if (!map[m_id].save.map)
|
|
|
clif_displaymessage(fd, msg_txt(sd,1068)); // No Save (Return to last Save Point)
|
|
|
else if (map[m_id].save.x == -1 || map[m_id].save.y == -1 ) {
|
|
@@ -4146,77 +4145,77 @@ ACMD_FUNC(mapinfo) {
|
|
|
}
|
|
|
|
|
|
strcpy(atcmd_output,msg_txt(sd,1049)); // Weather Flags:
|
|
|
- if (map[m_id].flag.snow)
|
|
|
+ if (map_getmapflag(m_id, MF_SNOW))
|
|
|
strcat(atcmd_output, " Snow |");
|
|
|
- if (map[m_id].flag.fog)
|
|
|
+ if (map_getmapflag(m_id, MF_FOG))
|
|
|
strcat(atcmd_output, " Fog |");
|
|
|
- if (map[m_id].flag.sakura)
|
|
|
+ if (map_getmapflag(m_id, MF_SAKURA))
|
|
|
strcat(atcmd_output, " Sakura |");
|
|
|
- if (map[m_id].flag.clouds)
|
|
|
+ if (map_getmapflag(m_id, MF_CLOUDS))
|
|
|
strcat(atcmd_output, " Clouds |");
|
|
|
- if (map[m_id].flag.clouds2)
|
|
|
+ if (map_getmapflag(m_id, MF_CLOUDS2))
|
|
|
strcat(atcmd_output, " Clouds2 |");
|
|
|
- if (map[m_id].flag.fireworks)
|
|
|
+ if (map_getmapflag(m_id, MF_FIREWORKS))
|
|
|
strcat(atcmd_output, " Fireworks |");
|
|
|
- if (map[m_id].flag.leaves)
|
|
|
+ if (map_getmapflag(m_id, MF_LEAVES))
|
|
|
strcat(atcmd_output, " Leaves |");
|
|
|
- if (map[m_id].flag.nightenabled)
|
|
|
+ if (map_getmapflag(m_id, MF_NIGHTENABLED))
|
|
|
strcat(atcmd_output, " Displays Night |");
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
strcpy(atcmd_output,msg_txt(sd,1050)); // Other Flags:
|
|
|
- if (map[m_id].flag.nobranch)
|
|
|
+ if (map_getmapflag(m_id, MF_NOBRANCH))
|
|
|
strcat(atcmd_output, " NoBranch |");
|
|
|
- if (map[m_id].flag.notrade)
|
|
|
+ if (map_getmapflag(m_id, MF_NOTRADE))
|
|
|
strcat(atcmd_output, " NoTrade |");
|
|
|
- if (map[m_id].flag.novending)
|
|
|
+ if (map_getmapflag(m_id, MF_NOVENDING))
|
|
|
strcat(atcmd_output, " NoVending |");
|
|
|
- if (map[m_id].flag.nodrop)
|
|
|
+ if (map_getmapflag(m_id, MF_NODROP))
|
|
|
strcat(atcmd_output, " NoDrop |");
|
|
|
- if (map[m_id].flag.noskill)
|
|
|
+ if (map_getmapflag(m_id, MF_NOSKILL))
|
|
|
strcat(atcmd_output, " NoSkill |");
|
|
|
- if (map[m_id].flag.noicewall)
|
|
|
+ if (map_getmapflag(m_id, MF_NOICEWALL))
|
|
|
strcat(atcmd_output, " NoIcewall |");
|
|
|
- if (map[m_id].flag.allowks)
|
|
|
+ if (map_getmapflag(m_id, MF_ALLOWKS))
|
|
|
strcat(atcmd_output, " AllowKS |");
|
|
|
- if (map[m_id].flag.reset)
|
|
|
+ if (map_getmapflag(m_id, MF_RESET))
|
|
|
strcat(atcmd_output, " Reset |");
|
|
|
- if (map[m_id].flag.hidemobhpbar)
|
|
|
+ if (map_getmapflag(m_id, MF_HIDEMOBHPBAR))
|
|
|
strcat(atcmd_output, " HideMobHPBar |");
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
strcpy(atcmd_output,msg_txt(sd,1051)); // Other Flags2:
|
|
|
- if (map[m_id].nocommand)
|
|
|
+ if (map_getmapflag(m_id, MF_NOCOMMAND))
|
|
|
strcat(atcmd_output, " NoCommand |");
|
|
|
- if (map[m_id].flag.nobaseexp)
|
|
|
+ if (map_getmapflag(m_id, MF_NOBASEEXP))
|
|
|
strcat(atcmd_output, " NoBaseEXP |");
|
|
|
- if (map[m_id].flag.nojobexp)
|
|
|
+ if (map_getmapflag(m_id, MF_NOJOBEXP))
|
|
|
strcat(atcmd_output, " NoJobEXP |");
|
|
|
- if (map[m_id].flag.nomobloot)
|
|
|
+ if (map_getmapflag(m_id, MF_NOMOBLOOT))
|
|
|
strcat(atcmd_output, " NoMobLoot |");
|
|
|
- if (map[m_id].flag.nomvploot)
|
|
|
+ if (map_getmapflag(m_id, MF_NOMVPLOOT))
|
|
|
strcat(atcmd_output, " NoMVPLoot |");
|
|
|
- if (map[m_id].flag.partylock)
|
|
|
+ if (map_getmapflag(m_id, MF_PARTYLOCK))
|
|
|
strcat(atcmd_output, " PartyLock |");
|
|
|
- if (map[m_id].flag.guildlock)
|
|
|
+ if (map_getmapflag(m_id, MF_GUILDLOCK))
|
|
|
strcat(atcmd_output, " GuildLock |");
|
|
|
- if (map[m_id].flag.loadevent)
|
|
|
+ if (map_getmapflag(m_id, MF_LOADEVENT))
|
|
|
strcat(atcmd_output, " Loadevent |");
|
|
|
- if (map[m_id].flag.chmautojoin)
|
|
|
- strcat(atcmd_output, " Chmautojoin |");
|
|
|
- if (map[m_id].flag.nousecart)
|
|
|
+ if (map_getmapflag(m_id, MF_NOMAPCHANNELAUTOJOIN))
|
|
|
+ strcat(atcmd_output, " NoMapChannelAutoJoin |");
|
|
|
+ if (map_getmapflag(m_id, MF_NOUSECART))
|
|
|
strcat(atcmd_output, " NoUsecart |");
|
|
|
- if (map[m_id].flag.noitemconsumption)
|
|
|
+ if (map_getmapflag(m_id, MF_NOITEMCONSUMPTION))
|
|
|
strcat(atcmd_output, " NoItemConsumption |");
|
|
|
- if (map[m_id].flag.nosumstarmiracle)
|
|
|
- strcat(atcmd_output, " NoSumStarMiracle |");
|
|
|
- if (map[m_id].flag.nomineeffect)
|
|
|
+ if (map_getmapflag(m_id, MF_NOSUNMOONSTARMIRACLE))
|
|
|
+ strcat(atcmd_output, " NoSunMoonStarMiracle |");
|
|
|
+ if (map_getmapflag(m_id, MF_NOMINEEFFECT))
|
|
|
strcat(atcmd_output, " NoMineEffect |");
|
|
|
- if (map[m_id].flag.nolockon)
|
|
|
+ if (map_getmapflag(m_id, MF_NOLOCKON))
|
|
|
strcat(atcmd_output, " NoLockOn |");
|
|
|
- if (map[m_id].flag.notomb)
|
|
|
+ if (map_getmapflag(m_id, MF_NOTOMB))
|
|
|
strcat(atcmd_output, " NoTomb |");
|
|
|
- if (map[m_id].flag.nocostume)
|
|
|
+ if (map_getmapflag(m_id, MF_NOCOSTUME))
|
|
|
strcat(atcmd_output, " NoCostume |");
|
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
@@ -5367,7 +5366,7 @@ ACMD_FUNC(killable)
|
|
|
ACMD_FUNC(skillon)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- map[sd->bl.m].flag.noskill = 0;
|
|
|
+ map_setmapflag(sd->bl.m, MF_NOSKILL, false);
|
|
|
clif_displaymessage(fd, msg_txt(sd,244)); // Skills have been enabled on this map.
|
|
|
return 0;
|
|
|
}
|
|
@@ -5379,7 +5378,7 @@ ACMD_FUNC(skillon)
|
|
|
ACMD_FUNC(skilloff)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- map[sd->bl.m].flag.noskill = 1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_NOSKILL, true);
|
|
|
clif_displaymessage(fd, msg_txt(sd,243)); // Skills have been disabled on this map.
|
|
|
return 0;
|
|
|
}
|
|
@@ -5952,7 +5951,7 @@ ACMD_FUNC(changelook)
|
|
|
ACMD_FUNC(autotrade) {
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_AUTOTRADE) != battle_config.autotrade_mapflag ) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1179)); // Autotrade is not allowed on this map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -6011,7 +6010,7 @@ ACMD_FUNC(changegm)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if( map[sd->bl.m].flag.guildlock || map[sd->bl.m].flag.gvg_castle ) {
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_GUILDLOCK) || map_getmapflag(sd->bl.m, MF_GVG_CASTLE) ) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1182)); // You cannot change guild leaders on this map.
|
|
|
return -1;
|
|
|
}
|
|
@@ -6331,21 +6330,19 @@ ACMD_FUNC(autoloottype)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * No longer available, keeping here just in case it's back someday. [Ind]
|
|
|
- **/
|
|
|
/*==========================================
|
|
|
* It is made to rain.
|
|
|
+ * No longer available, keeping here just in case it's back someday. [Ind]
|
|
|
*------------------------------------------*/
|
|
|
//ACMD_FUNC(rain)
|
|
|
//{
|
|
|
// nullpo_retr(-1, sd);
|
|
|
-// if (map[sd->bl.m].flag.rain) {
|
|
|
-// map[sd->bl.m].flag.rain=0;
|
|
|
+// if (map_getmapflag(sd->bl.m, MF_RAIN)) {
|
|
|
+// map_setmapflag(sd->bl.m, MF_RAIN, false);
|
|
|
// clif_weather(sd->bl.m);
|
|
|
// clif_displaymessage(fd, msg_txt(sd,1201)); // The rain has stopped.
|
|
|
// } else {
|
|
|
-// map[sd->bl.m].flag.rain=1;
|
|
|
+// map_setmapflag(sd->bl.m, MF_RAIN, true);
|
|
|
// clif_weather(sd->bl.m);
|
|
|
// clif_displaymessage(fd, msg_txt(sd,1202)); // It has started to rain.
|
|
|
// }
|
|
@@ -6358,12 +6355,12 @@ ACMD_FUNC(autoloottype)
|
|
|
ACMD_FUNC(snow)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.snow) {
|
|
|
- map[sd->bl.m].flag.snow=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_SNOW)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_SNOW, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1203)); // Snow has stopped falling.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.snow=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_SNOW, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1204)); // It has started to snow.
|
|
|
}
|
|
@@ -6377,12 +6374,12 @@ ACMD_FUNC(snow)
|
|
|
ACMD_FUNC(sakura)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.sakura) {
|
|
|
- map[sd->bl.m].flag.sakura=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_SAKURA)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_SAKURA, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1205)); // Cherry tree leaves no longer fall.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.sakura=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_SAKURA, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1206)); // Cherry tree leaves have begun to fall.
|
|
|
}
|
|
@@ -6395,12 +6392,12 @@ ACMD_FUNC(sakura)
|
|
|
ACMD_FUNC(clouds)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.clouds) {
|
|
|
- map[sd->bl.m].flag.clouds=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_CLOUDS)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_CLOUDS, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1207)); // The clouds has disappear.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.clouds=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_CLOUDS, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1208)); // Clouds appear.
|
|
|
}
|
|
@@ -6414,12 +6411,12 @@ ACMD_FUNC(clouds)
|
|
|
ACMD_FUNC(clouds2)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.clouds2) {
|
|
|
- map[sd->bl.m].flag.clouds2=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_CLOUDS2)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_CLOUDS2, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1209)); // The alternative clouds disappear.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.clouds2=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_CLOUDS2, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1210)); // Alternative clouds appear.
|
|
|
}
|
|
@@ -6433,12 +6430,12 @@ ACMD_FUNC(clouds2)
|
|
|
ACMD_FUNC(fog)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.fog) {
|
|
|
- map[sd->bl.m].flag.fog=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_FOG)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_FOG, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1211)); // The fog has gone.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.fog=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_FOG, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1212)); // Fog hangs over.
|
|
|
}
|
|
@@ -6451,12 +6448,12 @@ ACMD_FUNC(fog)
|
|
|
ACMD_FUNC(leaves)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.leaves) {
|
|
|
- map[sd->bl.m].flag.leaves=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_LEAVES)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_LEAVES, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1213)); // Leaves no longer fall.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.leaves=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_LEAVES, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1214)); // Fallen leaves fall.
|
|
|
}
|
|
@@ -6470,12 +6467,12 @@ ACMD_FUNC(leaves)
|
|
|
ACMD_FUNC(fireworks)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- if (map[sd->bl.m].flag.fireworks) {
|
|
|
- map[sd->bl.m].flag.fireworks=0;
|
|
|
+ if (map_getmapflag(sd->bl.m, MF_FIREWORKS)) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_FIREWORKS, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1215)); // Fireworks have ended.
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.fireworks=1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_FIREWORKS, true);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1216)); // Fireworks have launched.
|
|
|
}
|
|
@@ -6489,17 +6486,15 @@ ACMD_FUNC(fireworks)
|
|
|
ACMD_FUNC(clearweather)
|
|
|
{
|
|
|
nullpo_retr(-1, sd);
|
|
|
- /**
|
|
|
- * No longer available, keeping here just in case it's back someday. [Ind]
|
|
|
- **/
|
|
|
- //map[sd->bl.m].flag.rain=0;
|
|
|
- map[sd->bl.m].flag.snow=0;
|
|
|
- map[sd->bl.m].flag.sakura=0;
|
|
|
- map[sd->bl.m].flag.clouds=0;
|
|
|
- map[sd->bl.m].flag.clouds2=0;
|
|
|
- map[sd->bl.m].flag.fog=0;
|
|
|
- map[sd->bl.m].flag.fireworks=0;
|
|
|
- map[sd->bl.m].flag.leaves=0;
|
|
|
+
|
|
|
+ //map_setmapflag(sd->bl.m, MF_RAIN, false); // No longer available, keeping here just in case it's back someday. [Ind]
|
|
|
+ map_setmapflag(sd->bl.m, MF_SNOW, false);
|
|
|
+ map_setmapflag(sd->bl.m, MF_SAKURA, false);
|
|
|
+ map_setmapflag(sd->bl.m, MF_CLOUDS, false);
|
|
|
+ map_setmapflag(sd->bl.m, MF_CLOUDS2, false);
|
|
|
+ map_setmapflag(sd->bl.m, MF_FOG, false);
|
|
|
+ map_setmapflag(sd->bl.m, MF_FIREWORKS, false);
|
|
|
+ map_setmapflag(sd->bl.m, MF_LEAVES, false);
|
|
|
clif_weather(sd->bl.m);
|
|
|
clif_displaymessage(fd, msg_txt(sd,291)); // Weather effects will dispell on warp/refresh
|
|
|
|
|
@@ -8150,84 +8145,69 @@ ACMD_FUNC(fakename)
|
|
|
* Ragnarok Resources
|
|
|
*------------------------------------------*/
|
|
|
ACMD_FUNC(mapflag) {
|
|
|
-#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif_displaymessage(sd->fd,#cmd)
|
|
|
-#define setflag( cmd ) \
|
|
|
- if ( strcmp( flag_name , #cmd ) == 0 ){\
|
|
|
- map[ sd->bl.m ].flag.cmd = flag;\
|
|
|
- sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag);\
|
|
|
- clif_displaymessage(sd->fd,atcmd_output);\
|
|
|
- return 0;\
|
|
|
- }
|
|
|
- char flag_name[100];
|
|
|
- short flag=0,i;
|
|
|
+ char flag_name[CHAT_SIZE_MAX];
|
|
|
+ short flag = 0, i, j;
|
|
|
+ StringBuf buf;
|
|
|
+
|
|
|
nullpo_retr(-1, sd);
|
|
|
+
|
|
|
memset(flag_name, '\0', sizeof(flag_name));
|
|
|
|
|
|
if (!message || !*message || (sscanf(message, "%99s %6hd", flag_name, &flag) < 1)) {
|
|
|
clif_displaymessage(sd->fd,msg_txt(sd,1311)); // Enabled Mapflags in this map:
|
|
|
clif_displaymessage(sd->fd,"----------------------------------");
|
|
|
- checkflag(town); checkflag(autotrade); checkflag(allowks); checkflag(nomemo);
|
|
|
- checkflag(noteleport); checkflag(noreturn); checkflag(monster_noteleport); checkflag(nosave);
|
|
|
- checkflag(nobranch); checkflag(noexppenalty); checkflag(pvp); checkflag(pvp_noparty);
|
|
|
- checkflag(pvp_noguild); checkflag(pvp_nightmaredrop); checkflag(pvp_nocalcrank); checkflag(gvg_castle);
|
|
|
- checkflag(gvg); checkflag(gvg_dungeon); checkflag(gvg_noparty); checkflag(battleground);
|
|
|
- checkflag(nozenypenalty); checkflag(notrade); checkflag(noskill); checkflag(nowarp);
|
|
|
- checkflag(nowarpto); checkflag(noicewall); checkflag(snow); checkflag(clouds);
|
|
|
- checkflag(clouds2); checkflag(fog); checkflag(fireworks); checkflag(sakura);
|
|
|
- checkflag(leaves); checkflag(nogo); checkflag(nobaseexp); checkflag(nojobexp);
|
|
|
- checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled); checkflag(restricted);
|
|
|
- checkflag(nodrop); checkflag(novending); checkflag(loadevent); checkflag(nochat);
|
|
|
- checkflag(partylock); checkflag(guildlock); checkflag(reset); checkflag(chmautojoin);
|
|
|
- checkflag(nousecart); checkflag(noitemconsumption); checkflag(nosumstarmiracle); checkflag(nomineeffect);
|
|
|
- checkflag(nolockon); checkflag(notomb); checkflag(nocostume); checkflag(gvg_te);
|
|
|
- checkflag(gvg_te_castle); checkflag(hidemobhpbar);
|
|
|
-#ifdef ADJUST_SKILL_DAMAGE
|
|
|
- checkflag(skill_damage);
|
|
|
-#endif
|
|
|
+ for( i = MF_MIN; i < MF_MAX; i++ ){
|
|
|
+ if( map_getmapflag_name(static_cast<e_mapflag>(i), flag_name) && map_getmapflag( sd->bl.m, static_cast<e_mapflag>(i) ) ){
|
|
|
+ clif_displaymessage(sd->fd, flag_name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
clif_displaymessage(sd->fd," ");
|
|
|
clif_displaymessage(sd->fd,msg_txt(sd,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
|
|
|
clif_displaymessage(sd->fd,msg_txt(sd,1313)); // Type "@mapflag available" to list the available mapflags.
|
|
|
return 1;
|
|
|
}
|
|
|
- for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase
|
|
|
-
|
|
|
- setflag(town); setflag(autotrade); setflag(allowks); setflag(nomemo);
|
|
|
- setflag(noteleport); setflag(noreturn); setflag(monster_noteleport); setflag(nosave);
|
|
|
- setflag(nobranch); setflag(noexppenalty); setflag(pvp); setflag(pvp_noparty);
|
|
|
- setflag(pvp_noguild); setflag(pvp_nightmaredrop); setflag(pvp_nocalcrank); setflag(gvg_castle);
|
|
|
- setflag(gvg); setflag(gvg_dungeon); setflag(gvg_noparty); setflag(battleground);
|
|
|
- setflag(nozenypenalty); setflag(notrade); setflag(noskill); setflag(nowarp);
|
|
|
- setflag(nowarpto); setflag(noicewall); setflag(snow); setflag(clouds);
|
|
|
- setflag(clouds2); setflag(fog); setflag(fireworks); setflag(sakura);
|
|
|
- setflag(leaves); setflag(nogo); setflag(nobaseexp); setflag(nojobexp);
|
|
|
- setflag(nomobloot); setflag(nomvploot); setflag(nightenabled); setflag(restricted);
|
|
|
- setflag(nodrop); setflag(novending); setflag(loadevent); setflag(nochat);
|
|
|
- setflag(partylock); setflag(guildlock); setflag(reset); setflag(chmautojoin);
|
|
|
- setflag(nousecart); setflag(noitemconsumption); setflag(nosumstarmiracle); setflag(nomineeffect);
|
|
|
- setflag(nolockon); setflag(notomb); setflag(nocostume); setflag(gvg_te);
|
|
|
- setflag(gvg_te_castle); setflag(hidemobhpbar);
|
|
|
-#ifdef ADJUST_SKILL_DAMAGE
|
|
|
- setflag(skill_damage);
|
|
|
-#endif
|
|
|
|
|
|
- clif_displaymessage(sd->fd,msg_txt(sd,1314)); // Invalid flag name or flag.
|
|
|
- clif_displaymessage(sd->fd,msg_txt(sd,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
|
|
|
+ // Check if the list of mapflags was requested
|
|
|
+ if( strcasecmp(flag_name,"available") ){
|
|
|
+ for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase
|
|
|
+
|
|
|
+ enum e_mapflag mapflag = map_getmapflag_by_name(flag_name);
|
|
|
+
|
|
|
+ if( mapflag != MF_INVALID ){
|
|
|
+ map_setmapflag(sd->bl.m, static_cast<e_mapflag>(mapflag), flag != 0);
|
|
|
+ sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",flag_name,flag?"On":"Off",flag);
|
|
|
+ clif_displaymessage(sd->fd,atcmd_output);
|
|
|
+ return 0;
|
|
|
+ }else{
|
|
|
+ clif_displaymessage(sd->fd, msg_txt(sd, 1314)); // Invalid flag name or flag.
|
|
|
+ clif_displaymessage(sd->fd, msg_txt(sd, 1313)); // Type "@mapflag available" to list the available mapflags.
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
clif_displaymessage(sd->fd,msg_txt(sd,1315)); // Available Flags:
|
|
|
clif_displaymessage(sd->fd,"----------------------------------");
|
|
|
- clif_displaymessage(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,");
|
|
|
- clif_displaymessage(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,");
|
|
|
- clif_displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,");
|
|
|
- clif_displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
|
|
|
- clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot, nomvploot,");
|
|
|
- clif_displaymessage(sd->fd,"nightenabled, restricted, nodrop, novending, loadevent, nochat, partylock, guildlock,");
|
|
|
- clif_displaymessage(sd->fd,"reset, chmautojoin, nousecart, noitemconsumption, nosumstarmiracle, nolockon, notomb,");
|
|
|
- clif_displaymessage(sd->fd,"nocostume, gvg_te, gvg_te_castle, hidemobhpbar");
|
|
|
-#ifdef ADJUST_SKILL_DAMAGE
|
|
|
- clif_displaymessage(sd->fd,"skill_damage");
|
|
|
-#endif
|
|
|
+ StringBuf_Init(&buf);
|
|
|
+ for( i = MF_MIN, j = 0; i < MF_MAX; i++ ){
|
|
|
+ if( map_getmapflag_name( static_cast<e_mapflag>(i), flag_name ) ){
|
|
|
+ StringBuf_AppendStr( &buf, flag_name );
|
|
|
|
|
|
-#undef checkflag
|
|
|
-#undef setflag
|
|
|
+ if( (i + 1) < MF_MAX ){
|
|
|
+ StringBuf_AppendStr( &buf, ", " );
|
|
|
+ }
|
|
|
+
|
|
|
+ j++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if( i > MF_MIN && ( j == 6 || ( i + 1 ) == MF_MAX ) ){
|
|
|
+ clif_displaymessage(sd->fd, StringBuf_Value(&buf) );
|
|
|
+ StringBuf_Clear(&buf);
|
|
|
+ j = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ StringBuf_Destroy(&buf);
|
|
|
+ clif_displaymessage(sd->fd, msg_txt(sd, 1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -8671,11 +8651,11 @@ ACMD_FUNC(allowks)
|
|
|
{
|
|
|
nullpo_retr(-1,sd);
|
|
|
|
|
|
- if( map[sd->bl.m].flag.allowks ) {
|
|
|
- map[sd->bl.m].flag.allowks = 0;
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_ALLOWKS) ) {
|
|
|
+ map_setmapflag(sd->bl.m, MF_ALLOWKS, false);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1330)); // [ Map K.S Protection Active ]
|
|
|
} else {
|
|
|
- map[sd->bl.m].flag.allowks = 1;
|
|
|
+ map_setmapflag(sd->bl.m, MF_ALLOWKS, true);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1331)); // [ Map K.S Protection Inactive ]
|
|
|
}
|
|
|
return 0;
|
|
@@ -10480,7 +10460,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
|
|
|
// type value 0|2 = script|console invoked: bypass restrictions
|
|
|
if ( type == 1 || type == 3) {
|
|
|
//Commands are disabled on maps flagged as 'nocommand'
|
|
|
- if ( map[sd->bl.m].nocommand && pc_get_group_level(sd) < map[sd->bl.m].nocommand ) {
|
|
|
+ if ( pc_get_group_level(sd) < map_getmapflag(sd->bl.m, MF_NOCOMMAND) ) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,143)); // Commands are disabled on this map.
|
|
|
return false;
|
|
|
}
|