Added equipment max-level support as per manager Kenpachi request (required for upcoming renewal items).
- in renewal mode item_db's elv field now supports a optional elvmax separated by a colon, example: - 65:70 in the elv field means the item can only be worn by characters whose level is within 65~70 base level range. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16632 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
@@ -1039,7 +1039,11 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr
|
||||
}
|
||||
|
||||
id->wlv = cap_value(atoi(str[15]), REFINE_TYPE_ARMOR, REFINE_TYPE_MAX);
|
||||
#ifdef RENEWAL
|
||||
itemdb_re_split_atoi(str[16],&id->elv,&id->elvmax);
|
||||
#else
|
||||
id->elv = atoi(str[16]);
|
||||
#endif
|
||||
id->flag.no_refine = atoi(str[17]) ? 0 : 1; //FIXME: verify this
|
||||
id->look = atoi(str[18]);
|
||||
|
||||
|
||||
@@ -105,7 +105,8 @@ struct item_data {
|
||||
int wlv;
|
||||
int view_id;
|
||||
#ifdef RENEWAL
|
||||
int matk;//[RRInd] -- used in RE for matk
|
||||
int matk;
|
||||
int elvmax;/* maximum level for this item */
|
||||
#endif
|
||||
|
||||
int delay;
|
||||
|
||||
@@ -849,6 +849,10 @@ int pc_isequip(struct map_session_data *sd,int n)
|
||||
return 0;
|
||||
if(item->elv && sd->status.base_level < (unsigned int)item->elv)
|
||||
return 0;
|
||||
#ifdef RENEWAL
|
||||
if(item->elvmax && sd->status.base_level > (unsigned int)item->elvmax)
|
||||
return 0;
|
||||
#endif
|
||||
if(item->sex != 2 && sd->status.sex != item->sex)
|
||||
return 0;
|
||||
if(!map_flag_vs(sd->bl.m) && ((item->flag.no_equip&1) || !pc_isAllowedCardOn(sd,item->slot,n,1)))
|
||||
@@ -4067,6 +4071,11 @@ int pc_isUseitem(struct map_session_data *sd,int n)
|
||||
//Required level check
|
||||
if(item->elv && sd->status.base_level < (unsigned int)item->elv)
|
||||
return 0;
|
||||
|
||||
#ifdef RENEWAL
|
||||
if(item->elvmax && sd->status.base_level > (unsigned int)item->elvmax)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
//Not equipable by class. [Skotlex]
|
||||
if (!(
|
||||
|
||||
Reference in New Issue
Block a user