diff options
author | Paradox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-10-11 06:17:49 +0000 |
---|---|---|
committer | Paradox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-10-11 06:17:49 +0000 |
commit | a0d5cefbeed3b697692ce31d008533a8a69da4b1 (patch) | |
tree | 18233cc106236397404bfd01c0258abff8cad8dc /src/map/pc.c | |
parent | 6ce604ea27be125d26422dfe3690608e3f1fa8d7 (diff) | |
download | hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.tar.gz hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.tar.bz2 hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.tar.xz hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.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/trunk@14426 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 11 |
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; |