Index: map/pc.h =================================================================== --- map/pc.h (revision 17128) +++ map/pc.h (working copy) @@ -335,6 +335,7 @@ short itemindex; //Used item's index in sd->inventory [Skotlex] short catch_target_class; // pet catching, stores a pet class to catch (short now) [zzo] + int catch_rate_target_class; short spiritball, spiritball_old; int spirit_timer[MAX_SKILL_LEVEL]; Index: map/pet.c =================================================================== --- map/pet.c (revision 17128) +++ map/pet.c (working copy) @@ -517,7 +517,10 @@ return 1; } - pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - md->level)*30 + sd->battle_status.luk*20)*(200 - get_percentage(md->status.hp, md->status.max_hp))/100; + if(sd->catch_rate_target_class) + pet_catch_rate = sd->catch_rate_target_class; + else + pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - md->level)*30 + sd->battle_status.luk*20)*(200 - get_percentage(md->status.hp, md->status.max_hp))/100; if(pet_catch_rate < 1) pet_catch_rate = 1; if(battle_config.pet_catch_rate != 100) Index: map/script.c =================================================================== --- map/script.c (revision 17128) +++ map/script.c (working copy) @@ -10072,17 +10072,28 @@ } /*========================================== + * //[clydelion] + * http://rathena.org/board/topic/78979-request-catchpet-rate/ + * New syntax: pet {,}; + * note: 10000 = 100% *------------------------------------------*/ BUILDIN_FUNC(catchpet) { - int pet_id; + int pet_id,rate = 0; TBL_PC *sd; pet_id= script_getnum(st,2); + if( script_hasdata(st,3) ) + rate = script_getnum(st,3); sd=script_rid2sd(st); if( sd == NULL ) return 0; + if(rate > 0) + sd->catch_rate_target_class = rate; + else + sd->catch_rate_target_class = 0; + pet_catch_process1(sd,pet_id); return 0; } @@ -17501,7 +17512,7 @@ BUILDIN_DEF(getstatus, "i?"), BUILDIN_DEF(getscrate,"ii?"), BUILDIN_DEF(debugmes,"s"), - BUILDIN_DEF2(catchpet,"pet","i"), + BUILDIN_DEF2(catchpet,"pet","i?"), BUILDIN_DEF2(birthpet,"bpet",""), BUILDIN_DEF(resetlvl,"i"), BUILDIN_DEF(resetstatus,""),