* skill_check_condition clean up (bugreport:2770, bugreport:2957, bugreport:3010)

- Weapon, SP, HP and state are checked at the beginning of cast.
- Required items and ammos are checked at the end of cast.
- SP and status change required are removed at the end of cast without checking again.
- Required items are removed only if the skill is successfully used.
- Autocasts won't check for requirements but will remove them if you have them(except for SP/HP).

Hope won't cause any problems...

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13815 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Inkfish 2009-05-27 14:11:08 +00:00
parent fa42a3349e
commit b14a11ff5e
4 changed files with 440 additions and 338 deletions

View File

@ -3,6 +3,13 @@ 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/26
* skill_check_condition clean up (bugreport:2770, bugreport:2957, bugreport:3010) [Inkfish]
- Weapon, SP, HP and state are checked at the beginning of cast.
- Required items and ammos are checked at the end of cast.
- SP and status change required are removed at the end of cast without checking again.
- Required items are removed only if the skill is successfully used.
- Autocasts won't check for requirements but will remove them if you have them(except for SP/HP).
09/05/25 09/05/25
* Fixed losing skill list after base change. (bugreport:3106) [Inkfish] * Fixed losing skill list after base change. (bugreport:3106) [Inkfish]
* Now we can use 'boss_monster' to summon whatever monsters that need to be radared by Convex Mirror. (bugreport:2653) [Inkfish] * Now we can use 'boss_monster' to summon whatever monsters that need to be radared by Convex Mirror. (bugreport:2653) [Inkfish]

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,12 @@ struct status_change_entry;
#define SD_SPLASH 0x4000 // skill_area_sub will count targets in skill_area_temp[2] #define SD_SPLASH 0x4000 // skill_area_sub will count targets in skill_area_temp[2]
#define SD_PREAMBLE 0x8000 // skill_area_sub will transmit a 'magic' damage packet (-30000 dmg) for the first target selected #define SD_PREAMBLE 0x8000 // skill_area_sub will transmit a 'magic' damage packet (-30000 dmg) for the first target selected
#define MAX_SKILL_ITEM_REQUIRE 10
struct skill_condition {
int weapon,ammo,ammo_qty,hp,sp,zeny,spiritball,mhp,state;
int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE];
};
// ƒXƒLƒƒf?ƒ^ƒx?ƒX // ƒXƒLƒƒf?ƒ^ƒx?ƒX
struct s_skill_db { struct s_skill_db {
char name[NAME_LENGTH]; char name[NAME_LENGTH];
@ -81,7 +87,7 @@ struct s_skill_db {
int blewcount[MAX_SKILL_LEVEL]; 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 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,spiritball[MAX_SKILL_LEVEL]; int weapon,ammo,ammo_qty[MAX_SKILL_LEVEL],state,spiritball[MAX_SKILL_LEVEL];
int itemid[10],amount[10]; int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE];
int castnodex[MAX_SKILL_LEVEL], delaynodex[MAX_SKILL_LEVEL]; int castnodex[MAX_SKILL_LEVEL], delaynodex[MAX_SKILL_LEVEL];
int nocast; int nocast;
int unit_id[2]; int unit_id[2];
@ -281,7 +287,13 @@ int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,int damage
int skill_castfix( struct block_list *bl, int skill_id, int skill_lv); int skill_castfix( struct block_list *bl, int skill_id, int skill_lv);
int skill_castfix_sc( struct block_list *bl, int time); int skill_castfix_sc( struct block_list *bl, int time);
int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv); int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv);
int skill_check_condition( struct map_session_data *sd, short skill, short lv, int type);
// Skill conditions check and remove [Inkfish]
int skill_check_condition_castbegin(struct map_session_data *sd, short skill, short lv);
int skill_check_condition_castend(struct map_session_data *sd, short skill, short lv);
int skill_consume_requirement(struct map_session_data *sd, short skill, short lv, short type);
struct skill_condition skill_get_requirement(struct map_session_data *sd, short skill, short lv);
int skill_check_pc_partner(struct map_session_data *sd, short skill_id, short* skill_lv, int range, int cast_flag); int skill_check_pc_partner(struct map_session_data *sd, short skill_id, short* skill_lv, int range, int cast_flag);
// -- moonsoul (added skill_check_unit_cell) // -- moonsoul (added skill_check_unit_cell)
int skill_check_unit_cell(int skillid,int m,int x,int y,int unit_id); int skill_check_unit_cell(int skillid,int m,int x,int y,int unit_id);

View File

@ -948,7 +948,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
} }
break; break;
} }
if (!skill_check_condition(sd, skill_num, skill_lv, 0)) if (!skill_check_condition_castbegin(sd, skill_num, skill_lv))
return 0; return 0;
} }
//TODO: Add type-independant skill_check_condition function. //TODO: Add type-independant skill_check_condition function.
@ -1145,7 +1145,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh
if( sd ) if( sd )
{ {
if( skillnotok(skill_num, sd) || !skill_check_condition(sd, skill_num, skill_lv,0) ) if( skillnotok(skill_num, sd) || !skill_check_condition_castbegin(sd, skill_num, skill_lv) )
return 0; return 0;
} }