summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c56
1 files changed, 46 insertions, 10 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index cd4b2a54f..ee1fcd7da 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1293,6 +1293,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
VECTOR_INIT(sd->script_queues);
VECTOR_INIT(sd->storage.item); // initialize storage item vector.
+ VECTOR_INIT(sd->hatEffectId);
sd->state.dialog = 0;
@@ -4901,15 +4902,16 @@ int pc_isUseitem(struct map_session_data *sd,int n)
return 0; // You cannot use this item while sitting.
}
- if (sd->state.storage_flag != STORAGE_FLAG_CLOSED && item->type != IT_CASH) {
- clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1475));
- return 0; // You cannot use this item while storage is open.
- }
-
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: {
@@ -4943,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
@@ -4960,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
@@ -4988,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;
}
@@ -5092,6 +5119,11 @@ int pc_useitem(struct map_session_data *sd,int n) {
return 0;
}
+ if (battle_config.storage_use_item == 1 && sd->state.storage_flag != STORAGE_FLAG_CLOSED) {
+ clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd, 1475));
+ return 0; // You cannot use this item while storage is open.
+ }
+
if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 )
return 0;
@@ -5178,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);