public static void PlacePuddleIfSprayableEx(ulong lotID, LotLocation loc, Vector3 pos, bool set, short startingRoomId) { for (sbyte i = loc.mLevel; i >= 0; i = (sbyte)(i - 1)) { LotLocation location = new LotLocation(loc.mX, loc.mZ, i, 0); if (World.GetRoomId(lotID, location, eRoomDefinition.LightBlocking) == startingRoomId) { foreach (ObjectGuid guid in World.GetObjects(lotID, location)) { ISprinklable sprinklable = guid.ObjectFromId <ISprinklable>(); if (sprinklable != null) { sprinklable.OnSprinkled(); } IPlanterBowl bowl = guid.ObjectFromId <IPlanterBowl>(); if (bowl != null) { WaterContainedPlant(bowl); } ISoilRug rug = guid.ObjectFromId <ISoilRug>(); if (rug != null) { WaterContainedPlant(rug); } } if (World.HasSolidFloor(lotID, location) && ((i != 0) || (World.GetTerrainType(pos.x, pos.z, 0) == 0x20))) { if (!Tempest.Settings.mSprinklersSpawnPuddles || !PuddleManager.IsValidPuddleLocation(lotID, location)) { break; } World.SetPuddle(lotID, location, set); return; } } } }