summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 03:43:37 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 03:43:37 +0000
commit13126fd8573dbca5096014f4d007d0469ec24e28 (patch)
treef15d3672c5c52dedb9b2718994c536bf21be2327 /src/map/skill.c
parent44e93bbade25a71f087b89dc49c9f470c5c0d736 (diff)
downloadhercules-13126fd8573dbca5096014f4d007d0469ec24e28.tar.gz
hercules-13126fd8573dbca5096014f4d007d0469ec24e28.tar.bz2
hercules-13126fd8573dbca5096014f4d007d0469ec24e28.tar.xz
hercules-13126fd8573dbca5096014f4d007d0469ec24e28.zip
Fixed bugreport:5486, now a more friendly message is displayed upon skill fail when you do not have enough of the required ammo.
Dev Note: I wasn't able to find a proper reply packet so I came up with this .-. if you know a official solution make yourself comfortable to replace. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15752 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 1bae14129..24bdd9ee1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11755,12 +11755,17 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor
}
if( require.ammo ) { //Skill requires stuff equipped in the arrow slot.
- if((i=sd->equip_index[EQI_AMMO]) < 0 ||
- !sd->inventory_data[i] ||
- sd->status.inventory[i].amount < require.ammo_qty
- ) {
+ if((i=sd->equip_index[EQI_AMMO]) < 0 || !sd->inventory_data[i] ) {
clif_arrow_fail(sd,0);
return 0;
+ } else if( sd->status.inventory[i].amount < require.ammo_qty ) {
+ char e_msg[100];
+ sprintf(e_msg,"Skill Failed. [%s] requires %dx %s.",
+ skill_get_desc(skill),
+ require.ammo_qty,
+ itemdb_jname(sd->status.inventory[i].nameid));
+ clif_colormes(sd,COLOR_RED,e_msg);
+ return 0;
}
if (!(require.ammo&1<<sd->inventory_data[i]->look))
{ //Ammo type check. Send the "wrong weapon type" message