- Code: Select all
protected override void OnTarget( Mobile from, object o )
{
if(o is SmallBOD)
{
SmallBOD bod = (SmallBOD)o;
if(bod != null)
{
if( bod.IsChildOf( from.Backpack ) )
{
switch(bod.AmountMax)
{
case 10:
{
from.SendMessage("That BOD is too small to be cut...");break;
}
case 15:
{
bod.AmountMax = 10;
if(bod.AmountCur > 10)bod.AmountCur=10;
from.SendMessage("You cut the BOD and get a new one of ten pieces...");break;
}
case 20:
{
from.SendMessage("Do you want to cut the BOD in two equal pieces ? ");
from.SendMessage("If not, it will be cut down into fifteen pieces...");
from.SendMessage("Y/N ?");
from.Prompt = new CutPrompt(bod);break;
}
}
}
else
from.SendMessage("That must be in your Backpack to use it !");
}
}
else
from.SendMessage("That is not a SmallBOD !");
}
From the code I'm sure its just not defined within the (SmallBOD) listing. Also further down you'll likley need to add the exceptions for taming bods:
- Code: Select all
public override void OnResponse( Mobile from, string text )
{
if ( m_Bod.Deleted || !from.InRange( m_Bod.GetWorldLocation(), 1 ) )
return;
switch(text)
{
case "y":
{
int rest = 0;
if(m_Bod.AmountCur > 10)
{
rest = m_Bod.AmountCur-10;
m_Bod.AmountCur=10;
}
m_Bod.AmountMax = 10;
SmallBOD copy = null;
if(m_Bod is SmallSmithBOD)copy = new SmallSmithBOD(m_Bod.Hue, m_Bod.AmountMax, m_Bod.Type, m_Bod.Number, m_Bod.Graphic, m_Bod.RequireExceptional, m_Bod.Material);
else if(m_Bod is SmallTailorBOD)copy = new SmallTailorBOD(m_Bod.Hue, m_Bod.AmountMax, m_Bod.Type, m_Bod.Number, m_Bod.Graphic, m_Bod.RequireExceptional, m_Bod.Material);
copy.AmountCur = rest;
from.AddToBackpack(copy);
from.SendMessage("You cut the BOD in two pieces...");
break;
}
case "n":
{
m_Bod.AmountMax = 15;
if(m_Bod.AmountCur > 15)m_Bod.AmountCur=15;
from.SendMessage("You cut the BOD and get a new one of fifteen pieces...");
break;
}
}
}
}
}
...so that m_Bod can can see if its a SmallTamingBOD and create the correct new ones.