private void Bait_OnApply(Mobile from, object targeted, object state) { if (targeted is IFishingPole) { BaseBait bait = state as BaseBait; IFishingPole pole = (IFishingPole)targeted; if (pole.Bait == Bait.Aucun && pole.Charge <= 0) { pole.Bait = bait.Bait; pole.Charge = bait.Charge; from.SendMessage("Vous accrochez l'appât après la canne à pêche."); bait.Delete(); } else { from.SendMessage("Cette canne à pêche possède déjà un appât."); } } else { from.SendMessage("Vous devez choisir une canne à pêche."); } }
public override void OnClick() { if (!m_From.CheckAlive()) { return; } if (m_Pole.Bait == Bait.Aucun || m_Pole.Charge <= 0) { return; } BaseBait newBait = BaseBait.CreateBait(m_Pole.Bait, m_Pole.Charge); if (newBait != null) { m_From.AddToBackpack(newBait); } m_Pole.Bait = Bait.Aucun; m_Pole.Charge = 0; m_From.SendMessage("Vous enlevez l'appât."); }
public ApplyBaitEntry(Mobile from, BaseBait bait) : base(90, 1) { m_From = from; m_Bait = bait; }