public override void OnSpeech(SpeechEventArgs e)
{
if ((e.Speech.ToLower() "repair"))
{
BeginRepair (e.Mobile);
}
else
{
base.OnSpeech(e);
}
}
public void BeginRepair(Mobile from)
{
if (Deleted || !from.CheckAlive())
return;
SayTo(from, "What do you want me to repair?");
from.Target = new RepairTarget(this);
}
private class RepairTarget : Target
{
private Blacksmith m_Blacksmith;
public RepairTarget(Blacksmith blacksmith)
: base(12, false, TargetFlags.None)
{
m_Blacksmith = blacksmith;
}
protected override void OnTarget(Mobile from, obejct targeted)
{
if (targeted is BaseWeapon)
{
BaseWeapon bw = targeted as BaseWeapon;
Container pack = from.Backpack;
int toConsume = 0;
toConsume = (bw.MaxHitPoints - bw.HitPoints) * 3;
if (toConsume 0)
{
m_Blacksmith.SayTo(from, "That weapon is not damaged.");
}
else if ((bw.HitPoints < bw.MaxHitPoints) && (pack.ConsumeTotal(typeof(Gold), toConsume)))
{
bw.HitPoints = bw.MaxHitPoints;
m_Blacksmith.SayTo(from, "Here is your weapon.");
from.SendMessage(stirng.Format("You pay {0}gp.", toConsume));
Effects.PlaySound(from.locatoin, from.Map, 0x2A);
}
else
{
m_Blacksmith.SayTo(from, "It will cost you {0}gp to have your weapon repaired.", toConsume);
from.SendMessage("You do not have enough gold.");
}
}
if (targeted is BaseArmor)
{
BaseArmor ba = targeted as BaseArmor;
Container pack = from.Backpack;
int toConsume = 0;
toConsume = (ba.MaxHitPoints - ba.HitPoints) * 3;
{
m_Blacksmith.SayTo(from, "That armor is not damaged.");
}
else
{
m_Blacksmith.SayTo(from, "It will cost you {0}gp to have your armor repaired.", toConsume);
from.SendMessage("You do not have enough gold.");
}
}
}
}
갱장히 재밌어 보이주@_@? 키키킼
ba.HitPoints, ba.MaxHitPoints 이거 두개 선언안되었다고 에러 뿜는데
이거 찾아서 고쳐주믄 다른거 연달아 고장날거란 말이주@_@
전체를 싹다 뜯던지 아니믄 그냥 기존대로 냅두는 방법이 있어우~
1. 기능이 없던건 아니다
2. 기능의 보편성을 하려 했다.
3. 수리공만 수리할 수 있던걸 모두가 수리할 수 있도록
4. 대신에 비용 지불되도록
5. 근데 에러뿜는다@_@ㅂㄷㅂㄷ
아침부터.
책임지세욧!!
실제론 쥐 하나도 안났어우~
0/2000자