summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-05 21:07:42 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-05 21:07:42 +0000
commit31b7d59052233baa1f6539a2c2d59508071bd418 (patch)
tree9012d4130bcf239eca19a073e9645a5cae5cfd43 /src/map/skill.c
parent370bf9f32ed937420323611ca44580f127c40252 (diff)
downloadhercules-31b7d59052233baa1f6539a2c2d59508071bd418.tar.gz
hercules-31b7d59052233baa1f6539a2c2d59508071bd418.tar.bz2
hercules-31b7d59052233baa1f6539a2c2d59508071bd418.tar.xz
hercules-31b7d59052233baa1f6539a2c2d59508071bd418.zip
- Modified the ammo checks so that ammo is consumed at the end of battle_calc_weapon_attack (should fix element being lost on final arrow).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5914 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index c4d41781f..a4fd1f7bc 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7524,6 +7524,20 @@ static int skill_check_condition_hermod_sub(struct block_list *bl,va_list ap)
}
/*==========================================
+ * Determines if a given skill should be made to consume ammo
+ * when used by the player. [Skotlex]
+ *------------------------------------------
+ */
+int skill_isammotype(TBL_PC *sd, int skill)
+{
+ return (
+ (sd->status.weapon == W_BOW || (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) &&
+ skill != HT_PHANTASMIC && skill != GS_MAGICALBULLET &&
+ skill_get_type(skill) == BF_WEAPON && !(skill_get_nk(skill)&NK_NO_DAMAGE)
+ )
+}
+
+/*==========================================
* ƒXƒLƒ‹Žg—p?Œ??i?‚ÅŽg—pŽ¸”s?j
*------------------------------------------
*/
@@ -7635,10 +7649,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ
else
sp += (sd->status.max_sp * abs(sp_rate))/100;
- if (!ammo && sd->status.weapon == W_BOW && skill &&
- skill != HT_PHANTASMIC && skill != GS_MAGICALBULLET &&
- skill_get_type(skill) == BF_WEAPON && !(skill_get_nk(skill)&NK_NO_DAMAGE)
- )
+ if (!ammo && skill && skill_isammotype(sd, skill))
{ //Assume this skill is using the weapon, therefore it requires arrows.
ammo = 2; //1<<1 <- look 1 (arrows) moved right 1 times.
ammo_qty = skill_get_num(skill, lv);
@@ -8213,8 +8224,9 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ
if(index[i] >= 0)
pc_delitem(sd,index[i],amount[i],0); // ƒAƒCƒeƒ€?Á”ï
}
- if (ammo && battle_config.arrow_decrement)
- pc_delitem(sd,sd->equip_index[10],ammo_qty,0);
+// Ammo is now reduced in battle_calc_weapon_attack. [Skotlex]
+// if (ammo && battle_config.arrow_decrement)
+// pc_delitem(sd,sd->equip_index[10],ammo_qty,0);
}
if(type&2)