protected override void OnTarget(Mobile from, object targeted) { Console.WriteLine("Code making it to OnTarget."); BaseRanged rang = it_Ranged as BaseRanged; BaseRangedModule module = rang.BaseRangedModule; if (targeted is Item && targeted is Bolt) { Console.WriteLine("Code making it to bolt check."); Item item = ( Item )targeted; string errorMsg = "You cannot arm a crossbow that does not have a string."; if (!module.HasBowString) { from.SendMessage("{0}", errorMsg); return; } if (item.GetType() == typeof(Bolt)) { module.BoltSelection = BoltType.Normal; rang.InvalidateProperties(); } if (item.GetType() == typeof(PoisonBolt)) { module.BoltSelection = BoltType.Poison; rang.InvalidateProperties(); } if (item.GetType() == typeof(ExplosiveBolt)) { module.BoltSelection = BoltType.Explosive; rang.InvalidateProperties(); } if (item.GetType() == typeof(ArmorPiercingBolt)) { module.BoltSelection = BoltType.ArmorPiercing; rang.InvalidateProperties(); } if (item.GetType() == typeof(FreezeBolt)) { module.BoltSelection = BoltType.Freeze; rang.InvalidateProperties(); } if (item.GetType() == typeof(LightningBolt)) { module.BoltSelection = BoltType.Lightning; rang.InvalidateProperties(); } } else { from.SendMessage("You can only target a bolt."); } }
public static void CutString(Mobile from, BaseRanged ranged) { BaseRangedModule module = ranged.BaseRangedModule; module.StringStrengthSelection = StringStrength.NoString; module.PullWeightSelection = PoundsPerPull.Zero; module.HasBowString = false; from.PlaySound(0x248); from.SendMessage("You have just removed the string from your bow."); ranged.InvalidateProperties(); }
protected override void OnTarget(Mobile from, object targeted) { if (LucidNagual.DataCenter.DebugAdvancedArchery) { Console.WriteLine("Code making it to OnTarget."); } BaseRanged rang = it_Ranged as BaseRanged; BaseRangedModule module = rang.BaseRangedModule; if (targeted is Item && targeted is BaseStringer) { if (LucidNagual.DataCenter.DebugAdvancedArchery) { Console.WriteLine("Code making it to BaseStringer check."); } Item item = ( Item )targeted; if (item == null) { from.SendMessage("You have decided to not apply the string."); } string errorMsg = "This bow already contains a string."; if (MoreBaseRanged.CheckForString(from, errorMsg, rang) == false) { return; } if (LucidNagual.DataCenter.DebugAdvancedArchery) { Console.WriteLine("Code making it passed string check."); } double fletching = from.Skills[SkillName.Fletching].Base; if (fletching > 100) { if (LucidNagual.DataCenter.DebugAdvancedArchery) { Console.WriteLine("AA Check: Code making it passed gm fletching check."); } if (item.GetType() == typeof(LinenThreadStringer)) { Conjunction(module, 1, 0); CheckSkill(from, rang, module); module.HasBowString = true; item.Delete(); rang.InvalidateProperties(); } if (item.GetType() == typeof(CottonStringer)) { Conjunction(module, 2, 0); CheckSkill(from, rang, module); module.HasBowString = true; item.Delete(); rang.InvalidateProperties(); } if (item.GetType() == typeof(SilkStringer)) { Conjunction(module, 3, 0); CheckSkill(from, rang, module); module.HasBowString = true; item.Delete(); rang.InvalidateProperties(); } if (item.GetType() == typeof(HorseHairStringer)) { Conjunction(module, 4, 0); CheckSkill(from, rang, module); module.HasBowString = true; item.Delete(); rang.InvalidateProperties(); } if (item.GetType() == typeof(HempStringer)) { Conjunction(module, 5, 0); CheckSkill(from, rang, module); module.HasBowString = true; item.Delete(); rang.InvalidateProperties(); } if (item.GetType() == typeof(AngelHairStringer)) { Conjunction(module, 6, 0); CheckSkill(from, rang, module); module.HasBowString = true; item.Delete(); rang.InvalidateProperties(); } } if (fletching < 100) { from.SendMessage("Only a grandmaster bowcrafter can modify this weapon."); return; } if (LucidNagual.DataCenter.DebugAdvancedArchery) { Console.WriteLine("Code making it passed modification check."); } } else { from.SendMessage("You can only target a bow stringer."); } }