Abracadabra2.0
Member
I am working on a stone that players can contribute gold to a common goal. The idea is that they would double click the stone to get the gump, which displays the goal and the current amount contributed. There's a button they can click to get a target, and they would target either a pile of gold or a bank check. The problem I'm having is figuring out how to get the amount of the gold or value of the bank check to add to the contribution amount. Both scripts are attached for reference. This is the method where I need some help:
Code:
public class GoalStoneTarget : Target
{
private GoalStone GSparent;
public GoalStoneTarget(GoalStone parentGS) : base(-1, true, TargetFlags.None)
{
GSparent = parentGS;
}
protected override void OnTarget(Mobile from, object o)
{
if (GSparent == null || from == null || o == null)
{
Console.WriteLine("GoalStone: That's odd. Better call a GM");
return;
}
if (o is Gold || o is BankCheck) //Need Help Here
{
GSparent.Contribution +=
}
else
from.SendMessage("You can't contribute that!");
}
}
}