summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-11 06:17:49 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-11 06:17:49 +0000
commit31ac1ba472e692330136f02bcae3a19ef86f5749 (patch)
treefc9a58ffe4146f83c37ed3a03263c78a7d1931f4 /src/map/pc.c
parent8938559e752595bf98d353c9901a0120cf945654 (diff)
downloadhercules-31ac1ba472e692330136f02bcae3a19ef86f5749.tar.gz
hercules-31ac1ba472e692330136f02bcae3a19ef86f5749.tar.bz2
hercules-31ac1ba472e692330136f02bcae3a19ef86f5749.tar.xz
hercules-31ac1ba472e692330136f02bcae3a19ef86f5749.zip
Implemented official cash food behavior, including use delay, not being dispelled (including on death), distinct status effects and icons from the ordinary food types.
Updated items accordingly. (bugreport:2560) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14426 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 808d47792..72fc4da90 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -851,6 +851,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->pvp_timer = INVALID_TIMER;
sd->canuseitem_tick = tick;
+ sd->canusecashfood_tick = tick;
sd->canequip_tick = tick;
sd->cantalk_tick = tick;
sd->cansendmail_tick = tick;
@@ -3666,7 +3667,9 @@ int pc_useitem(struct map_session_data *sd,int n)
return 0;
//Prevent mass item usage. [Skotlex]
- if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 )
+ if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 ||
+ (itemdb_iscashfood(sd->status.inventory[n].nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0)
+ )
return 0;
if( sd->sc.count && (
@@ -3718,7 +3721,11 @@ int pc_useitem(struct map_session_data *sd,int n)
potion_flag = 3; //Even more effective potions.
}
- sd->canuseitem_tick= tick + battle_config.item_use_interval; //Update item use time.
+ //Update item use time.
+ sd->canuseitem_tick = tick + battle_config.item_use_interval;
+ if( itemdb_iscashfood(sd->status.inventory[n].nameid) )
+ sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval;
+
run_script(script,0,sd->bl.id,fake_nd->bl.id);
potion_flag = 0;
return 1;