summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-04-08 14:46:34 +0200
committerGitHub <noreply@github.com>2018-04-08 14:46:34 +0200
commit81e1ace120e191f2d218d5a735c93192d2dfbea4 (patch)
tree0784f194a3289b44593eaf143945207db3259f9e /src
parent1248aa338a366d03d530c323b12de6f0ba61736a (diff)
parent558f279801089fb374120ae932143f36d123af25 (diff)
downloadhercules-81e1ace120e191f2d218d5a735c93192d2dfbea4.tar.gz
hercules-81e1ace120e191f2d218d5a735c93192d2dfbea4.tar.bz2
hercules-81e1ace120e191f2d218d5a735c93192d2dfbea4.tar.xz
hercules-81e1ace120e191f2d218d5a735c93192d2dfbea4.zip
Merge pull request #2006 from Jedzkie/MessageFixes
Message Fixes
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/itemdb.h3
-rw-r--r--src/map/pc.c45
-rw-r--r--src/map/status.c6
4 files changed, 50 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e57f6e01b..63f44dd85 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5468,6 +5468,7 @@ void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 s
/// 0 = "Saved location as a Memo Point for Warp skill." in color 0xFFFF00 (cyan)
/// 1 = "Skill Level is not high enough." in color 0x0000FF (red)
/// 2 = "You haven't learned Warp." in color 0x0000FF (red)
+/// 3 = "Cannot save location as a Memo Point at current location." in color 0x0000FF (red)
///
/// @param sd Who receives the message
/// @param type What message
@@ -5490,6 +5491,7 @@ void clif_skill_memomessage(struct map_session_data* sd, int type)
/// 0 = "Unable to Teleport in this area" in color 0xFFFF00 (cyan)
/// 1 = "Saved point cannot be memorized." in color 0x0000FF (red)
/// 2 = "This skill cannot be used within this area." in color 0xFFFF00 (cyan)
+/// 3 = "This item cannot be used within this area." in color 0xFFFF00 (cyan)
///
/// @param sd Who receives the message
/// @param type What message
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 5344a7cd6..b170059ca 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -137,6 +137,8 @@ enum item_itemid {
ITEMID_MAGIC_CASTLE = 12308,
ITEMID_BULGING_HEAD = 12309,
ITEMID_THICK_MANUAL50 = 12312,
+ ITEMID_N_FLY_WING = 12323,
+ ITEMID_N_BUTTERFLY_WING = 12324,
ITEMID_N_MAGNIFIER = 12325,
ITEMID_ANSILA = 12333,
ITEMID_REPAIRA = 12392,
@@ -162,6 +164,7 @@ enum item_itemid {
ITEMID_THURISAZ = 12731,
ITEMID_WYRD = 12732,
ITEMID_HAGALAZ = 12733,
+ ITEMID_C_WING_OF_FLY = 12887,
ITEMID_DUN_TELE_SCROLL1 = 14527,
ITEMID_BATTLE_MANUAL25 = 14532,
ITEMID_BATTLE_MANUAL100 = 14533,
diff --git a/src/map/pc.c b/src/map/pc.c
index dd9a7126f..ee1fcd7da 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4904,8 +4904,14 @@ int pc_isUseitem(struct map_session_data *sd,int n)
switch( nameid ) { // TODO: Is there no better way to handle this, other than hardcoding item IDs?
case ITEMID_ANODYNE:
- if (map_flag_gvg2(sd->bl.m))
+ if (map_flag_gvg2(sd->bl.m)) {
+#if PACKETVER >= 20080311
+ clif->skill_mapinfomessage(sd, 3);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, msg_sd(sd, 51));
+#endif
return 0;
+ }
break;
case ITEMID_GIANT_FLY_WING: {
@@ -4939,12 +4945,19 @@ int pc_isUseitem(struct map_session_data *sd,int n)
}
FALLTHROUGH
case ITEMID_WING_OF_FLY:
+ case ITEMID_N_FLY_WING:
+ case ITEMID_C_WING_OF_FLY:
if (map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m)) {
+#if PACKETVER >= 20080311
clif->skill_mapinfomessage(sd, 0);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd, 49));
+#endif
return 0;
}
/* Fall through */
case ITEMID_WING_OF_BUTTERFLY:
+ case ITEMID_N_BUTTERFLY_WING:
case ITEMID_DUN_TELE_SCROLL1:
case ITEMID_DUN_TELE_SCROLL2:
case ITEMID_WOB_RUNE: // Yellow Butterfly Wing
@@ -4956,15 +4969,27 @@ int pc_isUseitem(struct map_session_data *sd,int n)
clif->message(sd->fd, msg_sd(sd,863)); // "Duel: Can't use this item in duel."
return 0;
}
- if( nameid != ITEMID_WING_OF_FLY && nameid != ITEMID_GIANT_FLY_WING && map->list[sd->bl.m].flag.noreturn )
+ if (nameid != ITEMID_WING_OF_FLY && nameid != ITEMID_GIANT_FLY_WING && map->list[sd->bl.m].flag.noreturn) {
+#if PACKETVER >= 20080311
+ clif->skill_mapinfomessage(sd, 0);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd, 49));
+#endif
return 0;
+ }
break;
case ITEMID_BRANCH_OF_DEAD_TREE:
case ITEMID_RED_POUCH_OF_SURPRISE:
case ITEMID_BLOODY_DEAD_BRANCH:
case ITEMID_PORING_BOX:
- if( map->list[sd->bl.m].flag.nobranch || map_flag_gvg2(sd->bl.m) )
+ if (map->list[sd->bl.m].flag.nobranch || map_flag_gvg2(sd->bl.m)) {
+#if PACKETVER >= 20080311
+ clif->skill_mapinfomessage(sd, 3);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, msg_sd(sd, 51));
+#endif
return 0;
+ }
break;
// Mercenary Items
@@ -4984,8 +5009,14 @@ int pc_isUseitem(struct map_session_data *sd,int n)
break;
case ITEMID_NEURALIZER:
- if( !map->list[sd->bl.m].flag.reset )
+ if (!map->list[sd->bl.m].flag.reset) {
+#if PACKETVER >= 20080311
+ clif->skill_mapinfomessage(sd, 3);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, msg_sd(sd, 51));
+#endif
return 0;
+ }
break;
}
@@ -5179,7 +5210,11 @@ int pc_useitem(struct map_session_data *sd,int n) {
/* on restricted maps the item is consumed but the effect is not used */
for(i = 0; i < map->list[sd->bl.m].zone->disabled_items_count; i++) {
if( map->list[sd->bl.m].zone->disabled_items[i] == nameid ) {
- clif->msgtable(sd, MSG_ITEM_CANT_USE_AREA); // This item cannot be used within this area
+#if PACKETVER >= 20080311
+ clif->skill_mapinfomessage(sd, 3);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, msg_sd(sd, 50));
+#endif
if( battle_config.item_restricted_consumption_type && sd->status.inventory[n].expire_time == 0 ) {
clif->useitemack(sd,n,sd->status.inventory[n].amount-1,true);
pc->delitem(sd, n, 1, 1, DELITEM_NORMAL, LOG_TYPE_CONSUME);
diff --git a/src/map/status.c b/src/map/status.c
index 3e4b4a45c..b2f67735b 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1780,7 +1780,11 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
for(i = 0; i < map->list[src->m].zone->disabled_skills_count; i++) {
if( skill_id == map->list[src->m].zone->disabled_skills[i]->nameid && (map->list[src->m].zone->disabled_skills[i]->type&src->type) ) {
if (src->type == BL_PC) {
- clif->msgtable(sd, MSG_SKILL_CANT_USE_AREA); // This skill cannot be used within this area
+#if PACKETVER >= 20080311
+ clif->skill_mapinfomessage(sd, 2);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, msg_sd(sd, 50));
+#endif
} else if (src->type == BL_MOB && map->list[src->m].zone->disabled_skills[i]->subtype != MZS_NONE) {
if( st->mode&MD_BOSS ) { /* is boss */
if( !( map->list[src->m].zone->disabled_skills[i]->subtype&MZS_BOSS ) )