diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 29 | ||||
-rw-r--r-- | src/map/clif.h | 1 | ||||
-rw-r--r-- | src/map/itemdb.h | 50 | ||||
-rw-r--r-- | src/map/npc.h | 3 | ||||
-rw-r--r-- | src/map/pc.c | 42 | ||||
-rw-r--r-- | src/map/status.h | 84 |
6 files changed, 124 insertions, 85 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 5939222e9..8ab6e71a4 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11025,39 +11025,36 @@ void clif_parse_RemoveOption(int fd,struct map_session_data *sd) void clif_parse_ChangeCart(int fd,struct map_session_data *sd) __attribute__((nonnull (2))); /// Request to change cart's visual look (CZ_REQ_CHANGECART). /// 01af <num>.W -void clif_parse_ChangeCart(int fd,struct map_session_data *sd) +void clif_parse_ChangeCart(int fd, struct map_session_data *sd) {// TODO: State tracking? int type; - if( pc->checkskill(sd, MC_CHANGECART) < 1 ) + if (pc->checkskill(sd, MC_CHANGECART) == 0) return; #ifdef RENEWAL - if( sd->npc_id || sd->state.workinprogress&1 ){ + if (sd->npc_id || sd->state.workinprogress&1) { clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); return; } #endif - type = RFIFOW(fd,2); + type = RFIFOW(fd, 2); + + if ( #ifdef NEW_CARTS - if( (type == 9 && sd->status.base_level > 131) || - (type == 8 && sd->status.base_level > 121) || - (type == 7 && sd->status.base_level > 111) || - (type == 6 && sd->status.base_level > 101) || + (type == 9 && sd->status.base_level > 130) || + (type == 8 && sd->status.base_level > 120) || + (type == 7 && sd->status.base_level > 110) || + (type == 6 && sd->status.base_level > 100) || +#endif (type == 5 && sd->status.base_level > 90) || (type == 4 && sd->status.base_level > 80) || (type == 3 && sd->status.base_level > 65) || (type == 2 && sd->status.base_level > 40) || (type == 1)) -#else - if( (type == 5 && sd->status.base_level > 90) || - (type == 4 && sd->status.base_level > 80) || - (type == 3 && sd->status.base_level > 65) || - (type == 2 && sd->status.base_level > 40) || - (type == 1)) -#endif - pc->setcart(sd,type); + + pc->setcart(sd, type); } /// Request to select cart's visual look for new cart design (CZ_SELECTCART). 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/npc.h b/src/map/npc.h index 6180e9765..3bd11d536 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -125,7 +125,6 @@ struct npc_data { struct hplugin_data_store *hdata; ///< HPM Plugin Data Store }; - #define START_NPC_NUM 110000000 enum actor_classes { @@ -142,7 +141,7 @@ enum actor_classes { #define MAX_NPC_CLASS 1000 // New NPC range #define MAX_NPC_CLASS2_START 10001 -#define MAX_NPC_CLASS2_END 10203 +#define MAX_NPC_CLASS2_END 10248 //Script NPC events. enum npce_event { 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) diff --git a/src/map/status.h b/src/map/status.h index 6f68c36c3..06e7e07b8 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1759,10 +1759,10 @@ enum si_type { //SI_HEALTHSTATE_HEAVYPOISON = 890, //SI_HEALTHSTATE_FEAR = 891, //SI_CHERRY_BLOSSOM_CAKE = 892, - SI_SU_STOOP = 893, - SI_CATNIPPOWDER = 894, + SI_SU_STOOP = 893, + SI_CATNIPPOWDER = 894, SI_BLOSSOM_FLUTTERING = 895, - SI_SV_ROOTTWIST = 896, + SI_SV_ROOTTWIST = 896, //SI_ATTACK_PROPERTY_NOTHING = 897, //SI_ATTACK_PROPERTY_WATER = 898, //SI_ATTACK_PROPERTY_GROUND = 899, @@ -1784,11 +1784,11 @@ enum si_type { //SI_RESIST_PROPERTY_DARKNESS = 914, //SI_RESIST_PROPERTY_TELEKINESIS = 915, //SI_RESIST_PROPERTY_UNDEAD = 916, - SI_BITESCAR = 917, - SI_ARCLOUSEDASH = 918, - SI_TUNAPARTY = 919, - SI_SHRIMP = 920, - SI_FRESHSHRIMP = 921, + SI_BITESCAR = 917, + SI_ARCLOUSEDASH = 918, + SI_TUNAPARTY = 919, + SI_SHRIMP = 920, + SI_FRESHSHRIMP = 921, //SI_PERIOD_RECEIVEITEM = 922, //SI_PERIOD_PLUSEXP = 923, //SI_PERIOD_PLUSJOBEXP = 924, @@ -1800,14 +1800,78 @@ enum si_type { //SI_HELM_ISIA = 930, //SI_HELM_ASIR = 931, //SI_HELM_URJ = 932, - SI_SUHIDE = 933, + SI_SUHIDE = 933, //SI_ = 934, //SI_DORAM_BUF_01 = 935, //SI_DORAM_BUF_02 = 936, - SI_SPRITEMABLE = 937, + SI_SPRITEMABLE = 937, + //SI_AID_PERIOD_RECEIVEITEM = 938, + //SI_AID_PERIOD_PLUSEXP = 939, + //SI_AID_PERIOD_PLUSJOBEXP = 940, + //SI_AID_PERIOD_DEADPENALTY = 941, + //SI_AID_PERIOD_ADDSTOREITEMCOUNT = 942, + //SI_ = 943, + //SI_ = 944, + //SI_ = 945, + //SI_ = 946, + //SI_ = 947, + //SI_ = 948, + //SI_ = 949, + //SI_HISS = 950, + //SI_ = 951, + //SI_NYANGGRASS = 952, + //SI_CHATTERING = 953, + //SI_ = 954, + //SI_ = 955, + //SI_ = 956, + //SI_ = 957, + //SI_ = 958, + //SI_ = 959, + //SI_ = 960, + //SI_GROOMING = 961, + //SI_PROTECTIONOFSHRIMP = 962, //SI_EP16_2_BUFF_SS = 963, //SI_EP16_2_BUFF_SC = 964, //SI_EP16_2_BUFF_AC = 965, + //SI_GS_MAGICAL_BULLET = 966, + //SI_ = 967, + //SI_ = 968, + //SI_ = 969, + //SI_ = 970, + //SI_ = 971, + //SI_ = 972, + //SI_ = 973, + //SI_ = 974, + //SI_ = 975, + //SI_FALLEN_ANGEL = 976, + //SI_ = 977, + //SI_ = 978, + //SI_BLAZE_BEAD = 979, + //SI_FROZEN_BEAD = 980, + //SI_BREEZE_BEAD = 981, + //SI_ = 982, + //SI_AID_PERIOD_RECEIVEITEM_2ND = 983, + //SI_AID_PERIOD_PLUSEXP_2ND = 984, + //SI_AID_PERIOD_PLUSJOBEXP_2ND = 985, + //SI_PRONTERA_JP = 986, + //SI_ = 987, + //SI_GLOOM_CARD = 988, + //SI_PHARAOH_CARD = 989, + //SI_KIEL_CARD = 990, + //SI_ = 991, + //SI_CHEERUP = 992, + //SI_ = 993, + //SI_ = 994, + //SI_S_MANAPOTION = 995, + //SI_M_DEFSCROLL = 996, + //SI_ = 997, + //SI_ = 998, + //SI_ = 999, + //SI_AS_RAGGED_GOLEM_CARD = 1000, + //SI_LHZ_DUN_N1 = 1001, + //SI_LHZ_DUN_N2 = 1002, + //SI_LHZ_DUN_N3 = 1003, + //SI_LHZ_DUN_N4 = 1004, #ifndef SI_MAX SI_MAX, #endif |