Jump to content
  • 0
Sign in to follow this  
prism

Disabling items in loot pets/disable specific pets on map

Question

Is it possible to block certain items from being placed inside of a pet's inventory? If not, is it possible to automatically make specific pets be returned to egg when entering a map?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Is it possible to block certain items from being placed inside of a pet's inventory? If not, is it possible to automatically make specific pets be returned to egg when entering a map?

 

 

Any script documentations for this @@Dastgir? Not sure if this can be done through OnPCLoadMapEvent o.O.

 

you can find it on conf/battle/pet.conf

 

// Are pets disabled during Guild Wars?
// If set to yes, pets are automatically returned to egg when entering castles during WoE times
// and hatching is forbidden within as well.
pet_disable_in_gvg: no
 
change to :
pet_disable_in_gvg: yes
Edited by Zhao Chow

Share this post


Link to post
Share on other sites
  • 0

That doesn't really answer my question though. I'm asking if it's possible to stop certain items from being placed inside of pets or if it's possible to disable specific pets on maps. That setting disables ALL pets and only in GVG.

Edited by prism

Share this post


Link to post
Share on other sites
  • 0

Is it possible to block certain items from being placed inside of a pet's inventory?

nothing is impossible

if you willing to touch the source code, I move to source support I mean plugin request, since I only write plugins now

https://github.com/HerculesWS/Hercules/blob/master/src/map/pet.c#L951

.

If not, is it possible to automatically make specific pets be returned to egg when entering a map?

there is no known way to automatically turn them into egg form, but there is a *getpetinfo script command

the command will return 0 if no pet is found

so can use this to check if the player having pet or not

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

there is no need a list, that was call from map->foreachinrange

https://github.com/HerculesWS/Hercules/blob/master/src/map/pet.c#L883

so all items runs separate functions

 

just add if ( fitem->id == <item ID> || fitem->id == <item ID> ) return 0; will do I think

note the the source name might not match, has to read from where it declare

 

 

EDIT: Answer

#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pet.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"PetNoLootItemID",	SERVER_TYPE_MAP,	"0.1",	HPM_VERSION,};int pet_ai_sub_hard_lootsearch_pre( struct block_list *bl, va_list *ap ) {	struct flooritem_data *fitem = (struct flooritem_data *)bl;		// pet will no loot these items	if ( fitem->item_data.nameid == 501 || fitem->item_data.nameid == 502 || fitem->item_data.nameid == 503 || fitem->item_data.nameid == 504 || fitem->item_data.nameid == 505 )		hookStop();	return 0;}HPExport void plugin_init (void) {	addHookPre( "pet->ai_sub_hard_lootsearch", pet_ai_sub_hard_lootsearch_pre );}
Edited by AnnieRuru

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
Answer this question...

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