Follow up to a7b8fd4

* Resolves a check for skills that have required equipment items to check for all items in the list.
* Fixes #782 - Removed renewal items from pre-renewal skill requirements for 3rd classes.
This commit is contained in:
aleos89 2015-12-03 11:20:12 -05:00
parent 1f47604f57
commit 523cb145f5
5 changed files with 41 additions and 38 deletions

View File

@ -751,7 +751,7 @@
//Skill messages //Skill messages
720: %s is required. 720: %s is required.
721: [%s] Poison effect was applied to the weapon. 721: [%s] Poison effect was applied to the weapon.
722: Please equipped with a %s. //722: Free
// @costume // @costume
723: '%s' is an unknown costume 723: '%s' is an unknown costume

View File

@ -680,13 +680,13 @@
//**** //****
// NC Mechanic // NC Mechanic
2256,0,0,3:6:9:12:15,0,0,0,99,0,0,mado,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_BOOSTKNUCKLE 2256,0,0,3:6:9:12:15,0,0,0,99,0,0,mado,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_BOOSTKNUCKLE
2257,0,0,50,0,0,0,99,0,0,mado,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1549:16030:16031:16032 //NC_PILEBUNKER 2257,0,0,50,0,0,0,99,0,0,mado,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_PILEBUNKER
2258,0,0,2:4:6,0,0,0,99,0,0,mado,0,0,6145,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_VULCANARM 2258,0,0,2:4:6,0,0,0,99,0,0,mado,0,0,6145,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_VULCANARM
2259,0,0,20,0,0,0,99,0,0,mado,0,0,2139,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_FLAMELAUNCHER 2259,0,0,20,0,0,0,99,0,0,mado,0,0,2139,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_FLAMELAUNCHER
2260,0,0,20,0,0,0,99,0,0,mado,0,0,6146,1,6147,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_COLDSLOWER 2260,0,0,20,0,0,0,99,0,0,mado,0,0,6146,1,6147,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_COLDSLOWER
2261,0,0,40:45:50,0,0,0,99,8,1,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_ARMSCANNON 2261,0,0,40:45:50,0,0,0,99,8,1,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_ARMSCANNON
2262,0,0,20:40:60,0,0,0,99,0,0,mado,0,0,2800,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_ACCELERATION 2262,0,0,20:40:60,0,0,0,99,0,0,mado,0,0,2800,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_ACCELERATION
2263,0,0,25,0,0,0,99,0,0,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2801 //NC_HOVERING 2263,0,0,25,0,0,0,99,0,0,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_HOVERING
2264,0,0,5,0,0,0,99,0,0,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_F_SIDESLIDE 2264,0,0,5,0,0,0,99,0,0,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_F_SIDESLIDE
2265,0,0,5,0,0,0,99,0,0,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_B_SIDESLIDE 2265,0,0,5,0,0,0,99,0,0,mado,0,0,6146,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_B_SIDESLIDE

View File

