v0.0.1-Alpha (#42)
This commit is contained in:
parent
d30f93c454
commit
a36796c2c1
3552 changed files with 2476 additions and 15223 deletions
32
Projects/Scripts/Engines/Plants/PlantPourTarget.cs
Normal file
32
Projects/Scripts/Engines/Plants/PlantPourTarget.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using Server.Targeting;
|
||||
|
||||
namespace Server.Engines.Plants
|
||||
{
|
||||
public class PlantPourTarget : Target
|
||||
{
|
||||
private PlantItem m_Plant;
|
||||
|
||||
public PlantPourTarget(PlantItem plant) : base(3, true, TargetFlags.None)
|
||||
{
|
||||
m_Plant = plant;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (!m_Plant.Deleted && from.InRange(m_Plant.GetWorldLocation(), 3) && targeted is Item item)
|
||||
m_Plant.Pour(from, item);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
if (!m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant &&
|
||||
from.InRange(m_Plant.GetWorldLocation(), 3) && m_Plant.IsUsableBy(from))
|
||||
{
|
||||
if (from.HasGump<MainPlantGump>())
|
||||
from.CloseGump<MainPlantGump>();
|
||||
|
||||
from.SendGump(new MainPlantGump(m_Plant));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue