So i modified the Homestone script so it only allows to mark a new home (destination)

if theres a certain item in a range of 4

(example item named ''cucu'')

My question:

When a player use the heartstone Is there a way to check if that item''cucu'' still there?

and if is not there dont teleport the player to the destination?

Like I have never seen a '''check'' if theres X item in a recall rune destination for example or an area around

sorry for my bad english
 

Attachments

  • HomeStone.cs
    11.5 KB · Views: 6
Something like that should work, in this case 4 would be the Range.

Code:
private static readonly Type homestoneMarker = typeof(Katana);

Code:
IPooledEnumerable<Item> items = HomeMap.GetItemsInRange(Home, 4);
foreach (Item i in items)
{
    if (i.GetType().IsEqualOrChildOf(homestoneMarker))
    {
        from.SendMessage("The homestone does not react, the {0} seems to be missing at the destination.", homestoneMarker.Name.ToLower());
        items.Free();
        return false;
    }
}
items.Free();

Also I did not see any line in that code that was doing what you said about

So i modified the Homestone script so it only allows to mark a new home (destination)

if theres a certain item in a range of 4

(example item named ''cucu'')
 

Attachments

  • [ServUO.com]-HomeStone.cs
    11.5 KB · Views: 7
Back