@ -5589,9 +5589,9 @@ static void pc_checkallowskill(struct map_session_data *sd)
} }
/*========================================== /*==========================================
* Return equiped itemid? on player sd at pos * Return equipped index of item on player sd at pos
* Return * Return
* -1 : mean nothing equiped * -1 : Nothing equipped
* idx : (this index could be used in inventory to found item_data) * idx : (this index could be used in inventory to found item_data)
*------------------------------------------*/ *------------------------------------------*/
short pc_checkequip(struct map_session_data *sd,int pos) short pc_checkequip(struct map_session_data *sd,int pos)
@ -5609,7 +5609,7 @@ short pc_checkequip(struct map_session_data *sd,int pos)
} }
/*========================================== /*==========================================
* Check if sd as nameid equiped somewhere * Check if sd has nameid equipped somewhere
* @sd : the player session * @sd : the player session
* @nameid : id of the item to check * @nameid : id of the item to check
* @min : : see pc.h enum equip_index from ? to @max * @min : : see pc.h enum equip_index from ? to @max

View File

@ -15068,14 +15068,15 @@ bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_i
if (require.eqItem_count) { if (require.eqItem_count) {
for (i = 0; i < require.eqItem_count; i++) { for (i = 0; i < require.eqItem_count; i++) {
uint16 reqeqit = require.eqItem[i]; uint16 reqeqit = require.eqItem[i];
if (!reqeqit) if (!reqeqit)
break; //no more required item get out of here break; //no required item; get out of here
if (!pc_checkequip2(sd,reqeqit,EQI_ACC_L,EQI_MAX)) { if (!pc_checkequip2(sd,reqeqit,EQI_ACC_L,EQI_MAX)) {
char output[CHAT_SIZE_MAX]; if (i == require.eqItem_count) {
//Official use msgstringtable.txt for each skill failure clif_skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
sprintf(output,msg_txt(sd,722),itemdb_jname(reqeqit)); return false;
clif_colormes(sd->fd, color_table[COLOR_RED], output); }
return false; continue;
} }
} }
} }
@ -20288,7 +20289,8 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
skill_split_atoi(split[12],skill_db[idx]->require.spiritball); skill_split_atoi(split[12],skill_db[idx]->require.spiritball);
for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; i++ ) { for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; i++ ) {
int32 itemid = atoi(split[13 + 2 * i]); uint16 itemid = atoi(split[13 + 2 * i]);
if (itemid > 0 && !itemdb_exists(itemid) ) { if (itemid > 0 && !itemdb_exists(itemid) ) {
ShowError("skill_parse_row_requiredb: Invalid item (in ITEM_REQUIRE list) %d for skill %d.\n", itemid, atoi(split[0])); ShowError("skill_parse_row_requiredb: Invalid item (in ITEM_REQUIRE list) %d for skill %d.\n", itemid, atoi(split[0]));
return false; return false;
@ -20301,17 +20303,18 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
trim(split[33]); trim(split[33]);
if (split[33][0] != '\0' || atoi(split[33])) { if (split[33][0] != '\0' || atoi(split[33])) {
int require[MAX_SKILL_EQUIP_REQUIRE]; int require[MAX_SKILL_EQUIP_REQUIRE];
if ((skill_db[idx]->require.eqItem_count = skill_split_atoi2(split[33], require, ":", 500, ARRAYLENGTH(require)))) { if ((skill_db[idx]->require.eqItem_count = skill_split_atoi2(split[33], require, ":", 500, ARRAYLENGTH(require)))) {
CREATE(skill_db[idx]->require.eqItem, uint16, skill_db[idx]->require.eqItem_count); CREATE(skill_db[idx]->require.eqItem, uint16, skill_db[idx]->require.eqItem_count);
for (i = 0; i < skill_db[idx]->require.eqItem_count; i++){ for (i = 0; i < skill_db[idx]->require.eqItem_count; i++){
if (require[i] > 0 && !itemdb_exists(require[i])) { if (require[i] > 0 && !itemdb_exists(require[i])) {
ShowError("skill_parse_row_requiredb: Invalid item (in EQUIP_REQUIRE list) %d for skill %d.\n", require[i], atoi(split[0])); ShowError("skill_parse_row_requiredb: Invalid item (in EQUIP_REQUIRE list) %d for skill %d.\n", require[i], atoi(split[0]));
aFree(skill_db[idx]->require.eqItem); //don't need to retain this aFree(skill_db[idx]->require.eqItem); //don't need to retain this
skill_db[idx]->require.eqItem_count = 0; skill_db[idx]->require.eqItem_count = 0;
return false; return false;
} }
skill_db[idx]->require.eqItem[i] = require[i]; skill_db[idx]->require.eqItem[i] = require[i];
} }
} }
} }
return true; return true;

View File

@ -136,23 +136,23 @@ struct skill_condition {
/// Skill requirement structure. !TODO: Cleanup the variable types that use array [MAX_SKILL_LEVEL] /// Skill requirement structure. !TODO: Cleanup the variable types that use array [MAX_SKILL_LEVEL]
struct s_skill_require { struct s_skill_require {
int hp[MAX_SKILL_LEVEL]; ///< HP cost int hp[MAX_SKILL_LEVEL]; ///< HP cost
int mhp[MAX_SKILL_LEVEL]; ///< Max HP to trigger int mhp[MAX_SKILL_LEVEL]; ///< Max HP to trigger
int sp[MAX_SKILL_LEVEL]; /// SP cost int sp[MAX_SKILL_LEVEL]; /// SP cost
int hp_rate[MAX_SKILL_LEVEL]; /// HP cost (%) int hp_rate[MAX_SKILL_LEVEL]; /// HP cost (%)
int sp_rate[MAX_SKILL_LEVEL]; /// SP cost (%) int sp_rate[MAX_SKILL_LEVEL]; /// SP cost (%)
int zeny[MAX_SKILL_LEVEL]; /// Zeny cost int zeny[MAX_SKILL_LEVEL]; /// Zeny cost
uint32 weapon; /// Weapon type. Combined bitmask of enum weapon_type (1<<weapon) uint32 weapon; /// Weapon type. Combined bitmask of enum weapon_type (1<<weapon)
uint16 ammo; /// Ammo type. Combine bitmask of enum ammo_type (1<<ammo) uint16 ammo; /// Ammo type. Combine bitmask of enum ammo_type (1<<ammo)
int ammo_qty[MAX_SKILL_LEVEL]; /// Amount of ammo int ammo_qty[MAX_SKILL_LEVEL]; /// Amount of ammo
uint8 state; /// State/condition. @see enum e_require_state uint8 state; /// State/condition. @see enum e_require_state
int spiritball[MAX_SKILL_LEVEL]; /// Spiritball cost int spiritball[MAX_SKILL_LEVEL]; /// Spiritball cost
int itemid[MAX_SKILL_ITEM_REQUIRE]; /// Required item uint16 itemid[MAX_SKILL_ITEM_REQUIRE]; /// Required item
int amount[MAX_SKILL_ITEM_REQUIRE]; /// Amount of item uint16 amount[MAX_SKILL_ITEM_REQUIRE]; /// Amount of item
uint16 *eqItem; /// List of equipped item uint16 *eqItem; /// List of equipped item
enum sc_type *status; /// List of Status required (SC) enum sc_type *status; /// List of Status required (SC)
uint8 status_count, /// Count of SC uint8 status_count, /// Count of SC
eqItem_count; /// Count of equipped item eqItem_count; /// Count of equipped item
}; };
/// Database skills. !TODO: Cleanup the variable types that use array [MAX_SKILL_LEVEL] /// Database skills. !TODO: Cleanup the variable types that use array [MAX_SKILL_LEVEL]