Fixed skills used through items and Hocus-pocus consume requirements if you have them. (bugreport:3164)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13836 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
35785a3e20
commit
cf43afb4c9
@ -3,6 +3,8 @@ 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/06/02
|
||||||
|
* Fixed skills used through items and Hocus-pocus consume requirements if you have them. (bugreport:3164) [Inkfish]
|
||||||
09/06/01
|
09/06/01
|
||||||
* Fixed Fiberlock sometimes fails due to the long interval of skill_unit_timer. It may never fail now, though this may not be official. (bugreport:3136) [Inkfish]
|
* Fixed Fiberlock sometimes fails due to the long interval of skill_unit_timer. It may never fail now, though this may not be official. (bugreport:3136) [Inkfish]
|
||||||
09/05/30
|
09/05/30
|
||||||
|
100
src/map/skill.c
100
src/map/skill.c
@ -4363,14 +4363,20 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
clif_skill_nodamage(src,bl,skillid,skilllv,1);
|
clif_skill_nodamage(src,bl,skillid,skilllv,1);
|
||||||
if(skilllv == 1) {
|
|
||||||
// possibility to skip menu [LuzZza]
|
// FIXME: Before r13836, sd->skillitem was never equal to AL_TELEPORT!!
|
||||||
if(!battle_config.skip_teleport_lv1_menu && sd->skillitem != AL_TELEPORT)
|
// So, neither normal casted, nor item skill, nor autocasts would skip the menu! What was this intended to do?
|
||||||
|
// Now, I assume only autocasts teleport may always skip the menu. [Inkfish]
|
||||||
|
if( skilllv == 1 )
|
||||||
|
{
|
||||||
|
if( !battle_config.skip_teleport_lv1_menu && sd->skillitem == AL_TELEPORT ) // possibility to skip menu [LuzZza]
|
||||||
clif_skill_warppoint(sd,skillid,skilllv, (unsigned short)-1,0,0,0);
|
clif_skill_warppoint(sd,skillid,skilllv, (unsigned short)-1,0,0,0);
|
||||||
else
|
else
|
||||||
pc_randomwarp(sd,3);
|
pc_randomwarp(sd,3);
|
||||||
} else {
|
}
|
||||||
if (sd->skillitem != AL_TELEPORT)
|
else
|
||||||
|
{
|
||||||
|
if( sd->skillitem == AL_TELEPORT )
|
||||||
clif_skill_warppoint(sd,skillid,skilllv, (unsigned short)-1,sd->status.save_point.map,0,0);
|
clif_skill_warppoint(sd,skillid,skilllv, (unsigned short)-1,sd->status.save_point.map,0,0);
|
||||||
else //Autocasted Teleport level 2??
|
else //Autocasted Teleport level 2??
|
||||||
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
|
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
|
||||||
@ -5854,6 +5860,9 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr data)
|
|||||||
sc->data[SC_SPIRIT]->val3 = 0; //Clear bounced spell check.
|
sc->data[SC_SPIRIT]->val3 = 0; //Clear bounced spell check.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( sd && sd->skillitem == ud->skillid )
|
||||||
|
sd->skillitem = sd->skillitemlv = 0;
|
||||||
|
|
||||||
if (ud->skilltimer == -1) {
|
if (ud->skilltimer == -1) {
|
||||||
if(md) md->skillidx = -1;
|
if(md) md->skillidx = -1;
|
||||||
else ud->skillid = 0; //mobs can't clear this one as it is used for skill condition 'afterskill'
|
else ud->skillid = 0; //mobs can't clear this one as it is used for skill condition 'afterskill'
|
||||||
@ -5901,9 +5910,10 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr data)
|
|||||||
//You can't place a skill failed packet here because it would be
|
//You can't place a skill failed packet here because it would be
|
||||||
//sent in ALL cases, even cases where skill_check_condition fails
|
//sent in ALL cases, even cases where skill_check_condition fails
|
||||||
//which would lead to double 'skill failed' messages u.u [Skotlex]
|
//which would lead to double 'skill failed' messages u.u [Skotlex]
|
||||||
if(sd) sd->skillitem = sd->skillitemlv = 0;
|
if(sd)
|
||||||
else
|
sd->skillitem = sd->skillitemlv = 0;
|
||||||
if(md) md->skillidx = -1;
|
else if(md)
|
||||||
|
md->skillidx = -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6028,6 +6038,9 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr data)
|
|||||||
map_freeblock_lock();
|
map_freeblock_lock();
|
||||||
skill_castend_pos2(src,ud->skillx,ud->skilly,ud->skillid,ud->skilllv,tick,0);
|
skill_castend_pos2(src,ud->skillx,ud->skilly,ud->skillid,ud->skilllv,tick,0);
|
||||||
|
|
||||||
|
if( sd && sd->skillitem == ud->skillid )
|
||||||
|
sd->skillitem = sd->skillitemlv = 0;
|
||||||
|
|
||||||
if (ud->skilltimer == -1) {
|
if (ud->skilltimer == -1) {
|
||||||
if (md) md->skillidx = -1;
|
if (md) md->skillidx = -1;
|
||||||
else ud->skillid = 0; //Non mobs can't clear this one as it is used for skill condition 'afterskill'
|
else ud->skillid = 0; //Non mobs can't clear this one as it is used for skill condition 'afterskill'
|
||||||
@ -8056,37 +8069,30 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
|
|||||||
|
|
||||||
if (lv <= 0 || sd->chatID) return 0;
|
if (lv <= 0 || sd->chatID) return 0;
|
||||||
|
|
||||||
if( battle_config.gm_skilluncond &&
|
if( battle_config.gm_skilluncond && pc_isGM(sd)>= battle_config.gm_skilluncond && sd->skillitem != skill )
|
||||||
pc_isGM(sd)>= battle_config.gm_skilluncond &&
|
|
||||||
sd->skillitem != skill)
|
|
||||||
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
|
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
sd->state.arrow_atk = skill_get_ammotype(skill)?1:0; //Need to do arrow state check.
|
||||||
//Need to do arrow state check.
|
sd->spiritball_old = sd->spiritball; //Need to do Spiritball check.
|
||||||
sd->state.arrow_atk = skill_get_ammotype(skill)?1:0;
|
|
||||||
//Need to do Spiritball check.
|
|
||||||
sd->spiritball_old = sd->spiritball;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pc_is90overweight(sd)) {
|
if(pc_is90overweight(sd)) {
|
||||||
clif_skill_fail(sd,skill,9,0);
|
clif_skill_fail(sd,skill,9,0);
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sd->state.abra_flag )
|
if( sd->menuskill_id == AM_PHARMACY )
|
||||||
{
|
{
|
||||||
if( sd->skillitem == skill )
|
switch( skill )
|
||||||
return 1;
|
{
|
||||||
sd->skillitem = sd->skillitemlv = sd->state.abra_flag = 0; // Cancelled, using a different skill
|
case AM_PHARMACY:
|
||||||
}
|
case AC_MAKINGARROW:
|
||||||
|
case BS_REPAIRWEAPON:
|
||||||
if (sd->menuskill_id == AM_PHARMACY &&
|
case AM_TWILIGHT1:
|
||||||
(skill == AM_PHARMACY || skill == AC_MAKINGARROW || skill == BS_REPAIRWEAPON ||
|
case AM_TWILIGHT2:
|
||||||
skill == AM_TWILIGHT1 || skill == AM_TWILIGHT2 || skill == AM_TWILIGHT3
|
case AM_TWILIGHT3:
|
||||||
)) {
|
return 0;
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = &sd->battle_status;
|
status = &sd->battle_status;
|
||||||
@ -8094,10 +8100,13 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
|
|||||||
if( !sc->count )
|
if( !sc->count )
|
||||||
sc = NULL;
|
sc = NULL;
|
||||||
|
|
||||||
if(sd->skillitem == skill) {
|
if( sd->skillitem == skill )
|
||||||
// When a target was selected
|
{
|
||||||
{ //Consume items that were skipped in pc_use_item [Skotlex]
|
if( sd->state.abra_flag ) // Hocus-Pocus was used. [Inkfish]
|
||||||
if((i = sd->itemindex) == -1 ||
|
sd->state.abra_flag = 0;
|
||||||
|
else
|
||||||
|
{ // When a target was selected, consume items that were skipped in pc_use_item [Skotlex]
|
||||||
|
if( (i = sd->itemindex) == -1 ||
|
||||||
sd->status.inventory[i].nameid != sd->itemid ||
|
sd->status.inventory[i].nameid != sd->itemid ||
|
||||||
sd->inventory_data[i] == NULL ||
|
sd->inventory_data[i] == NULL ||
|
||||||
!sd->inventory_data[i]->flag.delay_consume ||
|
!sd->inventory_data[i]->flag.delay_consume ||
|
||||||
@ -8559,28 +8568,17 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor
|
|||||||
|
|
||||||
if( battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond && sd->skillitem != skill )
|
if( battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond && sd->skillitem != skill )
|
||||||
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
|
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
sd->state.arrow_atk = skill_get_ammotype(skill)?1:0; //Need to do arrow state check.
|
||||||
//Need to do arrow state check.
|
sd->spiritball_old = sd->spiritball; //Need to do Spiritball check.
|
||||||
sd->state.arrow_atk = skill_get_ammotype(skill)?1:0;
|
|
||||||
//Need to do Spiritball check.
|
|
||||||
sd->spiritball_old = sd->spiritball;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pc_is90overweight(sd) )
|
if( pc_is90overweight(sd) )
|
||||||
{
|
{
|
||||||
clif_skill_fail(sd,skill,9,0);
|
clif_skill_fail(sd,skill,9,0);
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sd->state.abra_flag )
|
|
||||||
{ // Abracadabra skill, skip requisites!
|
|
||||||
sd->skillitem = sd->skillitemlv = sd->state.abra_flag = 0; // Clear out the data.
|
|
||||||
if( sd->skillitem == skill )
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( sd->menuskill_id == AM_PHARMACY )
|
if( sd->menuskill_id == AM_PHARMACY )
|
||||||
{ // Cast start or cast end??
|
{ // Cast start or cast end??
|
||||||
switch( skill )
|
switch( skill )
|
||||||
@ -8591,16 +8589,12 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor
|
|||||||
case AM_TWILIGHT1:
|
case AM_TWILIGHT1:
|
||||||
case AM_TWILIGHT2:
|
case AM_TWILIGHT2:
|
||||||
case AM_TWILIGHT3:
|
case AM_TWILIGHT3:
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sd->skillitem == skill )
|
if( sd->skillitem == skill ) // Casting finished (Item skill or Hocus-Pocus)
|
||||||
{ // Casting finished
|
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
// perform skill-specific checks (and actions)
|
// perform skill-specific checks (and actions)
|
||||||
switch( skill )
|
switch( skill )
|
||||||
@ -8740,6 +8734,10 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, short
|
|||||||
|
|
||||||
if( !sd )
|
if( !sd )
|
||||||
return req;
|
return req;
|
||||||
|
|
||||||
|
if( sd->skillitem == skill )
|
||||||
|
return req; // Item skills and Hocus-Pocus don't have requirements.[Inkfish]
|
||||||
|
|
||||||
j = skill_get_index(skill);
|
j = skill_get_index(skill);
|
||||||
if( j == 0 ) // invalid skill id
|
if( j == 0 ) // invalid skill id
|
||||||
return req;
|
return req;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user