* Some more fixes to skill condition issues.

- Fixed skills fail when MAX_INVENTORY reached. (bugreport:3139)
- Fixed spiritballs not being removed correctly in some situation.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13818 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Inkfish 2009-05-29 02:25:38 +00:00
parent a4c36c7af8
commit 586fdbcfdf
2 changed files with 49 additions and 23 deletions

View File

@ -3,10 +3,14 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
09/05/29
* Some more fixes to skill condition issues. [Inkfish]
- Fixed skills fail when MAX_INVENTORY reached.
- Fixed spiritballs not being removed correctly in some situation.
09/05/28 09/05/28
* Fixed some skill condition issues. [Inkfish] * Fixed some skill condition issues. [Inkfish]
- HP is now checked at the end of cast. - HP is now checked at the end of cast.
- Lv 6-10 StoneCurse doesn't consume gems. - Lv 6-10 StoneCurse doesn't consume gems when it fails.
- Tarotcard's aftercast delay will still be applied if it fails. - Tarotcard's aftercast delay will still be applied if it fails.
09/05/26 09/05/26
* skill_check_condition clean up (bugreport:2770, bugreport:2957, bugreport:3010) [Inkfish] * skill_check_condition clean up (bugreport:2770, bugreport:2957, bugreport:3010) [Inkfish]

View File

@ -8159,17 +8159,12 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
return 0; return 0;
} }
break; break;
case MO_FINGEROFFENSIVE: //指弾 case MO_FINGEROFFENSIVE:
case GS_FLING: case GS_FLING:
if (sd->spiritball > 0 && sd->spiritball < require.spiritball) { if( sd->spiritball > 0 && sd->spiritball < require.spiritball )
require.spiritball = sd->spiritball; sd->spiritball_old = require.spiritball = sd->spiritball;
sd->spiritball_old = sd->spiritball; else
} sd->spiritball_old = require.spiritball;
else sd->spiritball_old = require.spiritball;
break;
case MO_BODYRELOCATION:
if (sc && sc->data[SC_EXPLOSIONSPIRITS])
require.spiritball = 0;
break; break;
case MO_CHAINCOMBO: case MO_CHAINCOMBO:
if(!sc) if(!sc)
@ -8196,23 +8191,20 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
case MO_EXTREMITYFIST: case MO_EXTREMITYFIST:
// if(sc && sc->data[SC_EXTREMITYFIST]) //To disable Asura during the 5 min skill block uncomment this... // if(sc && sc->data[SC_EXTREMITYFIST]) //To disable Asura during the 5 min skill block uncomment this...
// return 0; // return 0;
if(sc && sc->data[SC_BLADESTOP]) if( sc && sc->data[SC_BLADESTOP] )
require.spiritball--; break;
else if (sc && sc->data[SC_COMBO]) { if( sc && sc->data[SC_COMBO] )
{
switch(sc->data[SC_COMBO]->val1) { switch(sc->data[SC_COMBO]->val1) {
case MO_COMBOFINISH: case MO_COMBOFINISH:
require.spiritball = 4;
break;
case CH_TIGERFIST: case CH_TIGERFIST:
require.spiritball = 3; case CH_CHAINCRUSH:
break;
case CH_CHAINCRUSH: //It should consume whatever is left as long as it's at least 1.
require.spiritball = sd->spiritball?sd->spiritball:1;
break; break;
default: default:
return 0; return 0;
} }
} else if(!unit_can_move(&sd->bl)) //Check only on begin casting. }
if( !unit_can_move(&sd->bl) )
{ //Placed here as ST_MOVE_ENABLE should not apply if rooted or on a combo. [Skotlex] { //Placed here as ST_MOVE_ENABLE should not apply if rooted or on a combo. [Skotlex]
clif_skill_fail(sd,skill,0,0); clif_skill_fail(sd,skill,0,0);
return 0; return 0;
@ -8370,7 +8362,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
break; break;
//Auron insists we should implement SP consumption when you are not Soul Linked. [Skotlex] //Auron insists we should implement SP consumption when you are not Soul Linked. [Skotlex]
//Only invoke on skill begin cast (instant cast skill). [Kevin] //Only invoke on skill begin cast (instant cast skill). [Kevin]
if(require.sp>0) if( require.sp > 0 )
{ {
if (status->sp < (unsigned int)require.sp) if (status->sp < (unsigned int)require.sp)
clif_skill_fail(sd,skill,1,0); clif_skill_fail(sd,skill,1,0);
@ -8660,6 +8652,8 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor
for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; ++i ) for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; ++i )
{ {
if( !require.itemid[i] )
continue;
index[i] = pc_search_inventory(sd,require.itemid[i]); index[i] = pc_search_inventory(sd,require.itemid[i]);
if( index[i] < 0 || sd->status.inventory[index[i]].amount < require.amount[i] ) { if( index[i] < 0 || sd->status.inventory[index[i]].amount < require.amount[i] ) {
if( require.itemid[i] == ITEMID_RED_GEMSTONE ) if( require.itemid[i] == ITEMID_RED_GEMSTONE )
@ -8716,6 +8710,9 @@ int skill_consume_requirement( struct map_session_data *sd, short skill, short l
for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; ++i ) for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; ++i )
{ {
if( !req.itemid[i] )
continue;
if( itemid_isgemstone(req.itemid[i]) && skill != HW_GANBANTEIN && sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_WIZARD ) if( itemid_isgemstone(req.itemid[i]) && skill != HW_GANBANTEIN && sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_WIZARD )
continue; //Gemstones are checked, but not substracted from inventory. continue; //Gemstones are checked, but not substracted from inventory.
@ -8856,7 +8853,32 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, short
if(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_MONK) if(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_MONK)
req.sp -= req.sp*25/100; //FIXME: Need real data. this is a custom value. req.sp -= req.sp*25/100; //FIXME: Need real data. this is a custom value.
break; break;
case MO_BODYRELOCATION:
if( sc && sc->data[SC_EXPLOSIONSPIRITS] )
req.spiritball = 0;
break;
case MO_EXTREMITYFIST:
if( sc )
{
if( sc->data[SC_BLADESTOP] )
req.spiritball--;
else if( sc->data[SC_COMBO] )
{
switch( sc->data[SC_COMBO]->val1 )
{
case MO_COMBOFINISH:
req.spiritball = 4;
break;
case CH_TIGERFIST:
req.spiritball = 3;
break;
case CH_CHAINCRUSH: //It should consume whatever is left as long as it's at least 1.
req.spiritball = sd->spiritball?sd->spiritball:1;
break;
}
}
}
break;
} }
return req; return req;