- 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://svn.code.sf.net/p/rathena/svn/trunk@7419 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-06-30 13:53:13 +00:00
parent f9975e2c78
commit 1b7a54c893
7 changed files with 61 additions and 50 deletions

View File

@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/30
* Cleanup in itemheal related code, fixed the item heal group bonus not
working on Groups beyond 7. [Skotlex]
* Fixed pet's loot not being moved to your inventory on logout. [Skotlex]
2006/05/29 2006/05/29
* Made the map server send list of characters online to the char-server on * Made the map server send list of characters online to the char-server on
reconnection regardless of "kick_on_disconnect" setting, as otherwise, a reconnection regardless of "kick_on_disconnect" setting, as otherwise, a

View File

@ -59,45 +59,6 @@ struct item_group {
int id[30]; // 120 bytes int id[30]; // 120 bytes
}; };
enum {
IG_BLUEBOX=1,
IG_VIOLETBOX, //2
IG_CARDALBUM, //3
IG_GIFTBOX, //4
IG_SCROLLBOX, //5
IG_FINDINGORE, //6
IG_COOKIEBAG, //7
IG_POTION, //8
IG_HERBS, //9
IG_FRUITS, //10
IG_MEAT, //11
IG_CANDY, //12
IG_JUICE, //13
IG_FISH, //14
IG_BOXES, //15
IG_GEMSTONE, //16
IG_JELLOPY, //17
IG_ORE, //18
IG_FOOD, //19
IG_RECOVERY, //20
IG_MINERALS, //21
IG_TAMING, //22
IG_SCROLLS, //23
IG_QUIVERS, //24
IG_MASKS, //25
IG_ACCESORY, //26
IG_JEWELS, //27
IG_GIFTBOX_1, //28
IG_GIFTBOX_2, //29
IG_GIFTBOX_3, //30
IG_GIFTBOX_4, //31
IG_EGGBOY, //32
IG_EGGGIRL, //33
IG_GIFTBOXCHINA, //34
IG_LOTTOBOX, //35
MAX_ITEMGROUP,
} item_group_list;
struct item_data* itemdb_searchname(const char *name); struct item_data* itemdb_searchname(const char *name);
int itemdb_searchname_array(struct item_data** data, int size, const char *str); int itemdb_searchname_array(struct item_data** data, int size, const char *str);
struct item_data* itemdb_load(int nameid); struct item_data* itemdb_load(int nameid);

View File

