Index: trunk/src/map/skill.c
===================================================================
--- trunk/src/map/skill.c (revision 220)
+++ trunk/src/map/skill.c (revision 221)
@@ -165,8 +165,8 @@
int skill_get_sp_rate(int id, int lv ) { skill_get (skill_db[id].sp_rate[lv-1], id, lv); }
int skill_get_state(int id) { skill_get (skill_db[id].state, id, 1); }
int skill_get_spiritball(int id, int lv) { skill_get (skill_db[id].spiritball[lv-1], id, lv); }
-int skill_get_itemid(int id, int idx) { skill_get (skill_db[id].itemid[idx], id, 1); }
-int skill_get_itemqty(int id, int idx) { skill_get (skill_db[id].amount[idx], id, 1); }
+int skill_get_itemid(int id, int idx, int lv) { skill_get (skill_db[id].itemid[idx].val[lv-1], id, lv); }
+int skill_get_itemqty(int id, int idx, int lv) { skill_get (skill_db[id].amount[idx].val[lv-1], id, lv); }
int skill_get_zeny( int id ,int lv ) { skill_get (skill_db[id].zeny[lv-1], id, lv); }
int skill_get_num( int id ,int lv ) { skill_get (skill_db[id].num[lv-1], id, lv); }
int skill_get_cast( int id ,int lv ) { skill_get (skill_db[id].cast[lv-1], id, lv); }
@@ -2998,8 +2998,8 @@
// Requeriments
for( i = 0; i < ARRAYLENGTH(itemid); i++ )
{
- itemid[i] = skill_db[j].itemid[i];
- amount[i] = skill_db[j].amount[i];
+ itemid[i] = skill_db[j].itemid[i].val[lv-1];
+ amount[i] = skill_db[j].amount[i].val[lv-1];
}
hp = skill_db[j].hp[lv-1];
sp = skill_db[j].sp[lv-1];
@@ -6335,7 +6335,7 @@
map_freeblock_unlock();
return 1;
}
- if(sd->inventory_data[i] == NULL || sd->status.inventory[i].amount < skill_db[skillid].amount[x])
+ if(sd->inventory_data[i] == NULL || sd->status.inventory[i].amount < require.amount[x])
{
clif_skill_fail(sd,skillid,0,0,0);
map_freeblock_unlock();
@@ -6946,17 +6946,18 @@
{ // get back all items used to deploy the trap
for( i = 0; i < 10; i++ )
{
- if( skill_db[su->group->skill_id].itemid[i] > 0 )
+ int nameid = skill_db[su->group->skill_id].itemid[i].val[skilllv-1];
+ if( nameid > 0 )
{
int flag;
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid = skill_db[su->group->skill_id].itemid[i];
+ item_tmp.nameid = nameid;
item_tmp.identify = 1;
- if( item_tmp.nameid && (flag=pc_additem(sd,&item_tmp,skill_db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) )
+ if( item_tmp.nameid && (flag=pc_additem(sd,&item_tmp,nameid,LOG_TYPE_OTHER)) )
{
clif_additem(sd,0,0,flag);
- map_addflooritem(&item_tmp,skill_db[su->group->skill_id].amount[i],sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map_addflooritem(&item_tmp,nameid,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}
@@ -9940,7 +9941,7 @@
case CR_SLIMPITCHER:
if (sd) {
int i=0,j=0;
- require = skill_get_requirement(sd,skillid,skilllv);
+ require = skill_get_requirement(sd,skillid,skilllv);
i = skilllv%11 - 1;
j = pc_search_inventory(sd,require.itemid[i]);
if( j < 0 || require.itemid[i] <= 0 || sd->inventory_data[j] == NULL || sd->status.inventory[j].amount < require.amount[i] )
@@ -9972,7 +9973,7 @@
} else {
int i = skilllv%11 - 1;
struct item_data *item;
- i = skill_db[skillid].itemid[i];
+ i = skill_db[skillid].itemid[i].val[skilllv-1];
item = itemdb_search(i);
potion_flag = 1;
potion_hp = 0;
@@ -13602,10 +13603,12 @@
continue;
break;
}
+ req.itemid[i] = skill_db[j].itemid[i].val[lv-1];
+ req.amount[i] = skill_db[j].amount[i].val[lv-1];
+ //req.amount[i] = skill_get_itemqty(j,i,lv);
- req.itemid[i] = skill_db[j].itemid[i];
- req.amount[i] = skill_db[j].amount[i];
-
if( itemid_isgemstone(req.itemid[i]) && skill != HW_GANBANTEIN )
{
if( sd->special_state.no_gemstone || sd->state.no_gemstone )
@@ -13630,8 +13633,8 @@
if( skill == NC_SHAPESHIFT || skill == GN_FIRE_EXPANSION || skill == SO_SUMMON_AGNI ||
skill == SO_SUMMON_AQUA || skill == SO_SUMMON_VENTUS || skill == SO_SUMMON_TERA || skill == NC_REPAIR )
{
- req.itemid[lv-1] = skill_db[j].itemid[lv-1];
- req.amount[lv-1] = skill_db[j].amount[lv-1];
+ req.itemid[lv-1] = skill_db[j].itemid[lv-1].val[lv-1];
+ req.amount[lv-1] = skill_db[j].amount[lv-1].val[lv-1];
}
// Check for cost reductions due to skills & SCs
@@ -13720,14 +13723,12 @@
if(sc && (sc->data[SC_HEATER_OPTION] || sc->data[SC_COOLER_OPTION] || sc->data[SC_BLAST_OPTION] || sc->data[SC_CURSED_SOIL_OPTION]))
req.sp += req.sp / 2;
break;
- default:
- if(sc && sc->data[SC_EDP])
- switch(skill){
- case AS_SONICBLOW:
- case GC_COUNTERSLASH:
- case GC_CROSSIMPACT:
- req.sp += req.sp;
- }
+ case AS_SONICBLOW:
+ case GC_COUNTERSLASH:
+ case GC_CROSSIMPACT:
+ if(sc && sc->data[SC_EDP])
+ req.sp += req.sp;
+ break;
}
return req;
@@ -17676,8 +17677,10 @@
skill_split_atoi(split[11],skill_db[i].spiritball);
for( j = 0; j < MAX_SKILL_ITEM_REQUIRE; j++ ) {
- skill_db[i].itemid[j] = atoi(split[12+ 2*j]);
- skill_db[i].amount[j] = atoi(split[13+ 2*j]);
+ //skill_db[i].itemid[j] = atoi(split[12+ 2*j]);
+ //skill_db[i].amount[j] = atoi(split[13+ 2*j]);
+ skill_split_atoi(split[12+2*j],skill_db[i].itemid[j].val);
+ skill_split_atoi(split[13+2*j],skill_db[i].amount[j].val);
}
return true;
Index: trunk/src/map/skill.h
===================================================================
--- trunk/src/map/skill.h (revision 220)
+++ trunk/src/map/skill.h (revision 221)
@@ -102,7 +102,9 @@
int blewcount[MAX_SKILL_LEVEL];
int hp[MAX_SKILL_LEVEL],sp[MAX_SKILL_LEVEL],mhp[MAX_SKILL_LEVEL],hp_rate[MAX_SKILL_LEVEL],sp_rate[MAX_SKILL_LEVEL],zeny[MAX_SKILL_LEVEL];
int weapon,ammo,ammo_qty[MAX_SKILL_LEVEL],state,eqid[MAX_SKILL_LEVEL],pakror,spiritball[MAX_SKILL_LEVEL];
- int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE];
+ struct {
+ int val[MAX_SKILL_LEVEL];
+ } amount[MAX_SKILL_ITEM_REQUIRE], itemid[MAX_SKILL_ITEM_REQUIRE];
int castnodex[MAX_SKILL_LEVEL], delaynodex[MAX_SKILL_LEVEL];
int nocast;
int dmgpvp, dmgmob, dmgmvp;