- Reverted the previous change, changed the pet capture code to try to capture a mob based on their view class rather than actual class.

- Changed various instances of md->db->lv for md->level, since the later is the actual mob level.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8471 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-08-24 15:25:50 +00:00
parent ac3aeb0574
commit 383129375f
5 changed files with 12 additions and 14 deletions

View File

@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
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/08/24 2006/08/24
* Reverted the previous change, changed the pet capture code to try to
capture a mob based on their view class rather than actual class.
[Skotlex]
* Fixed the md->class_ variable not being updated when a mob's class is * Fixed the md->class_ variable not being updated when a mob's class is
changed. [Skotlex] changed. [Skotlex]
* Added setting clear_skills_on_warp to specify when a character's * Added setting clear_skills_on_warp to specify when a character's

View File

@ -1954,7 +1954,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
drop_rate += (int)(0.5+drop_rate*status_get_luk(src)*battle_config.drops_by_luk2/10000.); drop_rate += (int)(0.5+drop_rate*status_get_luk(src)*battle_config.drops_by_luk2/10000.);
} }
if (sd && battle_config.pk_mode && if (sd && battle_config.pk_mode &&
(int)(md->db->lv - sd->status.base_level) >= 20) (int)(md->level - sd->status.base_level) >= 20)
drop_rate = (int)(drop_rate*1.25); // pk_mode increase drops if 20 level difference [Valaris] drop_rate = (int)(drop_rate*1.25); // pk_mode increase drops if 20 level difference [Valaris]
// if (10000 < rand()%10000+drop_rate) //May be better if MAX_RAND is too low? // if (10000 < rand()%10000+drop_rate) //May be better if MAX_RAND is too low?
@ -2014,7 +2014,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
} }
if(sd->get_zeny_num && rand()%100 < sd->get_zeny_rate) //Gets get_zeny_num per level +/-10% [Skotlex] if(sd->get_zeny_num && rand()%100 < sd->get_zeny_rate) //Gets get_zeny_num per level +/-10% [Skotlex]
pc_getzeny(sd,md->db->lv*sd->get_zeny_num*(90+rand()%21)/100); pc_getzeny(sd,md->level*sd->get_zeny_num*(90+rand()%21)/100);
} }
if(md->lootitem) { if(md->lootitem) {
for(i=0;i<md->lootitem_count;i++) for(i=0;i<md->lootitem_count;i++)
@ -2275,7 +2275,6 @@ int mob_class_change (struct mob_data *md, int class_)
hp_rate = md->status.hp*100/md->status.max_hp; hp_rate = md->status.hp*100/md->status.max_hp;
md->db = mob_db(class_); md->db = mob_db(class_);
md->class_ = class_;
if (battle_config.override_mob_names==1) if (battle_config.override_mob_names==1)
memcpy(md->name,md->db->name,NAME_LENGTH-1); memcpy(md->name,md->db->name,NAME_LENGTH-1);
else else

View File

@ -3234,9 +3234,9 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
return 0; return 0;
skill = pc_checkskill(sd,RG_STEALCOIN)*10; skill = pc_checkskill(sd,RG_STEALCOIN)*10;
rate = skill + (sd->status.base_level - md->db->lv)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2;
if(rand()%1000 < rate) { if(rand()%1000 < rate) {
pc_getzeny(sd,md->db->lv*10 + rand()%100); pc_getzeny(sd,md->level*10 + rand()%100);
md->state.steal_coin_flag = 1; md->state.steal_coin_flag = 1;
return 1; return 1;
} }

View File

@ -577,23 +577,19 @@ int pet_catch_process2(struct map_session_data *sd,int target_id)
pc_delitem(sd,i,1,0); pc_delitem(sd,i,1,0);
} }
i = search_petDB_index(md->class_,PET_CLASS); i = search_petDB_index(md->vd->class_,PET_CLASS);
//catch_target_class == 0 is used for universal lures. [Skotlex] //catch_target_class == 0 is used for universal lures. [Skotlex]
//for now universal lures do not include bosses. //for now universal lures do not include bosses.
if (sd->catch_target_class == 0 && !(md->status.mode&MD_BOSS)) if (sd->catch_target_class == 0 && !(md->status.mode&MD_BOSS))
sd->catch_target_class = md->class_; sd->catch_target_class = md->vd->class_;
if(i < 0 || sd->catch_target_class != md->class_) { if(i < 0 || sd->catch_target_class != md->vd->class_) {
clif_emotion(&md->bl, 7); //mob will do /ag if wrong lure is used on them. clif_emotion(&md->bl, 7); //mob will do /ag if wrong lure is used on them.
clif_pet_rulet(sd,0); clif_pet_rulet(sd,0);
sd->catch_target_class = -1; sd->catch_target_class = -1;
return 1; return 1;
} }
//target_idによる敵→卵判定 pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - md->level)*30 + sd->battle_status.luk*20)*(200 - md->status.hp*100/md->status.max_hp)/100;
// if(battle_config.etc_log)
// printf("mob_id = %d, mob_class = %d\n",md->bl.id,md->class_);
//成功の場合
pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - md->db->lv)*30 + sd->battle_status.luk*20)*(200 - md->status.hp*100/md->status.max_hp)/100;
if(pet_catch_rate < 1) pet_catch_rate = 1; if(pet_catch_rate < 1) pet_catch_rate = 1;
if(battle_config.pet_catch_rate != 100) if(battle_config.pet_catch_rate != 100)
pet_catch_rate = (pet_catch_rate*battle_config.pet_catch_rate)/100; pet_catch_rate = (pet_catch_rate*battle_config.pet_catch_rate)/100;

View File

@ -3929,7 +3929,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
pc_delspiritball(dstsd,dstsd->spiritball,0); pc_delspiritball(dstsd,dstsd->spiritball,0);
} else if (dstmd && !(tstatus->mode&MD_BOSS) && rand() % 100 < 20) } else if (dstmd && !(tstatus->mode&MD_BOSS) && rand() % 100 < 20)
{ // check if target is a monster and not a Boss, for the 20% chance to absorb 2 SP per monster's level [Reddozen] { // check if target is a monster and not a Boss, for the 20% chance to absorb 2 SP per monster's level [Reddozen]
i = 2 * dstmd->db->lv; i = 2 * dstmd->level;
mob_target(dstmd,src,0); mob_target(dstmd,src,0);
} }
if (i) { if (i) {