@ -216,6 +216,46 @@ enum {
ELE_MAX ELE_MAX
}; };
enum {
IG_BLUEBOX=1,
IG_VIOLETBOX, //2
IG_CARDALBUM, //3
IG_GIFTBOX, //4
IG_SCROLLBOX, //5
IG_FINDINGORE, //6
IG_COOKIEBAG, //7
IG_POTION, //8
IG_HERBS, //9
IG_FRUITS, //10
IG_MEAT, //11
IG_CANDY, //12
IG_JUICE, //13
IG_FISH, //14
IG_BOXES, //15
IG_GEMSTONE, //16
IG_JELLOPY, //17
IG_ORE, //18
IG_FOOD, //19
IG_RECOVERY, //20
IG_MINERALS, //21
IG_TAMING, //22
IG_SCROLLS, //23
IG_QUIVERS, //24
IG_MASKS, //25
IG_ACCESORY, //26
IG_JEWELS, //27
IG_GIFTBOX_1, //28
IG_GIFTBOX_2, //29
IG_GIFTBOX_3, //30
IG_GIFTBOX_4, //31
IG_EGGBOY, //32
IG_EGGGIRL, //33
IG_GIFTBOXCHINA, //34
IG_LOTTOBOX, //35
MAX_ITEMGROUP,
} item_group_list;
struct block_list { struct block_list {
struct block_list *next,*prev; struct block_list *next,*prev;
int id; int id;
@ -587,7 +627,7 @@ struct map_session_data {
int magic_addsize[3]; int magic_addsize[3];
int critaddrace[RC_MAX]; int critaddrace[RC_MAX];
int expaddrace[RC_MAX]; int expaddrace[RC_MAX];
int itemhealrate[7]; int itemhealrate[MAX_ITEMGROUP];
int addeff3[SC_COMMON_MAX-SC_COMMON_MIN+1]; int addeff3[SC_COMMON_MAX-SC_COMMON_MIN+1];
short addeff3_type[SC_COMMON_MAX-SC_COMMON_MIN+1]; short addeff3_type[SC_COMMON_MAX-SC_COMMON_MIN+1];
short sp_gain_race[RC_MAX]; short sp_gain_race[RC_MAX];

View File

@ -2131,8 +2131,12 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
sd->subrace2[type2]+=val; sd->subrace2[type2]+=val;
break; break;
case SP_ADD_ITEM_HEAL_RATE: case SP_ADD_ITEM_HEAL_RATE:
if(sd->state.lr_flag != 2) if(sd->state.lr_flag == 2)
sd->itemhealrate[type2 - 1] += val; 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; break;
case SP_EXP_ADDRACE: case SP_EXP_ADDRACE:
if(sd->state.lr_flag != 2) 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ñœ * 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; int bonus, type;
nullpo_retr(0, sd);
if(hp) { if(hp) {
bonus = 100 + (sd->battle_status.vit<<1) bonus = 100 + (sd->battle_status.vit<<1)
+ pc_checkskill(sd,SM_RECOVERY)*10 + pc_checkskill(sd,SM_RECOVERY)*10
+ pc_checkskill(sd,AM_LEARNINGPOTION)*5; + pc_checkskill(sd,AM_LEARNINGPOTION)*5;
// A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG] // 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); bonus += (potion_flag==2)?50:(potion_flag==3?100:0);
if ((type = itemdb_group(sd->itemid)) > 0 && type <= 7) if ((type = itemdb_group(itemid)) > 0 && type < MAX_ITEMGROUP && sd->itemhealrate[type])
bonus = bonus * (100+sd->itemhealrate[type - 1]) / 100; bonus += bonus * sd->itemhealrate[type] / 100;
if(bonus!=100) if(bonus!=100)
hp = hp * bonus / 100; hp = hp * bonus / 100;
} }

View File

@ -156,7 +156,7 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
int pc_dead(struct map_session_data *sd,struct block_list *src); int pc_dead(struct map_session_data *sd,struct block_list *src);
void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp); void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp);
void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int type); void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int type);
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 pc_percentheal(struct map_session_data *sd,int,int); int pc_percentheal(struct map_session_data *sd,int,int);
int pc_jobchange(struct map_session_data *,int, int); int pc_jobchange(struct map_session_data *,int, int);
int pc_setoption(struct map_session_data *,int); int pc_setoption(struct map_session_data *,int);

View File

@ -3343,6 +3343,7 @@ int buildin_heal(struct script_state *st)
*/ */
int buildin_itemheal(struct script_state *st) int buildin_itemheal(struct script_state *st)
{ {
struct map_session_data *sd;
int hp,sp; int hp,sp;
hp=conv_num(st,& (st->stack->stack_data[st->start+2])); hp=conv_num(st,& (st->stack->stack_data[st->start+2]));
@ -3353,8 +3354,10 @@ int buildin_itemheal(struct script_state *st)
potion_sp = sp; potion_sp = sp;
return 0; return 0;
} }
pc_itemheal(script_rid2sd(st),hp,sp); sd = script_rid2sd(st);
if (!sd) return 0;
pc_itemheal(sd,sd->itemid,hp,sp);
return 0; return 0;
} }
/*========================================== /*==========================================

View File

@ -1658,6 +1658,7 @@ int unit_free(struct block_list *bl) {
} }
if (pd->loot) if (pd->loot)
{ {
pet_lootitem_drop(pd,sd);
if (pd->loot->item) if (pd->loot->item)
aFree(pd->loot->item); aFree(pd->loot->item);
aFree (pd->loot); aFree (pd->loot);