protected override void OnTarget(Mobile m, object targ) { if (p_Bandage.Deleted || p_Bandage.Amount < 1) { return; } m.RevealingAction(); int id; bool found = false; if (targ is LandTarget) { id = (targ as LandTarget).TileID; for (int i = 0; i < WaterTiles_Land.Length / 2; i++) { if (id >= WaterTiles_Land[i, 0] && id <= WaterTiles_Land[i, 1]) { found = true; break; } } } else if (targ is Item || targ is StaticTarget) { if (targ is Item) { id = (targ as Item).ItemID; } else { id = (targ as StaticTarget).ItemID; } for (int i = 0; i < WaterTiles_Static.Length / 2; i++) { if (id >= WaterTiles_Static[i, 0] && id <= WaterTiles_Static[i, 1]) { found = true; break; } } } if (targ is BaseBeverage) { p_Bandage.OnAfterTarget(m, found, (targ as BaseBeverage)); } else { p_Bandage.OnAfterTarget(m, found, null); } }
protected override void OnTarget(Mobile m, object targ) { if (m_Bandage.Deleted || m_Bandage.Amount < 1) { return; } m.RevealingAction(); int id; bool found = false; if (targ is LandTarget) { id = (targ as LandTarget).TileID; for (int i = 0; i < WaterTiles_Land.Length / 2; i++) { if (id >= WaterTiles_Land[i, 0] && id <= WaterTiles_Land[i, 1]) { found = true; break; } } } else if (targ is Item || targ is StaticTarget) { if (targ is Item) { id = (targ as Item).ItemID; } else { id = (targ as StaticTarget).ItemID; } for (int i = 0; i < WaterTiles_Static.Length / 2; i++) { if (id >= WaterTiles_Static[i, 0] && id <= WaterTiles_Static[i, 1]) { found = true; break; } } } if (found) { m_Bandage.OnAfterTarget(m); } else { m.SendMessage("You can only wash bloody bandages in water."); } }