summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-04-21 01:08:06 +0200
committerGitHub <noreply@github.com>2017-04-21 01:08:06 +0200
commit3159c574dd842d4677872deb52685e64b6f9c973 (patch)
tree02380dd2b933ffaa9ccb142ff723aaccc1a45053 /src
parentb1fdb0176241759a3085ad8b4d5bf415d3392f03 (diff)
parent60f9a68f90d495323e9e4533c7a1573ca5d86e71 (diff)
downloadhercules-3159c574dd842d4677872deb52685e64b6f9c973.tar.gz
hercules-3159c574dd842d4677872deb52685e64b6f9c973.tar.bz2
hercules-3159c574dd842d4677872deb52685e64b6f9c973.tar.xz
hercules-3159c574dd842d4677872deb52685e64b6f9c973.zip
Merge pull request #1693 from Jedzkie/5-ItemFixes
Item Fixes
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/itemdb.h50
-rw-r--r--src/map/pc.c42
3 files changed, 36 insertions, 57 deletions
diff --git a/src/map/clif.h b/src/map/clif.h
index e16655c1a..6b5fb8dca 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -69,6 +69,7 @@ struct view_data;
#define COLOR_RED 0xff0000U
#define COLOR_GREEN 0x00ff00U
#define COLOR_WHITE 0xffffffU
+#define COLOR_YELLOW 0xffff00U
#define COLOR_DEFAULT COLOR_GREEN
/**
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 618111d2a..138a783ae 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -147,6 +147,23 @@ enum item_itemid {
ITEMID_BLACK_THING = 12435,
ITEMID_BOARDING_HALTER = 12622,
ITEMID_NOBLE_NAMEPLATE = 12705,
+ ITEMID_POISON_PARALYSIS = 12717,
+ ITEMID_POISON_LEECH = 12718,
+ ITEMID_POISON_OBLIVION = 12719,
+ ITEMID_POISON_CONTAMINATION = 12720,
+ ITEMID_POISON_NUMB = 12721,
+ ITEMID_POISON_FEVER = 12722,
+ ITEMID_POISON_LAUGHING = 12723,
+ ITEMID_POISON_FATIGUE = 12724,
+ ITEMID_NAUTHIZ = 12725,
+ ITEMID_RAIDO = 12726,
+ ITEMID_BERKANA = 12727,
+ ITEMID_ISA = 12728,
+ ITEMID_OTHILA = 12729,
+ ITEMID_URUZ = 12730,
+ ITEMID_THURISAZ = 12731,
+ ITEMID_WYRD = 12732,
+ ITEMID_HAGALAZ = 12733,
ITEMID_DUN_TELE_SCROLL1 = 14527,
ITEMID_BATTLE_MANUAL25 = 14532,
ITEMID_BATTLE_MANUAL100 = 14533,
@@ -161,6 +178,7 @@ enum item_itemid {
ITEMID_PILEBUNCKER_S = 16030,
ITEMID_PILEBUNCKER_P = 16031,
ITEMID_PILEBUNCKER_T = 16032,
+ ITEMID_LUX_ANIMA = 22540,
};
enum cards_item_list {
@@ -262,37 +280,6 @@ enum cash_food_item_list {
};
/**
- * GC Poison
- */
-enum poison_item_list {
- ITEMID_POISON_PARALYSIS = 12717,
- ITEMID_POISON_LEECH, // 12718
- ITEMID_POISON_OBLIVION, // 12719
- ITEMID_POISON_CONTAMINATION, // 12720
- ITEMID_POISON_NUMB, // 12721
- ITEMID_POISON_FEVER, // 12722
- ITEMID_POISON_LAUGHING, // 12723
- ITEMID_POISON_FATIGUE, // 12724
-};
-
-
-/**
- * Rune Knight
- **/
-enum rune_item_list {
- ITEMID_NAUTHIZ = 12725,
- ITEMID_RAIDO, // 12726
- ITEMID_BERKANA, // 12727
- ITEMID_ISA, // 12728
- ITEMID_OTHILA, // 12729
- ITEMID_URUZ, // 12730
- ITEMID_THURISAZ, // 12731
- ITEMID_WYRD, // 12732
- ITEMID_HAGALAZ, // 12733
- ITEMID_LUX_ANIMA = 22540,
-};
-
-/**
* Geneticist
*/
enum geneticist_item_list {
@@ -566,7 +553,6 @@ struct item_data {
#define itemdb_canrefine(n) (!itemdb->search(n)->flag.no_refine)
#define itemdb_allowoption(n) (!itemdb->search(n)->flag.no_options)
-#define itemdb_is_rune(n) (((n) >= ITEMID_NAUTHIZ && (n) <= ITEMID_HAGALAZ) || (n) == ITEMID_LUX_ANIMA)
#define itemdb_is_element(n) ((n) >= ITEMID_SCARLET_PTS && (n) <= ITEMID_LIME_GREEN_PTS)
#define itemdb_is_spellbook(n) ((n) >= ITEMID_MAGIC_BOOK_FB && (n) <= ITEMID_MAGIC_BOOK_DL)
#define itemdb_is_poison(n) ((n) >= ITEMID_POISON_PARALYSIS && (n) <= ITEMID_POISON_FATIGUE)
diff --git a/src/map/pc.c b/src/map/pc.c
index e9855c16d..b4985dd5f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4840,11 +4840,7 @@ 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) )
- return 0;
- /* Fall through */
- case ITEMID_ALOEBERA:
- if( pc_issit(sd) )
+ if (map_flag_gvg2(sd->bl.m))
return 0;
break;
case ITEMID_WING_OF_FLY:
@@ -4921,17 +4917,6 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( nameid >= ITEMID_BOW_MERCENARY_SCROLL1 && nameid <= ITEMID_SPEARMERCENARY_SCROLL10 && sd->md != NULL ) // Mercenary Scrolls
return 0;
- /**
- * Only Rune Knights may use runes
- **/
- if (itemdb_is_rune(nameid) && (sd->job & MAPID_THIRDMASK) != MAPID_RUNE_KNIGHT)
- return 0;
- /**
- * Only GCross may use poisons
- **/
- else if (itemdb_is_poison(nameid) && (sd->job & MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS)
- return 0;
-
if( item->package || item->group ) {
if (pc_is90overweight(sd)) {
clif->msgtable(sd, MSG_ITEM_CANT_OBTAIN_WEIGHT);
@@ -5078,15 +5063,22 @@ int pc_useitem(struct map_session_data *sd,int n) {
if( sd->inventory_data[n]->flag.delay_consume && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status->check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) )
return 0;
- if( sd->inventory_data[n]->delay > 0 ) {
- ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid );
- if( i == MAX_ITEMDELAYS ) /* item not found. try first empty now */
- ARR_FIND(0, MAX_ITEMDELAYS, i, !sd->item_delay[i].nameid );
- if( i < MAX_ITEMDELAYS ) {
- if( sd->item_delay[i].nameid ) {// found
- if( DIFF_TICK(sd->item_delay[i].tick, tick) > 0 ) {
- int e_tick = (int)(DIFF_TICK(sd->item_delay[i].tick, tick)/1000);
- clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, e_tick + 1); // [%d] seconds left until you can use
+ if (sd->inventory_data[n]->delay > 0) {
+ ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid);
+ if (i == MAX_ITEMDELAYS) /* item not found. try first empty now */
+ ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == 0);
+ if (i < MAX_ITEMDELAYS) {
+ if (sd->item_delay[i].nameid != 0) {// found
+ if (DIFF_TICK(sd->item_delay[i].tick, tick) > 0) {
+ int delay_tick = (int)(DIFF_TICK(sd->item_delay[i].tick, tick) / 1000);
+#if PACKETVER >= 20101123
+ clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, delay_tick + 1); // [%d] seconds left until you can use
+#else
+ char delay_msg[100];
+ clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, delay_tick + 1); // [%d] seconds left until you can use
+ sprintf(delay_msg, msg_sd(sd, 26), delay_tick + 1);
+ clif->messagecolor_self(sd->fd, COLOR_YELLOW, delay_msg);
+#endif
return 0; // Delay has not expired yet
}
} else {// not yet used item (all slots are initially empty)