Disabling items in loot pets/disable specific pets on map

prism

New member
Messages
69
Points
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?

 
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
 
Last edited by a moderator:
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.

 
Last edited by a moderator:
Is it possible to block certain items from being placed inside of a pet's inventory?
nothing is impossibleif 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 commandthe command will return 0 if no pet is found

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

 
Last edited by a moderator:
How would I go about creating a list of item IDS for pets to ignore in this area of the source?

 
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

Code:
#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 );}
 
Last edited by a moderator:
Back
Top