Jump to content
Sign in to follow this  
themon

this kind of pet evolution will be cool

Recommended Posts

is there an existing script for pet vs pet. or humonculus vs humonculus?

Share this post


Link to post
Share on other sites

Can you convert script ?

/src/map/mapreg_sql.c
find

CODE
static int script_autosave_mapreg(int tid, unsigned int tick, int id, intptr data)
{
if( mapreg_dirty )
script_save_mapreg();

return 0;
}



add this

CODE
static int pethatch_eggsearch(int tid, unsigned int tick, int id, int data){
struct block_list *bl = map_id2bl(id);
struct map_session_data *sd = map_id2sd(id);
int i;

if(!sd) return 0;

i = pc_search_inventory(sd,data);
pet_select_egg(sd,i);

return 0;
}



find

CODE
add_timer_func_list(script_autosave_mapreg, "script_autosave_mapreg");



add this

CODE
add_timer_func_list(pethatch_eggsearch, "pethatch_eggsearch");




/src/map/script.c
find

CODE
// declarations that were supposed to be exported from npc_chat.c
#ifdef PCRE_SUPPORT
BUILDIN_FUNC(defpattern);
BUILDIN_FUNC(activatepset);
BUILDIN_FUNC(deactivatepset);
BUILDIN_FUNC(deletepset);
#endif



add this

CODE
BUILDIN_FUNC(pethatch)
{
TBL_PC *sd;
int pet_id;

sd=script_rid2sd(st);
if (!sd)
return 0;

if(sd->status.pet_id)
return 0;

pet_id = search_petDB_index(script_getnum(st,2), PET_CLASS);
if(pet_id < 0)
script_pushint(st,0);
else {
sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(
sd->status.account_id, sd->status.char_id,
(short)pet_db[pet_id].class_, (short)mob_db(pet_db[pet_id].class_)->lv,
(short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
100, 0, 1, pet_db[pet_id].jname);
}

return 0;
}

BUILDIN_FUNC(petremove)
{
TBL_PC *sd;

sd=script_rid2sd(st);
if (!sd)
return 0;

if(!sd->status.pet_id)
return 0;

unit_free(&sd->pd->bl,0);
intif_delete_petdata(sd->status.pet_id);
sd->status.pet_id = 0;

return 0;
}



find

CODE
BUILDIN_DEF(setcell,"siiiiii"),



add this

CODE
BUILDIN_DEF(pethatch,"i"),
BUILDIN_DEF(petremove,""),



find

CODE
"OnPCJobLvUpEvent",



add this

CODE
"OnPCJobLvUpEvent",
"OnPetEvolveEvent",




/src/map/pet.c
find

CODE
clif_pet_food(sd,pd->petDB->FoodID,1);



add this

CODE
if(pd->pet.intimate == 1000)
npc_script_event(sd, NPCE_PETEVOLVE);




/src/map/npc.h
find

CODE
NPCE_KILLNPC,



add this

CODE
NPCE_PETEVOLVE,




/src/map/script.h
find

CODE
const char *joblvup_event_name;



add this

CODE
const char *pet_evolved_event_name;




/src/map/npc.c
find

CODE
{"Kill NPC Event",script_config.kill_mob_event_name},



add this

CODE
{"Pet Evolution Event",script_config.pet_evolved_event_name},

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.