Jump to content
  • 0

add hatched pet after novice starts


Ruda

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/18/20
  • Last Seen:  

hi,

how can i give a hatched pet at start? I dont want give a pet incubator.

thanks

Edited by Ruda
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   8
  • Joined:  05/12/20
  • Last Seen:  

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...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/18/20
  • Last Seen:  

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...