Ruda Posted September 21, 2020 Posted September 21, 2020 (edited) hi, how can i give a hatched pet at start? I dont want give a pet incubator. thanks Edited September 21, 2020 by Ruda Quote
0 buraquera Posted September 22, 2020 Posted September 22, 2020 21 hours ago, Ruda said: hi, how can i give a hatched pet at start? I dont want give a pet incubator. thanks Via scripts you can do makepet <pet id>; while(!getpetinfo(PETINFO_ID) bpet; But this will acctually give the char an egg and then open the hatch egg windows. If the player cancels the hatch, i will open again until player has selected to hatch it. I think its the best you u can do via script... Quote
0 AnnieRuru Posted September 22, 2020 Posted September 22, 2020 can only be done with source edit let's see pc.cpp ... void pc_reg_received(struct map_session_data *sd) { ... // pet if (sd->status.pet_id > 0) intif_request_petdata(sd->status.account_id, sd->status.char_id, sd->status.pet_id); hmm ... much harder than I thought, not only needs to modify pc.c, but because the pet database are saved in char-server, also needs to *hack* the char-server related files to trick that players has a pet from nothingness how about the other way round, start from char-server, after create a new character, auto-add a pet immediately src/char/char.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/char/char.cpp b/src/char/char.cpp index 2fc2f854b..578c79131 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -1495,6 +1495,11 @@ int char_make_new_char( struct char_session_data* sd, char* name_, int str, int } ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s\n", sd->account_id, char_id, slot, name); + + if ( Sql_Query( sql_handle, "insert into pet values (null, 1002, 'Poring', %d, %d, 1, 9001, 0, 250, 100, 0,0,0)", sd->account_id, char_id ) == SQL_ERROR ) + Sql_ShowDebug( sql_handle ); + if ( Sql_Query( sql_handle, "update `char` set pet_id = (select max(pet_id) from pet) where char_id = %d", char_id ) == SQL_ERROR ) + Sql_ShowDebug( sql_handle ); return char_id; } yeah, this patch working perfectly on rathena Quote
0 Ruda Posted September 23, 2020 Author Posted September 23, 2020 ok, its too complicated for me i did a new NPC and when you have a renamed pet, then he warp you out of new_1-1...(classic warp deleted) -makepet -birthpet -getpetinfo(PETINFO_RENAMED) and woking fine, but thanks. Quote
Question
Ruda
hi,
how can i give a hatched pet at start? I dont want give a pet incubator.
thanks
Edited by Ruda3 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.