Jump to content

Recommended Posts

Hey,

 

as man of you should know some servers (World of Metin, Baria) have a "system" which summons the pet which was summoned last after teleportation.

I tried it using quest flags in the summon quest but it doesn't work because the quest function pet.summon() needs a item which was selected short before.

So here is my question: Does anyone know how to do this via game source or even has a tip where to search? I searched the whole Petsystem.cpp but didn't get any idea where to start.

 

Thanks in advance

Link to comment
https://metin2.dev/topic/11910-summon-pet-after-teleport/
Share on other sites

Put a qf when u click the item pet with the vnum ex;

local mob_vnum = pet_info[1] <-- here vnum of pet.

pc.setqf("pet_vnum", mob_vnum)
And other qf when is summon = 1 and unssummon = 0

when login with pc.getqf("pet_summon") == 1 begin
 pet.summon(pc.getqf("pet_vnum"), ......)
end

its just an example, but you can do easy if you play with the qf's.

 

Good luck.

Link to comment
https://metin2.dev/topic/11910-summon-pet-after-teleport/#findComment-69295
Share on other sites

34 minutes ago, ѕeмa™ said:

Put a qf when u click the item pet with the vnum ex;

local mob_vnum = pet_info[1] <-- here vnum of pet.

pc.setqf("pet_vnum", mob_vnum)
And other qf when is summon = 1 and unssummon = 0

when login with pc.getqf("pet_summon") == 1 begin
 pet.summon(pc.getqf("pet_vnum"), ......)
end

its just an example, but you can do easy if you play with the qf's.

 

Good luck.

That is exactly what I did and I already wrote in this topic that is not working because the Pet Summon function needs to have a selected item which is the seal to summon the pet.

Link to comment
https://metin2.dev/topic/11910-summon-pet-after-teleport/#findComment-69296
Share on other sites

We accomplished this by adding a pet equipment slot.

If you want to do it without source modification (quest only) you could save the item id in a questflag when summoning the pet in the first place -> item.get_id()

When you'll relog or teleport the questflag will still hold the unique item_id which you can use to set your current used quest item -> item.select(pc.getqf('pet_item_id'))

After that you can just use pet.summon() because CQuestManager::instance().GetCurrentItem() is now returning a valid LPITEM instance (by our previously defined item.select(pc.getqf('pet_item_id')) )

 

 

  • Love 1
Link to comment
https://metin2.dev/topic/11910-summon-pet-after-teleport/#findComment-69301
Share on other sites

24 minutes ago, Socialized said:

We accomplished this by adding a pet equipment slot.

If you want to do it without source modification (quest only) you could save the item id in a questflag when summoning the pet in the first place -> item.get_id()

When you'll relog or teleport the questflag will still hold the unique item_id which you can use to set your current used quest item -> item.select(pc.getqf('pet_item_id'))

After that you can just use pet.summon() because CQuestManager::instance().GetCurrentItem() is now returning a valid LPITEM instance (by our previously defined item.select(pc.getqf('pet_item_id')) )

 

 

Well I prefer a solution using the source code

Link to comment
https://metin2.dev/topic/11910-summon-pet-after-teleport/#findComment-69302
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.