PewN Posted February 19, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Share Posted February 19, 2013 (edited) here's the source of catchpet how can i make it pet <pet_id>,<catch_rate>; please BUILDIN_FUNC(catchpet) { int pet_id; TBL_PC *sd; pet_id= script_getnum(st,2); sd=script_rid2sd(st); if( sd == NULL ) return 0; pet_catch_process1(sd,pet_id); return 0; } Edited February 19, 2013 by TrojanWorm Quote Link to comment Share on other sites More sharing options...
Emistry Posted February 19, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted February 19, 2013 this ? trunk/conf/battle/pet.conf // Rate for catching pets (Note 2) pet_catch_rate: 100 Quote Link to comment Share on other sites More sharing options...
PewN Posted February 20, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 20, 2013 this ? trunk/conf/battle/pet.conf // Rate for catching pets (Note 2) pet_catch_rate: 100 no.. i want a source that look like this pet <pet_id>,catchrate; bump refer to this topic http://www.eathena.ws/board/index.php?showtopic=255045 bump Quote Link to comment Share on other sites More sharing options...
Emistry Posted February 20, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted February 20, 2013 try this ? BUILDIN_FUNC(catchpet) { int pet_id, rate = 0; TBL_PC *sd; pet_id = script_getnum(st,2); sd = script_rid2sd(st); rate = script_getnum(st,3); if( rate > 100 ) rate = 100; if( sd != NULL ) if( rnd() % 100 < rate ) pet_catch_process1(sd,pet_id); return 0; } Quote Link to comment Share on other sites More sharing options...
PewN Posted February 20, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 20, 2013 (edited) try this ? BUILDIN_FUNC(catchpet) { int pet_id, rate = 0; TBL_PC *sd; pet_id = script_getnum(st,2); sd = script_rid2sd(st); rate = script_getnum(st,3); if( rate > 100 ) rate = 100; if( sd != NULL ) if( rnd() % 100 < rate ) pet_catch_process1(sd,pet_id); return 0; } i will try this emistry thanks for your help edit: not working after i recompile no error then i edit my item_db2 i add pet <pet_id>,rate; parseline error pet <petid>','10; bump please help try this ? BUILDIN_FUNC(catchpet) { int pet_id, rate = 0; TBL_PC *sd; pet_id = script_getnum(st,2); sd = script_rid2sd(st); rate = script_getnum(st,3); if( rate > 100 ) rate = 100; if( sd != NULL ) if( rnd() % 100 < rate ) pet_catch_process1(sd,pet_id); return 0; } i think it's not there.. i don't know if i will add pet_catch_rate2 for other.. but i don't know what will go on.. int pet_catch_process1(struct map_session_data *sd,int target_class) { nullpo_ret(sd); sd->catch_target_class = target_class; clif_catch_process(sd); return 0; } int pet_catch_process2(struct map_session_data* sd, int target_id) { struct mob_data* md; int i = 0, pet_catch_rate = 0; nullpo_retr(1, sd); md = (struct mob_data*)map_id2bl(target_id); if(!md || md->bl.type != BL_MOB || md->bl.prev == NULL) { // Invalid inputs/state, abort capture. clif_pet_roulette(sd,0); sd->catch_target_class = -1; sd->itemid = sd->itemindex = -1; return 1; } //FIXME: delete taming item here, if this was an item-invoked capture and the item was flagged as delay-consume [ultramage] i = search_petDB_index(md->class_,PET_CLASS); //catch_target_class == 0 is used for universal lures (except bosses for now). [Skotlex] if (sd->catch_target_class == 0 && !(md->status.mode&MD_BOSS)) sd->catch_target_class = md->class_; if(i < 0 || sd->catch_target_class != md->class_) { clif_emotion(&md->bl, E_AG); //mob will do if wrong lure is used on them. clif_pet_roulette(sd,0); sd->catch_target_class = -1; 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(pet_catch_rate < 1) pet_catch_rate = 1; if(battle_config.pet_catch_rate != 100) pet_catch_rate = (pet_catch_rate*battle_config.pet_catch_rate)/100; if(rnd()%10000 < pet_catch_rate) { unit_remove_map(&md->bl,CLR_OUTSIGHT); status_kill(&md->bl); clif_pet_roulette(sd,1); intif_create_pet(sd->status.account_id,sd->status.char_id,pet_db[i].class_,mob_db(pet_db[i].class_)->lv, pet_db[i].EggID,0,pet_db[i].intimate,100,0,1,pet_db[i].jname); } else { clif_pet_roulette(sd,0); sd->catch_target_class = -1; } return 0; } Edited February 20, 2013 by TrojanWorm Quote Link to comment Share on other sites More sharing options...
clydelion Posted February 20, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted February 20, 2013 Hello. Use this, built from the latest rathena. http://upaste.me/raw/ea09540608f242bb An updated manual for it would be.. *pet <pet id>{,<pet catch rate>}; This command is used in all the item scripts for taming items. Running this command will make the pet catching cursor appear on the client connected to the invoking character, usable on the monsters with the specified pet ID number. It will still work outside an item script. <pet catch rate> is not required. If not supplied it would use the formula: rate = ([Pet DB's Capture constant] + ([Player's Level] - [Monster's Level])*30 + LUK*20) * (200 - [Current Percentage of Monster's HP])/100; Otherwise, 10000 = 100%. A full list of pet IDs can be found inside 'db/pet_db.txt' Enjoy. 1 Quote Link to comment Share on other sites More sharing options...
PewN Posted February 20, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 20, 2013 Hello. Use this, built from the latest rathena. http://upaste.me/raw/ea09540608f242bb An updated manual for it would be.. *pet <pet id>{,<pet catch rate>}; This command is used in all the item scripts for taming items. Running this command will make the pet catching cursor appear on the client connected to the invoking character, usable on the monsters with the specified pet ID number. It will still work outside an item script. <pet catch rate> is not required. If not supplied it would use the formula: rate = ([Pet DB's Capture constant] + ([Player's Level] - [Monster's Level])*30 + LUK*20) * (200 - [Current Percentage of Monster's HP])/100; Otherwise, 10000 = 100%. A full list of pet IDs can be found inside 'db/pet_db.txt' Enjoy. THANKS FOR THIS I WILL TRY THIS CLYDELION Quote Link to comment Share on other sites More sharing options...
Question
PewN
here's the source of catchpet how can i make it
pet <pet_id>,<catch_rate>;
please
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.