summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-30 13:53:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-30 13:53:13 +0000
commit15976eb40c2689d53d537ab425447eca572d9e7e (patch)
treefbabf9d6f2e9b87485babe28c19567d9e097d949 /src/map/pc.c
parent90cbdc408520d9902be4f67d29a3ebc7f8625c5b (diff)
downloadhercules-15976eb40c2689d53d537ab425447eca572d9e7e.tar.gz
hercules-15976eb40c2689d53d537ab425447eca572d9e7e.tar.bz2
hercules-15976eb40c2689d53d537ab425447eca572d9e7e.tar.xz
hercules-15976eb40c2689d53d537ab425447eca572d9e7e.zip
- Moved item group enumeration from itemdb.h to map.h
- Cleanup in itemheal related code, fixed the item heal group bonus not working on Groups beyond 7. - Fixed pet's loot not being moved to your inventory on logout. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7419 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 4f153252e..606d85f88 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2131,8 +2131,12 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
sd->subrace2[type2]+=val;
break;
case SP_ADD_ITEM_HEAL_RATE:
- if(sd->state.lr_flag != 2)
- sd->itemhealrate[type2 - 1] += val;
+ if(sd->state.lr_flag == 2)
+ break;
+ if (type2 < MAX_ITEMGROUP)
+ sd->itemhealrate[type2] += val;
+ else
+ ShowWarning("pc_bonus2: AddItemHealRate: Group %d is beyond limit (%d).\n", type2, MAX_ITEMGROUP);
break;
case SP_EXP_ADDRACE:
if(sd->state.lr_flag != 2)
@@ -5225,20 +5229,18 @@ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int ty
* HP/SP‰ñ•œ
*------------------------------------------
*/
-int pc_itemheal(struct map_session_data *sd,int hp,int sp)
+int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
{
int bonus, type;
- nullpo_retr(0, sd);
-
if(hp) {
bonus = 100 + (sd->battle_status.vit<<1)
+ pc_checkskill(sd,SM_RECOVERY)*10
+ pc_checkskill(sd,AM_LEARNINGPOTION)*5;
// A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG]
bonus += (potion_flag==2)?50:(potion_flag==3?100:0);
- if ((type = itemdb_group(sd->itemid)) > 0 && type <= 7)
- bonus = bonus * (100+sd->itemhealrate[type - 1]) / 100;
+ if ((type = itemdb_group(itemid)) > 0 && type < MAX_ITEMGROUP && sd->itemhealrate[type])
+ bonus += bonus * sd->itemhealrate[type] / 100;
if(bonus!=100)
hp = hp * bonus / 100;
}