Dan(Tasanar)

Moderator
I want to make it so players can only un-shrink their pets, OnDoubleClick, when they are within X tiles from an animal trainer NPC.

Before I try this on my own I am wondering if there is another item that is already scripted that works in this manner? Maybe a quest Item I am not thinking of?

Again not asking anyone to script this for me just looking to be pointed in the right direction, before I start trying to reinvent the wheel. I looked at how BaseVendor handles being within X tiles to get bulk order context menu but I have still kind of hit a wall.

Thanks for any insight.

- Tasanar
 
I would assume some sort of

if (!IsTrainerNear())
return;
...(unshrink)


private bool IsTrainerNear()
{
foreach (mobile m in in m.GetMobilesInRange( range ) )
{
if (m is AnimalTrainer)
return true;
}
return false;
}
 
Back