From 13126fd8573dbca5096014f4d007d0469ec24e28 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 22 Mar 2012 03:43:37 +0000 Subject: 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 --- src/map/skill.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/map/skill.c') 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<inventory_data[i]->look)) { //Ammo type check. Send the "wrong weapon type" message -- cgit v1.2.3-70-g09d2